On Wed, Jun 18, 2008 at 7:06 PM, Lukasz Szybalski <[EMAIL PROTECTED]> wrote:
>> You probably need to put testfile.py in +package+/testfile.py
>>
>
> Thanks that did it. I also updated http://lucasmanual.com/mywiki/Paste
>
> Now as part of the paster create -t myapp , I would like to ask for
> few vars like this:
>
> 1. How can I ask for 1~10 urls of files.
>
> I found that I could do something in my __init__.py
> vars = [
> templates.var('version', 'Version (like 0.1)'),
> templates.var('description', 'One-line description of the package'),
> templates.var('long_description', 'Multi-line description (in reST)'),
> ]
> then add vars to my template class:
>
> class FrameworkTemplate(templates.Template):
>
> egg_plugins = ['myapp']
> summary = 'Template for creating a basic Framework package'
> required_templates = ['basic_package']
> _template_dir = 'template'
> use_cheetah = True
> vars=vars
>
> but I don't want to do:
> templates.var('fileurl1', 'URL of first file name'),
> templates.var('fileurl2', 'URL of first file name'),
> templates.var('fileurl3', 'URL of first file name'),
> ....
>
> 2. How could I do it in some kind of loop? How to escape it (Continue|Done)
> I would like to get a list of urls as my final data type. Should I do
> it using template.var or custom command or ?
>
>
>
> 3. I've been told that I could something like this below, but how is
> this dictionary different from the list above? I couldn't find any
> examples on it. Is the below code part of command or part of
> basictemplate?
>
> 4. Could you go over below code, line by line and tell me what each
> part refers too briefly?
>
> vars = {}
> if self.interactive:
> vars['input_file'] = self.challenge('Enter input file')
> else:
> # check the command line... then
> raise BadCommand('You must provide an INPUT_FILE when non-interactive')
> vars.update(self.parse_vars(self.args[1:]))
>
> template.check_vars(vars, self)
> self.create_template(template, output_dir, vars)
Any ideas on the above?
I could write a function that would ask for all the information I
need, but how would I call it using "templates.var" ? Any pointers
how this could be accomplished?
Lucas
_______________________________________________
Paste-users mailing list
[email protected]
http://webwareforpython.org/cgi-bin/mailman/listinfo/paste-users