http://www.mediawiki.org/wiki/Special:Code/pywikipedia/9044
Revision: 9044 Author: xqt Date: 2011-03-13 10:26:54 +0000 (Sun, 13 Mar 2011) Log Message: ----------- stripped trailing whitespace
Modified Paths: -------------- trunk/pywikipedia/userinterfaces/cgi_interface.py trunk/pywikipedia/userinterfaces/terminal_interface.py trunk/pywikipedia/userinterfaces/tkinter_interface.py trunk/pywikipedia/userinterfaces/transliteration.py trunk/pywikipedia/userinterfaces/wxpython_interface.py
Modified: trunk/pywikipedia/userinterfaces/cgi_interface.py =================================================================== --- trunk/pywikipedia/userinterfaces/cgi_interface.py 2011-03-13 10:25:08 UTC (rev 9043) +++ trunk/pywikipedia/userinterfaces/cgi_interface.py 2011-03-13 10:26:54 UTC (rev 9044) @@ -8,6 +8,6 @@ if not toStdout: return sys.stdout.write(text.encode('UTF-8', 'replace')) - + def input(self, question, colors = None): self.output(question + ' ', newline = False, showcgi = True)
Modified: trunk/pywikipedia/userinterfaces/terminal_interface.py =================================================================== --- trunk/pywikipedia/userinterfaces/terminal_interface.py 2011-03-13 10:25:08 UTC (rev 9043) +++ trunk/pywikipedia/userinterfaces/terminal_interface.py 2011-03-13 10:26:54 UTC (rev 9044) @@ -269,7 +269,7 @@ def editText(self, text, jumpIndex = None, highlight = None): """ Uses a Tkinter edit box because we don't have a console editor - + Parameters: * text - a Unicode string * jumpIndex - an integer: position at which to put the caret
Modified: trunk/pywikipedia/userinterfaces/tkinter_interface.py =================================================================== --- trunk/pywikipedia/userinterfaces/tkinter_interface.py 2011-03-13 10:25:08 UTC (rev 9043) +++ trunk/pywikipedia/userinterfaces/tkinter_interface.py 2011-03-13 10:26:54 UTC (rev 9044) @@ -33,7 +33,7 @@ self.hotkeys = hotkeys self.default = default tkSimpleDialog.Dialog.__init__(self, master) - + def body(self, master): Label(self, text=self.question).grid(columnspan = len(self.options)) btns = [] @@ -60,7 +60,7 @@
def buttonbox(self): return - + def select(self, i, event=None): self.selection = i self.ok() @@ -109,7 +109,7 @@ object. Do not call this object's methods directly. Methods of this object cannot return values to the main thread; they must store them in attributes to be retrieved by the main thread. - + """ # TODO: use Event for inter-thread communication instead of wait loops def __init__(self, parent, **kwargs): @@ -153,7 +153,7 @@ This object serves only to dispatch event calls to the TkController object, to be run in that object's separate mainloop thread; and, when necessary, to wait for the user's response. - + """ def __init__(self, parent = None): # create a new window if necessary
Modified: trunk/pywikipedia/userinterfaces/transliteration.py =================================================================== --- trunk/pywikipedia/userinterfaces/transliteration.py 2011-03-13 10:25:08 UTC (rev 9043) +++ trunk/pywikipedia/userinterfaces/transliteration.py 2011-03-13 10:26:54 UTC (rev 9044) @@ -3,7 +3,7 @@ def __init__(self): self.trans = {} for char in u"ÀÁÂẦẤẪẨẬÃĀĂẰẮẴẶẲȦǠẠḀȂĄǍẢ": - self.trans[char] = u"A" + self.trans[char] = u"A" for char in u"ȀǞ": self.trans[char] = u"Ä" self.trans[u"Ǻ"] = u"Å" @@ -27,7 +27,7 @@ self.trans[u"Ḉ"] = u"Ç" self.trans[u"ḉ"] = u"ç" self.trans[u"Ð"] = u"Dh" - self.trans[u"ð"] = u"dh" + self.trans[u"ð"] = u"dh" for char in u"ĎḊḌḎḐḒĐƉƊƋ": self.trans[char] = u"D" for char in u"ďḋḍḏḑḓđɖɗƌ": @@ -146,7 +146,7 @@ for char in u"źẑżẓžẕƶȥ": self.trans[char] = u"z" self.trans[u"ɀ"] = u"zv" - + # Latin: extended Latin alphabet self.trans[u"ɑ"] = u"a" for char in u"ÆǼǢ": @@ -293,7 +293,7 @@ u"ҏ": u"r", u"Ҫ": u"Th", u"ҫ": u"th", u"Ҭ": u"T", u"ҭ": u"t", u"Ӯ": u"Û", u"ӯ": u"û", u"Ұ": u"U", u"Ӹ": u"U", u"ұ": u"u", u"ӹ": u"u", u"Ҵ": u"Tts", u"ҵ": u"tts", u"Ӵ": u"Ch", u"ӵ": u"ch"}) - + for char in u"ЈӤҊ": self.trans[char] = u"J" for char in u"јӥҋ": @@ -362,7 +362,7 @@ self.trans[u"ר"] = u"r" self.trans[u"ש"] = u"sh" self.trans[u"ת"] = u"th" - + # Arab alphabet for char in u"اﺍﺎ": self.trans[char] = u"a" @@ -1258,7 +1258,7 @@ self.trans[char] = u"8" for char in u"৯": self.trans[char] = u"9" - + # Thai (because of complications of the alphabet, self.transliterations # are very imprecise here) for char in u"ก": @@ -1589,7 +1589,7 @@
def transliterate(self, char, default="?", prev="-", next="-"): if char in self.trans: - return self.trans[char] + return self.trans[char] #Arabic if char == u"◌": return prev
Modified: trunk/pywikipedia/userinterfaces/wxpython_interface.py =================================================================== --- trunk/pywikipedia/userinterfaces/wxpython_interface.py 2011-03-13 10:25:08 UTC (rev 9043) +++ trunk/pywikipedia/userinterfaces/wxpython_interface.py 2011-03-13 10:26:54 UTC (rev 9044) @@ -12,7 +12,7 @@ class UI(terminal_interface.UI): def __init__(self): pass - + def input(self, question, password = False): """ Works like raw_input(), but returns a unicode string instead of ASCII. @@ -21,7 +21,7 @@ question. """ # TODO: hide input if password = True - + self.output(question) if password: answer = wx.PasswordEntryDialog( None, question, '','') @@ -42,7 +42,7 @@ options[i] = '%s[%s]%s' % (option[:pos], option[pos], option[pos+1:]) else: options[i] = '%s [%s]' % (option, hotkey) - + while True: prompt = '%s\n(%s)' % (question, ', '.join(options)) self.output('%s (%s)' % (question, ', '.join(options))) @@ -50,7 +50,7 @@ answer.ShowModal() answer = answer.GetValue() self.output(answer+'\n') - + if answer.lower() in hotkeys or answer.upper() in hotkeys: return answer elif default and answer=='':# empty string entered
pywikipedia-svn@lists.wikimedia.org