kopia lustrzana https://github.com/piku/piku
Guard against non-existent plugins dir.
rodzic
5ac6ae2d1d
commit
480d285882
15
piku.py
15
piku.py
|
@ -1386,13 +1386,14 @@ def _get_plugin_commands(path):
|
||||||
sys_path.append(abspath(path))
|
sys_path.append(abspath(path))
|
||||||
|
|
||||||
cli_commands = []
|
cli_commands = []
|
||||||
for item in listdir(path):
|
if isdir(path):
|
||||||
module_path = join(path, item)
|
for item in listdir(path):
|
||||||
if not isdir(module_path):
|
module_path = join(path, item)
|
||||||
continue
|
if not isdir(module_path):
|
||||||
module = import_module(item)
|
continue
|
||||||
if hasattr(module, 'cli_commands'):
|
module = import_module(item)
|
||||||
cli_commands.append(module.cli_commands())
|
if hasattr(module, 'cli_commands'):
|
||||||
|
cli_commands.append(module.cli_commands())
|
||||||
|
|
||||||
return cli_commands
|
return cli_commands
|
||||||
|
|
||||||
|
|
Ładowanie…
Reference in New Issue