From: jingui.ren Date: Wed, 7 Feb 2018 02:42:48 +0000 (+0800) Subject: in ConfigMgr::get(),the parent's instance can't access it's child X-Git-Tag: released-tools-18.01.7~8 X-Git-Url: http://review.tizen.org/git/?a=commitdiff_plain;h=cb1c2091c7576801206b21b56bbce7486cd70ffa;p=tools%2Fgbs.git in ConfigMgr::get(),the parent's instance can't access it's child class method BizConfigManager::get_optional_item(),it should be moved to parent class. Change-Id: I1d773a640a23629bdcd1352cd089b00d9530aa55 --- diff --git a/gitbuildsys/conf.py b/gitbuildsys/conf.py index 5c01f28..798dc86 100644 --- a/gitbuildsys/conf.py +++ b/gitbuildsys/conf.py @@ -407,6 +407,13 @@ url = http://download.tizen.org/releases/daily/trunk/ivi/latest/ return True return False + def get_optional_item(self, section, option, default=None): + '''return default if section.option does not exist''' + try: + return self.get(option, section) + except errors.ConfigError: + return default + def get(self, opt, section='general'): 'get item value. return plain text of password if item is passwd' @@ -636,13 +643,6 @@ class BizConfigManager(ConfigMgr): 'Please check %s, a new profile oriented style of config ' ' which was converted from your current settings.' % fname) - def get_optional_item(self, section, option, default=None): - '''return default if section.option does not exist''' - try: - return self.get(option, section) - except errors.ConfigError: - return default - def _get_url_options(self, section_id): '''get url/user/passwd from a section''' url = os.path.expanduser(self._interpolate(self.get('url', section_id)))