1
0
mirror of https://gitlab.com/fdroid/fdroidserver.git synced 2024-11-19 21:30:10 +01:00

fix PEP8: W504 line break after binary operator

This commit is contained in:
Hans-Christoph Steiner 2018-05-29 12:31:56 +02:00
parent 8c4f75e05f
commit e6d5260c3c
10 changed files with 50 additions and 50 deletions

View File

@ -105,14 +105,14 @@ def build_server(app, build, vcs, build_dir, output_dir, log_dir, force):
logging.debug("rsyncing " + path + " to " + ftp.getcwd())
# TODO this should move to `vagrant rsync` from >= v1.5
try:
subprocess.check_output(['rsync', '--recursive', '--perms', '--links', '--quiet', '--rsh=' +
'ssh -o StrictHostKeyChecking=no' +
' -o UserKnownHostsFile=/dev/null' +
' -o LogLevel=FATAL' +
' -o IdentitiesOnly=yes' +
' -o PasswordAuthentication=no' +
' -p ' + str(sshinfo['port']) +
' -i ' + sshinfo['idfile'],
subprocess.check_output(['rsync', '--recursive', '--perms', '--links', '--quiet', '--rsh='
+ 'ssh -o StrictHostKeyChecking=no'
+ ' -o UserKnownHostsFile=/dev/null'
+ ' -o LogLevel=FATAL'
+ ' -o IdentitiesOnly=yes'
+ ' -o PasswordAuthentication=no'
+ ' -p ' + str(sshinfo['port'])
+ ' -i ' + sshinfo['idfile'],
path,
sshinfo['user'] + "@" + sshinfo['hostname'] + ":" + ftp.getcwd()],
stderr=subprocess.STDOUT)

View File

@ -352,8 +352,8 @@ def assert_config_keystore(config):
nosigningkey = True
logging.critical(_("'keypass' not found in config.py!"))
if nosigningkey:
raise FDroidException("This command requires a signing key, " +
"you can create one using: fdroid update --create-key")
raise FDroidException("This command requires a signing key, "
+ "you can create one using: fdroid update --create-key")
def find_sdk_tools_cmd(cmd):
@ -2148,8 +2148,8 @@ def FDroidPopenBytes(commands, cwd=None, envs=None, output=True, stderr_to_stdou
stdin=subprocess.DEVNULL, stdout=subprocess.PIPE,
stderr=stderr_param)
except OSError as e:
raise BuildException("OSError while trying to execute " +
' '.join(commands) + ': ' + str(e))
raise BuildException("OSError while trying to execute "
+ ' '.join(commands) + ': ' + str(e))
# TODO are these AsynchronousFileReader threads always exiting?
if not stderr_to_stdout and options.verbose:

View File

@ -179,8 +179,8 @@ class DockerDriver(object):
)['Id']
output = self.cli.exec_start(exec_id).decode('utf-8')
if ("Could not access the Package Manager" in output or
"device offline" in output):
if ("Could not access the Package Manager" in output
or "device offline" in output):
logging.info("Device or package manager isn't up")
if app_id.split('_')[0] in output: # TODO: this is a temporary fix

View File

@ -146,18 +146,18 @@ def get_metadata_from_url(app, url):
app.SourceCode = ""
app.WebSite = ""
if not projecttype:
raise FDroidException("Unable to determine the project type. " +
"The URL you supplied was not in one of the supported formats. " +
"Please consult the manual for a list of supported formats, " +
"and supply one of those.")
raise FDroidException("Unable to determine the project type. "
+ "The URL you supplied was not in one of the supported formats. "
+ "Please consult the manual for a list of supported formats, "
+ "and supply one of those.")
# Ensure we have a sensible-looking repo address at this point. If not, we
# might have got a page format we weren't expecting. (Note that we
# specifically don't want git@...)
if ((repotype != 'bzr' and (not repo.startswith('http://') and
not repo.startswith('https://') and
not repo.startswith('git://'))) or
' ' in repo):
if ((repotype != 'bzr' and (not repo.startswith('http://')
and not repo.startswith('https://')
and not repo.startswith('git://')))
or ' ' in repo):
raise FDroidException("Repo address '{0}' does not seem to be valid".format(repo))
# Get a copy of the source so we can extract some info...

View File

@ -209,8 +209,8 @@ def main():
opensc_so = files[0]
else:
opensc_so = '/usr/lib/opensc-pkcs11.so'
logging.warn('No OpenSC PKCS#11 module found, ' +
'install OpenSC then edit "opensc-fdroid.cfg"!')
logging.warn('No OpenSC PKCS#11 module found, '
+ 'install OpenSC then edit "opensc-fdroid.cfg"!')
with open(os.path.join(examplesdir, 'opensc-fdroid.cfg'), 'r') as f:
opensc_fdroid = f.read()
opensc_fdroid = re.sub('^library.*', 'library = ' + opensc_so, opensc_fdroid,

View File

@ -110,20 +110,20 @@ def update_awsbucket_s3cmd(repo_section):
s3url = s3bucketurl + '/fdroid/'
logging.debug('s3cmd sync new files in ' + repo_section + ' to ' + s3url)
logging.debug(_('Running first pass with MD5 checking disabled'))
if subprocess.call(s3cmd_sync +
['--no-check-md5', '--skip-existing',
'--exclude', indexxml,
'--exclude', indexjar,
'--exclude', indexv1jar,
repo_section, s3url]) != 0:
if subprocess.call(s3cmd_sync
+ ['--no-check-md5', '--skip-existing',
'--exclude', indexxml,
'--exclude', indexjar,
'--exclude', indexv1jar,
repo_section, s3url]) != 0:
raise FDroidException()
logging.debug('s3cmd sync all files in ' + repo_section + ' to ' + s3url)
if subprocess.call(s3cmd_sync +
['--no-check-md5',
'--exclude', indexxml,
'--exclude', indexjar,
'--exclude', indexv1jar,
repo_section, s3url]) != 0:
if subprocess.call(s3cmd_sync
+ ['--no-check-md5',
'--exclude', indexxml,
'--exclude', indexjar,
'--exclude', indexv1jar,
repo_section, s3url]) != 0:
raise FDroidException()
logging.debug(_('s3cmd sync indexes {path} to {url} and delete')
@ -256,10 +256,11 @@ def update_serverwebroot(serverwebroot, repo_section):
# the one rsync command that is allowed to run in ~/.ssh/authorized_keys.
# (serverwebroot is guaranteed to have a trailing slash in common.py)
logging.info('rsyncing ' + repo_section + ' to ' + serverwebroot)
if subprocess.call(rsyncargs +
['--exclude', indexxml, '--exclude', indexjar,
'--exclude', indexv1jar,
repo_section, serverwebroot]) != 0:
if subprocess.call(rsyncargs
+ ['--exclude', indexxml,
'--exclude', indexjar,
'--exclude', indexv1jar,
repo_section, serverwebroot]) != 0:
raise FDroidException()
if subprocess.call(rsyncargs + [repo_section, serverwebroot]) != 0:
raise FDroidException()

View File

@ -113,8 +113,8 @@ def main():
destpath = os.path.join(logsdir, f)
destsize = ftp.stat(f).st_size
if (not os.path.exists(destpath) or
os.path.getsize(destpath) != destsize):
if not os.path.exists(destpath) \
or os.path.getsize(destpath) != destsize:
logging.debug("...retrieving " + f)
ftp.get(f, destpath)
except Exception:

View File

@ -1853,8 +1853,8 @@ def main():
parser.add_argument("-I", "--icons", action="store_true", default=False,
help=_("Resize all the icons exceeding the max pixel size and exit"))
parser.add_argument("-e", "--editor", default="/etc/alternatives/editor",
help=_("Specify editor to use in interactive mode. Default " +
"is {path}").format(path='/etc/alternatives/editor'))
help=_("Specify editor to use in interactive mode. Default is {path}")
.format(path='/etc/alternatives/editor'))
parser.add_argument("-w", "--wiki", default=False, action="store_true",
help=_("Update the wiki"))
parser.add_argument("--pretty", action="store_true", default=False,

View File

@ -368,8 +368,8 @@ class LibvirtBuildVm(FDroidBuildVm):
def package(self, output=None, keep_box_file=False):
if not output:
output = "buildserver.box"
logger.debug('no output name set for packaging \'%s\',' +
'defaulting to %s', self.srvname, output)
logger.debug('no output name set for packaging \'%s\','
+ 'defaulting to %s', self.srvname, output)
storagePool = self.conn.storagePoolLookupByName('default')
domainInfo = self.conn.lookupByName(self.srvname).info()
if storagePool:
@ -434,8 +434,8 @@ class LibvirtBuildVm(FDroidBuildVm):
os.remove('box.img')
else:
logger.warn('could not connect to storage-pool \'default\',' +
'skipping packaging buildserver box')
logger.warn('could not connect to storage-pool \'default\','
+ 'skipping packaging buildserver box')
def box_add(self, boxname, boxfile, force=True):
boximg = '%s_vagrant_box_image_0.img' % (boxname)

View File

@ -602,8 +602,7 @@ def main():
sys.exit(1)
if not options.keep_box_file:
logger.debug('box added to vagrant, ' +
'removing generated box file \'%s\'',
logger.debug("""box added to vagrant, removing generated box file '%s'""",
boxfile)
os.remove(boxfile)