'errors': 'surrogateescape',
}
+ main_branches = ('development', 'test', 'production')
+
# -------------------------------------------------------------------------
def __init__(self, output_type='json', appname=None, verbose=0, version=__version__):
"""Constructor."""
res = super(ShowModulesApp, self).as_dict()
res['open_args'] = self.open_args
+ res['main_branches'] = copy.copy(self.main_branches)
return res
return output_data
# -------------------------------------------------------------------------
- def read_cache_file(self):
+ def read_cache_file(self, only_main_branches=True):
LOG.debug("Searching for {!r} ...".format(self.cache_file))
if not os.path.exists(self.cache_file):
struct, appname=self.appname, verbose=self.verbose,
base_dir=self.base_dir)
if module_info:
+ if only_main_branches:
+ in_main_branches = False
+ for branch in self.main_branches:
+ if (branch in module_info.local_versions and
+ module_info.local_versions[branch]):
+ in_main_branches = True
+ elif (branch in module_info.expected_versions and
+ module_info.expected_versions[branch]):
+ in_main_branches = True
+ if in_main_branches:
+ break
+ if not in_main_branches:
+ continue
if self.should_display(module_info):
data.append(module_info)
except yaml.YAMLError as e: