1
0
mirror of https://github.com/openSUSE/osc.git synced 2024-12-26 09:56:13 +01:00

- load subcommands from /var/lib/osc-plugins/ or ~/.osc-plugins/

This commit is contained in:
Dr. Peter Poeml 2007-06-29 18:26:30 +00:00
parent 713529fc16
commit 5f2e9ac766

View File

@ -1320,7 +1320,14 @@ class Osc(cmdln.Cmdln):
print wipebinaries(conf.config['apiurl'], args[0], package, opts.arch, opts.repo)
if __name__ == '__main__':
osc = Osc()
sys.exit(osc.main())
# load subcommands plugged-in locally
plugin_dirs = ['/var/lib/osc-plugins', os.path.expanduser('~/.osc-plugins')]
for plugin_dir in plugin_dirs:
if os.path.isdir(plugin_dir):
for extfile in os.listdir(plugin_dir):
if not extfile.endswith('.py'):
continue
exec open(os.path.join(plugin_dir, extfile))