How to easily edit a template ?

Asked by Tony Byrne

I find it difficult to edit a template.

 I currently create an application from my template, cycle through edit, design, run until my application looks like an useful start point then view the differences. I now edit the template by cutting and pasting from the application back to the template. What keeps happening is that the application name "leaks" into the template.

 I looked into the code base and noticed that quicklyutils.file_from_template(template_dir, template_file, target_dir, substitutions=[], rename = True)
 has an argument <rename> that seems might help prevent this perhaps by creating a runnable application with template names like "camel_case_name" preserved, which can be copied into the template as is.

Question information

Language:
English Edit question
Status:
Solved
For:
Quickly Edit question
Assignee:
No assignee Edit question
Solved by:
Didier Roche-Tolomelli
Solved:
Last query:
Last reply:
Revision history for this message
Didier Roche-Tolomelli (didrocks) said :
#1

Hey Tony, thanks for using Quickly.

There is a way way easier answer:
quickly quickly <origin_template> <destination_template_name>
This will create the new template in ~quickly-templates/

And then, you can edit it there. It will then appear in every command, shell completion, and such…

quickly help quickly for more info :)

Revision history for this message
Tony Byrne (tony-badwolf) said :
#2

Thanks for the quick(ly) reply, it doesn't quite reach my problem.

Imagine you create your project, that needs a text box, so you add handlers to the project's menu
on_menu_edit_cut(self,widget, data=None)
on_menu_edit_copy(self,widget, data=None)
on_menu_edit_paste(self,widget, data=None)

Then define some key bindings
Ctrl+X
Ctrl+C
Ctrl+V
Alt E P

Then add a bunch of code.

Then a month later you need a new project, and it has a text box. Is there an easy way to re-use your existing code to formulate a template ?

The current quickly quickly old-template new-template followed by template edits leads to a work flow that is more like C that python.

quickly quickly old-template new-template
Edit new-template (like edit new-template.c)
quickly create new-template foo-project (like cc new-template.c -o foo-project)
test foo-project, discover bug or missing feature.
Delete foo-project (like build clean)
Then repeat
edit new-template
quickly create new-template foo-project
test foo-project
delete foo-project
until template seems complete.

You add a bunch of code to foo-project to complete it.

Then begin bar-project from new-template, but it needs a bug fix you placed into foo-project 3 weeks after you stopped editing new-template.

Revision history for this message
Best Didier Roche-Tolomelli (didrocks) said :
#3

No, there is no way to do what you want (creating a project from another project). That will be sweet to add, but hard to achieve regarding python and packaging conversion which both conflict.

You are more than welcome to hop into #quickly on freenode and try working on that!

Revision history for this message
Tony Byrne (tony-badwolf) said :
#4

Thanks Didier Roche, that solved my question.