Commits

Ronald Oussoren  committed 91333bc

Run reindent.py to remove trailing whitespace

  • Participants
  • Parent commits 906546c

Comments (0)

Files changed (36)

File examples/EggInstaller/EggInstaller.py

     while os.path.exists(name):
         time.sleep(0.1)
     log('done')
-    
+
 if __name__ == '__main__':
     main()

File examples/PyQt/hello_app/hello.py

 
 # Add a basic widget to this application:
 # The first argument is the text we want this QWidget to show, the second
-# one is the parent widget. Since Our "hello" is the only thing we use (the 
+# one is the parent widget. Since Our "hello" is the only thing we use (the
 # so-called "MainWidget", it does not have a parent.
 hello = Qt.QLabel("<h2>Hello, World</h2>")
 

File examples/PySide/hello.py

 
 # Add a basic widget to this application:
 # The first argument is the text we want this QWidget to show, the second
-# one is the parent widget. Since Our "hello" is the only thing we use (the 
+# one is the parent widget. Since Our "hello" is the only thing we use (the
 # so-called "MainWidget", it does not have a parent.
 hello = QtGui.QLabel("<h2>Hello, World</h2>")
 

File py2app/apptemplate/setup.py

         arch = distutils.util.get_platform().split('-')[-1]
         if sys.prefix.startswith('/System') and \
             sys.version_info[:2] == (2,5):
-                arch = "fat"
+            arch = "fat"
 
     name = 'main-' + arch
 

File py2app/bootstrap/argv_emulation.py

 sys.argv emulation
 
 This module starts a basic event loop to collect file- and url-open AppleEvents. Those get
-converted to strings and stuffed into sys.argv. When that is done we continue starting 
+converted to strings and stuffed into sys.argv. When that is done we continue starting
 the application.
 
-This is a workaround to convert scripts that expect filenames on the command-line to work 
+This is a workaround to convert scripts that expect filenames on the command-line to work
 in a GUI environment. GUI applications should not use this feature.
 
 NOTE: This module uses ctypes and not the Carbon modules in the stdlib because the latter
     timer_func = ctypes.CFUNCTYPE(
             None, ctypes.c_void_p, ctypes.c_long)
 
