diff -r 0f24c65fb7e5 Demo/tix/samples/Balloon.py --- a/Demo/tix/samples/Balloon.py Sat Jan 05 07:37:47 2013 +0200 +++ b/Demo/tix/samples/Balloon.py Sat Jan 05 18:01:21 2013 +0200 @@ -19,7 +19,7 @@ TCL_ALL_EVENTS = 0 -def RunSample (root): +def RunSample(root): balloon = DemoBalloon(root) balloon.mainloop() balloon.destroy() @@ -52,7 +52,7 @@ b.bind_widget(button2, balloonmsg='Self-destruct button', statusmsg='Press this button and it will destroy itself') - def quitcmd (self): + def quitcmd(self): self.exit = 0 def mainloop(self): @@ -60,7 +60,7 @@ while self.exit < 0 and foundEvent > 0: foundEvent = self.root.tk.dooneevent(TCL_ALL_EVENTS) - def destroy (self): + def destroy(self): self.root.destroy() if __name__ == '__main__': diff -r 0f24c65fb7e5 Demo/tix/samples/Control.py --- a/Demo/tix/samples/Control.py Sat Jan 05 07:37:47 2013 +0200 +++ b/Demo/tix/samples/Control.py Sat Jan 05 18:01:21 2013 +0200 @@ -22,7 +22,7 @@ TCL_ALL_EVENTS = 0 -def RunSample (root): +def RunSample(root): control = DemoControl(root) control.mainloop() control.destroy() @@ -80,18 +80,18 @@ box.pack(side=Tix.BOTTOM, fill=Tix.X) top.pack(side=Tix.TOP, fill=Tix.BOTH, expand=1) - def okcmd (self): + def okcmd(self): # tixDemo:Status "Selected %d of %s engines each of thrust %d", (demo_num_engines.get(), demo_maker.get(), demo_thrust.get()) self.quitcmd() - def quitcmd (self): + def quitcmd(self): self.exit = 0 def mainloop(self): while self.exit < 0: self.root.tk.dooneevent(TCL_ALL_EVENTS) - def destroy (self): + def destroy(self): self.root.destroy() maker_list = ['P&W', 'GE', 'Rolls Royce'] diff -r 0f24c65fb7e5 Demo/tix/samples/DirList.py --- a/Demo/tix/samples/DirList.py Sat Jan 05 07:37:47 2013 +0200 +++ b/Demo/tix/samples/DirList.py Sat Jan 05 18:01:21 2013 +0200 @@ -21,7 +21,7 @@ TCL_ALL_EVENTS = 0 -def RunSample (root): +def RunSample(root): dirlist = DemoDirList(root) dirlist.mainloop() dirlist.destroy() @@ -93,25 +93,25 @@ box.pack( anchor='s', fill='x', side=BOTTOM) - def copy_name (self, dir, ent): + def copy_name(self, dir, ent): # This should work as it is the entry's textvariable self.dlist_dir = dir.cget('value') # but it isn't so I'll do it manually ent.entry.delete(0,'end') ent.entry.insert(0, self.dlist_dir) - def okcmd (self): + def okcmd(self): # tixDemo:Status "You have selected the directory" + self.dlist_dir self.quitcmd() - def quitcmd (self): + def quitcmd(self): self.exit = 0 def mainloop(self): while self.exit < 0: self.root.tk.dooneevent(TCL_ALL_EVENTS) - def destroy (self): + def destroy(self): self.root.destroy() # This "if" statement makes it possible to run this script file inside or diff -r 0f24c65fb7e5 Demo/tix/samples/DirTree.py --- a/Demo/tix/samples/DirTree.py Sat Jan 05 07:37:47 2013 +0200 +++ b/Demo/tix/samples/DirTree.py Sat Jan 05 18:01:21 2013 +0200 @@ -21,7 +21,7 @@ TCL_ALL_EVENTS = 0 -def RunSample (root): +def RunSample(root): dirtree = DemoDirTree(root) dirtree.mainloop() dirtree.destroy() @@ -87,18 +87,18 @@ box.pack( anchor='s', fill='x', side=BOTTOM) - def copy_name (self, dir, ent): + def copy_name(self, dir, ent): # This should work as it is the entry's textvariable self.dlist_dir = dir.cget('value') # but it isn't so I'll do it manually ent.entry.delete(0,'end') ent.entry.insert(0, self.dlist_dir) - def okcmd (self): + def okcmd(self): # tixDemo:Status "You have selected the directory" + self.dlist_dir self.quitcmd() - def quitcmd (self): + def quitcmd(self): # tixDemo:Status "You have selected the directory" + self.dlist_dir self.exit = 0 @@ -106,7 +106,7 @@ while self.exit < 0: self.root.tk.dooneevent(TCL_ALL_EVENTS) - def destroy (self): + def destroy(self): self.root.destroy() # This "if" statement makes it possible to run this script file inside or diff -r 0f24c65fb7e5 Demo/tix/samples/PanedWin.py --- a/Demo/tix/samples/PanedWin.py Sat Jan 05 07:37:47 2013 +0200 +++ b/Demo/tix/samples/PanedWin.py Sat Jan 05 18:01:21 2013 +0200 @@ -19,7 +19,7 @@ TCL_ALL_EVENTS = 0 -def RunSample (root): +def RunSample(root): panedwin = DemoPanedwin(root) panedwin.mainloop() panedwin.destroy() @@ -83,14 +83,14 @@ command=self.quitcmd) box.pack(side=Tix.BOTTOM, fill=Tix.X) - def quitcmd (self): + def quitcmd(self): self.exit = 0 def mainloop(self): while self.exit < 0: self.root.tk.dooneevent(TCL_ALL_EVENTS) - def destroy (self): + def destroy(self): self.root.destroy() if __name__ == '__main__': diff -r 0f24c65fb7e5 Demo/tix/samples/SHList1.py --- a/Demo/tix/samples/SHList1.py Sat Jan 05 07:37:47 2013 +0200 +++ b/Demo/tix/samples/SHList1.py Sat Jan 05 18:01:21 2013 +0200 @@ -17,7 +17,7 @@ TCL_ALL_EVENTS = 0 -def RunSample (root): +def RunSample(root): shlist = DemoSHList(root) shlist.mainloop() shlist.destroy() @@ -109,17 +109,17 @@ box.pack( side=Tix.BOTTOM, fill=Tix.X) top.pack( side=Tix.TOP, fill=Tix.BOTH, expand=1 ) - def okcmd (self): + def okcmd(self): self.quitcmd() - def quitcmd (self): + def quitcmd(self): self.exit = 0 def mainloop(self): while self.exit < 0: self.root.tk.dooneevent(TCL_ALL_EVENTS) - def destroy (self): + def destroy(self): self.root.destroy() diff -r 0f24c65fb7e5 Demo/tix/samples/SHList2.py --- a/Demo/tix/samples/SHList2.py Sat Jan 05 07:37:47 2013 +0200 +++ b/Demo/tix/samples/SHList2.py Sat Jan 05 18:01:21 2013 +0200 @@ -20,7 +20,7 @@ TCL_ALL_EVENTS = 0 -def RunSample (root): +def RunSample(root): shlist = DemoSHList(root) shlist.mainloop() shlist.destroy() @@ -146,17 +146,17 @@ box.pack( side=Tix.BOTTOM, fill=Tix.X) top.pack( side=Tix.TOP, fill=Tix.BOTH, expand=1 ) - def okcmd (self): + def okcmd(self): self.quitcmd() - def quitcmd (self): + def quitcmd(self): self.exit = 0 def mainloop(self): while self.exit < 0: self.root.tk.dooneevent(TCL_ALL_EVENTS) - def destroy (self): + def destroy(self): self.root.destroy() diff -r 0f24c65fb7e5 Demo/tix/tixwidgets.py --- a/Demo/tix/tixwidgets.py Sat Jan 05 07:37:47 2013 +0200 +++ b/Demo/tix/tixwidgets.py Sat Jan 05 18:01:21 2013 +0200 @@ -131,7 +131,7 @@ # Tkinter defines a Tcl tkerror procedure that in effect # silences all background Tcl error reporting. # root.tk.eval('if {[info commands tkerror] != ""} {rename tkerror pytkerror}') - def quitcmd (self): + def quitcmd(self): """Quit our mainloop. It is up to you to call root.destroy() after.""" self.exit = 0 @@ -169,7 +169,7 @@ self.exit = 1 raise SystemExit, 1 - def destroy (self): + def destroy(self): self.root.destroy() def RunMain(root): diff -r 0f24c65fb7e5 Demo/zlib/minigzip.py --- a/Demo/zlib/minigzip.py Sat Jan 05 07:37:47 2013 +0200 +++ b/Demo/zlib/minigzip.py Sat Jan 05 18:01:21 2013 +0200 @@ -22,7 +22,7 @@ v += (ord(input.read(1)) << 24) return v -def compress (filename, input, output): +def compress(filename, input, output): output.write('\037\213\010') # Write the header, ... output.write(chr(FNAME)) # ... flag byte ... @@ -46,7 +46,7 @@ write32(output, crcval) # ... the CRC ... write32(output, statval[6]) # and the file size. -def decompress (input, output): +def decompress(input, output): magic = input.read(2) if magic != '\037\213': print 'Not a gzipped file' diff -r 0f24c65fb7e5 Lib/SimpleXMLRPCServer.py --- a/Lib/SimpleXMLRPCServer.py Sat Jan 05 07:37:47 2013 +0200 +++ b/Lib/SimpleXMLRPCServer.py Sat Jan 05 18:01:21 2013 +0200 @@ -551,7 +551,7 @@ self.send_header("Content-length", "0") self.end_headers() - def report_404 (self): + def report_404(self): # Report a 404 error self.send_response(404) response = 'No such page' diff -r 0f24c65fb7e5 Lib/asynchat.py --- a/Lib/asynchat.py Sat Jan 05 07:37:47 2013 +0200 +++ b/Lib/asynchat.py Sat Jan 05 18:01:21 2013 +0200 @@ -52,7 +52,7 @@ from sys import py3kwarning from warnings import filterwarnings, catch_warnings -class async_chat (asyncore.dispatcher): +class async_chat(asyncore.dispatcher): """This is an abstract class. You must derive from this class, and add the two methods collect_incoming_data() and found_terminator()""" @@ -61,7 +61,7 @@ ac_in_buffer_size = 4096 ac_out_buffer_size = 4096 - def __init__ (self, sock=None, map=None): + def __init__(self, sock=None, map=None): # for string terminator matching self.ac_in_buffer = '' @@ -92,11 +92,11 @@ def found_terminator(self): raise NotImplementedError("must be implemented in subclass") - def set_terminator (self, term): + def set_terminator(self, term): "Set the input delimiter. Can be a fixed string of any length, an integer, or None" self.terminator = term - def get_terminator (self): + def get_terminator(self): return self.terminator # grab some more data from the socket, @@ -104,7 +104,7 @@ # check for the terminator, # if found, transition to the next state. - def handle_read (self): + def handle_read(self): try: data = self.recv (self.ac_in_buffer_size) @@ -170,13 +170,13 @@ self.collect_incoming_data (self.ac_in_buffer) self.ac_in_buffer = '' - def handle_write (self): + def handle_write(self): self.initiate_send() - def handle_close (self): + def handle_close(self): self.close() - def push (self, data): + def push(self, data): sabs = self.ac_out_buffer_size if len(data) > sabs: for i in xrange(0, len(data), sabs): @@ -185,11 +185,11 @@ self.producer_fifo.append(data) self.initiate_send() - def push_with_producer (self, producer): + def push_with_producer(self, producer): self.producer_fifo.append(producer) self.initiate_send() - def readable (self): + def readable(self): "predicate for inclusion in the readable for select()" # cannot use the old predicate, it violates the claim of the # set_terminator method. @@ -197,11 +197,11 @@ # return (len(self.ac_in_buffer) <= self.ac_in_buffer_size) return 1 - def writable (self): + def writable(self): "predicate for inclusion in the writable for select()" return self.producer_fifo or (not self.connected) - def close_when_done (self): + def close_when_done(self): "automatically close this channel once the outgoing queue is empty" self.producer_fifo.append(None) @@ -245,7 +245,7 @@ # we tried to send some actual data return - def discard_buffers (self): + def discard_buffers(self): # Emergencies only! self.ac_in_buffer = '' del self.incoming[:] @@ -253,11 +253,11 @@ class simple_producer: - def __init__ (self, data, buffer_size=512): + def __init__(self, data, buffer_size=512): self.data = data self.buffer_size = buffer_size - def more (self): + def more(self): if len (self.data) > self.buffer_size: result = self.data[:self.buffer_size] self.data = self.data[self.buffer_size:] @@ -268,25 +268,25 @@ return result class fifo: - def __init__ (self, list=None): + def __init__(self, list=None): if not list: self.list = deque() else: self.list = deque(list) - def __len__ (self): + def __len__(self): return len(self.list) - def is_empty (self): + def is_empty(self): return not self.list - def first (self): + def first(self): return self.list[0] - def push (self, data): + def push(self, data): self.list.append(data) - def pop (self): + def pop(self): if self.list: return (1, self.list.popleft()) else: @@ -307,7 +307,7 @@ # re: 12820/s # regex: 14035/s -def find_prefix_at_end (haystack, needle): +def find_prefix_at_end(haystack, needle): l = len(needle) - 1 while l and not haystack.endswith(needle[:l]): l -= 1 diff -r 0f24c65fb7e5 Lib/bsddb/dbtables.py --- a/Lib/bsddb/dbtables.py Sat Jan 05 07:37:47 2013 +0200 +++ b/Lib/bsddb/dbtables.py Sat Jan 05 18:01:21 2013 +0200 @@ -249,7 +249,7 @@ key = bytes(key, "iso8859-1") return self._db.delete(key, txn=txn) - def close (self) : + def close(self) : return self._db.close() self.db = db_py3k(self.db) diff -r 0f24c65fb7e5 Lib/bsddb/test/test_compare.py --- a/Lib/bsddb/test/test_compare.py Sat Jan 05 07:37:47 2013 +0200 +++ b/Lib/bsddb/test/test_compare.py Sat Jan 05 18:01:21 2013 +0200 @@ -23,20 +23,20 @@ def lowercase_cmp(left, right): return cmp (left.lower(), right.lower()) -def make_reverse_comparator (cmp): - def reverse (left, right, delegate=cmp): +def make_reverse_comparator(cmp): + def reverse(left, right, delegate=cmp): return - delegate (left, right) return reverse _expected_lexical_test_data = ['', 'CCCP', 'a', 'aaa', 'b', 'c', 'cccce', 'ccccf'] _expected_lowercase_test_data = ['', 'a', 'aaa', 'b', 'c', 'CC', 'cccce', 'ccccf', 'CCCP'] -class ComparatorTests (unittest.TestCase): +class ComparatorTests(unittest.TestCase): if sys.version_info < (2, 4) : def assertTrue(self, expr, msg=None) : return self.failUnless(expr,msg=msg) - def comparator_test_helper (self, comparator, expected_data): + def comparator_test_helper(self, comparator, expected_data): data = expected_data[:] import sys @@ -60,18 +60,18 @@ self.assertEqual(data, expected_data, "comparator `%s' is not right: %s vs. %s" % (comparator, expected_data, data)) - def test_lexical_comparator (self): + def test_lexical_comparator(self): self.comparator_test_helper (lexical_cmp, _expected_lexical_test_data) - def test_reverse_lexical_comparator (self): + def test_reverse_lexical_comparator(self): rev = _expected_lexical_test_data[:] rev.reverse () self.comparator_test_helper (make_reverse_comparator (lexical_cmp), rev) - def test_lowercase_comparator (self): + def test_lowercase_comparator(self): self.comparator_test_helper (lowercase_cmp, _expected_lowercase_test_data) -class AbstractBtreeKeyCompareTestCase (unittest.TestCase): +class AbstractBtreeKeyCompareTestCase(unittest.TestCase): env = None db = None @@ -84,7 +84,7 @@ def assertLess(self, a, b, msg=None) : return self.assertTrue(a>> ExtendedContext.scaleb(Decimal('7.50'), Decimal('-2')) diff -r 0f24c65fb7e5 Lib/dumbdbm.py --- a/Lib/dumbdbm.py Sat Jan 05 07:37:47 2013 +0200 +++ b/Lib/dumbdbm.py Sat Jan 05 18:01:21 2013 +0200 @@ -217,7 +217,7 @@ __del__ = close - def _chmod (self, file): + def _chmod(self, file): if hasattr(self._os, 'chmod'): self._os.chmod(file, self._mode) diff -r 0f24c65fb7e5 Lib/httplib.py --- a/Lib/httplib.py Sat Jan 05 07:37:47 2013 +0200 +++ b/Lib/httplib.py Sat Jan 05 18:01:21 2013 +0200 @@ -1198,7 +1198,7 @@ self.cert_file = cert_file - def FakeSocket (sock, sslobj): + def FakeSocket(sock, sslobj): warnings.warn("FakeSocket is deprecated, and won't be in 3.x. " + "Use the result of ssl.wrap_socket() directly instead.", DeprecationWarning, stacklevel=2) diff -r 0f24c65fb7e5 Lib/idlelib/MultiCall.py --- a/Lib/idlelib/MultiCall.py Sat Jan 05 07:37:47 2013 +0200 +++ b/Lib/idlelib/MultiCall.py Sat Jan 05 18:01:21 2013 +0200 @@ -308,7 +308,7 @@ if widget in _multicall_dict: return _multicall_dict[widget] - class MultiCall (widget): + class MultiCall(widget): assert issubclass(widget, Tkinter.Misc) def __init__(self, *args, **kwargs): diff -r 0f24c65fb7e5 Lib/idlelib/rpc.py --- a/Lib/idlelib/rpc.py Sat Jan 05 07:37:47 2013 +0200 +++ b/Lib/idlelib/rpc.py Sat Jan 05 18:01:21 2013 +0200 @@ -191,7 +191,7 @@ return ("OK", ret) elif how == 'QUEUE': request_queue.put((seq, (method, args, kwargs))) - return("QUEUED", None) + return ("QUEUED", None) else: return ("ERROR", "Unsupported message type: %s" % how) except SystemExit: diff -r 0f24c65fb7e5 Lib/lib-tk/Tix.py --- a/Lib/lib-tk/Tix.py Sat Jan 05 07:37:47 2013 +0200 +++ b/Lib/lib-tk/Tix.py Sat Jan 05 18:01:21 2013 +0200 @@ -290,7 +290,7 @@ Both options are for use by subclasses only. """ - def __init__ (self, master=None, widgetName=None, + def __init__(self, master=None, widgetName=None, static_options=None, cnf={}, kw={}): # Merge keywords and dictionary arguments if kw: @@ -588,7 +588,7 @@ cross Button : present if created with the fancy option""" # FIXME: It should inherit -superclass tixLabelWidget - def __init__ (self, master=None, cnf={}, **kw): + def __init__(self, master=None, cnf={}, **kw): TixWidget.__init__(self, master, 'tixComboBox', ['editable', 'dropdown', 'fancy', 'options'], cnf, kw) @@ -632,7 +632,7 @@ label Label""" # FIXME: It should inherit -superclass tixLabelWidget - def __init__ (self, master=None, cnf={}, **kw): + def __init__(self, master=None, cnf={}, **kw): TixWidget.__init__(self, master, 'tixControl', ['options'], cnf, kw) self.subwidget_list['incr'] = _dummyButton(self, 'incr') self.subwidget_list['decr'] = _dummyButton(self, 'decr') @@ -873,7 +873,7 @@ Subwidgets - None""" - def __init__ (self,master=None,cnf={}, **kw): + def __init__(self,master=None,cnf={}, **kw): TixWidget.__init__(self, master, 'tixHList', ['columns', 'options'], cnf, kw) @@ -1067,7 +1067,7 @@ Subwidgets - None""" - def __init__ (self,master=None,cnf={}, **kw): + def __init__(self,master=None,cnf={}, **kw): TixWidget.__init__(self, master, 'tixInputOnly', None, cnf, kw) class LabelEntry(TixWidget): @@ -1080,7 +1080,7 @@ label Label entry Entry""" - def __init__ (self,master=None,cnf={}, **kw): + def __init__(self,master=None,cnf={}, **kw): TixWidget.__init__(self, master, 'tixLabelEntry', ['labelside','options'], cnf, kw) self.subwidget_list['label'] = _dummyLabel(self, 'label') @@ -1097,7 +1097,7 @@ label Label frame Frame""" - def __init__ (self,master=None,cnf={}, **kw): + def __init__(self,master=None,cnf={}, **kw): TixWidget.__init__(self, master, 'tixLabelFrame', ['labelside','options'], cnf, kw) self.subwidget_list['label'] = _dummyLabel(self, 'label') @@ -1156,7 +1156,7 @@ nbframe NoteBookFrame page widgets added dynamically with the add method""" - def __init__ (self,master=None,cnf={}, **kw): + def __init__(self,master=None,cnf={}, **kw): TixWidget.__init__(self,master,'tixNoteBook', ['options'], cnf, kw) self.subwidget_list['nbframe'] = TixSubWidget(self, 'nbframe', destroy_physically=0) @@ -1393,7 +1393,7 @@ Subwidgets - None""" - def __init__ (self,master=None,cnf={}, **kw): + def __init__(self,master=None,cnf={}, **kw): TixWidget.__init__(self, master, 'tixShell', ['options', 'title'], cnf, kw) class DialogShell(TixWidget): @@ -1405,7 +1405,7 @@ Subwidgets - None""" # FIXME: It should inherit from Shell - def __init__ (self,master=None,cnf={}, **kw): + def __init__(self,master=None,cnf={}, **kw): TixWidget.__init__(self, master, 'tixDialogShell', ['options', 'title', 'mapped', @@ -1446,7 +1446,7 @@ Subwidgets - None""" - def __init__ (self,master=None,cnf={}, **kw): + def __init__(self,master=None,cnf={}, **kw): TixWidget.__init__(self, master, 'tixTList', ['options'], cnf, kw) def active_set(self, index): diff -r 0f24c65fb7e5 Lib/lib-tk/tkFileDialog.py --- a/Lib/lib-tk/tkFileDialog.py Sat Jan 05 07:37:47 2013 +0200 +++ b/Lib/lib-tk/tkFileDialog.py Sat Jan 05 18:01:21 2013 +0200 @@ -173,7 +173,7 @@ return open(filename, mode) return None -def askdirectory (**options): +def askdirectory(**options): "Ask for a directory, and return the file name" return Directory(**options).show() diff -r 0f24c65fb7e5 Lib/lib-tk/turtle.py --- a/Lib/lib-tk/turtle.py Sat Jan 05 07:37:47 2013 +0200 +++ b/Lib/lib-tk/turtle.py Sat Jan 05 18:01:21 2013 +0200 @@ -808,7 +808,7 @@ ############################################################################## -class Terminator (Exception): +class Terminator(Exception): """Will be raised in TurtleScreen.update, if _RUNNING becomes False. Thus stops execution of turtle graphics script. Main purpose: use in diff -r 0f24c65fb7e5 Lib/logging/handlers.py --- a/Lib/logging/handlers.py Sat Jan 05 07:37:47 2013 +0200 +++ b/Lib/logging/handlers.py Sat Jan 05 18:01:21 2013 +0200 @@ -788,7 +788,7 @@ priority = self.priority_names[priority] return (facility << 3) | priority - def close (self): + def close(self): """ Closes the socket. """ diff -r 0f24c65fb7e5 Lib/nntplib.py --- a/Lib/nntplib.py Sat Jan 05 07:37:47 2013 +0200 +++ b/Lib/nntplib.py Sat Jan 05 18:01:21 2013 +0200 @@ -525,7 +525,7 @@ else: return resp, path - def date (self): + def date(self): """Process the DATE command. Arguments: None Returns: diff -r 0f24c65fb7e5 Lib/optparse.py --- a/Lib/optparse.py Sat Jan 05 07:37:47 2013 +0200 +++ b/Lib/optparse.py Sat Jan 05 18:01:21 2013 +0200 @@ -94,7 +94,7 @@ _ = gettext -class OptParseError (Exception): +class OptParseError(Exception): def __init__(self, msg): self.msg = msg @@ -102,7 +102,7 @@ return self.msg -class OptionError (OptParseError): +class OptionError(OptParseError): """ Raised if an Option instance is created with invalid or inconsistent arguments. @@ -118,18 +118,18 @@ else: return self.msg -class OptionConflictError (OptionError): +class OptionConflictError(OptionError): """ Raised if conflicting options are added to an OptionParser. """ -class OptionValueError (OptParseError): +class OptionValueError(OptParseError): """ Raised if an invalid option value is encountered on the command line. """ -class BadOptionError (OptParseError): +class BadOptionError(OptParseError): """ Raised if an invalid option is seen on the command line. """ @@ -139,7 +139,7 @@ def __str__(self): return _("no such option: %s") % self.opt_str -class AmbiguousOptionError (BadOptionError): +class AmbiguousOptionError(BadOptionError): """ Raised if an ambiguous option is seen on the command line. """ @@ -358,7 +358,7 @@ return ", ".join(opts) -class IndentedHelpFormatter (HelpFormatter): +class IndentedHelpFormatter(HelpFormatter): """Format help with indented section bodies. """ @@ -377,7 +377,7 @@ return "%*s%s:\n" % (self.current_indent, "", heading) -class TitledHelpFormatter (HelpFormatter): +class TitledHelpFormatter(HelpFormatter): """Format help with underlined section headers. """ @@ -1085,7 +1085,7 @@ return "\n".join(result) -class OptionGroup (OptionContainer): +class OptionGroup(OptionContainer): def __init__(self, parser, title, description=None): self.parser = parser @@ -1115,7 +1115,7 @@ return result -class OptionParser (OptionContainer): +class OptionParser(OptionContainer): """ Class attributes: diff -r 0f24c65fb7e5 Lib/profile.py --- a/Lib/profile.py Sat Jan 05 07:37:47 2013 +0200 +++ b/Lib/profile.py Sat Jan 05 18:01:21 2013 +0200 @@ -296,7 +296,7 @@ timings[fn] = 0, 0, 0, 0, {} return 1 - def trace_dispatch_c_call (self, frame, t): + def trace_dispatch_c_call(self, frame, t): fn = ("", 0, self.c_func_name) self.cur = (t, 0, 0, fn, frame, self.cur) timings = self.timings diff -r 0f24c65fb7e5 Lib/pstats.py --- a/Lib/pstats.py Sat Jan 05 07:37:47 2013 +0200 +++ b/Lib/pstats.py Sat Jan 05 18:01:21 2013 +0200 @@ -459,7 +459,7 @@ def __init__(self, comp_select_list): self.comp_select_list = comp_select_list - def compare (self, left, right): + def compare(self, left, right): for index, direction in self.comp_select_list: l = left[index] r = right[index] diff -r 0f24c65fb7e5 Lib/test/pyclbr_input.py --- a/Lib/test/pyclbr_input.py Sat Jan 05 07:37:47 2013 +0200 +++ b/Lib/test/pyclbr_input.py Sat Jan 05 18:01:21 2013 +0200 @@ -8,10 +8,10 @@ def om(self): pass -class B (object): +class B(object): def bm(self): pass -class C (B): +class C(B): foo = Other().foo om = Other.om diff -r 0f24c65fb7e5 Lib/test/test_SimpleHTTPServer.py --- a/Lib/test/test_SimpleHTTPServer.py Sat Jan 05 07:37:47 2013 +0200 +++ b/Lib/test/test_SimpleHTTPServer.py Sat Jan 05 18:01:21 2013 +0200 @@ -8,18 +8,18 @@ from test import test_support -class SocketlessRequestHandler (SimpleHTTPRequestHandler): +class SocketlessRequestHandler(SimpleHTTPRequestHandler): def __init__(self): pass class SimpleHTTPRequestHandlerTestCase(unittest.TestCase): """ Test url parsing """ - def setUp (self): + def setUp(self): self.translated = os.getcwd() self.translated = os.path.join(self.translated, 'filename') self.handler = SocketlessRequestHandler () - def test_queryArguments (self): + def test_queryArguments(self): path = self.handler.translate_path ('/filename') self.assertEqual (path, self.translated) path = self.handler.translate_path ('/filename?foo=bar') @@ -27,7 +27,7 @@ path = self.handler.translate_path ('/filename?a=b&spam=eggs#zot') self.assertEqual (path, self.translated) - def test_startWithDoubleSlash (self): + def test_startWithDoubleSlash(self): path = self.handler.translate_path ('//filename') self.assertEqual (path, self.translated) path = self.handler.translate_path ('//filename?foo=bar') diff -r 0f24c65fb7e5 Lib/test/test_asynchat.py --- a/Lib/test/test_asynchat.py Sat Jan 05 07:37:47 2013 +0200 +++ b/Lib/test/test_asynchat.py Sat Jan 05 18:01:21 2013 +0200 @@ -100,10 +100,10 @@ class TestAsynchat(unittest.TestCase): usepoll = False - def setUp (self): + def setUp(self): self._threads = test_support.threading_setup() - def tearDown (self): + def tearDown(self): test_support.threading_cleanup(*self._threads) def line_terminator_check(self, term, server_chunk): diff -r 0f24c65fb7e5 Lib/test/test_decorators.py --- a/Lib/test/test_decorators.py Sat Jan 05 07:37:47 2013 +0200 +++ b/Lib/test/test_decorators.py Sat Jan 05 18:01:21 2013 +0200 @@ -7,7 +7,7 @@ return func return decorate -class MiscDecorators (object): +class MiscDecorators(object): @staticmethod def author(name): def decorate(func): @@ -17,7 +17,7 @@ # ----------------------------------------------- -class DbcheckError (Exception): +class DbcheckError(Exception): def __init__(self, exprstr, func, args, kwds): # A real version of this would set attributes here Exception.__init__(self, "dbcheck %r failed (func=%s args=%s kwds=%s)" % @@ -228,7 +228,7 @@ return func return decorate - class NameLookupTracer (object): + class NameLookupTracer(object): def __init__(self, index): self.index = index diff -r 0f24c65fb7e5 Lib/test/test_httpservers.py --- a/Lib/test/test_httpservers.py Sat Jan 05 07:37:47 2013 +0200 +++ b/Lib/test/test_httpservers.py Sat Jan 05 18:01:21 2013 +0200 @@ -93,7 +93,7 @@ HTTPResponseMatch = re.compile('HTTP/1.[0-9]+ 200 OK') - def setUp (self): + def setUp(self): self.handler = SocketlessRequestHandler() def send_typical_request(self, message): diff -r 0f24c65fb7e5 Lib/test/test_mailbox.py --- a/Lib/test/test_mailbox.py Sat Jan 05 07:37:47 2013 +0200 +++ b/Lib/test/test_mailbox.py Sat Jan 05 18:01:21 2013 +0200 @@ -747,10 +747,10 @@ self._box.lock() self._box.unlock() - def test_folder (self): + def test_folder(self): # Test for bug #1569790: verify that folders returned by .get_folder() # use the same factory function. - def dummy_factory (s): + def dummy_factory(s): return None box = self._factory(self._path, factory=dummy_factory) folder = box.add_folder('folder1') @@ -759,7 +759,7 @@ folder1_alias = box.get_folder('folder1') self.assertIs(folder1_alias._factory, dummy_factory) - def test_directory_in_folder (self): + def test_directory_in_folder(self): # Test that mailboxes still work if there's a stray extra directory # in a folder. for i in range(10): @@ -1053,7 +1053,7 @@ def test_get_folder(self): # Open folders - def dummy_factory (s): + def dummy_factory(s): return None self._box = self._factory(self._path, dummy_factory) diff -r 0f24c65fb7e5 Lib/test/test_mmap.py --- a/Lib/test/test_mmap.py Sat Jan 05 07:37:47 2013 +0200 +++ b/Lib/test/test_mmap.py Sat Jan 05 18:01:21 2013 +0200 @@ -458,7 +458,7 @@ m[start:stop:step] = data self.assertEqual(m[:], "".join(L)) - def make_mmap_file (self, f, halfsize): + def make_mmap_file(self, f, halfsize): # Write 2 pages worth of data to the file f.write ('\0' * halfsize) f.write ('foo') @@ -466,7 +466,7 @@ f.flush () return mmap.mmap (f.fileno(), 0) - def test_empty_file (self): + def test_empty_file(self): f = open (TESTFN, 'w+b') f.close() with open(TESTFN, "rb") as f : @@ -479,7 +479,7 @@ except: self.fail("unexpected exception: " + str(e)) - def test_offset (self): + def test_offset(self): f = open (TESTFN, 'w+b') try: # unlink TESTFN no matter what diff -r 0f24c65fb7e5 Lib/test/test_old_mailbox.py --- a/Lib/test/test_old_mailbox.py Sat Jan 05 07:37:47 2013 +0200 +++ b/Lib/test/test_old_mailbox.py Sat Jan 05 18:01:21 2013 +0200 @@ -124,7 +124,7 @@ def tearDown(self): os.unlink(self._path) - def test_from_regex (self): + def test_from_regex(self): # Testing new regex from bug #1633678 with open(self._path, 'w') as f: f.write("""From fred@example.com Mon May 31 13:24:50 2004 +0200 diff -r 0f24c65fb7e5 Lib/test/test_optparse.py --- a/Lib/test/test_optparse.py Sat Jan 05 07:37:47 2013 +0200 +++ b/Lib/test/test_optparse.py Sat Jan 05 18:01:21 2013 +0200 @@ -1027,7 +1027,7 @@ elif os.path.isfile(test_support.TESTFN): os.unlink(test_support.TESTFN) - class MyOption (Option): + class MyOption(Option): def check_file(option, opt, value): if not os.path.exists(value): raise OptionValueError("%s: file does not exist" % value) @@ -1063,7 +1063,7 @@ type="string", dest="apple")] self.parser = OptionParser(option_list=options) - class MyOption (Option): + class MyOption(Option): ACTIONS = Option.ACTIONS + ("extend",) STORE_ACTIONS = Option.STORE_ACTIONS + ("extend",) TYPED_ACTIONS = Option.TYPED_ACTIONS + ("extend",) diff -r 0f24c65fb7e5 Lib/test/test_os.py --- a/Lib/test/test_os.py Sat Jan 05 07:37:47 2013 +0200 +++ b/Lib/test/test_os.py Sat Jan 05 18:01:21 2013 +0200 @@ -484,7 +484,7 @@ os.remove(dirname) os.rmdir(test_support.TESTFN) -class MakedirTests (unittest.TestCase): +class MakedirTests(unittest.TestCase): def setUp(self): os.mkdir(test_support.TESTFN) @@ -517,7 +517,7 @@ os.removedirs(path) -class DevNullTests (unittest.TestCase): +class DevNullTests(unittest.TestCase): def test_devnull(self): f = file(os.devnull, 'w') f.write('hello') @@ -526,7 +526,7 @@ self.assertEqual(f.read(), '') f.close() -class URandomTests (unittest.TestCase): +class URandomTests(unittest.TestCase): def test_urandom_length(self): self.assertEqual(len(os.urandom(0)), 0) diff -r 0f24c65fb7e5 Lib/test/test_poll.py --- a/Lib/test/test_poll.py Sat Jan 05 07:37:47 2013 +0200 +++ b/Lib/test/test_poll.py Sat Jan 05 18:01:21 2013 +0200 @@ -118,7 +118,7 @@ cmd = 'for i in 0 1 2 3 4 5 6 7 8 9; do echo testing...; sleep 1; done' p = os.popen(cmd, 'r') pollster = select.poll() - pollster.register( p, select.POLLIN ) + pollster.register(p, select.POLLIN) for tout in (0, 1000, 2000, 4000, 8000, 16000) + (-1,)*10: fdlist = pollster.poll(tout) if (fdlist == []): diff -r 0f24c65fb7e5 Lib/test/test_readline.py --- a/Lib/test/test_readline.py Sat Jan 05 07:37:47 2013 +0200 +++ b/Lib/test/test_readline.py Sat Jan 05 18:01:21 2013 +0200 @@ -11,7 +11,7 @@ # Skip tests if there is no readline module readline = import_module('readline') -class TestHistoryManipulation (unittest.TestCase): +class TestHistoryManipulation(unittest.TestCase): @unittest.skipIf(not hasattr(readline, 'clear_history'), "The history update test cannot be run because the " diff -r 0f24c65fb7e5 Lib/test/test_socket.py --- a/Lib/test/test_socket.py Sat Jan 05 07:37:47 2013 +0200 +++ b/Lib/test/test_socket.py Sat Jan 05 18:01:21 2013 +0200 @@ -72,7 +72,7 @@ new threaded class from an existing unit test, use multiple inheritance: - class NewClass (OldClass, ThreadableTest): + class NewClass(OldClass, ThreadableTest): pass This class defines two new fixture functions with obvious @@ -1616,7 +1616,7 @@ print "TIPC module is not loaded, please 'sudo modprobe tipc'" return False -class TIPCTest (unittest.TestCase): +class TIPCTest(unittest.TestCase): def testRDM(self): srv = socket.socket(socket.AF_TIPC, socket.SOCK_RDM) cli = socket.socket(socket.AF_TIPC, socket.SOCK_RDM) @@ -1636,7 +1636,7 @@ self.assertEqual(msg, MSG) -class TIPCThreadableTest (unittest.TestCase, ThreadableTest): +class TIPCThreadableTest(unittest.TestCase, ThreadableTest): def __init__(self, methodName = 'runTest'): unittest.TestCase.__init__(self, methodName = methodName) ThreadableTest.__init__(self) diff -r 0f24c65fb7e5 Lib/test/test_subprocess.py --- a/Lib/test/test_subprocess.py Sat Jan 05 07:37:47 2013 +0200 +++ b/Lib/test/test_subprocess.py Sat Jan 05 18:01:21 2013 +0200 @@ -1314,7 +1314,7 @@ self.assertEqual([(256, 999), (666,), (666,)], record_calls) @unittest.skipUnless(mswindows, "mswindows only") -class CommandsWithSpaces (BaseTestCase): +class CommandsWithSpaces(BaseTestCase): def setUp(self): super(CommandsWithSpaces, self).setUp() diff -r 0f24c65fb7e5 Lib/test/test_textwrap.py --- a/Lib/test/test_textwrap.py Sat Jan 05 07:37:47 2013 +0200 +++ b/Lib/test/test_textwrap.py Sat Jan 05 18:01:21 2013 +0200 @@ -251,7 +251,7 @@ self.check_split(text, expect) - def test_unix_options (self): + def test_unix_options(self): # Test that Unix-style command-line options are wrapped correctly. # Both Optik (OptionParser) and Docutils rely on this behaviour! @@ -285,7 +285,7 @@ "--dry-", "run", " ", "or", " ", "--dryrun"] self.check_split(text, expect) - def test_funky_hyphens (self): + def test_funky_hyphens(self): # Screwy edge cases cooked up by David Goodger. All reported # in SF bug #596434. self.check_split("what the--hey!", ["what", " ", "the", "--", "hey!"]) @@ -319,7 +319,7 @@ self.check_split("the ['wibble-wobble'] widget", ['the', ' ', "['wibble-", "wobble']", ' ', 'widget']) - def test_funky_parens (self): + def test_funky_parens(self): # Second part of SF bug #596434: long option strings inside # parentheses. self.check_split("foo (--option) bar", @@ -436,7 +436,7 @@ self.assertRaises(ValueError, wrap, text, -1) -class LongWordTestCase (BaseTestCase): +class LongWordTestCase(BaseTestCase): def setUp(self): self.wrapper = TextWrapper() self.text = '''\ diff -r 0f24c65fb7e5 Lib/test/test_with.py --- a/Lib/test/test_with.py Sat Jan 05 07:37:47 2013 +0200 +++ b/Lib/test/test_with.py Sat Jan 05 18:01:21 2013 +0200 @@ -498,7 +498,7 @@ def testRaisedGeneratorExit2(self): # From bug 1462485 - class cm (object): + class cm(object): def __enter__(self): pass def __exit__(self, type, value, traceback): diff -r 0f24c65fb7e5 Lib/test/test_xmlrpc.py --- a/Lib/test/test_xmlrpc.py Sat Jan 05 07:37:47 2013 +0200 +++ b/Lib/test/test_xmlrpc.py Sat Jan 05 18:01:21 2013 +0200 @@ -81,7 +81,7 @@ self.assertTrue(then >= dt) self.assertTrue(dt < then) - def test_bug_1164912 (self): + def test_bug_1164912(self): d = xmlrpclib.DateTime() ((new_d,), dummy) = xmlrpclib.loads(xmlrpclib.dumps((d,), methodresponse=True)) diff -r 0f24c65fb7e5 Lib/xmlrpclib.py --- a/Lib/xmlrpclib.py Sat Jan 05 07:37:47 2013 +0200 +++ b/Lib/xmlrpclib.py Sat Jan 05 18:01:21 2013 +0200 @@ -653,7 +653,7 @@ f = self.dispatch[InstanceType] f(self, value, write) - def dump_nil (self, value, write): + def dump_nil(self, value, write): if not self.allow_none: raise TypeError, "cannot marshal None unless allow_none is enabled" write("") @@ -839,7 +839,7 @@ dispatch = {} - def end_nil (self, data): + def end_nil(self, data): self.append(None) self._value = 0 dispatch["nil"] = end_nil diff -r 0f24c65fb7e5 Lib/zipfile.py --- a/Lib/zipfile.py Sat Jan 05 07:37:47 2013 +0200 +++ b/Lib/zipfile.py Sat Jan 05 18:01:21 2013 +0200 @@ -249,7 +249,7 @@ return -class ZipInfo (object): +class ZipInfo(object): """Class with attributes describing each file in the ZIP archive.""" __slots__ = ( diff -r 0f24c65fb7e5 Misc/BeOS-setup.py --- a/Misc/BeOS-setup.py Sat Jan 05 07:37:47 2013 +0200 +++ b/Misc/BeOS-setup.py Sat Jan 05 18:01:21 2013 +0200 @@ -131,7 +131,7 @@ self.announce('WARNING: building of extension "%s" failed: %s' % (ext.name, sys.exc_info()[1])) - def get_platform (self): + def get_platform(self): # Get value of sys.platform platform = sys.platform if platform[:6] =='cygwin': diff -r 0f24c65fb7e5 Tools/bgen/bgen/bgenVariable.py --- a/Tools/bgen/bgen/bgenVariable.py Sat Jan 05 07:37:47 2013 +0200 +++ b/Tools/bgen/bgen/bgenVariable.py Sat Jan 05 18:01:21 2013 +0200 @@ -96,7 +96,7 @@ if self.flags == ErrorMode: self.type.errorCheck(self.name) - def mkvalueFormat (self): + def mkvalueFormat(self): """Call the type's mkvalueFormat method.""" return self.type.mkvalueFormat() diff -r 0f24c65fb7e5 Tools/gdb/libpython.py --- a/Tools/gdb/libpython.py Sat Jan 05 07:37:47 2013 +0200 +++ b/Tools/gdb/libpython.py Sat Jan 05 18:01:21 2013 +0200 @@ -1090,10 +1090,10 @@ class PyObjectPtrPrinter: "Prints a (PyObject*)" - def __init__ (self, gdbval): + def __init__(self, gdbval): self.gdbval = gdbval - def to_string (self): + def to_string(self): pyop = PyObjectPtr.from_pyobject_ptr(self.gdbval) if True: return pyop.get_truncated_repr(MAX_OUTPUT_LEN) @@ -1130,7 +1130,7 @@ /usr/lib/libpython2.6.so.1.0-gdb.py /usr/lib/debug/usr/lib/libpython2.6.so.1.0.debug-gdb.py """ -def register (obj): +def register(obj): if obj == None: obj = gdb diff -r 0f24c65fb7e5 Tools/ssl/get-remote-certificate.py --- a/Tools/ssl/get-remote-certificate.py Sat Jan 05 07:37:47 2013 +0200 +++ b/Tools/ssl/get-remote-certificate.py Sat Jan 05 18:01:21 2013 +0200 @@ -8,7 +8,7 @@ import sys -def fetch_server_certificate (host, port): +def fetch_server_certificate(host, port): import re, tempfile, os, ssl diff -r 0f24c65fb7e5 setup.py --- a/setup.py Sat Jan 05 07:37:47 2013 +0200 +++ b/setup.py Sat Jan 05 18:01:21 2013 +0200 @@ -2007,7 +2007,7 @@ # Suppress the warning about installation into the lib_dynload # directory, which is not in sys.path when running Python during # installation: - def initialize_options (self): + def initialize_options(self): install.initialize_options(self) self.warn_dir=0