chiark / gitweb /
fix PEP8 "E711 comparison to None should be 'if cond is None:'"
authorHans-Christoph Steiner <hans@eds.org>
Fri, 2 May 2014 02:02:40 +0000 (22:02 -0400)
committerHans-Christoph Steiner <hans@eds.org>
Tue, 6 May 2014 15:45:02 +0000 (11:45 -0400)
fdroidserver/common.py
fdroidserver/init.py

index e30d188c5b615e4bfa2d4dcd8e61c0f60fc92af7..4803c4ffda2239cc4b72d9d151bc0cc1663e08fa 100644 (file)
@@ -121,7 +121,7 @@ def read_config(opts, config_file='config.py'):
     return config
 
 def test_sdk_exists(c):
-    if c['sdk_path'] == None:
+    if c['sdk_path'] is None:
         # c['sdk_path'] is set to the value of ANDROID_HOME by default
         logging.critical('No Android SDK found! ANDROID_HOME is not set and sdk_path is not in config.py!')
         logging.info('You can use ANDROID_HOME to set the path to your SDK, i.e.:')
@@ -145,7 +145,7 @@ def write_password_file(pwtype, password=None):
     '''
     filename = '.fdroid.' + pwtype + '.txt'
     fd = os.open(filename, os.O_CREAT | os.O_TRUNC | os.O_WRONLY, 0600)
-    if password == None:
+    if password is None:
         os.write(fd, config[pwtype])
     else:
         os.write(fd, password)
index bf4a05faf245a7c1e2e0e9274a8771be26b02c88..7c1dd2437b535522ca7cd44849fc0e82e939695a 100644 (file)
@@ -124,14 +124,14 @@ def main():
 
     # track down where the Android SDK is, the default is to use the path set
     # in ANDROID_HOME if that exists, otherwise None
-    if options.android_home != None:
+    if options.android_home is not None:
         test_config['sdk_path'] = options.android_home
     elif not common.test_sdk_exists(test_config):
         # if neither --android-home nor the default sdk_path exist, prompt the user
         default_sdk_path = '/opt/android-sdk'
         while not options.no_prompt:
             s = raw_input('Enter the path to the Android SDK (' + default_sdk_path + ') here:\n> ')
-            if re.match('^\s*$', s) != None:
+            if re.match('^\s*$', s) is not None:
                 test_config['sdk_path'] = default_sdk_path
             else:
                 test_config['sdk_path'] = s
@@ -246,7 +246,7 @@ def main():
         password = genpassword()
         write_to_config('keystorepass', password)
         write_to_config('keypass', password)
-        if options.repo_keyalias == None:
+        if options.repo_keyalias is None:
             repo_keyalias = socket.getfqdn()
             write_to_config('repo_keyalias', repo_keyalias)
         if not options.distinguished_name:
@@ -260,7 +260,7 @@ def main():
     logging.info('  Android SDK Build Tools:\t' + os.path.dirname(aapt))
     logging.info('  Android NDK (optional):\t' + ndk_path)
     logging.info('  Keystore for signing key:\t' + keystore)
-    if repo_keyalias != None:
+    if repo_keyalias is not None:
         logging.info('  Alias for key in store:\t' + repo_keyalias)
     logging.info('\nTo complete the setup, add your APKs to "' +
           os.path.join(fdroiddir, 'repo') + '"' +