]> granicus.if.org Git - python/commitdiff
Whitespace normalization.
authorTim Peters <tim.peters@gmail.com>
Sun, 11 Jun 2006 19:42:51 +0000 (19:42 +0000)
committerTim Peters <tim.peters@gmail.com>
Sun, 11 Jun 2006 19:42:51 +0000 (19:42 +0000)
Lib/ctypes/test/test_anon.py
Lib/ctypes/test/test_varsize_struct.py
Lib/idlelib/Bindings.py
Lib/idlelib/PyShell.py
Lib/idlelib/configHandler.py
Lib/idlelib/macosxSupport.py
Lib/optparse.py
Lib/test/test_textwrap.py
Lib/textwrap.py

index 62e2ce79339f9d508f584fdfc793fee14db18f2a..99e02cb5546b77d489f104976a2d3a995e3f7f37 100644 (file)
@@ -49,7 +49,7 @@ class AnonTest(unittest.TestCase):
                         ("_", ANON_U),
                         ("y", c_int)]
             _anonymous_ = ["_"]
-        
+
         self.failUnlessEqual(Y.x.offset, 0)
         self.failUnlessEqual(Y.a.offset, sizeof(c_int))
         self.failUnlessEqual(Y.b.offset, sizeof(c_int))
index aa8930d3742f775b1db8dc74d4be0e9abb567d6e..996a630a93d5f7b16ade756a848224baff9a2c60 100644 (file)
@@ -110,6 +110,6 @@ class VarSizeTest(unittest.TestCase):
         array[:5] = [10, 11, 12, 13, 14]
         self.failUnlessEqual(array[:], [10, 11, 12, 13, 14, 25, 26, 27, 28, 29, 0, 0, 0, 0, 0])
         self.failUnlessEqual(varsize_array[0:10], [10, 11, 12, 13, 14, 25, 26, 27, 28, 29])
-        
+
 if __name__ == "__main__":
     unittest.main()
index a695ab7a006b2bb2b196955def167252b5a9bf1e..d24be3f1e23825a17c65fb5121cd89e481e65af3 100644 (file)
@@ -94,7 +94,7 @@ if sys.platform == 'darwin' and '.app' in sys.executable:
     del menudefs[0][1][-3:]
     menudefs[0][1].insert(6, closeItem)
 
-    # Remove the 'About' entry from the help menu, it is in the application 
+    # Remove the 'About' entry from the help menu, it is in the application
     # menu
     del menudefs[-1][1][0:2]
 
index 0edd2d105f35df20b881bc53ce32a4c2b113ac2b..f7622f14f9a0e5a430c6b7f86080fec861f15129 100644 (file)
@@ -1396,8 +1396,8 @@ def main():
 
         if macosxSupport.runningAsOSXApp() and flist.dict:
             # On OSX: when the user has double-clicked on a file that causes
-            # IDLE to be launched the shell window will open just in front of 
-            # the file she wants to see. Lower the interpreter window when 
+            # IDLE to be launched the shell window will open just in front of
+            # the file she wants to see. Lower the interpreter window when
             # there are open files.
             shell.top.lower()
 
index 5ae643a71d6c66a10e47e9ce2ce3d0da8ff41113..826fb5dbb8141b6c952d259c6645d95c93bf29d8 100644 (file)
@@ -500,7 +500,7 @@ class IdleConf:
 
         if macosxSupport.runningAsOSXApp():
             # We're using AquaTk, replace all keybingings that use the
-            # Alt key by ones that use the Option key because the former 
+            # Alt key by ones that use the Option key because the former
             # don't work reliably.
             for k, v in result.items():
                 v2 = [ x.replace('<Alt-', '<Option-') for x in v ]
