if not ndk_path:
logging.critical("Android NDK version '%s' could not be found!" % build.ndk or 'r10e')
logging.critical("Configured versions:")
- for k, v in config['ndk_paths'].iteritems():
+ for k, v in config['ndk_paths'].items():
if k.endswith("_orig"):
continue
logging.critical(" %s: %s" % (k, v))
# Build applications...
failed_apps = {}
build_succeeded = []
- for appid, app in apps.iteritems():
+ for appid, app in apps.items():
first = True
.format(common.getappname(app), version))
return
- for appid, app in apps.iteritems():
+ for appid, app in apps.items():
if options.autoonly and app.AutoUpdateMode in ('None', 'Static'):
logging.debug("Nothing to do for {0}...".format(appid))
return allapps
apps = {}
- for appid, app in allapps.iteritems():
+ for appid, app in allapps.items():
if appid in vercodes:
apps[appid] = app
raise FDroidException("No packages specified")
error = False
- for appid, app in apps.iteritems():
+ for appid, app in apps.items():
vc = vercodes[appid]
if not vc:
continue
def getpaths(build_dir, globpaths):
paths_map = getpaths_map(build_dir, globpaths)
paths = set()
- for k, v in paths_map.iteritems():
+ for k, v in paths_map.items():
for p in v:
paths.add(p)
return paths
os.mkdir('stats')
lst = []
- for apk, app in self.apks.iteritems():
+ for apk, app in self.apks.items():
appid, added = app
line = apk + ' ' + appid
if added:
# with the most recent first.
def getlatest(self, num):
apps = {}
- for apk, app in self.apks.iteritems():
+ for apk, app in self.apks.items():
appid, added = app
if added:
if appid in apps:
apps[appid] = added
else:
apps[appid] = added
- sortedapps = sorted(apps.iteritems(), key=operator.itemgetter(1))[-num:]
+ sortedapps = sorted(apps.items(), key=operator.itemgetter(1))[-num:]
lst = [app for app, _ in sortedapps]
lst.reverse()
return lst
continue
apks[appid] = apkfile
- for appid, apk in apks.iteritems():
+ for appid, apk in apks.items():
if not apk:
raise FDroidException("No signed apk available for %s" % appid)
apks = {common.apknameinfo(apkfile)[0]: apkfile for apkfile in
sorted(glob.glob(os.path.join(output_dir, '*.apk')))}
- for appid, apk in apks.iteritems():
+ for appid, apk in apks.items():
# Get device list each time to avoid device not found errors
devs = devices()
if not devs:
def check_regexes(app):
- for f, checks in regex_checks.iteritems():
+ for f, checks in regex_checks.items():
for m, r in checks:
v = app.get_field(f)
t = metadata.fieldtype(f)
allapps = metadata.read_metadata(xref=True)
apps = common.read_app_args(options.appid, allapps, False)
- for appid, app in apps.iteritems():
+ for appid, app in apps.items():
if app.Disabled:
continue
# names. Should only be used for tests.
def field_dict(self):
d = {}
- for k, v in self.__dict__.iteritems():
+ for k, v in self.__dict__.items():
if k == 'builds':
d['builds'] = []
for build in v:
- b = {k: v for k, v in build.__dict__.iteritems() if not k.startswith('_')}
+ b = {k: v for k, v in build.__dict__.items() if not k.startswith('_')}
d['builds'].append(b)
elif not k.startswith('_'):
f = App.attr_to_field(k)
# Like dict.update(), but using human-readable field names
def update_fields(self, d):
- for f, v in d.iteritems():
+ for f, v in d.items():
if f == 'builds':
for b in v:
build = Build()
return paths[version]
def update_flags(self, d):
- for f, v in d.iteritems():
+ for f, v in d.items():
self.set_flag(f, v)
flagtypes = {
return ("fdroid.app:" + appid, "Dummy name - don't know yet")
raise MetaDataException("Cannot resolve app id " + appid)
- for appid, app in apps.iteritems():
+ for appid, app in apps.items():
try:
description_html(app.Description, linkres)
except MetaDataException as e:
# This function uses __dict__ to be faster
def post_metadata_parse(app):
- for k, v in app.__dict__.iteritems():
+ for k, v in app.__dict__.items():
if k not in app._modified:
continue
if type(v) in (float, int):
app.__dict__[k] = str(v)
for build in app.builds:
- for k, v in build.__dict__.iteritems():
+ for k, v in build.__dict__.items():
if k not in build._modified:
continue
def _decode_dict(data):
'''convert items in a dict from unicode to basestring'''
rv = {}
- for k, v in data.iteritems():
+ for k, v in data.items():
if isinstance(k, unicode):
k = k.encode('utf-8')
if isinstance(v, unicode):
if options.to is not None and options.to not in supported:
parser.error("Must give a valid format to --to")
- for appid, app in apps.iteritems():
+ for appid, app in apps.items():
base, ext = common.get_extension(app.metadatapath)
if not options.to and ext not in supported:
logging.info("Ignoring %s file at '%s'" % (ext, app.metadatapath))
}
def suspects_found(s):
- for n, r in usual_suspects.iteritems():
+ for n, r in usual_suspects.items():
if r.match(s):
yield n
scandelete_worked = set()
def toignore(fd):
- for k, paths in scanignore.iteritems():
+ for k, paths in scanignore.items():
for p in paths:
if fd.startswith(p):
scanignore_worked.add(k)
return False
def todelete(fd):
- for k, paths in scandelete.iteritems():
+ for k, paths in scandelete.items():
for p in paths:
if fd.startswith(p):
scandelete_worked.add(k)
srclib_dir = os.path.join(build_dir, 'srclib')
extlib_dir = os.path.join(build_dir, 'extlib')
- for appid, app in apps.iteritems():
+ for appid, app in apps.items():
if app.Disabled:
logging.info("Skipping %s: disabled" % appid)
:param apkcache: current apk cache information
:param repodirs: the repo directories to process
"""
- for appid, app in apps.iteritems():
+ for appid, app in apps.items():
for build in app.builds:
if not build.disable:
continue
def archive_old_apks(apps, apks, archapks, repodir, archivedir, defaultkeepversions):
- for appid, app in apps.iteritems():
+ for appid, app in apps.items():
if app.ArchivePolicy:
keepversions = int(app.ArchivePolicy[:-9])
# level. When doing this, we use the info from the most recent version's apk.
# We deal with figuring out when the app was added and last updated at the
# same time.
- for appid, app in apps.iteritems():
+ for appid, app in apps.items():
bestver = 0
for apk in apks + archapks:
if apk['id'] == appid:
# per-app subscription feeds for nightly builds and things like it
if config['per_app_repos']:
add_apks_to_per_app_repos(repodirs[0], apks)
- for appid, app in apps.iteritems():
+ for appid, app in apps.items():
repodir = os.path.join(appid, 'fdroid', 'repo')
appdict = dict()
appdict[appid] = app