mirror of
https://gitlab.com/fdroid/fdroidserver.git
synced 2024-08-15 19:00:11 +02:00
Replace finds with pythonic terms
This commit is contained in:
parent
8f3a2d4355
commit
efc8317272
@ -1361,7 +1361,7 @@ def isApkDebuggable(apkfile, config):
|
||||
print "ERROR: Failed to get apk manifest information"
|
||||
sys.exit(1)
|
||||
for line in output.splitlines():
|
||||
if line.find('android:debuggable') != -1 and not line.endswith('0x0'):
|
||||
if 'android:debuggable' in line and not line.endswith('0x0'):
|
||||
return True
|
||||
return False
|
||||
|
||||
|
@ -341,11 +341,10 @@ def parse_srclib(metafile, **kw):
|
||||
if not line or line.startswith("#"):
|
||||
continue
|
||||
|
||||
index = line.find(':')
|
||||
if index == -1:
|
||||
try:
|
||||
field, value = line.split(':',1)
|
||||
except ValueError:
|
||||
raise MetaDataException("Invalid metadata in " + metafile.name + " at: " + line)
|
||||
field = line[:index]
|
||||
value = line[index+1:]
|
||||
|
||||
if field == "Subdir":
|
||||
thisinfo[field] = value.split(',')
|
||||
@ -543,11 +542,10 @@ def parse_metadata(metafile):
|
||||
if line.startswith("#"):
|
||||
curcomments.append(line)
|
||||
continue
|
||||
index = line.find(':')
|
||||
if index == -1:
|
||||
try:
|
||||
field, value = line.split(':',1)
|
||||
except ValueError:
|
||||
raise MetaDataException("Invalid metadata in " + metafile.name + " at: " + line)
|
||||
field = line[:index]
|
||||
value = line[index+1:]
|
||||
|
||||
# Translate obsolete fields...
|
||||
if field == 'Market Version':
|
||||
|
@ -101,7 +101,7 @@ def main():
|
||||
cwd=tmp_dir, stdout=subprocess.PIPE)
|
||||
out = p.communicate()[0]
|
||||
lines = out.splitlines()
|
||||
if len(lines) != 1 or lines[0].find('META-INF') == -1:
|
||||
if len(lines) != 1 or 'META-INF' not in lines[0]:
|
||||
raise Exception("Unexpected diff output - " + out)
|
||||
|
||||
print "...successfully verified"
|
||||
|
Loading…
Reference in New Issue
Block a user