mirror of
https://gitlab.com/fdroid/fdroidserver.git
synced 2024-11-14 02:50:12 +01:00
Fix imports in Python 3
Since common and metadata import each other, we must import via "fdroidserver.*".
This commit is contained in:
parent
99edd64372
commit
e3591cb7b8
@ -43,7 +43,7 @@ except ImportError:
|
||||
|
||||
from zipfile import ZipFile
|
||||
|
||||
import metadata
|
||||
import fdroidserver.metadata
|
||||
from fdroidserver.asynchronousfilereader import AsynchronousFileReader
|
||||
|
||||
|
||||
@ -486,9 +486,9 @@ def getvcs(vcstype, remote, local):
|
||||
|
||||
|
||||
def getsrclibvcs(name):
|
||||
if name not in metadata.srclibs:
|
||||
if name not in fdroidserver.metadata.srclibs:
|
||||
raise VCSException("Missing srclib " + name)
|
||||
return metadata.srclibs[name]['Repo Type']
|
||||
return fdroidserver.metadata.srclibs[name]['Repo Type']
|
||||
|
||||
|
||||
class vcs:
|
||||
@ -1215,10 +1215,10 @@ def getsrclib(spec, srclib_dir, subdir=None, basepath=False,
|
||||
if '/' in name:
|
||||
name, subdir = name.split('/', 1)
|
||||
|
||||
if name not in metadata.srclibs:
|
||||
if name not in fdroidserver.metadata.srclibs:
|
||||
raise VCSException('srclib ' + name + ' not found.')
|
||||
|
||||
srclib = metadata.srclibs[name]
|
||||
srclib = fdroidserver.metadata.srclibs[name]
|
||||
|
||||
sdir = os.path.join(srclib_dir, name)
|
||||
|
||||
|
@ -41,7 +41,7 @@ except ImportError:
|
||||
# use the C implementation when available
|
||||
import xml.etree.cElementTree as ElementTree
|
||||
|
||||
import common
|
||||
import fdroidserver.common
|
||||
|
||||
srclibs = None
|
||||
|
||||
@ -352,7 +352,7 @@ class Build():
|
||||
version = self.ndk
|
||||
if not version:
|
||||
version = 'r10e' # falls back to latest
|
||||
paths = common.config['ndk_paths']
|
||||
paths = fdroidserver.common.config['ndk_paths']
|
||||
if version not in paths:
|
||||
return ''
|
||||
return paths[version]
|
||||
@ -826,7 +826,7 @@ def get_default_app_info(metadatapath=None):
|
||||
if metadatapath is None:
|
||||
appid = None
|
||||
else:
|
||||
appid, _ = common.get_extension(os.path.basename(metadatapath))
|
||||
appid, _ = fdroidserver.common.get_extension(os.path.basename(metadatapath))
|
||||
|
||||
app = App()
|
||||
app.metadatapath = metadatapath
|
||||
@ -947,15 +947,15 @@ def _decode_bool(s):
|
||||
|
||||
|
||||
def parse_metadata(metadatapath):
|
||||
_, ext = common.get_extension(metadatapath)
|
||||
accepted = common.config['accepted_formats']
|
||||
_, ext = fdroidserver.common.get_extension(metadatapath)
|
||||
accepted = fdroidserver.common.config['accepted_formats']
|
||||
if ext not in accepted:
|
||||
raise MetaDataException('"%s" is not an accepted format, convert to: %s' % (
|
||||
metadatapath, ', '.join(accepted)))
|
||||
|
||||
app = App()
|
||||
app.metadatapath = metadatapath
|
||||
app.id, _ = common.get_extension(os.path.basename(metadatapath))
|
||||
app.id, _ = fdroidserver.common.get_extension(os.path.basename(metadatapath))
|
||||
|
||||
with open(metadatapath, 'r') as mf:
|
||||
if ext == 'txt':
|
||||
|
Loading…
Reference in New Issue
Block a user