chiark / gitweb /
Apply some autopep8-python2 suggestions
authorDaniel Martí <mvdan@mvdan.cc>
Wed, 31 Dec 2014 15:42:26 +0000 (16:42 +0100)
committerDaniel Martí <mvdan@mvdan.cc>
Wed, 31 Dec 2014 15:44:06 +0000 (16:44 +0100)
fdroid
fdroidserver/build.py
fdroidserver/common.py
fdroidserver/lint.py
fdroidserver/metadata.py
fdroidserver/stats.py
makebuildserver
setup.py

diff --git a/fdroid b/fdroid
index ac32d7c17ad5f66ac45ffae83f99de0270d6be0a..ab901a7bb8038d15382b1f150cb9d7a569cea5e9 100755 (executable)
--- a/fdroid
+++ b/fdroid
@@ -40,7 +40,7 @@ commands = {
     "scanner": "Scan the source code of a package",
     "stats": "Update the stats of the repo",
     "server": "Interact with the repo HTTP server",
-    }
+}
 
 
 def print_help():
index 01eb2f96f0918de8b88a95f4893a62968fb09ca5..677e4c88fa3caf1d523b576ebf992807344d061c 100644 (file)
@@ -48,7 +48,7 @@ def get_builder_vm_id():
     if os.path.isdir(vd):
         # Vagrant 1.2 (and maybe 1.1?) it's a directory tree...
         with open(os.path.join(vd, 'machines', 'default',
-                  'virtualbox', 'id')) as vf:
+                               'virtualbox', 'id')) as vf:
             id = vf.read()
         return id
     else:
@@ -71,7 +71,7 @@ def got_valid_builder_vm():
         return True
     # Vagrant 1.2 - the directory can exist, but the id can be missing...
     if not os.path.exists(os.path.join(vd, 'machines', 'default',
-                          'virtualbox', 'id')):
+                                       'virtualbox', 'id')):
         return False
     return True
 
@@ -302,7 +302,7 @@ def build_server(app, thisbuild, vcs, build_dir, output_dir, force):
         ftp.put(os.path.join(serverpath, 'common.py'), 'common.py')
         ftp.put(os.path.join(serverpath, 'metadata.py'), 'metadata.py')
         ftp.put(os.path.join(serverpath, '..', 'buildserver',
-                'config.buildserver.py'), 'config.py')
+                             'config.buildserver.py'), 'config.py')
         ftp.chmod('config.py', 0o600)
 
         # Copy over the ID (head commit hash) of the fdroidserver in use...
@@ -824,7 +824,7 @@ def build_local(app, thisbuild, vcs, build_dir, output_dir, srclib_dir, extlib_d
             shutil.copyfile(os.path.join(homedir, fn),
                             os.path.join(metadir, fn))
             subprocess.call(['jar', 'uf', os.path.abspath(src),
-                            'META-INF/' + fn], cwd=tmp_dir)
+                             'META-INF/' + fn], cwd=tmp_dir)
 
     # Copy the unsigned apk to our destination directory for further
     # processing (by publish.py)...
index adb3cd616d023508883a7b7b7cbf339497ddfbfd..b9e7b81c615926c69f73fc45ae2bfe30228ac3e6 100644 (file)
@@ -391,6 +391,7 @@ def getsrclibvcs(name):
 
 
 class vcs:
+
     def __init__(self, remote, local):
 
         # svn, git-svn and bzr may require auth
@@ -439,9 +440,8 @@ class vcs:
                     writeback = False
                 else:
                     deleterepo = True
-                    logging.info(
-                        "Repository details for %s changed - deleting" % (
-                            self.local))
+                    logging.info("Repository details for %s changed - deleting" % (
+                        self.local))
             else:
                 deleterepo = True
                 logging.info("Repository details for %s missing - deleting" % (
@@ -592,8 +592,9 @@ class vcs_git(vcs):
     def latesttags(self, alltags, number):
         self.checkrepo()
         p = FDroidPopen(['echo "' + '\n'.join(alltags) + '" | '
-                        + 'xargs -I@ git log --format=format:"%at @%n" -1 @ | '
-                        + 'sort -n | awk \'{print $2}\''],
+                         +
+                         'xargs -I@ git log --format=format:"%at @%n" -1 @ | '
+                         + 'sort -n | awk \'{print $2}\''],
                         cwd=self.local, shell=True, output=False)
         return p.output.splitlines()[-number:]
 
@@ -1005,6 +1006,7 @@ def parse_androidmanifests(paths, ignoreversions=None):
 
 
 class FDroidException(Exception):
+
     def __init__(self, value, detail=None):
         self.value = value
         self.detail = detail
@@ -1415,7 +1417,7 @@ def scan_source(build_dir, root_dir, thisbuild):
         re.compile(r'crashlytics', re.IGNORECASE),
         re.compile(r'ouya.*sdk', re.IGNORECASE),
         re.compile(r'libspen23', re.IGNORECASE),
-        ]
+    ]
 
     scanignore = getpaths(build_dir, thisbuild, 'scanignore')
     scandelete = getpaths(build_dir, thisbuild, 'scandelete')