index d403514394d204c177c499ee3d36cdad78b946be..d55dbcbde80bf67f4515cf984c2fde178d388967 100644 (file)
@@ -1,36 +1,36 @@
-"""
-A number of function that enhance IDLE on MacOSX when it used as a normal
-GUI application (as opposed to an X11 application).
-"""
-import sys
-
-def runningAsOSXApp():
-    """ Returns True iff running from the IDLE.app bundle on OSX """
-    return (sys.platform == 'darwin' and 'IDLE.app' in sys.argv[0])
-
-def addOpenEventSupport(root, flist):
-    """
-    This ensures that the application will respont to open AppleEvents, which
-    makes is feaseable to use IDLE as the default application for python files.
-    """
-    def doOpenFile(*args):
-        for fn in args:
-            flist.open(fn)
-           
-    # The command below is a hook in aquatk that is called whenever the app
-    # receives a file open event. The callback can have multiple arguments,
-    # one for every file that should be opened.
-    root.createcommand("::tk::mac::OpenDocument", doOpenFile)
-
-def hideTkConsole(root):
-    root.tk.call('console', 'hide')
-
-
-def setupApp(root, flist):
-    """
-    Perform setup for the OSX application bundle.
-    """
-    if not runningAsOSXApp(): return
-
-    hideTkConsole(root)
-    addOpenEventSupport(root, flist)
+"""\r
+A number of function that enhance IDLE on MacOSX when it used as a normal\r
+GUI application (as opposed to an X11 application).\r
+"""\r
+import sys\r
+\r
+def runningAsOSXApp():\r
+    """ Returns True iff running from the IDLE.app bundle on OSX """\r
+    return (sys.platform == 'darwin' and 'IDLE.app' in sys.argv[0])\r
+\r
+def addOpenEventSupport(root, flist):\r
+    """\r
+    This ensures that the application will respont to open AppleEvents, which\r
+    makes is feaseable to use IDLE as the default application for python files.\r
+    """\r
+    def doOpenFile(*args):\r
+        for fn in args:\r
+            flist.open(fn)\r
+\r
+    # The command below is a hook in aquatk that is called whenever the app\r
+    # receives a file open event. The callback can have multiple arguments,\r
+    # one for every file that should be opened.\r
+    root.createcommand("::tk::mac::OpenDocument", doOpenFile)\r
+\r
+def hideTkConsole(root):\r
+    root.tk.call('console', 'hide')\r
+\r
+\r
+def setupApp(root, flist):\r
+    """\r
+    Perform setup for the OSX application bundle.\r
+    """\r
+    if not runningAsOSXApp(): return\r
+\r
+    hideTkConsole(root)\r
+    addOpenEventSupport(root, flist)\r
index f0fad2c889d2965bb9ceeb374593108ed3fa55e1..ef382aa3475644560c5762870eb091b1295a94dd 100644 (file)
@@ -256,7 +256,7 @@ class HelpFormatter:
                              text_width,
                              initial_indent=indent,
                              subsequent_indent=indent)
-        
+
     def format_description(self, description):
         if description:
             return self._format_text(description) + "\n"
@@ -1214,7 +1214,7 @@ class OptionParser (OptionContainer):
         """
         Declare that you are done with this OptionParser.  This cleans up
         reference cycles so the OptionParser (and all objects referenced by
-        it) can be garbage-collected promptly.  After calling destroy(), the 
+        it) can be garbage-collected promptly.  After calling destroy(), the
         OptionParser is unusable.
         """
         OptionContainer.destroy(self)
index 98cc86962c9d075319b4a27e67b6adb0172a4221..500eceb183820c4d1d873ddec096bc34d6816def 100644 (file)
@@ -552,7 +552,7 @@ def foo():
 
         text = "  \t  hello there\n  \t  how are you?"
         self.assertEquals(expect, dedent(text))
-        
+
         text = "  \thello there\n  \t  how are you?"
         expect = "hello there\n  how are you?"
         self.assertEquals(expect, dedent(text))
index e18000ac429c1bc9ec19c9d092069887858827a0..ccff2aba1287b61ca96918c8be631f6f0305ddbf 100644 (file)
@@ -344,13 +344,13 @@ def dedent(text):
 
         # Current line more deeply indented than previous winner:
         # no change (previous winner is still on top).
-        elif indent.startswith(margin): 
-            pass                        
+        elif indent.startswith(margin):
+            pass
 
         # Current line consistent with and no deeper than previous winner:
         # it's the new winner.
-        elif margin.startswith(indent): 
-            margin = indent             
+        elif margin.startswith(indent):
+            margin = indent
 
         # Current line and previous winner have no common whitespace:
         # there is no margin.