Пример #1
0
 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)
Пример #2
0
 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)