diff options
author | Nat Goodspeed <nat@lindenlab.com> | 2018-08-15 16:41:19 -0400 |
---|---|---|
committer | Nat Goodspeed <nat@lindenlab.com> | 2018-08-15 16:41:19 -0400 |
commit | bc5aeae202ba6683cdae363a91d054043dc09949 (patch) | |
tree | 3f77b2c588833bd1738b51d062ff7215fd616de6 /indra/newview/viewer_manifest.py | |
parent | 1b2f52257aa84d43cdeec31f1b1424e7ad44fa7f (diff) |
DRTVWR-447: Simplify redundant if-key-in-dict-and-value-nonempty logic
Diffstat (limited to 'indra/newview/viewer_manifest.py')
-rwxr-xr-x | indra/newview/viewer_manifest.py | 25 |
1 files changed, 14 insertions, 11 deletions
diff --git a/indra/newview/viewer_manifest.py b/indra/newview/viewer_manifest.py index ad6ba3ddff..ea0b3625be 100755 --- a/indra/newview/viewer_manifest.py +++ b/indra/newview/viewer_manifest.py @@ -108,17 +108,18 @@ class ViewerManifest(LLManifest): Type='String', Value='')) settings_install = {} - if 'sourceid' in self.args and self.args['sourceid']: + sourceid = self.args.get('sourceid') + if sourceid: settings_install['sourceid'] = settings_template['sourceid'].copy() - settings_install['sourceid']['Value'] = self.args['sourceid'] - print "Set sourceid in settings_install.xml to '%s'" % self.args['sourceid'] + settings_install['sourceid']['Value'] = sourceid + print "Set sourceid in settings_install.xml to '%s'" % sourceid - if 'channel_suffix' in self.args and self.args['channel_suffix']: + if self.args.get('channel_suffix'): settings_install['CmdLineChannel'] = settings_template['CmdLineChannel'].copy() settings_install['CmdLineChannel']['Value'] = self.channel_with_pkg_suffix() print "Set CmdLineChannel in settings_install.xml to '%s'" % self.channel_with_pkg_suffix() - if 'grid' in self.args and self.args['grid']: + if self.args.get('grid'): settings_install['CmdLineGridChoice'] = settings_template['CmdLineGridChoice'].copy() settings_install['CmdLineGridChoice']['Value'] = self.grid() print "Set CmdLineGridChoice in settings_install.xml to '%s'" % self.grid() @@ -212,8 +213,9 @@ class ViewerManifest(LLManifest): def channel_with_pkg_suffix(self): fullchannel=self.channel() - if 'channel_suffix' in self.args and self.args['channel_suffix']: - fullchannel+=' '+self.args['channel_suffix'] + channel_suffix = self.args.get('channel_suffix') + if channel_suffix: + fullchannel+=' '+channel_suffix return fullchannel def channel_variant(self): @@ -239,11 +241,12 @@ class ViewerManifest(LLManifest): if self.channel_type() == 'release': suffix=suffix.replace('Release', '').strip() # for the base release viewer, suffix will now be null - for any other, append what remains - if len(suffix) > 0: - suffix = "_"+ ("_".join(suffix.split())) + if suffix: + suffix = "_".join([''] + suffix.split()) # the additional_packages mechanism adds more to the installer name (but not to the app name itself) - if 'channel_suffix' in self.args and self.args['channel_suffix']: - suffix+='_'+("_".join(self.args['channel_suffix'].split())) + # ''.split() produces empty list, so suffix only changes if + # channel_suffix is non-empty + suffix = "_".join([suffix] + self.args.get('channel_suffix', '').split()) return suffix def installer_base_name(self): |