A coily
plugin closely resembles a Python package with some slight tweaks. This doesn't mean that a plugin is meant to be installed as a Python package. It is only a description of the folder structure.
Let's look at the layout of the gen-cherrypy-app
plugin as an example.
Some parts of this layout are required, and other parts are not. The top folder is the name of the plugin.
__init__.py
file inside the top directory.__init__.py
must include a __description__
variable. This description is shown when we run the coily --help
command.__init__.py
must include a command function, which is either a create
or apply
function. create
is used when the plugin needs one argument from the user. apply
is used when no argument is needed from the user.Let's look at how gen-cherrypy-app
meets each of these requirements.
__init__.py
, we can see the following help message defined.__description__ = "plugin to create skeleton CherryPy applications"
gen-cherrypy-app
is used to create a skeleton application. It needs the user to supply the name of the application it will create. Again, looking inside __init__.py
, the following method signature can be found.def create(plugin_path, name)
The rest of the files are not plug-in requirements, but instead are utilized by gen-cherrypy-app
as shown in the next section.
3.144.90.182