# Figure out what kind of project it is...
projecttype = None
- app['Web Site'] = url # by default, we might override it
+ app.WebSite = url # by default, we might override it
if url.startswith('git://'):
projecttype = 'git'
repo = url
repotype = 'git'
- app['Source Code'] = ""
- app['Web Site'] = ""
+ app.SourceCode = ""
+ app.WebSite = ""
elif url.startswith('https://github.com'):
projecttype = 'github'
repo = url
repotype = 'git'
- app['Source Code'] = url
- app['Issue Tracker'] = url + '/issues'
- app['Web Site'] = ""
+ app.SourceCode = url
+ app.IssueTracker = url + '/issues'
+ app.WebSite = ""
elif url.startswith('https://gitlab.com/'):
projecttype = 'gitlab'
# git can be fussy with gitlab URLs unless they end in .git
else:
repo = url + '.git'
repotype = 'git'
- app['Source Code'] = url + '/tree/HEAD'
- app['Issue Tracker'] = url + '/issues'
+ app.SourceCode = url + '/tree/HEAD'
+ app.IssueTracker = url + '/issues'
elif url.startswith('https://bitbucket.org/'):
if url.endswith('/'):
url = url[:-1]
projecttype = 'bitbucket'
- app['Source Code'] = url + '/src'
- app['Issue Tracker'] = url + '/issues'
+ app.SourceCode = url + '/src'
+ app.IssueTracker = url + '/issues'
# Figure out the repo type and adddress...
- repotype, repo = getrepofrompage(app['Source Code'])
+ repotype, repo = getrepofrompage(app.SourceCode)
if not repotype:
logging.error("Unable to determine vcs type. " + repo)
sys.exit(1)
vcs.gotorevision(options.rev)
root_dir = get_subdir(build_dir)
- app['Repo Type'] = repotype
- app['Repo'] = repo
+ app.RepoType = repotype
+ app.Repo = repo
return root_dir, build_dir
config = common.read_config(options)
apps = metadata.read_metadata()
- package, app = metadata.get_default_app_info_list(apps)
- app['id'] = None
- app['Update Check Mode'] = "Tags"
+ app = metadata.App()
+ app.UpdateCheckMode = "Tags"
root_dir = None
build_dir = None
root_dir, build_dir = get_metadata_from_url(app, options.url)
elif os.path.isdir('.git'):
if options.url:
- app['Web Site'] = options.url
+ app.WebSite = options.url
root_dir = get_subdir(os.getcwd())
else:
logging.error("Specify project url.")
sys.exit(1)
# Create a build line...
- build = {}
- build['version'] = version or '?'
- build['vercode'] = vercode or '?'
- build['commit'] = '?'
- build['disable'] = 'Generated by import.py - check/set version fields and commit id'
+ build = metadata.Build()
+ build.version = version or '?'
+ build.vercode = vercode or '?'
+ build.commit = '?'
+ build.disable = 'Generated by import.py - check/set version fields and commit id'
if options.subdir:
- build['subdir'] = options.subdir
+ build.subdir = options.subdir
if os.path.exists(os.path.join(root_dir, 'jni')):
- build['buildjni'] = ['yes']
+ build.buildjni = ['yes']
- for flag, value in metadata.flag_defaults.iteritems():
- if flag in build:
- continue
- build[flag] = value
-
- app['builds'].append(build)
+ app.builds.append(build)
# Keep the repo directory to save bandwidth...
if not os.path.exists('build'):
if build_dir is not None:
shutil.move(build_dir, os.path.join('build', package))
with open('build/.fdroidvcs-' + package, 'w') as f:
- f.write(app['Repo Type'] + ' ' + app['Repo'])
+ f.write(app.RepoType + ' ' + app.Repo)
metadatapath = os.path.join('metadata', package + '.txt')
with open(metadatapath, 'w') as f: