summaryrefslogtreecommitdiff
path: root/protocols/Quotes/Utility/DukasCopy.py
diff options
context:
space:
mode:
authorKirill Volinsky <mataes2007@gmail.com>2012-10-13 09:49:24 +0000
committerKirill Volinsky <mataes2007@gmail.com>2012-10-13 09:49:24 +0000
commitf7d2c07c102d940727b0f053864c04ed32a76ff8 (patch)
tree07ee5f7aeb9a85341d39f5566a065899dd4de3e9 /protocols/Quotes/Utility/DukasCopy.py
parent221fd937a28a3254936c65ca06a98713e41528cc (diff)
Quotes: folders restructurization
git-svn-id: http://svn.miranda-ng.org/main/trunk@1905 1316c22d-e87f-b044-9b9b-93d7a3e3ba9c
Diffstat (limited to 'protocols/Quotes/Utility/DukasCopy.py')
-rw-r--r--protocols/Quotes/Utility/DukasCopy.py48
1 files changed, 0 insertions, 48 deletions
diff --git a/protocols/Quotes/Utility/DukasCopy.py b/protocols/Quotes/Utility/DukasCopy.py
deleted file mode 100644
index 2d12d1c4ec..0000000000
--- a/protocols/Quotes/Utility/DukasCopy.py
+++ /dev/null
@@ -1,48 +0,0 @@
-from html.parser import HTMLParser
-import sys
-
-class MyHTMLParser(HTMLParser):
- def __init__(self, in_fn,out_fn):
- HTMLParser.__init__(self)
- f_in = open(in_fn,'r')
- self.quote = 0
- self.descr = ''
- self.f_out = open(out_fn,'w')
- self.feed(f_in.read())
- f_in.close()
- self.f_out.close()
-
- def handle_starttag(self, tag, attrs):
- #print ("start of a %s" % tag)
- #print (attrs)
- self.start = 1
- if tag == 'input':
- self.f_out.write('\n<quote>')
- for k in attrs:
- if k[0] == 'stname':
- self.f_out.write('\n\t<symbol>%s</symbol>'%k[1])
- if k[0] == 'stid':
- self.f_out.write('\n\t<id>%s</id>'%k[1])
- self.quote = 1
-
-
- def handle_endtag(self, tag):
- self.start = 0
- if tag == 'tr' and self.quote == 1:
- if self.descr:
- self.f_out.write('\n\t<description>%s</description>'%self.descr)
- self.f_out.write('\n</quote>')
- self.quote = 0
- self.descr = 1
- #print ("end of a %s" % tag)
-
- def handle_data(self, data):
- if self.start == 1:
- self.descr = data
- #print ("Data %s" % self.descr)
-
-
-
-parser = MyHTMLParser(sys.argv[1],sys.argv[2])
-parser.close()
- \ No newline at end of file