diff options
author | review-bot <reviewbot@samsung.com> | 2021-09-24 13:56:09 +0900 |
---|---|---|
committer | 박정훈/Tizen Platform Lab(SR)/Staff Engineer/삼성전자 <jh1979.park@samsung.com> | 2021-09-24 15:30:17 +0900 |
commit | c5ce5bde2022e2addebe50ed6ac1ec5233755480 (patch) | |
tree | 50a455cfeccd516fa6ad787aec38fc6f6921b717 | |
parent | 79b9469ae55ae4f6abdf5cb7872040701f5de1e1 (diff) | |
download | tic-core-c5ce5bde2022e2addebe50ed6ac1ec5233755480.tar.gz tic-core-c5ce5bde2022e2addebe50ed6ac1ec5233755480.tar.bz2 tic-core-c5ce5bde2022e2addebe50ed6ac1ec5233755480.zip |
[Reform] Apply Coding Style
-rw-r--r-- | tic/parser/recipe_parser.py | 14 |
1 files changed, 10 insertions, 4 deletions
diff --git a/tic/parser/recipe_parser.py b/tic/parser/recipe_parser.py index ab0bf8b..d706663 100644 --- a/tic/parser/recipe_parser.py +++ b/tic/parser/recipe_parser.py @@ -46,6 +46,7 @@ REPO_OPT_PRIORITY_PATTERN = re.compile('--priority\s*=\s*(?P<level>[0-9]+)') REPO_OPT_SSL_PATTERN = re.compile('--ssl_verify') HTTP_HTTPS_PROT = re.compile('^http[s]?') + class DefaultRecipe(object): DEFAULT_RECIPE = { 'NoChrootScripts': [ @@ -146,6 +147,7 @@ class DefaultRecipe(object): def get_default_parameter(): return [dict(url=DEFAULT_RECIPE_NAME, type='recipe')] + default_recipe = DefaultRecipe() @@ -290,7 +292,8 @@ class RecipeParser(object): if re_p is None: repo_opt = ''.join([repo_opt, ' ', PRIORITY_OPTION % opt_priority[0]]) else: - repo_opt = REPO_OPT_PRIORITY_PATTERN.sub(PRIORITY_OPTION % opt_priority[0], repo_opt) + repo_opt = REPO_OPT_PRIORITY_PATTERN.sub(PRIORITY_OPTION % opt_priority[0], + repo_opt) # 2. ssl_verify re_ssl = REPO_OPT_SSL_PATTERN.search(repo_opt) @@ -301,7 +304,7 @@ class RecipeParser(object): result = [] repositories = self.get_repositories() repo_name = {} # 'name': count - repo_url = {} # 'url': exist + repo_url = {} # 'url': exist opt_ssl_verity = 'no' opt_priority = [0] base_opt = '--ssl_verify=no --priority=%s' @@ -439,9 +442,11 @@ class RecipeParser(object): mic2opt = config['Default']['Mic2Options'] pack_match = PACK_TO_OPT_PATTERN.search(mic2opt) if pack_match is not None: - config['Default']['Mic2Options'] = PACK_TO_OPT_PATTERN.sub(PACK_TO_OPTION % imagename, mic2opt) + config['Default']['Mic2Options'] = PACK_TO_OPT_PATTERN.sub( + PACK_TO_OPTION % imagename, mic2opt) else: - config['Default']['Mic2Options'] = ''.join([mic2opt, ' ', PACK_TO_OPTION % imagename]) + config['Default']['Mic2Options'] = ''.join( + [mic2opt, ' ', PACK_TO_OPTION % imagename]) # set packages if packages: config['Default']['ExtraPackages'] = packages @@ -510,4 +515,5 @@ def load_yaml(path): logger.error(err) raise TICError(configmgr.message['recipe_parse_error'] % os.path.basename(path)) + YamlInfo = collections.namedtuple('YamlInfo', 'cachedir, configs, repos') |