-    ae_callback = ctypes.CFUNCTYPE(ctypes.c_int, ctypes.c_void_p, 
+    ae_callback = ctypes.CFUNCTYPE(ctypes.c_int, ctypes.c_void_p,
         ctypes.c_void_p, ctypes.c_void_p)
-    carbon.AEInstallEventHandler.argtypes = [ 
+    carbon.AEInstallEventHandler.argtypes = [
             ctypes.c_int, ctypes.c_int, ae_callback,
             ctypes.c_void_p, ctypes.c_char ]
-    carbon.AERemoveEventHandler.argtypes = [ 
+    carbon.AERemoveEventHandler.argtypes = [
             ctypes.c_int, ctypes.c_int, ae_callback,
             ctypes.c_char ]
 
 
 
     carbon.ReceiveNextEvent.restype = ctypes.c_int
-    carbon.ReceiveNextEvent.argtypes = [ 
+    carbon.ReceiveNextEvent.argtypes = [
         ctypes.c_long,  ctypes.POINTER(EventTypeSpec),
         ctypes.c_double, ctypes.c_char,
         ctypes.POINTER(ctypes.c_void_p)
     ]
 
-    
+
     carbon.AEGetParamDesc.restype = ctypes.c_int
     carbon.AEGetParamDesc.argtypes = [
             ctypes.c_void_p, ctypes.c_int, ctypes.c_int,
             ctypes.POINTER(ctypes.c_long) ]
 
     carbon.AEGetNthDesc.restype = ctypes.c_int
-    carbon.AEGetNthDesc.argtypes = [ 
+    carbon.AEGetNthDesc.argtypes = [
             ctypes.c_void_p, ctypes.c_long, ctypes.c_int,
             ctypes.c_void_p, ctypes.c_void_p ]
 
     carbon.AEGetDescDataSize.argtypes = [ ctypes.POINTER(AEDesc) ]
 
     carbon.AEGetDescData.restype = ctypes.c_int
-    carbon.AEGetDescData.argtypes = [ 
+    carbon.AEGetDescData.argtypes = [
             ctypes.POINTER(AEDesc),
             ctypes.c_void_p,
             ctypes.c_int,
 
         running[0] = False
         return 0
-    
+
     carbon.AEInstallEventHandler(kAEInternetSuite, kAEISGetURL,
             open_url_handler, 0, FALSE)
 
     while running[0] and now - start < timeout[0]:
         event = ctypes.c_void_p()
 
-        sts = carbon.ReceiveNextEvent(1, ctypes.byref(eventType), 
+        sts = carbon.ReceiveNextEvent(1, ctypes.byref(eventType),
                 start + timeout[0] - now, TRUE, ctypes.byref(event))
         if sts != 0:
             print("argvemulator warning: fetching events failed")
         if sts != 0:
             print("argvemulator warning: processing events failed")
             break
-        
 
-    carbon.AERemoveEventHandler(kCoreEventClass, kAEOpenApplication, 
+
+    carbon.AERemoveEventHandler(kCoreEventClass, kAEOpenApplication,
             open_app_handler, FALSE)
     carbon.AERemoveEventHandler(kCoreEventClass, kAEOpenDocuments,
             open_file_handler, FALSE)

File py2app/bootstrap/boot_aliasapp.py

         source = fp.read() + "\n"
 
     exec(compile(source, script, 'exec'), globals(), globals())
-

File py2app/bootstrap/boot_aliasplugin.py

         source = fp.read() + "\n"
 
     exec(compile(source, script, 'exec'), globals(), globals())
-
-

File py2app/bootstrap/boot_plugin.py

     with open(path, 'rU') as fp:
         source = fp.read()
     exec(compile(source, path, 'exec'), globals(), globals())
-

File py2app/bootstrap/emulate_shell_environment.py

                 if ln.strip().startswith(b'--------'):
                     in_data = True
                 continue
-            
+
             if ln.startswith(b'--------'):
                 break
 
 
             else:
                 env[key] = value
-        
+
 
 _emulate_shell_environ()

File py2app/bootstrap/setup_included_subpackages.py

         pkg_dir = os.path.join(os.environ['RESOURCEPATH'],
             'lib', 'python%d.%d'%(sys.version_info[:2]))
         return imp.load_module(
-                fullname, None, 
+                fullname, None,
                 os.path.join(pkg_dir, fullname), ('', '', imp.PKG_DIRECTORY))
 
 import sys

File py2app/bootstrap/virtualenv.py

     # for platforms that aren't supported by py2app)
 
     paths = [os.path.join(sys.real_prefix, 'lib', 'python'+sys.version[:3])]
-    hardcoded_relative_dirs = paths[:] 
+    hardcoded_relative_dirs = paths[:]
     plat_path = os.path.join(sys.real_prefix, 'lib', 'python'+sys.version[:3],
          'plat-%s' % sys.platform)
     if os.path.exists(plat_path):

File py2app/build_app.py

         for src, dest in self.iter_mappingmodels(resdir):
             self.mkpath(os.path.dirname(dest))
             mapc(src, dest)
-        
+
     def iter_data_files(self):
         dist = self.distribution
         allres = chain(getattr(dist, 'data_files', ()) or (), self.resources)
             result['PyOptions']['optimize'] = self.optimize
         return result
 
-    
+
     def initialize_plist(self):
         plist = self.get_default_plist()
         for target in self.targets:
 
         if os.path.exists(self.bdist_dir):
             shutil.rmtree(self.bdist_dir)
-        
+
         self.collect_dir = os.path.abspath(
             os.path.join(self.bdist_dir, "collect"))
         self.mkpath(self.collect_dir)
             else:
                 basename = fmwk['shortname'] + '.framework'
                 yield os.path.join(fmwk['location'], basename)
-    
+
     def build_alias_executable(self, target, script, extra_scripts):
         # Build an alias executable for the target
         appdir, resdir, plist = self.create_bundle(target, script)
         self.symlink(
             os.path.join(realhome, 'config'),
             os.path.join(pyhome, 'config'))
-            
-        
+
+
         # symlink data files
         # XXX: fixme: need to integrate automatic data conversion
         for src, dest in self.iter_data_files():
         if sys.version_info[0] != 2:
             import zlib
             self.copy_file(zlib.__file__, os.path.dirname(arcdir))
-        
+
         ext_dir = os.path.join(pydir, os.path.basename(self.ext_dir))
         self.copy_tree(self.ext_dir, ext_dir, preserve_symlinks=True)
         self.copy_tree(self.framework_dir,

File py2app/bundletemplate/setup.py

         arch = distutils.util.get_platform().split('-')[-1]
         if sys.prefix.startswith('/System') and \
                 sys.version_info[:2] == (2,5):
-                    arch = "fat"
+            arch = "fat"
 
     name = 'main-' + arch
 

File py2app/recipes/pyenchant.py

 
     # Include the entire package outside of site-packages.zip,
     # mostly to avoid trying to extract the C code from the package
-    return dict(packages=['enchant']) 
+    return dict(packages=['enchant'])

File py2app/recipes/pyside.py

         elif fn.startswith('libshiboken-python'):
             add=True
         if add:
-            NOT_SYSTEM_FILES.append(os.path.join('/usr/lib', fn)) 
+            NOT_SYSTEM_FILES.append(os.path.join('/usr/lib', fn))
 
     return dict(resources=resources)

File py2app/recipes/sip.py

 using sip because we have no way to fine-tune this.
 
 The problem with SIP is that all inter-module depedencies (for example from
-PyQt4.Qt to PyQt4.QtCore) are handled in C code and therefore cannot be 
+PyQt4.Qt to PyQt4.QtCore) are handled in C code and therefore cannot be
 detected by the python code in py2app).
 """
 
                     # subpackage to ensure everything get seen.
                     for sub in os.listdir(fullpath):
                         if ".py" not in sub:
-                            self.packages.add('%s.%s'%(fn, sub.replace(".so","")))                            
+                            self.packages.add('%s.%s'%(fn, sub.replace(".so","")))
 
         # Causes a python3-related syntax error (metaclass keyword),
         # and you probably don't need it:

File py2app/recipes/virtualenv.py

 """
-virtualenv installs a wrapper for the real distutils into the 
+virtualenv installs a wrapper for the real distutils into the
 virtual environment. Ignore that wrapper, but go for the real
 distutils instead
 
-This recipe is rather compilicated and definitely not a 
+This recipe is rather compilicated and definitely not a
 good model for other recipes!!!
 """
 import sys, os, imp
             co = mf.replace_paths_in_code(co)
         mf.scan_code(co, m)
 
-        # That's not all there is to this, we need to look for 
+        # That's not all there is to this, we need to look for
         # MissingModules in the distutils namespace as well and
         # try to import these again.
         for m in mf.flatten():

File py2app/recipes/wx.py

 def check(cmd, mf):
-    # wx.lib.pubsub tries to be too smart w.r.t. 
+    # wx.lib.pubsub tries to be too smart w.r.t.
     # the __path__ it uses, include all of it when
     # found.
     m = mf.findNode('wx.lib.pubsub')

File py2app/script_py2applet.py

    or: py2applet [options...] script.py [data files...]
    or: py2applet --help
 """
-    
+
 SETUP_TEMPLATE = '''"""
 This is a setup.py script generated by py2applet
 
         if opt_short:
             optmap['-' + opt_short] = opt_long.rstrip('=')
     return optmap
-    
+
 def get_cmd_options():
     options = set()
     for option in build_app.py2app.user_options:
         if opt_long.endswith('=') and opt_short:
             options.add('-' + opt_short)
     return options
- 
+
 def main():
     if not sys.argv[1:]:
         print(HELP_TEXT)
         return
-    
+
     scripts = []
     data_files = []
     packages = []

File py2app/util.py

             raise DistutilsFileError("File doesn't exist: %s"%(orig_path,))
 
         try:
-           zf = zipfile.ZipFile(path)
+            zf = zipfile.ZipFile(path)
         except zipfile.BadZipfile:
             raise DistutilsFileError("File doesn't exist: %s"%(orig_path,))
 
             if not os.path.exists(destination):
                 os.mkdir(destination)
         for fn in zipio.listdir(source):
-            copy_resource(os.path.join(source, fn), 
+            copy_resource(os.path.join(source, fn),
                     os.path.join(destination, fn), dry_run=dry_run, symlink=symlink)
 
     else:
             if force or newer(mod.filename, cfile):
                 if verbose:
                     print("byte-compiling %s to %s" % (mod.filename, dfile))
-                    
+
                 if not dry_run:
                     mkpath(os.path.dirname(cfile))
                     suffix = os.path.splitext(mod.filename)[1]
                               ("Don't know how to handle %r" % mod.filename)
             else:
                 if verbose:
-                    print("skipping byte-compilation of %s to %s" % 
+                    print("skipping byte-compilation of %s to %s" %
                           (mod.filename, dfile))
 
 SCMDIRS = ['CVS', '.svn']
             # Support for Xcode 3.x and earlier
             if toolname == 'momc':
                 choices = [
-    	            '/Library/Application Support/Apple/Developer Tools/Plug-ins/XDCoreDataModel.xdplugin/Contents/Resources/momc',
+                    '/Library/Application Support/Apple/Developer Tools/Plug-ins/XDCoreDataModel.xdplugin/Contents/Resources/momc',
                     '/Developer/Library/Xcode/Plug-ins/XDCoreDataModel.xdplugin/Contents/Resources/momc',
                     '/Developer/usr/bin/momc',
                 ]
             for fn in choices:
                 if os.path.exists(fn):
                     _tools[toolname] = fn
-                    break 
+                    break
             else:
                 raise IOError("Tool %r not found"%(toolname,))
 

File py2app_tests/app_with_data/setup.py

     )),
     data_files = [
         ( 'sub1', [ 'data1/file1.txt', 'data1/file2.txt' ]),
-        'data2' 
+        'data2'
     ]
 )

File py2app_tests/app_with_scripts/helper1.py

 import curses
 print("Helper 1: %s"%(curses.__name__,))
-

File py2app_tests/app_with_scripts/presetup.py

             '-dynamic', '-o', os.path.join(bdir, 'libfoo.dylib'),
             '-install_name', os.path.abspath(os.path.join(bdir, 'libfoo.dylib')),
             os.path.join(os.path.join(bdir, 'libfoo.o'))])
-        
+
 setup(
     cmdclass = {
         'build_dylib': build_dylib,

File py2app_tests/test_app_resources.py

 
 
     def test_icon_file(self):
-        resource_dir = os.path.join(self.app_dir, 'dist', 'SimpleApp.app', 
+        resource_dir = os.path.join(self.app_dir, 'dist', 'SimpleApp.app',
             'Contents', 'Resources')
 
         pl = plistlib.readPlist(os.path.join(
 
 
     def test_resources(self):
-        resource_dir = os.path.join(self.app_dir, 'dist', 'SimpleApp.app', 
+        resource_dir = os.path.join(self.app_dir, 'dist', 'SimpleApp.app',
             'Contents', 'Resources')
 
         src_file = os.path.join(self.app_dir, 'data3', 'source.c')
             self.assertTrue(os.path.islink(dst_file))
 
     def test_data_files(self):
-        resource_dir = os.path.join(self.app_dir, 'dist', 'SimpleApp.app', 
+        resource_dir = os.path.join(self.app_dir, 'dist', 'SimpleApp.app',
             'Contents', 'Resources')
 
         for src_path, dst_path, chk_link in [
 
 if __name__ == "__main__":
     unittest.main()
-

File py2app_tests/test_app_with_scripts.py

 
     #
     # End of setup code
-    # 
+    #
 
     def test_helper1(self):
         p = self.run_script('helper1')
 
 if __name__ == "__main__":
     unittest.main()
-

File py2app_tests/test_argv_emulation.py

 
     #
     # End of setup code
-    # 
+    #
 
     def test_basic_start(self):
         self.maxDiff = None
 
 if __name__ == "__main__":
     unittest.main()
-

File py2app_tests/test_basic_app.py

 
     #
     # End of setup code
-    # 
+    #
 
     def test_basic_start(self):
         p = self.start_app()
 
 if __name__ == "__main__":
     unittest.main()
-

File py2app_tests/test_basic_plugin.py

             if 'LANG' not in env:
                 env['LANG'] = 'en_US.UTF-8'
 
-            
+
             p = subprocess.Popen(
                 cmd,
                 cwd = cls.plugin_dir,
                 env = dict(os.environ)
 
             p = subprocess.Popen(cc
-                +  get_config_var('LDFLAGS').split() + get_config_var('CFLAGS').split() + [ 
-                    '-o', 'bundle_loader', os.path.join(DIR_NAME, 'bundle_loader.m'), 
+                +  get_config_var('LDFLAGS').split() + get_config_var('CFLAGS').split() + [
+                    '-o', 'bundle_loader', os.path.join(DIR_NAME, 'bundle_loader.m'),
                     '-framework', 'Foundation'],
                 env=env,
                 stdout=subprocess.PIPE,
 
     #
     # End of setup code
-    # 
+    #
 
     def test_basic_start(self):
         p = self.start_app()
 
 if __name__ == "__main__":
     unittest.main()
-

File py2app_tests/test_compile_resources.py

 
 
     def test_resources(self):
-        resource_dir = os.path.join(self.app_dir, 'dist', 'Resources.app', 
+        resource_dir = os.path.join(self.app_dir, 'dist', 'Resources.app',
             'Contents', 'Resources')
 
         self.assertFalse(os.path.exists(os.path.join(resource_dir, 'MainMenu.xib')))
 
 if __name__ == "__main__":
     unittest.main()
-

File py2app_tests/test_explicit_includes.py

 
     #
     # End of setup code
-    # 
+    #
 
 
     def test_simple_imports(self):

File py2app_tests/test_package_data.py

 
     #
     # End of setup code
-    # 
+    #
 
     def test_package_data(self):
         p = self.start_app()
         ln = p.stdout.readline()
         path = ln.decode('utf-8')[:-1]
 
-        
+
         self.assertTrue(os.path.basename(path) in ['__init__.py', '__init__.pyc', '__init__.pyo'])
         self.assertTrue(zipio.isfile(path))
 

File py2app_tests/test_pkg_script.py

 
     #
     # End of setup code
-    # 
+    #
 
     def test_basic_start(self):
         p = self.start_app()
         p.stdin.flush()
         ln = p.stdout.readline()
         self.assertEqual(ln.strip(), b"False")
-        
+
 
         # Basic module that is always present:
         p.stdin.write('import_module("os")\n'.encode('latin1'))
 
 if __name__ == "__main__":
     unittest.main()
-
-

File py2app_tests/test_plugin_with_scripts.py

             if 'LANG' not in env:
                 env['LANG'] = 'en_US.UTF-8'
 
-            
+
             p = subprocess.Popen(
                 cmd,
                 cwd = cls.plugin_dir,
                 env = dict(os.environ)
 
             p = subprocess.Popen(cc
-                +  get_config_var('LDFLAGS').split() + get_config_var('CFLAGS').split() + [ 
-                    '-o', 'bundle_loader', os.path.join(DIR_NAME, 'bundle_loader.m'), 
+                +  get_config_var('LDFLAGS').split() + get_config_var('CFLAGS').split() + [
+                    '-o', 'bundle_loader', os.path.join(DIR_NAME, 'bundle_loader.m'),
                     '-framework', 'Foundation'],
                 env=env,
                 stdout=subprocess.PIPE,
         return p
     #
     # End of setup code
-    # 
+    #
 
 
     def test_helper1(self):
 
 if __name__ == "__main__":
     unittest.main()
-

File py2app_tests/test_py2applet.py

         scriptfn = script_py2applet.__file__
         if scriptfn.endswith('.pyc'):
             scriptfn = scriptfn[:-1]
-            
+
         p = subprocess.Popen([
             sys.executable, scriptfn ] + list(args),
             cwd = self.testdir,
 
 if __name__ == "__main__":
     unittest.main()
-
-
-        

File py2app_tests/test_shell_environment.py

 
     #
     # End of setup code
-    # 
+    #
 
     def test_shell_environment(self):
         self.maxDiff = None
 
         env = eval(data)
         path = env['PATH']
-        
+
         self.assertNotEqual(path, '/usr/bin:/bin')
-        
+
         elems = path.split(':')
         self.assertIn('/usr/bin', elems)
 
             # Collect sphinx output
             if not os.path.exists('dist'):
                 os.mkdir('dist')
-            zf = zipfile.ZipFile('dist/%s-docs.zip'%(name,), 'w', 
+            zf = zipfile.ZipFile('dist/%s-docs.zip'%(name,), 'w',
                     compression=zipfile.ZIP_DEFLATED)
 
             for toplevel, dirs, files in os.walk('doc/_build/html'):
             # Upload the results, this code is based on the distutils
             # 'upload' command.
             content = open('dist/%s-docs.zip'%(name,), 'rb').read()
-            
+
             data = {
                 ':action': 'doc_upload',
                 'name': name,
                 self.announce('Upload failed (%s): %s' % (r.status, r.reason),
                     log.ERROR)
 
-                print ('-'*75) 
+                print ('-'*75)
                 print (r.read())
                 print ('-'*75)
 
             if fnmatch(fn, pathPattern):
                 result.append(os.path.join(rootpath, fn))
     return result
-        
 
-def importExternalTestCases(unittest, 
+
+def importExternalTestCases(unittest,
         pathPattern="test_*.py", root=".", package=None):
     """
     Import all unittests in the PyObjC tree starting at 'root'
         testModules = [(package + '.' + m) for m in testModules]
 
     suites = []
-   
+
     for modName in testModules:
         try:
             module = __import__(modName)
         if nspkgs is not None:
             for nm in nspkgs:
                 del sys.modules[nm]
-        
+
         # Reset pkg_resources state:
         add_activation_listener(lambda dist: dist.activate())
         working_set.__init__()
             meta = self.distribution.metadata
             name = meta.get_name()
             test_pkg = name + "_tests"
-            suite = importExternalTestCases(unittest, 
+            suite = importExternalTestCases(unittest,
                     "test_*.py", test_pkg, test_pkg)
 
             runner = unittest.TextTestRunner(verbosity=self.verbosity)