Ejemplo n.º 1
0
 def _find_distribution(self, module):
     path = get_module_path(module)
     if path == self.trac_path:
         return pkg_resources.Distribution(project_name = 'Trac',
                                           version = TRAC_VERSION,
                                           location = path)
     for dist in pkg_resources.find_distributions(path, only = True):
         return dist
     else:
         # This is a plain Python source file, not an egg
         return pkg_resources.Distribution(project_name = module.__name__,
                                           version = '',
                                           location = module.__file__)
Ejemplo n.º 2
0
 def _find_distribution(self, module):
     path = get_module_path(module)
     if path == self.trac_path:
         return pkg_resources.Distribution(project_name='Trac',
                                           version=TRAC_VERSION,
                                           location=path)
     for dist in pkg_resources.find_distributions(path, only=True):
         return dist
     else:
         # This is a plain Python source file, not an egg
         return pkg_resources.Distribution(project_name=module.__name__,
                                           version='',
                                           location=module.__file__)
Ejemplo n.º 3
0
 def find_distribution(module):
     name = module.__name__
     path = get_module_path(module)
     sources = path_sources.get(path)
     if sources is None:
         sources = path_sources[path] = get_sources(path)
     dist = sources.get(name.replace('.', '/') + '.py')
     if dist is None:
         dist = sources.get(name.replace('.', '/') + '/__init__.py')
     if dist is None:
         # This is a plain Python source file, not an egg
         dist = pkg_resources.Distribution(project_name=name,
                                           version='',
                                           location=module.__file__)
     return dist
Ejemplo n.º 4
0
 def find_distribution(module):
     name = module.__name__
     path = get_module_path(module)
     sources = path_sources.get(path)
     if sources is None:
         sources = path_sources[path] = get_sources(path)
     dist = sources.get(name.replace('.', '/') + '.py')
     if dist is None:
         dist = sources.get(name.replace('.', '/') + '/__init__.py')
     if dist is None:
         # This is a plain Python source file, not an egg
         dist = pkg_resources.Distribution(project_name=name,
                                           version='',
                                           location=module.__file__)
     return dist
Ejemplo n.º 5
0
 def test_get_module_path(self):
     self.assertEqual(util.get_module_path(trac),
                      util.get_module_path(util))
Ejemplo n.º 6
0
 def __init__(self):
     self.trac_path = get_module_path(sys.modules['trac.core'])
Ejemplo n.º 7
0
 def __init__(self):
     self.trac_path = get_module_path(sys.modules['trac.core'])
Ejemplo n.º 8
0
 def test_get_module_path(self):
     self.assertEqual(util.get_module_path(trac),
                      util.get_module_path(util))