def get_modules_list(self, pattern=None): ''' Return module map references. :return: ''' if pattern and '*' not in pattern: pattern = '*{0}*'.format(pattern) modules = [] for m_name, m_path in self._modules_map.items(): m_path = m_path.split('.')[0] m_name = '.'.join([elm for elm in m_path.split(os.path.sep) if elm]) if pattern and fnmatch.fnmatch(m_name, pattern) or not pattern: modules.append(m_name) return sorted(modules)
def get_modules_list(self, pattern=None): """ Return module map references. :return: """ if pattern and "*" not in pattern: pattern = "*{}*".format(pattern) modules = [] for m_name, m_path in self._modules_map.items(): m_path = m_path.split(".")[0] m_name = ".".join([elm for elm in m_path.split(os.path.sep) if elm]) if pattern and fnmatch.fnmatch(m_name, pattern) or not pattern: modules.append(m_name) return sorted(modules)