Hello. I am trying to tell my program to ask user for input filenames and based on that it will need to create 2 .py files for each filename. I need to substitute the names of few fields in the .py files and add some things depending on extension. Right now I just want to create folder and single file in it, nothing fancy until I get an idea of how this whole thing is structured.
So I guess I want to create a program similar to paster create myapp, but it would be called from a command line: myapp create somename ???? or paster -t myapp? or? "paster create myapp" command created a structure of my program that will be creating my custom files. I read over here (http://pythonpaste.org/script/developer.html#templates) that I can use [paste.paster_create_template] framework = framework.templates:FrameworkTemplate 1. What will above do, and how can I call it later from a command line? paster create -t framework ??? 2. I add that I don't see it as being listed as template.? Where is a line that tells me I work on myapp vs I work on what will "myapp" create? paster create --list-templates 3. I need some help on what should be set where and how to get it working so at least one file is created. My current structure is: tree MyAPP/ MyAPP/ |-- __init__.py |-- myapp | `-- __init__.py |-- myapp.egg-info | |-- PKG-INFO | |-- SOURCES.txt | |-- dependency_links.txt | |-- entry_points.txt | |-- not-zip-safe | |-- paster_plugins.txt | `-- top_level.txt |-- setup.cfg `-- setup.py I start here : http://pythonpaste.org/script/developer.html So I want to start with template and later go into commands. I've been told I can create a templates with cheetah. templates/ somefile.py_tmpl My final finish project would be something like this? I think: some command to get it started? ...ask for Name....etc... which will give somename/ | --somefile.py | -- setup.py... 4. Do I need a templates folder or can I just put my somefile.py_tmpl into myapp folder (the structure above)? 5. What else I need to add? I think I need to add below to setup.py file?! setup(... entry_points=""" [paste.paster_create_template] framework = framework.templates:FrameworkTemplate """) 6. What does framework do in above. Does it mean I can call it as myapp -t framework? And below I need to put into __init__.py?! |-- myapp | `-- __init__.py " from paste.script import templates class FrameworkTemplate(templates.Template): egg_plugins = ['Framework'] summary = 'Template for creating a basic Framework package' required_templates = ['basic_package'] _template_dir = 'template' use_cheetah = True " 7. egg_plugins = ['Framework'], in my case this should be egg_plugins = ['MyAPP'] _template_dir = 'template', in my case this should be _template_dir = 'myapp' ??? Anything else I should change? If you guys could shed some light on where am I setting up the myapp project, and where am I working on what will 'myapp' create? Thanks, Lucas -- Where was my car manufactured? http://cars.lucasmanual.com/vin TurboGears Manual-Howto http://lucasmanual.com/pdf/TurboGears-Manual-Howto.pdf _______________________________________________ Paste-users mailing list [email protected] http://webwareforpython.org/cgi-bin/mailman/listinfo/paste-users
