mirror of
https://gitlab.com/fdroid/fdroidserver.git
synced 2024-08-16 03:10:09 +02:00
Fix pep8 whitespace errors
This commit is contained in:
parent
1e943a22df
commit
01b9fb1549
@ -70,9 +70,9 @@ def print_help(available_plugins=None):
|
||||
|
||||
def preparse_plugin(module_name, module_dir):
|
||||
"""No summary.
|
||||
|
||||
|
||||
Simple regex based parsing for plugin scripts.
|
||||
|
||||
|
||||
So we don't have to import them when we just need the summary,
|
||||
but not plan on executing this particular plugin.
|
||||
"""
|
||||
|
@ -371,7 +371,7 @@ def zip_data(apkfile, count=1024):
|
||||
"""
|
||||
Extract central directory, EOCD, and offsets from ZIP.
|
||||
|
||||
Returns
|
||||
Returns
|
||||
-------
|
||||
ZipData
|
||||
"""
|
||||
@ -411,7 +411,7 @@ def patch_v2_sig(extracted_v2_sig, output_apk):
|
||||
def patch_apk(extracted_meta, extracted_v2_sig, unsigned_apk, output_apk):
|
||||
"""Patch extracted_meta + extracted_v2_sig.
|
||||
|
||||
Patches extracted_meta + extracted_v2_sig (if not None)
|
||||
Patches extracted_meta + extracted_v2_sig (if not None)
|
||||
onto unsigned_apk and save as output_apk.
|
||||
"""
|
||||
date_time = copy_apk(unsigned_apk, output_apk)
|
||||
|
@ -836,7 +836,7 @@ def trybuild(app, build, build_dir, output_dir, log_dir, also_check_dir,
|
||||
Parameters
|
||||
----------
|
||||
output_dir
|
||||
The directory where the build output will go.
|
||||
The directory where the build output will go.
|
||||
Usually this is the 'unsigned' directory.
|
||||
repo_dir
|
||||
The repo directory - used for checking if the build is necessary.
|
||||
@ -895,7 +895,7 @@ def force_halt_build(timeout):
|
||||
|
||||
def parse_commandline():
|
||||
"""Parse the command line.
|
||||
|
||||
|
||||
Returns
|
||||
-------
|
||||
options
|
||||
|
@ -363,7 +363,7 @@ def check_gplay(app):
|
||||
|
||||
def try_init_submodules(app, last_build, vcs):
|
||||
"""Try to init submodules if the last build entry used them.
|
||||
|
||||
|
||||
They might have been removed from the app's repo in the meantime,
|
||||
so if we can't find any submodules we continue with the updates check.
|
||||
If there is any other error in initializing them then we stop the check.
|
||||
|
@ -972,7 +972,7 @@ class vcs:
|
||||
|
||||
def gotorevision(self, rev, refresh=True):
|
||||
"""Take the local repository to a clean version of the given revision.
|
||||
|
||||
|
||||
Take the local repository to a clean version of the given
|
||||
revision, which is specificed in the VCS's native
|
||||
format. Beforehand, the repository can be dirty, or even
|
||||
@ -1031,7 +1031,7 @@ class vcs:
|
||||
|
||||
def gotorevisionx(self, rev): # pylint: disable=unused-argument
|
||||
"""No summary.
|
||||
|
||||
|
||||
Derived classes need to implement this.
|
||||
|
||||
It's called once basic checking has been performed.
|
||||
@ -1109,7 +1109,7 @@ class vcs_git(vcs):
|
||||
|
||||
def checkrepo(self):
|
||||
"""No summary.
|
||||
|
||||
|
||||
If the local directory exists, but is somehow not a git repository,
|
||||
git will traverse up the directory tree until it finds one
|
||||
that is (i.e. fdroidserver) and then we'll proceed to destroy
|
||||
@ -1256,7 +1256,7 @@ class vcs_gitsvn(vcs):
|
||||
|
||||
def checkrepo(self):
|
||||
"""No summary.
|
||||
|
||||
|
||||
If the local directory exists, but is somehow not a git repository,
|
||||
git will traverse up the directory tree until it finds one that
|
||||
is (i.e. fdroidserver) and then we'll proceed to destory it!
|
||||
@ -2499,7 +2499,7 @@ class KnownApks:
|
||||
|
||||
def getapp(self, apkname):
|
||||
"""Look up information - given the 'apkname'.
|
||||
|
||||
|
||||
Returns (app id, date added/None).
|
||||
Or returns None for an unknown apk.
|
||||
"""
|
||||
@ -2587,7 +2587,7 @@ def is_apk_and_debuggable(apkfile):
|
||||
----------
|
||||
apkfile
|
||||
full path to the APK to check
|
||||
|
||||
|
||||
"""
|
||||
if get_file_extension(apkfile) != 'apk':
|
||||
return False
|
||||
@ -2708,7 +2708,7 @@ def get_apk_id_aapt(apkfile):
|
||||
|
||||
def get_native_code(apkfile):
|
||||
"""Aapt checks if there are architecture folders under the lib/ folder.
|
||||
|
||||
|
||||
We are simulating the same behaviour.
|
||||
"""
|
||||
arch_re = re.compile("^lib/(.*)/.*$")
|
||||
@ -2834,7 +2834,7 @@ def FDroidPopen(commands, cwd=None, envs=None, output=True, stderr_to_stdout=Tru
|
||||
optionally specifies a working directory
|
||||
envs
|
||||
a optional dictionary of environment variables and their values
|
||||
|
||||
|
||||
Returns
|
||||
-------
|
||||
A PopenResult.
|
||||
@ -3168,7 +3168,7 @@ def metadata_find_signing_files(appid, vercode):
|
||||
|
||||
Returns
|
||||
-------
|
||||
List
|
||||
List
|
||||
of 4-tuples for each signing key with following paths:
|
||||
(signature_file, signature_block_file, manifest, v2_files), where v2_files
|
||||
is either a (apk_signing_block_offset_file, apk_signing_block_file) pair or None
|
||||
@ -3207,7 +3207,7 @@ def metadata_find_developer_signing_files(appid, vercode):
|
||||
|
||||
Returns
|
||||
-------
|
||||
List
|
||||
List
|
||||
of 4-tuples for each signing key with following paths:
|
||||
(signature_file, signature_block_file, manifest, v2_files), where v2_files
|
||||
is either a (apk_signing_block_offset_file, apk_signing_block_file) pair or None
|
||||
@ -3337,7 +3337,7 @@ def apk_extract_signatures(apkpath, outdir):
|
||||
|
||||
def get_min_sdk_version(apk):
|
||||
"""Wrap the androguard function to always return and int.
|
||||
|
||||
|
||||
Fall back to 1 if we can't get a valid minsdk version.
|
||||
|
||||
Parameters
|
||||
@ -3490,7 +3490,7 @@ def verify_apk_signature(apk, min_sdk_version=None):
|
||||
|
||||
Returns
|
||||
-------
|
||||
Boolean
|
||||
Boolean
|
||||
whether the APK was verified
|
||||
"""
|
||||
if set_command_in_config('apksigner'):
|
||||
@ -3534,7 +3534,7 @@ def verify_old_apk_signature(apk):
|
||||
|
||||
Returns
|
||||
-------
|
||||
Boolean
|
||||
Boolean
|
||||
whether the APK was verified
|
||||
|
||||
"""
|
||||
@ -3635,7 +3635,7 @@ def compare_apks(apk1, apk2, tmp_dir, log_dir=None):
|
||||
|
||||
def set_command_in_config(command):
|
||||
"""Try to find specified command in the path, if it hasn't been manually set in config.yml.
|
||||
|
||||
|
||||
If found, it is added to the config
|
||||
dict. The return value says whether the command is available.
|
||||
|
||||
@ -3782,7 +3782,7 @@ def load_stats_fdroid_signing_key_fingerprints():
|
||||
|
||||
Returns
|
||||
-------
|
||||
dict
|
||||
dict
|
||||
containing the signing-key fingerprints.
|
||||
"""
|
||||
jar_file = os.path.join('stats', 'publishsigkeys.jar')
|
||||
@ -3819,7 +3819,7 @@ def write_to_config(thisconfig, key, value=None, config_file=None):
|
||||
config dictionary
|
||||
key
|
||||
variable name in config to be overwritten/added
|
||||
value
|
||||
value
|
||||
optional value to be written, instead of fetched
|
||||
from 'thisconfig' dictionary.
|
||||
"""
|
||||
|
@ -48,7 +48,7 @@ REMOTE_HOSTNAME_REGEX = re.compile(r'\W*\w+\W+(\w+).*')
|
||||
|
||||
def update_awsbucket(repo_section):
|
||||
"""Upload the contents of the directory `repo_section` (including subdirectories) to the AWS S3 "bucket".
|
||||
|
||||
|
||||
The contents of that subdir of the
|
||||
bucket will first be deleted.
|
||||
|
||||
@ -141,10 +141,10 @@ def update_awsbucket_s3cmd(repo_section):
|
||||
|
||||
def update_awsbucket_libcloud(repo_section):
|
||||
"""No summary.
|
||||
|
||||
|
||||
Upload the contents of the directory `repo_section` (including
|
||||
subdirectories) to the AWS S3 "bucket".
|
||||
|
||||
subdirectories) to the AWS S3 "bucket".
|
||||
|
||||
The contents of that subdir of the
|
||||
bucket will first be deleted.
|
||||
|
||||
|
@ -590,7 +590,7 @@ def _copy_to_local_copy_dir(repodir, f):
|
||||
|
||||
def v1_sort_packages(packages, fdroid_signing_key_fingerprints):
|
||||
"""Sort the supplied list to ensure a deterministic sort order for package entries in the index file.
|
||||
|
||||
|
||||
This sort-order also expresses
|
||||
installation preference to the clients.
|
||||
(First in this list = first to install)
|
||||
@ -1124,7 +1124,7 @@ def get_public_key_from_jar(jar):
|
||||
----------
|
||||
jar
|
||||
a zipfile.ZipFile object
|
||||
|
||||
|
||||
Returns
|
||||
-------
|
||||
the public key from the jar and its fingerprint
|
||||
|
@ -56,7 +56,7 @@ def publish_source_tarball(apkfilename, unsigned_dir, output_dir):
|
||||
|
||||
def key_alias(appid):
|
||||
"""No summary.
|
||||
|
||||
|
||||
Get the alias which F-Droid uses to indentify the singing key
|
||||
for this App in F-Droids keystore.
|
||||
"""
|
||||
@ -101,7 +101,7 @@ def read_fingerprints_from_keystore():
|
||||
|
||||
def sign_sig_key_fingerprint_list(jar_file):
|
||||
"""Sign the list of app-signing key fingerprints.
|
||||
|
||||
|
||||
This is used primaryily by fdroid update to determine which APKs
|
||||
where built and signed by F-Droid and which ones were
|
||||
manually added by users.
|
||||
@ -125,7 +125,7 @@ def sign_sig_key_fingerprint_list(jar_file):
|
||||
|
||||
def store_stats_fdroid_signing_key_fingerprints(appids, indent=None):
|
||||
"""Store list of all signing-key fingerprints for given appids to HD.
|
||||
|
||||
|
||||
This list will later on be needed by fdroid update.
|
||||
"""
|
||||
if not os.path.exists('stats'):
|
||||
@ -172,9 +172,9 @@ def check_for_key_collisions(allapps):
|
||||
|
||||
Parameters
|
||||
----------
|
||||
allapps
|
||||
allapps
|
||||
a dict of all apps to process
|
||||
|
||||
|
||||
Returns
|
||||
-------
|
||||
a list of all aliases corresponding to allapps
|
||||
|
@ -130,7 +130,7 @@ def scan_binary(apkfile):
|
||||
|
||||
def scan_source(build_dir, build=metadata.Build()):
|
||||
"""Scan the source code in the given directory (and all subdirectories).
|
||||
|
||||
|
||||
Returns
|
||||
-------
|
||||
the number of fatal problems encountered.
|
||||
@ -198,7 +198,7 @@ def scan_source(build_dir, build=metadata.Build()):
|
||||
|
||||
Parameters
|
||||
----------
|
||||
what: string
|
||||
what: string
|
||||
describing the problem, will be printed in log messages
|
||||
path_in_build_dir
|
||||
path to the file relative to `build`-dir
|
||||
@ -218,13 +218,13 @@ def scan_source(build_dir, build=metadata.Build()):
|
||||
|
||||
Parameters
|
||||
----------
|
||||
what: string
|
||||
what: string
|
||||
describing the problem, will be printed in log messages
|
||||
path_in_build_dir
|
||||
path to the file relative to `build`-dir
|
||||
filepath
|
||||
Path (relative to our current path) to the file
|
||||
|
||||
|
||||
Returns
|
||||
-------
|
||||
0 as we deleted the offending file
|
||||
@ -247,7 +247,7 @@ def scan_source(build_dir, build=metadata.Build()):
|
||||
|
||||
Parameters
|
||||
----------
|
||||
what: string
|
||||
what: string
|
||||
describing the problem, will be printed in log messages
|
||||
path_in_build_dir
|
||||
path to the file relative to `build`-dir
|
||||
@ -265,18 +265,18 @@ def scan_source(build_dir, build=metadata.Build()):
|
||||
|
||||
def handleproblem(what, path_in_build_dir, filepath):
|
||||
"""Dispatches to problem handlers (ignore, delete, warn).
|
||||
|
||||
|
||||
Or returns 1 for increasing the error count.
|
||||
|
||||
Parameters
|
||||
----------
|
||||
what: string
|
||||
what: string
|
||||
describing the problem, will be printed in log messages
|
||||
path_in_build_dir
|
||||
path to the file relative to `build`-dir
|
||||
filepath
|
||||
Path (relative to our current path) to the file
|
||||
|
||||
|
||||
Returns
|
||||
-------
|
||||
0 if the problem was ignored/deleted/is only a warning, 1 otherwise
|
||||
|
@ -7,14 +7,14 @@ python-tail can be used to monitor changes to a file.
|
||||
Example
|
||||
-------
|
||||
>>> import tail
|
||||
>>>
|
||||
>>>
|
||||
>>> # Create a tail instance
|
||||
>>> t = tail.Tail('file-to-be-followed')
|
||||
>>>
|
||||
>>>
|
||||
>>> # Register a callback function to be called when a new line is found in the followed file.
|
||||
>>> # If no callback function is registerd, new lines would be printed to standard out.
|
||||
>>> t.register_callback(callback_function)
|
||||
>>>
|
||||
>>>
|
||||
>>> # Follow the file with 5 seconds as sleep time between iterations.
|
||||
>>> # If sleep time is not provided 1 second is used as the default time.
|
||||
>>> t.follow(s=5)
|
||||
@ -67,7 +67,7 @@ class Tail(object):
|
||||
|
||||
def follow(self, s=1):
|
||||
"""Do a tail follow.
|
||||
|
||||
|
||||
If a callback function is registered it is called with every new line.
|
||||
Else printed to standard out.
|
||||
|
||||
|
@ -671,7 +671,7 @@ def has_known_vulnerability(filename):
|
||||
|
||||
def insert_obbs(repodir, apps, apks):
|
||||
"""Scan the .obb files in a given repo directory and adds them to the relevant APK instances.
|
||||
|
||||
|
||||
OBB files have versionCodes like APK
|
||||
files, and they are loosely associated. If there is an OBB file
|
||||
present, then any APK with the same or higher versionCode will use
|
||||
@ -1950,7 +1950,7 @@ def fill_missing_icon_densities(empty_densities, icon_filename, apk, repo_dir):
|
||||
|
||||
def apply_info_from_latest_apk(apps, apks):
|
||||
"""No summary.
|
||||
|
||||
|
||||
Some information from the apks needs to be applied up to the application level.
|
||||
|
||||
When doing this, we use the info from the most recent version's apk.
|
||||
@ -2236,7 +2236,7 @@ def prepare_apps(apps, apks, repodir):
|
||||
list of apks that belong into repo, this gets modified in place
|
||||
repodir
|
||||
the target repository directory, metadata files will be copied here
|
||||
|
||||
|
||||
Returns
|
||||
-------
|
||||
the relevant subset of apps (as a deepcopy)
|
||||
|
@ -80,7 +80,7 @@ def _check_output(cmd, cwd=None):
|
||||
|
||||
def get_build_vm(srvdir, provider=None):
|
||||
"""No summary.
|
||||
|
||||
|
||||
Factory function for getting FDroidBuildVm instances.
|
||||
|
||||
This function tries to figure out what hypervisor should be used
|
||||
|
Loading…
Reference in New Issue
Block a user