try:
- appid = app['Update Check Name'] if app['Update Check Name'] else app['id']
+ appid = app['Update Check Name'] or app['id']
if app['Repo Type'] == 'srclib':
build_dir = os.path.join('build', 'srclib', app['Repo'])
repotype = common.getsrclibvcs(app['Repo'])
try:
- appid = app['Update Check Name'] if app['Update Check Name'] else app['id']
+ appid = app['Update Check Name'] or app['id']
if app['Repo Type'] == 'srclib':
build_dir = os.path.join('build', 'srclib', app['Repo'])
repotype = common.getsrclibvcs(app['Repo'])
# subdir relative to the build dir if found, None otherwise.
def check_changed_subdir(app):
- appid = app['Update Check Name'] if app['Update Check Name'] else app['id']
+ appid = app['Update Check Name'] or app['id']
if app['Repo Type'] == 'srclib':
build_dir = os.path.join('build', 'srclib', app['Repo'])
else:
self.refreshed = True
# origin/HEAD is the HEAD of the remote, e.g. the "default branch" on
# a github repo. Most of the time this is the same as origin/master.
- rev = str(rev if rev else 'origin/HEAD')
+ rev = rev or 'origin/HEAD'
p = SilentPopen(['git', 'checkout', '-f', rev], cwd=self.local)
if p.returncode != 0:
raise VCSException("Git checkout of '%s' failed" % rev, p.output)
raise VCSException("Git svn rebase failed", p.output)
self.refreshed = True
- rev = str(rev if rev else 'master')
+ rev = rev or 'master'
if rev:
nospaces_rev = rev.replace(' ', '%20')
# Try finding a svn tag
raise VCSException("Hg pull failed", p.output)
self.refreshed = True
- rev = str(rev if rev else 'default')
+ rev = rev or 'default'
if not rev:
return
p = SilentPopen(['hg', 'update', '-C', rev], cwd=self.local)
# Create a build line...
build = {}
- build['version'] = version if version else '?'
- build['vercode'] = vercode if vercode else '?'
+ 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:
# Redundant summaries
summary = app['Summary']
- name = str(app['Name'] if app['Name'] else app['Auto Name'])
+ name = app['Name'] or app['Auto Name']
if summary and name:
summary_l = summary.lower()
name_l = name.lower()
mf.write("%s\n" % comment)
written += 1
if written > 0:
- logging.debug("...writing comments for " + (key if key else 'EOF'))
+ logging.debug("...writing comments for " + (key or 'EOF'))
def writefield(field, value=None):
writecomments(field)