mirror of
https://github.com/TeamPGM/pyrogram.git
synced 2024-11-16 20:59:29 +00:00
Fix plugins not being properly unloaded
Also, plugins' roots values will follow python notation: folder.plugins instead of folder/plugins, in case of roots inside another folder.
This commit is contained in:
parent
dd9c4801ed
commit
78ed83ebf7
@ -872,6 +872,7 @@ class Client(Methods, BaseClient):
|
|||||||
|
|
||||||
app.stop()
|
app.stop()
|
||||||
"""
|
"""
|
||||||
|
|
||||||
def do_it():
|
def do_it():
|
||||||
self.terminate()
|
self.terminate()
|
||||||
self.disconnect()
|
self.disconnect()
|
||||||
@ -918,6 +919,7 @@ class Client(Methods, BaseClient):
|
|||||||
|
|
||||||
app.stop()
|
app.stop()
|
||||||
"""
|
"""
|
||||||
|
|
||||||
def do_it():
|
def do_it():
|
||||||
self.stop()
|
self.stop()
|
||||||
self.start()
|
self.start()
|
||||||
@ -1525,7 +1527,7 @@ class Client(Methods, BaseClient):
|
|||||||
count = 0
|
count = 0
|
||||||
|
|
||||||
if not include:
|
if not include:
|
||||||
for path in sorted(Path(root).rglob("*.py")):
|
for path in sorted(Path(root.replace(".", "/")).rglob("*.py")):
|
||||||
module_path = '.'.join(path.parent.parts + (path.stem,))
|
module_path = '.'.join(path.parent.parts + (path.stem,))
|
||||||
module = reload(import_module(module_path))
|
module = reload(import_module(module_path))
|
||||||
|
|
||||||
@ -1587,7 +1589,7 @@ class Client(Methods, BaseClient):
|
|||||||
warn_non_existent_functions = True
|
warn_non_existent_functions = True
|
||||||
|
|
||||||
try:
|
try:
|
||||||
module = reload(import_module(module_path))
|
module = import_module(module_path)
|
||||||
except ImportError:
|
except ImportError:
|
||||||
log.warning('[{}] [UNLOAD] Ignoring non-existent module "{}"'.format(
|
log.warning('[{}] [UNLOAD] Ignoring non-existent module "{}"'.format(
|
||||||
self.session_name, module_path))
|
self.session_name, module_path))
|
||||||
|
Loading…
Reference in New Issue
Block a user