[Checkins] SVN: grokproject/trunk/ Merge changes from zopectl-less branch back into trunk.
Uli Fouquet
uli at gnufix.de
Tue Mar 9 16:59:36 EST 2010
Log message for revision 109878:
Merge changes from zopectl-less branch back into trunk.
Changed:
U grokproject/trunk/CHANGES.txt
A grokproject/trunk/grokproject/ext_eggs.cfg
D grokproject/trunk/grokproject/ext_eggs_paster.cfg
D grokproject/trunk/grokproject/ext_eggs_zctl.cfg
U grokproject/trunk/grokproject/main.py
D grokproject/trunk/grokproject/template_zopectl/
U grokproject/trunk/grokproject/templates.py
U grokproject/trunk/grokproject/utils.py
U grokproject/trunk/tests.py
U grokproject/trunk/tests_alternative_release_url.txt
D grokproject/trunk/tests_zopectl.txt
-=-
Modified: grokproject/trunk/CHANGES.txt
===================================================================
--- grokproject/trunk/CHANGES.txt 2010-03-09 16:55:53 UTC (rev 109877)
+++ grokproject/trunk/CHANGES.txt 2010-03-09 21:59:31 UTC (rev 109878)
@@ -4,8 +4,11 @@
1.0.4 (unreleased)
------------------
-* (no changes yet)
+* Remove '--zopectl' option. Paster setups are now the only supported
+ method to create new projects.
+ Fix bug https://bugs.launchpad.net/grok/+bug/524262
+
1.0.3 (2010-02-21)
------------------
Copied: grokproject/trunk/grokproject/ext_eggs.cfg (from rev 109877, grokproject/branches/ulif-zopectl-less/grokproject/ext_eggs.cfg)
===================================================================
--- grokproject/trunk/grokproject/ext_eggs.cfg (rev 0)
+++ grokproject/trunk/grokproject/ext_eggs.cfg 2010-03-09 21:59:31 UTC (rev 109878)
@@ -0,0 +1,17 @@
+Paste = 1.7.2
+PasteDeploy = 1.3.2
+PasteScript = 1.7.3
+grokui.admin = 0.4.1
+setuptools = 0.6c9
+collective.recipe.template = 1.4.0
+z3c.evalexception = 2.0
+z3c.recipe.dev = 0.5.3
+z3c.recipe.eggbasket = 0.4.3
+z3c.recipe.i18n = 0.5.3
+z3c.recipe.mkdir = 0.3.1
+zc.buildout = 1.1.1
+zc.lockfile = 1.0.0
+zc.recipe.egg = 1.1.0
+zc.recipe.filestorage = 1.0.1
+zope.app.container = 3.8.1
+zope.app.folder = 3.5.1
Deleted: grokproject/trunk/grokproject/ext_eggs_paster.cfg
===================================================================
--- grokproject/trunk/grokproject/ext_eggs_paster.cfg 2010-03-09 16:55:53 UTC (rev 109877)
+++ grokproject/trunk/grokproject/ext_eggs_paster.cfg 2010-03-09 21:59:31 UTC (rev 109878)
@@ -1,17 +0,0 @@
-Paste = 1.7.2
-PasteDeploy = 1.3.2
-PasteScript = 1.7.3
-grokui.admin = 0.4.1
-setuptools = 0.6c9
-collective.recipe.template = 1.4.0
-z3c.evalexception = 2.0
-z3c.recipe.dev = 0.5.3
-z3c.recipe.eggbasket = 0.4.3
-z3c.recipe.i18n = 0.5.3
-z3c.recipe.mkdir = 0.3.1
-zc.buildout = 1.1.1
-zc.lockfile = 1.0.0
-zc.recipe.egg = 1.1.0
-zc.recipe.filestorage = 1.0.1
-zope.app.container = 3.8.1
-zope.app.folder = 3.5.1
Deleted: grokproject/trunk/grokproject/ext_eggs_zctl.cfg
===================================================================
--- grokproject/trunk/grokproject/ext_eggs_zctl.cfg 2010-03-09 16:55:53 UTC (rev 109877)
+++ grokproject/trunk/grokproject/ext_eggs_zctl.cfg 2010-03-09 21:59:31 UTC (rev 109878)
@@ -1,17 +0,0 @@
-Paste = 1.7.2
-PasteDeploy = 1.3.2
-PasteScript = 1.7.3
-collective.recipe.template = 1.4.0
-grokui.admin = 0.4.1
-setuptools = 0.6c9
-z3c.evalexception = 2.0
-z3c.recipe.dev = 0.5.3
-z3c.recipe.eggbasket = 0.4.3
-z3c.recipe.i18n = 0.5.3
-zc.buildout = 1.1.1
-zc.lockfile = 1.0.0
-zc.recipe.egg = 1.1.0
-zc.recipe.filestorage = 1.0.1
-zc.zope3recipes = 0.10.0
-zope.app.container = 3.8.1
-zope.app.folder = 3.5.1
Modified: grokproject/trunk/grokproject/main.py
===================================================================
--- grokproject/trunk/grokproject/main.py 2010-03-09 16:55:53 UTC (rev 109877)
+++ grokproject/trunk/grokproject/main.py 2010-03-09 21:59:31 UTC (rev 109878)
@@ -20,8 +20,6 @@
"the latest version found on the grok website is used.")
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.")
parser.add_option('--version', action="store_true", dest="version",
default=False, help="Show grokproject version.")
@@ -62,8 +60,6 @@
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')
if options.grokversion:
extra_args.append('grokversion=%s' % options.grokversion)
Modified: grokproject/trunk/grokproject/templates.py
===================================================================
--- grokproject/trunk/grokproject/templates.py 2010-03-09 16:55:53 UTC (rev 109877)
+++ grokproject/trunk/grokproject/templates.py 2010-03-09 21:59:31 UTC (rev 109878)
@@ -75,12 +75,6 @@
vars[var_name] = xml.sax.saxutils.quoteattr(vars[var_name])
vars['app_class_name'] = vars['project'].capitalize()
- create_zopectl = False
- if vars.get('zopectl','') == 'True':
- create_zopectl = True
- if create_zopectl:
- self._template_dir = 'template_zopectl'
-
# Handling the version.cfg file.
print "Downloading info about versions..."
version = vars.get('grokversion', 'current')
@@ -97,7 +91,7 @@
# Maybe add additional eggs...
vars['version_info_additions'] = extend_versions_cfg(
- vars['version_info_file_contents'], create_zopectl)
+ vars['version_info_file_contents'])
# Which grok version are we depending on?
version = required_grok_version(vars['version_info_file_contents'])
Modified: grokproject/trunk/grokproject/utils.py
===================================================================
--- grokproject/trunk/grokproject/utils.py 2010-03-09 16:55:53 UTC (rev 109877)
+++ grokproject/trunk/grokproject/utils.py 2010-03-09 21:59:31 UTC (rev 109878)
@@ -174,19 +174,15 @@
return line.split(' ')[-1]
-def extend_versions_cfg(versions_cfg, for_zopectl=False):
+def extend_versions_cfg(versions_cfg):
"""Add additional package versions for versions.cfg.
We only add eggs that are not already included in versions.cfg
fetched from the release info URL (usually grok.zope.org/releaseinfo).
"""
here = os.path.dirname(__file__)
- if for_zopectl:
- additional_eggs = open(
- os.path.join(here, 'ext_eggs_zctl.cfg'), 'rb').read()
- else:
- additional_eggs = open(
- os.path.join(here, 'ext_eggs_paster.cfg'), 'rb').read()
+ additional_eggs = open(
+ os.path.join(here, 'ext_eggs.cfg'), 'rb').read()
# Create a list of already pinned eggs...
pinned = list()
Modified: grokproject/trunk/tests.py
===================================================================
--- grokproject/trunk/tests.py 2010-03-09 16:55:53 UTC (rev 109877)
+++ grokproject/trunk/tests.py 2010-03-09 21:59:31 UTC (rev 109878)
@@ -124,7 +124,6 @@
tempdir = os.getenv('TEMP','/tmp')
DOCTEST_FILES='''
-tests_zopectl.txt
tests_paste.txt
tests_alternative_release_url.txt
'''.strip().split('\n')
Modified: grokproject/trunk/tests_alternative_release_url.txt
===================================================================
--- grokproject/trunk/tests_alternative_release_url.txt 2010-03-09 16:55:53 UTC (rev 109877)
+++ grokproject/trunk/tests_alternative_release_url.txt 2010-03-09 21:59:31 UTC (rev 109878)
@@ -85,62 +85,3 @@
Cleanup:
>>> rmdir(package_dir)
-
-The "zopectl" version of the template should behave similarly:
-
- >>> paster = current_dir + '/bin/paster'
- >>> paster_params = ('create -t grok --no-interactive -o'.split() +
- ... [testdir])
- >>> grok_params = ('grokexample user=a passwd=a run_buildout=false '
- ... 'zopectl=True grok_release_url=' + alt_url).split()
- >>> sh([paster] + paster_params + grok_params)
- ['/.../bin/paster', 'create', '-t', 'grok', '--no-interactive',
- '-o', ... 'grokexample', 'user=a', 'passwd=a', 'run_buildout=false',
- 'zopectl=True', 'grok_release_url=.../fake_release/']
- ...
-
-Let's check the contents::
-
- >>> package_dir = os.path.join(testdir, 'grokexample')
- >>> ls(package_dir)
- bootstrap.py
- buildout.cfg
- setup.py
- src
- versions.cfg
-
- >>> software_dir = os.path.join(package_dir, 'src', 'grokexample')
- >>> ls(software_dir)
- __init__.py
- app.py
- app.txt
- app_templates
- configure.zcml
- ftesting.zcml
- static
- tests.py
-
-Let's see if the information in our fake release URL was correctly propagated.
-
- >>> cat(package_dir, 'versions.cfg')
- # This file contains a list of versions of the various grok modules that
- # belong together.
- # It was downloaded from file://.../fake_release/grok-0.555.cfg
- # when this project was created.
- <BLANKLINE>
- [versions]
- grok = 0.555
- <BLANKLINE>
- ...
-
- >>> cat(package_dir, 'buildout.cfg')
- [buildout]
- ...
- [eggbasket]
- recipe = z3c.recipe.eggbasket
- eggs = grok
- url = file:///.../grok-eggs-0.555.tgz...
-
-Cleanup (remove this after tempdir is really fixed):
-
- >>> rmdir(testdir)
Deleted: grokproject/trunk/tests_zopectl.txt
===================================================================
--- grokproject/trunk/tests_zopectl.txt 2010-03-09 16:55:53 UTC (rev 109877)
+++ grokproject/trunk/tests_zopectl.txt 2010-03-09 21:59:31 UTC (rev 109878)
@@ -1,237 +0,0 @@
-Grokproject tests
-=================
-
-Go to a directory::
-
- >>> cd(tempdir)
-
-Check that the directory does not exist::
-
- >>> rmdir('grokexample')
-
-Create an empty eggs directory. So we make sure that we don't have to
-care for arbitrary eggs, that were installed in the user's environment
-before. If a file ``shorttests`` exists in this directory, we do not
-create a new dir but make only sure it exists and leave it untouched::
-
- >>> tempeggs = 'grokexample-eggs'
- >>> eggsdir = os.path.join(tempdir, tempeggs)
- >>> maybe_mkdir(eggsdir)
-
-Then use paster. Eggs are placed in our freshly created eggs directory::
-
- >>> paster = current_dir + '/bin/paster'
- >>> pasterparams = ('create -t grok grokexample user=a passwd=a '
- ... 'zopectl=True')
- >>> sh([paster] + pasterparams.split() +
- ... ['eggs_dir=%s' % eggsdir, '--no-interactive'])
- ['/.../bin/paster', 'create', '-t', 'grok', 'grokexample',
- 'user=a', 'passwd=a', 'zopectl=True', ...
- ...
-
-Let's check the contents::
-
- >>> package_dir = os.path.join(tempdir, 'grokexample')
- >>> ls(package_dir)
- .installed.cfg
- bin
- bootstrap.py
- buildout.cfg
- develop-eggs
- parts
- setup.py
- src
- versions.cfg
-
- >>> software_dir = os.path.join(package_dir, 'src', 'grokexample')
- >>> ls(software_dir)
- __init__.py
- app.py
- app.txt
- app_templates
- configure.zcml
- ftesting.zcml
- static
- tests.py
-
- >>> bin_dir = os.path.join(package_dir, 'bin')
- >>> ls(bin_dir)
- buildout...
- i18nextract...
- i18nmergeall...
- i18nstats...
- test...
- zopectl...
- zpasswd...
-
-The eggs dir is filled now::
-
- >>> len(os.listdir(eggsdir)) > 100
- True
-
-The password given is stored SHA1 encoded::
-
- >>> buildout_cfg = os.path.join(package_dir, 'buildout.cfg')
- >>> print open(buildout_cfg, 'rb').read()
- [buildout]
- ...
- <principal id="zope.manager"
- title="Manager"
- login="a"
- password_manager="SHA1"
- password="...86f7e437faa5a7fce15d1ddcb9eaeaea377667b8"
- />
- ...
-
-
-Using i18n scripts
-------------------
-
-We can create a POT file out of our sources using the freshly
-generated `i18nextract`::
-
- >>> cmd = os.path.join(bin_dir, 'i18nextract')
- >>> output = read_sh(cmd)
- >>> print output
- domain:...'grokexample'
- ...
- output: '...grokexample.pot'
-
-The .pot file contains no specific entries right now. So let's add a
-source file with translatable content::
-
- >>> source = """
- ... from zope.i18nmessageid import MessageFactory
- ... _ = MessageFactory('grokexample')
- ...
- ... class SomeClassWithI18nableContent(object):
- ... title = _(u'mytitle')
- ... description = _(u'description')
- ... name = _(u'name')
- ... """
- >>> source_path = os.path.join(software_dir, 'translatable.py')
- >>> open(source_path, 'w').write(source)
-
-And rerun `bin/i18nextract`::
-
- >>> cmd = os.path.join(bin_dir, 'i18nextract')
- >>> output = read_sh(cmd)
-
-The translatable strings now appear in the generated .pot file::
-
- >>> pot_file = os.path.join(software_dir, 'locales', 'grokexample.pot')
- >>> print open(pot_file, 'r').read()
- ####...
- #: src/grokexample/translatable.py:6
- msgid "mytitle"
- msgstr ""
- <BLANKLINE>
- #: src/grokexample/translatable.py:7
- msgid "description"
- msgstr ""
- <BLANKLINE>
- #: src/grokexample/translatable.py:8
- msgid "name"
- msgstr ""
-
-Let's now create a translation for that (tiny) set of messages::
-
- >>> trans_dir_de = os.path.join(software_dir, 'locales', 'de',
- ... 'LC_MESSAGES')
- >>> os.makedirs(trans_dir_de)
-
-In this directory we create a copy of the original .pot file::
-
- >>> po_file_path = os.path.join(trans_dir_de, 'grokexample.po')
- >>> po_file = open(pot_file, 'r').read()
-
-We modify the translation to give some more interesting results::
-
- >>> po_file = po_file.replace('translatable.py:6\n',
- ... 'translatable.py:6\n#, fuzzy\n')
- >>> po_file = po_file.replace('"mytitle"\nmsgstr ""',
- ... '"mytitle"\nmsgstr "Mein Titel"')
- >>> po_file = po_file.replace('"name"\nmsgstr ""',
- ... '"name"\nmsgstr "Name"')
- >>> open(po_file_path, 'wb').write(po_file)
-
-We can merge all translations with bin/i18nmergeall::
-
- >>> cmd = os.path.join(bin_dir, 'i18nmergeall')
- >>> output = read_sh(cmd).split('\n')
- >>> print output[1]
- Merging language "de", domain "grokexample"
-
-We can see the status of translations calling bin/i18nstats::
-
- >>> cmd = os.path.join(bin_dir, 'i18nstats')
- >>> output = read_sh(cmd)
- >>> print output
- Language Total Done Not Done Fuzzy Done %
- ==========================================================
- de 3 1 1 1 33.33 %
-
-
-Using the generated `test` script
----------------------------------
-
-We can run tests::
-
- >>> cmd = os.path.join(bin_dir, 'test')
- >>> output = read_sh(cmd)
- >>> print output
- Running tests at level 1
- Running grokexample.FunctionalLayer tests:
- Set up grokexample.FunctionalLayer in ... seconds.
- Running:
- ...
- Ran 3 tests with 0 failures and 0 errors in ... seconds.
- Tearing down left over layers:
- Tear down grokexample.FunctionalLayer ... not supported
-
-Using the generated `buildout` script
--------------------------------------
-
-We can call the `buildout` script of the freshly generated
-project. For this to work, we have to switch to the project directory
-first::
-
- >>> cd(package_dir)
- >>> cmd = os.path.join(bin_dir, 'buildout')
- >>> output = read_sh(cmd)
- >>> print output
- Develop: ...
- Updating eggbasket.
- Updating app.
- Updating data.
- Updating zopectl.
- Updating i18n.
- i18n: setting up i18n tools
- Updating test.
- Updating zpasswd.
- <BLANKLINE>
-
-
-Using the generated `bootstrap` script
---------------------------------------
-
-Generated grokprojects come with their own `bootstrap.py` script, that
-makes it easier to distribute projects. As a normal Python module it
-has to be called with a Python interpreter::
-
- >>> import sys
- >>> cmd_arg = os.path.join(package_dir, 'bootstrap.py')
- >>> output = "OUTPUT:\n" + read_sh([sys.executable, cmd_arg])
- >>> print output
- OUTPUT:
- ...
- Installing 'z3c.recipe.eggbasket'.
- ...
- Now you can run 'bin/buildout'
-
-
-Clean up::
-
- >>> cd(tempdir)
- >>> rmdir('grokexample')
- >>> maybe_rmdir(eggsdir)
More information about the checkins
mailing list