Skip to content

Commit

Permalink
[add] plugin info
Browse files Browse the repository at this point in the history
  • Loading branch information
tomsimonart committed May 8, 2018
1 parent ab029df commit 19ee811
Show file tree
Hide file tree
Showing 3 changed files with 11 additions and 6 deletions.
13 changes: 7 additions & 6 deletions GLM/glm.py
Original file line number Diff line number Diff line change
Expand Up @@ -116,22 +116,23 @@ def plugin_loader(plugin, start, *args):
loaded_plugin = main_plugin.Plugin(True, *args)
else:
msg('ERROR', 2, 'plugin_loader', 'failsafe plugin activation')
print_plugin_info(failsafe.Plugin(False, *args))
loaded_plugin = failsafe.Plugin(True, *args)


def print_plugin_info(plugin):
if hasattr(plugin, "name"):
msg(plugin.name, 0, "Plugin", level=2)
msg(plugin.name, 0, "Plugin", level=2, slevel='info')
else:
msg("No name", 1, "print_plugin_info", level=2)
msg("No name", 1, "Plugin", level=1)
if hasattr(plugin, "author"):
msg(plugin.author, 0, 'Plugin', level=2)
msg(plugin.author, 0, 'Plugin', level=2, slevel='info')
else:
msg("No author", 1, "print_plugin_info", level=2)
msg("No author", 1, "Plugin", level=1)
if hasattr(plugin, "version"):
msg(plugin.version, 0, 'Plugin', level=2)
msg(plugin.version, 0, 'Plugin', level=2, slevel='info')
else:
msg("No version", 1, "print_plugin_info", level=2)
msg("No version", 1, "Plugin", level=1)


def plugin_selector(plugins):
Expand Down
2 changes: 2 additions & 0 deletions GLM/source/plugins/template_plugin.py
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,8 @@
class Plugin(PluginBase):
def __init__(self, start, *args):
super().__init__(start, *args)
self.name = "Example"
self.author = "Infected"
self.version = "0.9.0"

def _make_layout(self):
Expand Down
2 changes: 2 additions & 0 deletions GLM/source/specialplugins/failsafe.py
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,8 @@
class Plugin(PluginBase):
def __init__(self, start, *args):
super().__init__(start, *args)
self.name = "Failsafe Plugin"
self.author = "Infected"
self.version = "0.9.0"

def _make_layout(self):
Expand Down

0 comments on commit 19ee811

Please sign in to comment.