From: Hans-Christoph Steiner Date: Tue, 28 Nov 2017 09:40:11 +0000 (+0100) Subject: common: document read_pkg_args() and read_app_args() X-Git-Tag: 1.0.0~60^2~3 X-Git-Url: http://www.chiark.greenend.org.uk/ucgi/~ianmdlvl/git?a=commitdiff_plain;h=e2bbeb50832b666439ba78ceca60cc661bd43e42;p=fdroidserver.git common: document read_pkg_args() and read_app_args() It took me a long time to figure out how `fdroid build --all` builds the whole list of apps... --- diff --git a/fdroidserver/common.py b/fdroidserver/common.py index 332aaae3..a23ae2e9 100644 --- a/fdroidserver/common.py +++ b/fdroidserver/common.py @@ -444,17 +444,16 @@ def get_local_metadata_files(): return glob.glob('.fdroid.[a-jl-z]*[a-rt-z]') -def read_pkg_args(args, allow_vercodes=False): +def read_pkg_args(appid_versionCode_pairs, allow_vercodes=False): """ - :param args: arguments in the form of multiple appid:[vc] strings + :param appids: arguments in the form of multiple appid:[vc] strings :returns: a dictionary with the set of vercodes specified for each package """ - vercodes = {} - if not args: + if not appid_versionCode_pairs: return vercodes - for p in args: + for p in appid_versionCode_pairs: if allow_vercodes and ':' in p: package, vercode = p.split(':') else: @@ -468,13 +467,17 @@ def read_pkg_args(args, allow_vercodes=False): return vercodes -def read_app_args(args, allapps, allow_vercodes=False): - """ - On top of what read_pkg_args does, this returns the whole app metadata, but - limiting the builds list to the builds matching the vercodes specified. +def read_app_args(appid_versionCode_pairs, allapps, allow_vercodes=False): + """Build a list of App instances for processing + + On top of what read_pkg_args does, this returns the whole app + metadata, but limiting the builds list to the builds matching the + appid_versionCode_pairs and vercodes specified. If no appid_versionCode_pairs are specified, then + all App and Build instances are returned. + """ - vercodes = read_pkg_args(args, allow_vercodes) + vercodes = read_pkg_args(appid_versionCode_pairs, allow_vercodes) if not vercodes: return allapps