mirror of
https://gitlab.com/fdroid/fdroidserver.git
synced 2024-08-17 11:50:11 +02:00
A few more PEP8 fixes
This commit is contained in:
parent
7a699e4a48
commit
17a4f5c00f
@ -67,7 +67,7 @@ def update_awsbucket(repo_section):
|
|||||||
upload = False
|
upload = False
|
||||||
file_to_upload = os.path.join(root, name)
|
file_to_upload = os.path.join(root, name)
|
||||||
object_name = 'fdroid/' + os.path.relpath(file_to_upload, os.getcwd())
|
object_name = 'fdroid/' + os.path.relpath(file_to_upload, os.getcwd())
|
||||||
if not object_name in objs:
|
if object_name not in objs:
|
||||||
upload = True
|
upload = True
|
||||||
else:
|
else:
|
||||||
obj = objs.pop(object_name)
|
obj = objs.pop(object_name)
|
||||||
|
@ -251,7 +251,7 @@ def update_wiki(apps, apks):
|
|||||||
page.delete('No longer published')
|
page.delete('No longer published')
|
||||||
for pagename, text in genp.items():
|
for pagename, text in genp.items():
|
||||||
logging.debug("Checking " + pagename)
|
logging.debug("Checking " + pagename)
|
||||||
if not pagename in existingpages:
|
if pagename not in existingpages:
|
||||||
logging.debug("Creating page " + pagename)
|
logging.debug("Creating page " + pagename)
|
||||||
try:
|
try:
|
||||||
newpage = site.Pages[pagename]
|
newpage = site.Pages[pagename]
|
||||||
@ -427,15 +427,15 @@ def scan_apks(apps, apkcache, repodir, knownapks):
|
|||||||
thisinfo['permissions'].append(perm)
|
thisinfo['permissions'].append(perm)
|
||||||
elif line.startswith("uses-feature:"):
|
elif line.startswith("uses-feature:"):
|
||||||
perm = re.match(string_pat, line).group(1)
|
perm = re.match(string_pat, line).group(1)
|
||||||
#Filter out this, it's only added with the latest SDK tools and
|
# Filter out this, it's only added with the latest SDK tools and
|
||||||
#causes problems for lots of apps.
|
# causes problems for lots of apps.
|
||||||
if perm != "android.hardware.screen.portrait" \
|
if perm != "android.hardware.screen.portrait" \
|
||||||
and perm != "android.hardware.screen.landscape":
|
and perm != "android.hardware.screen.landscape":
|
||||||
if perm.startswith("android.feature."):
|
if perm.startswith("android.feature."):
|
||||||
perm = perm[16:]
|
perm = perm[16:]
|
||||||
thisinfo['features'].append(perm)
|
thisinfo['features'].append(perm)
|
||||||
|
|
||||||
if not 'sdkversion' in thisinfo:
|
if 'sdkversion' not in thisinfo:
|
||||||
logging.warn("no SDK version information found")
|
logging.warn("no SDK version information found")
|
||||||
thisinfo['sdkversion'] = 0
|
thisinfo['sdkversion'] = 0
|
||||||
|
|
||||||
@ -768,7 +768,7 @@ def make_index(apps, apks, repodir, archive, categories):
|
|||||||
if 'srcname' in apk:
|
if 'srcname' in apk:
|
||||||
addElement('srcname', apk['srcname'], doc, apkel)
|
addElement('srcname', apk['srcname'], doc, apkel)
|
||||||
for hash_type in ['sha256']:
|
for hash_type in ['sha256']:
|
||||||
if not hash_type in apk:
|
if hash_type not in apk:
|
||||||
continue
|
continue
|
||||||
hashel = doc.createElement("hash")
|
hashel = doc.createElement("hash")
|
||||||
hashel.setAttribute("type", hash_type)
|
hashel.setAttribute("type", hash_type)
|
||||||
@ -805,7 +805,7 @@ def make_index(apps, apks, repodir, archive, categories):
|
|||||||
logging.info("Creating signed index with this key:")
|
logging.info("Creating signed index with this key:")
|
||||||
logging.info("SHA256: %s" % repo_pubkey_fingerprint)
|
logging.info("SHA256: %s" % repo_pubkey_fingerprint)
|
||||||
|
|
||||||
#Create a jar of the index...
|
# Create a jar of the index...
|
||||||
p = FDroidPopen(['jar', 'cf', 'index.jar', 'index.xml'], cwd=repodir)
|
p = FDroidPopen(['jar', 'cf', 'index.jar', 'index.xml'], cwd=repodir)
|
||||||
if p.returncode != 0:
|
if p.returncode != 0:
|
||||||
logging.critical("Failed to create jar file")
|
logging.critical("Failed to create jar file")
|
||||||
|
@ -7,6 +7,7 @@ import time
|
|||||||
import hashlib
|
import hashlib
|
||||||
from optparse import OptionParser
|
from optparse import OptionParser
|
||||||
|
|
||||||
|
|
||||||
def vagrant(params, cwd=None, printout=False):
|
def vagrant(params, cwd=None, printout=False):
|
||||||
"""Run vagrant.
|
"""Run vagrant.
|
||||||
|
|
||||||
@ -18,7 +19,7 @@ def vagrant(params, cwd=None, printout=False):
|
|||||||
is the stdout (and stderr) from vagrant
|
is the stdout (and stderr) from vagrant
|
||||||
"""
|
"""
|
||||||
p = subprocess.Popen(['vagrant'] + params, cwd=cwd,
|
p = subprocess.Popen(['vagrant'] + params, cwd=cwd,
|
||||||
stdout=subprocess.PIPE, stderr=subprocess.STDOUT)
|
stdout=subprocess.PIPE, stderr=subprocess.STDOUT)
|
||||||
out = ''
|
out = ''
|
||||||
if printout:
|
if printout:
|
||||||
while True:
|
while True:
|
||||||
@ -37,9 +38,9 @@ serverdir = 'buildserver'
|
|||||||
|
|
||||||
parser = OptionParser()
|
parser = OptionParser()
|
||||||
parser.add_option("-v", "--verbose", action="store_true", default=False,
|
parser.add_option("-v", "--verbose", action="store_true", default=False,
|
||||||
help="Spew out even more information than normal")
|
help="Spew out even more information than normal")
|
||||||
parser.add_option("-c", "--clean", action="store_true", default=False,
|
parser.add_option("-c", "--clean", action="store_true", default=False,
|
||||||
help="Build from scratch, rather than attempting to update the existing server")
|
help="Build from scratch, rather than attempting to update the existing server")
|
||||||
options, args = parser.parse_args()
|
options, args = parser.parse_args()
|
||||||
|
|
||||||
config = {}
|
config = {}
|
||||||
@ -106,6 +107,7 @@ else:
|
|||||||
'606aadf815ae28cc7b0154996247c70d609f111b14e44bcbcd6cad4c87fefb6f')])
|
'606aadf815ae28cc7b0154996247c70d609f111b14e44bcbcd6cad4c87fefb6f')])
|
||||||
wanted = []
|
wanted = []
|
||||||
|
|
||||||
|
|
||||||
def sha256_for_file(path):
|
def sha256_for_file(path):
|
||||||
with open(path, 'r') as f:
|
with open(path, 'r') as f:
|
||||||
s = hashlib.sha256()
|
s = hashlib.sha256()
|
||||||
@ -234,4 +236,3 @@ vagrant(['box', 'add', 'buildserver', boxfile, '-f'],
|
|||||||
printout=options.verbose)
|
printout=options.verbose)
|
||||||
|
|
||||||
os.remove(boxfile)
|
os.remove(boxfile)
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user