MCPcopy Index your code
hub / github.com/pyload/pyload / autoreload_plugins

Method autoreload_plugins

module/plugins/hooks/UpdateManager.py:95–122  ·  view source on GitHub ↗

Reload and reindex all modified plugins

(self)

Source from the content-addressed store, hash-verified

93
94 @Expose
95 def autoreload_plugins(self):
96 """
97 Reload and reindex all modified plugins
98 """
99 reloads = []
100 modules = filter(
101 lambda m: m and (m.__name__.startswith("module.plugins.") or
102 m.__name__.startswith("userplugins.")) and
103 m.__name__.count(".") >= 2, sys.modules.values()
104 )
105 for m in modules:
106 root, plugin_type, plugin_name = m.__name__.rsplit(".", 2)
107 plugin_id = (plugin_type, plugin_name)
108 if plugin_type in self.pyload.pluginManager.plugins:
109 f = m.__file__.replace(".pyc", ".py")
110 if not os.path.isfile(f):
111 continue
112
113 mtime = os.path.getmtime(f)
114
115 if plugin_id not in self.mtimes:
116 self.mtimes[plugin_id] = mtime
117
118 elif self.mtimes[plugin_id] < mtime:
119 reloads.append(plugin_id)
120 self.mtimes[plugin_id] = mtime
121
122 return True if self.pyload.pluginManager.reloadPlugins(reloads) else False
123
124 def server_response(self, line=None):
125 try:

Callers 2

periodical_taskMethod · 0.95
autoreloadPluginsMethod · 0.95

Calls 6

filterFunction · 0.85
valuesMethod · 0.80
rsplitMethod · 0.80
reloadPluginsMethod · 0.80
replaceMethod · 0.45
appendMethod · 0.45

Tested by

no test coverage detected