From a70382b0e8bed265a1d314d9f6aae8f2dd48d20b Mon Sep 17 00:00:00 2001 From: George Hazan Date: Wed, 28 Nov 2012 18:45:54 +0000 Subject: ex-protos moved to the Plugins folder git-svn-id: http://svn.miranda-ng.org/main/trunk@2545 1316c22d-e87f-b044-9b9b-93d7a3e3ba9c --- protocols/Quotes/docs/Utility/Google.py | 52 --------------------------------- 1 file changed, 52 deletions(-) delete mode 100644 protocols/Quotes/docs/Utility/Google.py (limited to 'protocols/Quotes/docs/Utility/Google.py') diff --git a/protocols/Quotes/docs/Utility/Google.py b/protocols/Quotes/docs/Utility/Google.py deleted file mode 100644 index 35653a77f6..0000000000 --- a/protocols/Quotes/docs/Utility/Google.py +++ /dev/null @@ -1,52 +0,0 @@ -from html.parser import HTMLParser -import sys -from xml.etree.ElementTree import Element, ElementTree, SubElement - -class MyHTMLParser(HTMLParser): - def __init__(self,in_fn,out_fn): - HTMLParser.__init__(self) - f_in = open(in_fn,'r') - self.quote = 0 - self.start = 0 - self.parse_option = 0 - self.elQuote = Element("fake") - elProvider = Element("Provider") - SubElement(elProvider,'name').text = 'Google' - SubElement(elProvider,'ref').text = 'http://www.google.com' - SubElement(elProvider,'url').text = 'http://www.google.com/finance/converter?a=1&' - self.root = SubElement(elProvider,'section') - SubElement(self.root,'name').text = 'Currencies' - self.feed(f_in.read()) - f_in.close() - ElementTree(elProvider).write(out_fn) - - def handle_starttag(self, tag, attrs): - self.start = 1 - if tag == 'select': - if self.parse_option == 0: - for k in attrs: - if k[0] == 'name' and k[1] == 'from': - self.parse_option = 1 - break - else: - self.parse_option == 0 - elif self.parse_option == 1 and tag == 'option': - for k in attrs: - if k[0] == 'value': - self.elQuote = SubElement(self.root,'quote') - SubElement(self.elQuote,'id').text = k[1] - SubElement(self.elQuote,'symbol').text = k[1] - break - - def handle_endtag(self, tag): - self.start = 0 - if tag == 'select': - self.parse_option == 0 - - def handle_data(self, data): - if self.start == 1 and self.parse_option == 1: - SubElement(self.elQuote,'description').text = data - -parser = MyHTMLParser(sys.argv[1],sys.argv[2]) -parser.close() - -- cgit v1.2.3