Remove empty path elements when constructing modname
Without this, autohelp fails if you don't put a trailing slash on the input directory name. Change-Id: I6c37636c87ad86f93d1fd7121461ce543a6260b3
This commit is contained in:
@@ -65,6 +65,7 @@ def import_modules(repo_location, package_name, verbose=0):
|
|||||||
if pyfile.endswith('.py'):
|
if pyfile.endswith('.py'):
|
||||||
modfile = os.path.join(root, pyfile).split(repo_location)[1]
|
modfile = os.path.join(root, pyfile).split(repo_location)[1]
|
||||||
modname = os.path.splitext(modfile)[0].split(os.path.sep)
|
modname = os.path.splitext(modfile)[0].split(os.path.sep)
|
||||||
|
modname = [m for m in modname if m != '']
|
||||||
modname = '.'.join(modname)
|
modname = '.'.join(modname)
|
||||||
if modname.endswith('.__init__'):
|
if modname.endswith('.__init__'):
|
||||||
modname = modname[:modname.rfind(".")]
|
modname = modname[:modname.rfind(".")]
|
||||||
|
|||||||
Reference in New Issue
Block a user