[Checkins] SVN: grokproject/branches/d2m-dual-startup/ allow --zopectl option
Michael Haubenwallner
michael at d2m.at
Sat Sep 27 02:58:29 EDT 2008
Log message for revision 91539:
allow --zopectl option
Changed:
U grokproject/branches/d2m-dual-startup/CHANGES.txt
U grokproject/branches/d2m-dual-startup/README.txt
U grokproject/branches/d2m-dual-startup/grokproject/main.py
U grokproject/branches/d2m-dual-startup/grokproject/templates.py
U grokproject/branches/d2m-dual-startup/tests.txt
U grokproject/branches/d2m-dual-startup/tests_paste.txt
-=-
Modified: grokproject/branches/d2m-dual-startup/CHANGES.txt
===================================================================
--- grokproject/branches/d2m-dual-startup/CHANGES.txt 2008-09-26 23:41:58 UTC (rev 91538)
+++ grokproject/branches/d2m-dual-startup/CHANGES.txt 2008-09-27 06:58:26 UTC (rev 91539)
@@ -6,7 +6,8 @@
* added another template to support paster (template_paste)
* paster is the default server mode now
-* grokproject --zopectl=True ... creates a grokproject like before
+* 'grokproject --zopectl projectname' creates a grokproject like before
+* 'paster create -t grok projectname zopectl=True' does the same
* with bin/paster serve etc/debug.ini
you need to access the project from http://localhost:8080/@@login.html
Modified: grokproject/branches/d2m-dual-startup/README.txt
===================================================================
--- grokproject/branches/d2m-dual-startup/README.txt 2008-09-26 23:41:58 UTC (rev 91538)
+++ grokproject/branches/d2m-dual-startup/README.txt 2008-09-27 06:58:26 UTC (rev 91539)
@@ -19,11 +19,15 @@
the code for your web application. To start the Zope server, execute
``bin/paster serve etc/deploy.ini``.
-To create a project with the old ``zopectl`` layout run the ``grokproject``
+To create a project with the previous ``zopectl`` layout run the ``grokproject``
script like:
- $ grokproject --zopectl=True MammothHerd
+ $ grokproject --zopectl MammothHerd
+or:
+
+ $ paster create -t grok MammothHerd zopectl=True
+
For those who know paster: ``grokproject`` is just a wrapper around a
paster template. So instead of running the ``grokproject`` command,
you can also run:
Modified: grokproject/branches/d2m-dual-startup/grokproject/main.py
===================================================================
--- grokproject/branches/d2m-dual-startup/grokproject/main.py 2008-09-26 23:41:58 UTC (rev 91538)
+++ grokproject/branches/d2m-dual-startup/grokproject/main.py 2008-09-27 06:58:26 UTC (rev 91539)
@@ -13,6 +13,8 @@
"hierarchy).")
parser.add_option('-v', '--verbose', action="store_true", dest="verbose",
default=False, help="Be verbose.")
+ parser.add_option('--zopectl', action="store_true", dest="zopectl",
+ default=False, help="Use zopectl.")
# Options that override the interactive part of filling the templates.
for var in GrokProject.vars:
@@ -43,9 +45,12 @@
# the templates.
extra_args = []
for var in GrokProject.vars:
+ print var.name, getattr(options, var.name)
supplied_value = getattr(options, var.name)
if supplied_value is not None:
extra_args.append('%s=%s' % (var.name, supplied_value))
+ if options.zopectl:
+ extra_args.append('zopectl=True')
exit_code = runner.run(option_args + ['-t', 'grok', project]
+ extra_args)
sys.exit(exit_code)
Modified: grokproject/branches/d2m-dual-startup/grokproject/templates.py
===================================================================
--- grokproject/branches/d2m-dual-startup/grokproject/templates.py 2008-09-26 23:41:58 UTC (rev 91538)
+++ grokproject/branches/d2m-dual-startup/grokproject/templates.py 2008-09-27 06:58:26 UTC (rev 91539)
@@ -35,10 +35,6 @@
ask_var('eggs_dir',
'Location where zc.buildout will look for and place packages',
default='', should_ask=False),
- ask_var('zopectl',
- "Use zopectl",
- default=False, should_ask=False,
- getter=get_boolean_value_for_option),
]
def check_vars(self, vars, cmd):
@@ -60,13 +56,12 @@
vars = super(GrokProject, self).check_vars(vars, cmd)
for name in skipped_vars:
vars[name] = skipped_vars[name]
-
for var_name in ['user', 'passwd']:
# Escape values that go in site.zcml.
vars[var_name] = xml.sax.saxutils.quoteattr(vars[var_name])
vars['app_class_name'] = vars['project'].capitalize()
- if vars['zopectl']:
+ if vars.get('zopectl','') == 'True':
self._template_dir = 'template'
# Handling the version.cfg file.
Modified: grokproject/branches/d2m-dual-startup/tests.txt
===================================================================
--- grokproject/branches/d2m-dual-startup/tests.txt 2008-09-26 23:41:58 UTC (rev 91538)
+++ grokproject/branches/d2m-dual-startup/tests.txt 2008-09-27 06:58:26 UTC (rev 91539)
@@ -12,8 +12,8 @@
Then use paster::
>>> paster = current_dir + '/bin/paster create -t grok '
- >>> sh(paster + 'grokexample user=a passwd=a --no-interactive')
- /.../bin/paster create -t grok grokexample user=a passwd=a --no-interactive
+ >>> sh(paster + 'grokexample user=a passwd=a zopectl=True --no-interactive')
+ /.../bin/paster create -t grok grokexample user=a passwd=a zopectl=True --no-interactive
...
Let's check the contents::
Modified: grokproject/branches/d2m-dual-startup/tests_paste.txt
===================================================================
--- grokproject/branches/d2m-dual-startup/tests_paste.txt 2008-09-26 23:41:58 UTC (rev 91538)
+++ grokproject/branches/d2m-dual-startup/tests_paste.txt 2008-09-27 06:58:26 UTC (rev 91539)
@@ -12,8 +12,8 @@
Then use paster::
>>> paster = current_dir + '/bin/paster create -t grok '
- >>> sh(paster + 'grokexample user=a passwd=a server=paste --no-interactive')
- /.../bin/paster create -t grok grokexample user=a passwd=a server=paste --no-interactive
+ >>> sh(paster + 'grokexample user=a passwd=a --no-interactive')
+ /.../bin/paster create -t grok grokexample user=a passwd=a --no-interactive
...
Let's check the contents::
More information about the Checkins
mailing list