[Core] Add multiple/external cog paths support (#853)

* WIP cog path manager

* Initial working state

* Get real reloading working

* Type error thingy

* And fix the tests

* Start UI shit

* path reordering

* Add install path getter/setter and fix config syntax

* Determine bot directory at runtime

* Add UI commands for install path

* Update downloader to use install path

* Add sane install path default

* Make evaluation of cog install path lazy

* Some typing fixes

* Add another line to codeowners

* Conditionally put install path in paths

* Always put install path first

* Dont allow people to add the installdir as an additional path, guarantee install dir isn't shown with paths command

* Make shit update loaded cogs

* Add tests

* Another one
This commit is contained in:
Will
2017-08-10 23:09:49 -04:00
committed by GitHub
parent 0651a6ddc3
commit 13cabfbad7
8 changed files with 472 additions and 52 deletions

View File

@@ -38,14 +38,12 @@ def init_events(bot, cli_flags):
for package in packages:
try:
bot.load_extension(package)
spec = bot.cog_mgr.find_cog(package)
bot.load_extension(spec)
except Exception as e:
log.exception("Failed to load package {}".format(package),
exc_info=e)
failed.append(package)
if failed:
await bot.save_packages_status()
await bot.remove_loaded_package(package)
if packages:
print("Loaded packages: " + ", ".join(packages))