1
0
mirror of https://gitlab.com/fdroid/fdroidserver.git synced 2024-09-11 23:23:27 +02:00

Rename metafieldtype to fieldtype

For consistency with flagtype. Also less redundant.
This commit is contained in:
Daniel Martí 2015-12-03 13:53:49 +01:00
parent 2c095df947
commit 28566f6e57
2 changed files with 5 additions and 5 deletions

View File

@ -107,7 +107,7 @@ def check_regexes(app):
for f, checks in regex_checks.iteritems(): for f, checks in regex_checks.iteritems():
for m, r in checks: for m, r in checks:
v = app.get_field(f) v = app.get_field(f)
t = metadata.metafieldtype(f) t = metadata.fieldtype(f)
if t == metadata.TYPE_MULTILINE: if t == metadata.TYPE_MULTILINE:
for l in v.splitlines(): for l in v.splitlines():
if m.match(l): if m.match(l):

View File

@ -223,7 +223,7 @@ fieldtypes = {
} }
def metafieldtype(name): def fieldtype(name):
if name in fieldtypes: if name in fieldtypes:
return fieldtypes[name] return fieldtypes[name]
return TYPE_STRING return TYPE_STRING
@ -1115,7 +1115,7 @@ def parse_txt_metadata(metadatapath):
if f == 'Market Version Code': if f == 'Market Version Code':
f = 'Current Version Code' f = 'Current Version Code'
ftype = metafieldtype(f) ftype = fieldtype(f)
if ftype not in [TYPE_BUILD, TYPE_BUILD_V2]: if ftype not in [TYPE_BUILD, TYPE_BUILD_V2]:
add_comments(f) add_comments(f)
if ftype == TYPE_MULTILINE: if ftype == TYPE_MULTILINE:
@ -1273,7 +1273,7 @@ def write_txt_metadata(mf, app):
mf.write("# %s\n" % line) mf.write("# %s\n" % line)
def w_field(f, v): def w_field(f, v):
t = metafieldtype(f) t = fieldtype(f)
if t == TYPE_LIST: if t == TYPE_LIST:
v = ','.join(v) v = ','.join(v)
elif t == TYPE_MULTILINE: elif t == TYPE_MULTILINE:
@ -1319,7 +1319,7 @@ def write_yaml_metadata(mf, app):
def w_field(f, v, prefix='', t=None): def w_field(f, v, prefix='', t=None):
if t is None: if t is None:
t = metafieldtype(f) t = fieldtype(f)
v = '' v = ''
if t == TYPE_LIST: if t == TYPE_LIST:
v = '\n' v = '\n'