groundwork
groundwork copied to clipboard
Groundwork Tutorial Code Editing not accurate
https://groundwork.readthedocs.io/en/latest/quickstart.html
###Original Code### from groundwork import App
if __name__== "__main__": my_app = App() my_app.plugins.activate(["GwPluginInfo"]) my_app.commands.start_cli() #################
It should be ["GwPluginsInfo"]
https://groundwork.readthedocs.io/en/latest/commands.html
###Original Code### from groundwork import App from groundword.plugins import GwCommandInfo
my_app = App() my_app.plugins.activate(["GwCommandInfo"]) my_app.commands.start_cli() ################
It should be " GwCommandsInfo"
https://groundwork.readthedocs.io/en/latest/#example `` from groundwork import App from groundwork.patterns import GwCommandsPattern
class MyPlugin(GwCommandsPattern): def init(self, app, *args, **kwargs): self.name = "My Plugin" super().init(app, *args, **kwargs)
def activate(self):
self.commands.register(command='hello',
description='prints "hello world"',
function=self.greetings)
def greetings(self):
print("Hello world")
if name == "main": my_app = App(plugins=[MyPlugin]) # Creates app and registers MyPlugin my_app.plugins.activate(["MyPlugin"]) #My Plugin error . ---> MyPlugin Remove spaces # Initialise and activates 'My Plugin' my_app.commands.start_cli() # Starts the command line interface ``