@@ -1492,7 +1494,7 @@ def scan_source(build_dir, root_dir, thisbuild):
                     'application/java-archive',
                     'application/octet-stream',
                     'binary',
-                    ):
+            ):
 
                 if has_extension(fp, 'apk'):
                     removeproblem('APK file', fd, fp)
@@ -1610,6 +1612,7 @@ def isApkDebuggable(apkfile, config):
 
 
 class AsynchronousFileReader(threading.Thread):
+
     '''
     Helper class to implement asynchronous reading of a file
     in a separate thread. Pushes read lines on a queue to
@@ -1699,7 +1702,7 @@ def remove_signing_keys(build_dir):
         re.compile(r'.*variant\.outputFile = .*'),
         re.compile(r'.*output\.outputFile = .*'),
         re.compile(r'.*\.readLine\(.*'),
-        ]
+    ]
     for root, dirs, files in os.walk(build_dir):
         if 'build.gradle' in files:
             path = os.path.join(root, 'build.gradle')
@@ -1740,7 +1743,7 @@ def remove_signing_keys(build_dir):
                 'build.properties',
                 'default.properties',
                 'ant.properties',
-                ]:
+        ]:
             if propfile in files:
                 path = os.path.join(root, propfile)
 
index f6deefbb05f9df497264270b1b9569121928806f..8cf1bf61d903d340f44c8f121f7ae1f8dbbd71d5 100644 (file)
@@ -33,7 +33,7 @@ regex_warnings = {
          "github URLs should always use https:// not http://"),
         (re.compile(r'.*[^sS]://code\.google\.com/.*'),
          "code.google.com URLs should always use https:// not http://"),
-        ],
+    ],
     'Source Code': [
         (re.compile(r'.*[^sS]://github\.com/.*'),
          "github URLs should always use https:// (not http://, git://, or git@)"),
@@ -45,7 +45,7 @@ regex_warnings = {
          "dl.google.com URLs should always use https:// not http://"),
         (re.compile(r'.*[^sS]://gitorious\.org/.*'),
          "gitorious URLs should always use https:// (not http://, git://, or git@)"),
-        ],
+    ],
     'Repo': [
         (re.compile(r'.*[^sS]://code\.google\.com/.*'),
          "code.google.com URLs should always use https:// not http://"),
@@ -61,7 +61,7 @@ regex_warnings = {
          "Apache SVN URLs should always use https:// (not http:// or svn://)"),
         (re.compile(r'.*[^sS]://svn\.code\.sf\.net/.*'),
          "Sourceforge SVN URLs should always use https:// (not http:// or svn://)"),
-        ],
+    ],
     'Issue Tracker': [
         (re.compile(r'.*code\.google\.com/p/[^/]+[/]*$'),
          "/issues is missing"),
@@ -73,15 +73,15 @@ regex_warnings = {
          "github URLs should always use https:// not http://"),
         (re.compile(r'.*[^sS]://gitorious\.org/.*'),
          "gitorious URLs should always use https:// not http://"),
-        ],
+    ],
     'License': [
         (re.compile(r'^(|None|Unknown)$'),
          "No license specified"),
-        ],
+    ],
     'Summary': [
         (re.compile(r'^$'),
          "Summary yet to be filled"),
-        ],
+    ],
     'Description': [
         (re.compile(r'^No description available$'),
          "Description yet to be filled"),
@@ -91,7 +91,7 @@ regex_warnings = {
          "Unnecessary leading space"),
         (re.compile(r'.*\s$'),
          "Unnecessary trailing space"),
-        ],
+    ],
 }
 
 regex_pedantic = {
@@ -100,32 +100,32 @@ regex_pedantic = {
          "Appending .git is not necessary"),
         (re.compile(r'.*code\.google\.com/p/[^/]+/[^w]'),
          "Possible incorrect path appended to google code project site"),
-        ],
+    ],
     'Source Code': [
         (re.compile(r'.*github\.com/[^/]+/[^/]+\.git'),
          "Appending .git is not necessary"),
         (re.compile(r'.*code\.google\.com/p/[^/]+/source/.*'),
          "/source is often enough on its own"),
-        ],
+    ],
     'Repo': [
         (re.compile(r'^http://.*'),
          "use https:// if available"),
         (re.compile(r'^svn://.*'),
          "use https:// if available"),
-        ],
+    ],
     'Issue Tracker': [
         (re.compile(r'.*code\.google\.com/p/[^/]+/issues/.*'),
          "/issues is often enough on its own"),
         (re.compile(r'.*github\.com/[^/]+/[^/]+/issues/.*'),
          "/issues is often enough on its own"),
-        ],
+    ],
     'Summary': [
         (re.compile(r'.*\b(free software|open source)\b.*', re.IGNORECASE),
          "No need to specify that the app is Free Software"),
         (re.compile(r'.*[a-z0-9][.,!?][ $]'),
          "Punctuation should be avoided"),
-        ],
-    }
+    ],
+}
 
 
 def main():
index 979a01591cd6b37d7d480f31bd12cb24039d1a39..1ba5a713608f285310da8de62b7f9b5ef2256e80 100644 (file)
@@ -29,6 +29,7 @@ srclibs = None
 
 
 class MetaDataException(Exception):
+
     def __init__(self, value):
         self.value = value
 
@@ -69,7 +70,7 @@ app_defaults = OrderedDict([
     ('Current Version', ''),
     ('Current Version Code', '0'),
     ('No Source Since', ''),
-    ])
+])
 
 
 # In the order in which they are laid out on files
@@ -102,7 +103,7 @@ flag_defaults = OrderedDict([
     ('preassemble', []),
     ('antcommands', None),
     ('novcheck', False),
-    ])
+])
 
 
 # Designates a metadata field type and checks that it matches
@@ -222,7 +223,7 @@ valuetypes = {
                    r"^(Tags|Tags .+|RepoManifest|RepoManifest/.+|RepoTrunk|HTTP|Static|None)$", None,
                    ["Update Check Mode"],
                    [])
-    }
+}
 
 
 # Check an app's metadata information for integrity errors
index 05c44d3fdad62ebbb486c9e49cbfe4d029882e8f..ef80fe4d0e0811204101af0fb24c11a6019f3907 100644 (file)
@@ -149,7 +149,7 @@ def main():
                     'apps': Counter(),
                     'appsver': Counter(),
                     'unknown': []
-                    }
+                }
 
                 p = subprocess.Popen(["zcat", logfile], stdout=subprocess.PIPE)
                 matches = (logsearch(line) for line in p.stdout)
index c18c12d3cbfb93c3d4fc74054c6bbec2ca98b038..6dc317dcac9888680c7806fe34f86be4bfb3ce50 100755 (executable)
@@ -98,7 +98,7 @@ cachefiles = [
     ('Kivy-1.7.2.tar.gz',
      'https://pypi.python.org/packages/source/K/Kivy/Kivy-1.7.2.tar.gz',
      '0485e2ef97b5086df886eb01f8303cb542183d2d71a159466f99ad6c8a1d03f1'),
-    ]
+]
 
 if config['arch64']:
     cachefiles.extend([
index 669cfaee60174696d59d2485f29cb4ab9aa7810d..a4bff8c84298267e1589496c3706a639766ac8b8 100644 (file)
--- a/setup.py
+++ b/setup.py
@@ -19,7 +19,7 @@ setup(name='fdroidserver',
                   'examples/makebs.config.py',
                   'examples/opensc-fdroid.cfg',
                   'examples/fdroid-icon.png']),
-          ],
+      ],
       install_requires=[
           'mwclient',
           'paramiko',
@@ -28,12 +28,12 @@ setup(name='fdroidserver',
           'apache-libcloud >= 0.14.1',
           'pyasn1',
           'pyasn1-modules',
-          ],
+      ],
       classifiers=[
           'Development Status :: 3 - Alpha',
           'Intended Audience :: Developers',
           'License :: OSI Approved :: GNU General Public License v3 or later (GPLv3+)',
           'Operating System :: POSIX',
           'Topic :: Utilities',
-          ],
+      ],
       )