How to create a new Quickly application template?
Getting started quickly, so to say
The easiest thing to do is to base your first template on an existing one, and modify it to your needs. After running the following command, you'll have an ubuntu-application-qt template based on the ubuntu-application original template. You'll find it on /home/$USER/quickly-templates
, ready to modify to your heart's content:
quickly quickly ubuntu-application ubuntu-application-qt
Background
Here are some resources that will help you:
- Didier Roché's post on how to create a quickly template
- Use the
IMPORT
statement from the Quickly template language to import a subset of commands from an existing template. Here's an example taken from the ubuntu-cli template
Quickly templates can be written in whatever language you want. They are just a set of commands in a directory, containing commands to copy images, documents and interacting with the user.
Adding a command is quite easy: just drop it into the root template directory (data/templates
in the Quickly source tree, or in /usr/share/quickly/templates/
) and make it executable. Quickly will know by this way that the current file is a command that Quickly Core can launch.
Consequently, if you need additional internal commands that can be launched only by your own commands, just create a subdirectory in your template and add it there.
There are also some helpers if you need those names when creating a new command:
from quickly import templatetools
python_name = templatetools.python_name(project_name)
sentence_name, camel_case_name = templatetools.conventional_names(project_name)
And to load the project_name (see the blog post above on part 6):
if not configurationhandler.project_config:
configurationhandler.loadConfig()