mirror of
https://github.com/f-droid/fdroidserver.git
synced 2025-09-16 16:02:33 +03:00
fix PEP8 "E711 comparison to None should be 'if cond is None:'"
This commit is contained in:
parent
d564c37c35
commit
fccb990521
2 changed files with 6 additions and 6 deletions
|
@ -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)
|
||||
|
|
|
@ -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') + '"' +
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue