From: Hans-Christoph Steiner Date: Fri, 2 May 2014 02:02:40 +0000 (-0400) Subject: fix PEP8 "E711 comparison to None should be 'if cond is None:'" X-Git-Tag: 0.2~89^2~16 X-Git-Url: http://www.chiark.greenend.org.uk/ucgi/~ianmdlvl/git?a=commitdiff_plain;h=fccb990521b7c67442bf253e5581a6517cabaa8e;p=fdroidserver.git fix PEP8 "E711 comparison to None should be 'if cond is None:'" --- diff --git a/fdroidserver/common.py b/fdroidserver/common.py index e30d188c..4803c4ff 100644 --- a/fdroidserver/common.py +++ b/fdroidserver/common.py @@ -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) diff --git a/fdroidserver/init.py b/fdroidserver/init.py index bf4a05fa..7c1dd243 100644 --- a/fdroidserver/init.py +++ b/fdroidserver/init.py @@ -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') + '"' +