[Checkins] SVN: grokproject/trunk/ Moved all fanstatic features to the feature branch in order to make way for 2.3 release.

Jan-Jaap Driessen jdriessen at thehealthagency.com
Mon Jan 10 04:32:59 EST 2011


Log message for revision 119463:
  Moved all fanstatic features to the feature branch in order to make way for 2.3 release.

Changed:
  U   grokproject/trunk/grokproject/template/buildout.cfg_tmpl
  U   grokproject/trunk/grokproject/template/etc/debug.ini.in_tmpl
  U   grokproject/trunk/grokproject/template/etc/deploy.ini.in_tmpl
  U   grokproject/trunk/grokproject/template/etc/zope.conf.in_tmpl
  U   grokproject/trunk/grokproject/template/setup.py_tmpl
  U   grokproject/trunk/grokproject/template/src/+package+/app.py_tmpl
  U   grokproject/trunk/grokproject/template/src/+package+/app.txt_tmpl
  U   grokproject/trunk/grokproject/template/src/+package+/app_templates/index.pt_tmpl
  D   grokproject/trunk/grokproject/template/src/+package+/resource.py_tmpl
  D   grokproject/trunk/grokproject/template/src/+package+/static/evencaveman.jpg
  D   grokproject/trunk/grokproject/template/src/+package+/static/style.css
  U   grokproject/trunk/grokproject/template/src/+package+/tests.py_tmpl
  U   grokproject/trunk/grokproject/templates.py
  U   grokproject/trunk/grokproject/utils.py
  U   grokproject/trunk/setup.py
  U   grokproject/trunk/tests_paste.txt

-=-
Modified: grokproject/trunk/grokproject/template/buildout.cfg_tmpl
===================================================================
--- grokproject/trunk/grokproject/template/buildout.cfg_tmpl	2011-01-10 09:16:08 UTC (rev 119462)
+++ grokproject/trunk/grokproject/template/buildout.cfg_tmpl	2011-01-10 09:32:59 UTC (rev 119463)
@@ -1,22 +1,20 @@
 [buildout]
 extends = ${version_info_url}
-# XXX do not use groktoolkit trunk for release.
-extends = http://svn.zope.org/repos/main/groktoolkit/trunk/grok.cfg
 extends-cache = extends-cache
+find-links = ${find_links_url}
 include-site-packages = ${include_site_packages}
 develop = .
 unzip = true
 parts =
     app
     daemon
-    paster_ini_debug
-    paster_ini_deploy
+    debug_ini
+    deploy_ini
     i18n
     mkdirs
     site_zcml
     test
-    zope_conf_debug
-    zope_conf_deploy
+    zope_conf
     zpasswd
     interactive_debugger
 # For backward compatibility, telling buildout not to throw away
@@ -30,19 +28,11 @@
 # unless you specify an eggs-directory option here.
 ${eggs_dir}
 extensions += buildout.dumppickedversions
-             mr.developer
-always-checkout = true
-auto-checkout = grok
-                grokui.admin
-                grokui.base
 
-[sources]
-grok = svn http://svn.zope.org/repos/main/grok/trunk
-
 [versions]
 # Override versions here.
 # This version pin can be removed after the next groktoolkit release.
-grokcore.view = 2.3
+collective.recipe.scriptgen = 0.2
 
 [app]
 recipe = z3c.recipe.scripts
@@ -60,14 +50,14 @@
     --daemon --pid-file=$${buildout:directory}/var/daemon.pid
     --log-file=$${buildout:directory}/log/daemon.log
 
-[paster_ini_debug]
+[debug_ini]
 recipe = collective.recipe.template
 input = etc/debug.ini.in
 output = $${buildout:parts-directory}/etc/debug.ini
 host = 127.0.0.1
 port = 8080
 
-[paster_ini_deploy]
+[deploy_ini]
 recipe = collective.recipe.template
 input = etc/deploy.ini.in
 output = $${buildout:parts-directory}/etc/deploy.ini
@@ -101,25 +91,15 @@
 defaults = ['-v']
 
 [zope_conf]
+recipe = collective.recipe.template
 input = etc/zope.conf.in
+output = $${buildout:parts-directory}/etc/zope.conf
 filestorage = $${buildout:directory}/var/filestorage
 blobstorage = $${buildout:directory}/var/blobstorage
 logfiles = $${buildout:directory}/var/log
-# 'extra' is copied verbatim. Use it for product config sections and so.
 extra =
+# 'extra' is copied verbatim. Use it for product config sections and so.
 
-[zope_conf_debug]
-<= zope_conf
-recipe = collective.recipe.template
-output = $${buildout:parts-directory}/etc/zope.debug.conf
-devmode = on
-
-[zope_conf_deploy]
-<= zope_conf
-recipe = collective.recipe.template
-output = $${buildout:parts-directory}/etc/zope.deploy.conf
-devmode = off
-
 # This section is named so that the zpasswd utility is
 # called `zpasswd`
 [zpasswd]
@@ -135,7 +115,7 @@
 eggs = ${egg}
 entry-points =
   interactive_debugger=grokcore.startup.startup:interactive_debug_prompt
-arguments = zope_conf="$${zope_conf_debug:output}"
+arguments = zope_conf="$${zope_conf:output}"
 
 # The [data] and [log] parts are still in here to instruct buildout to not
 # unintentionally throw away the parts/data and parts/log subdirectories

Modified: grokproject/trunk/grokproject/template/etc/debug.ini.in_tmpl
===================================================================
--- grokproject/trunk/grokproject/template/etc/debug.ini.in_tmpl	2011-01-10 09:16:08 UTC (rev 119462)
+++ grokproject/trunk/grokproject/template/etc/debug.ini.in_tmpl	2011-01-10 09:32:59 UTC (rev 119463)
@@ -1,5 +1,5 @@
 [DEFAULT]
-zope_conf = %(here)s/zope.debug.conf
+zope_conf = %(here)s/zope.conf
 
 [server:main]
 use = egg:Paste#http
@@ -7,7 +7,7 @@
 port = $${:port}
 
 [pipeline:main]
-pipeline = accesslogging evalexception fanstatic grok
+pipeline = accesslogging evalexception grok
 
 [filter:accesslogging]
 use = egg:Paste#translogger
@@ -15,11 +15,6 @@
 [filter:evalexception]
 use = egg:z3c.evalexception#ajax
 
-[filter:fanstatic]
-use = egg:fanstatic#fanstatic
-devmode = $${zope_conf_debug:devmode}
-hashing = true
-
 [app:grok]
 use = egg:grokcore.startup#debug
 exempt-exceptions = zope.security.interfaces.IUnauthorized

Modified: grokproject/trunk/grokproject/template/etc/deploy.ini.in_tmpl
===================================================================
--- grokproject/trunk/grokproject/template/etc/deploy.ini.in_tmpl	2011-01-10 09:16:08 UTC (rev 119462)
+++ grokproject/trunk/grokproject/template/etc/deploy.ini.in_tmpl	2011-01-10 09:32:59 UTC (rev 119463)
@@ -1,5 +1,5 @@
 [DEFAULT]
-zope_conf = %(here)s/zope.deploy.conf
+zope_conf = %(here)s/zope.conf
 
 [server:main]
 use = egg:Paste#http
@@ -7,26 +7,15 @@
 port = $${:port}
 
 [pipeline:main]
-pipeline = accesslogging gzip fanstatic grok
+pipeline = gzip grok
 
-[filter:accesslogging]
-use = egg:Paste#translogger
+[app:grok]
+use = egg:grokcore.startup
 setup_console_handler = False
 
 [filter:gzip]
 use = egg:Paste#gzip
 
-[filter:fanstatic]
-use = egg:fanstatic#fanstatic
-devmode = $${zope_conf_deploy:devmode}
-bottom = true
-hashing = true
-mode = minified
-rollup = true
-
-[app:grok]
-use = egg:grokcore.startup
-
 # Logging configuration
 
 [loggers]

Modified: grokproject/trunk/grokproject/template/etc/zope.conf.in_tmpl
===================================================================
--- grokproject/trunk/grokproject/template/etc/zope.conf.in_tmpl	2011-01-10 09:16:08 UTC (rev 119462)
+++ grokproject/trunk/grokproject/template/etc/zope.conf.in_tmpl	2011-01-10 09:32:59 UTC (rev 119463)
@@ -31,7 +31,9 @@
 # logfiles are setup in the debug.ini and deploy.ini files.
 </eventlog>
 
-devmode $${devmode}
+# Comment this line to disable developer mode.  This should be done in
+# production
+devmode on
 
 # Extra configuration lines can be added to zope_conf's extra option. Put for
 # instance productconf sections in here.

Modified: grokproject/trunk/grokproject/template/setup.py_tmpl
===================================================================
--- grokproject/trunk/grokproject/template/setup.py_tmpl	2011-01-10 09:16:08 UTC (rev 119462)
+++ grokproject/trunk/grokproject/template/setup.py_tmpl	2011-01-10 09:32:59 UTC (rev 119463)
@@ -21,13 +21,8 @@
       install_requires=['setuptools',
                         'grok',
                         'grokui.admin',
-                        'fanstatic',
-                        'zope.fanstatic',
+                        'z3c.testsetup',
                         'grokcore.startup',${install_requires|nothing}
                         # Add extra requirements here
                         ],
-      entry_points={
-          'fanstatic.libraries': [
-              '${project_lowercase} = ${project_lowercase}.resource:library',
-          ]
-      })
+      )

Modified: grokproject/trunk/grokproject/template/src/+package+/app.py_tmpl
===================================================================
--- grokproject/trunk/grokproject/template/src/+package+/app.py_tmpl	2011-01-10 09:16:08 UTC (rev 119462)
+++ grokproject/trunk/grokproject/template/src/+package+/app.py_tmpl	2011-01-10 09:32:59 UTC (rev 119463)
@@ -1,10 +1,7 @@
 import grok
 
-from ${package} import resource
-
 class ${app_class_name}(grok.Application, grok.Container):
     pass
 
 class Index(grok.View):
-    def update(self):
-        resource.style.need()
+    pass # see app_templates/index.pt

Modified: grokproject/trunk/grokproject/template/src/+package+/app.txt_tmpl
===================================================================
--- grokproject/trunk/grokproject/template/src/+package+/app.txt_tmpl	2011-01-10 09:16:08 UTC (rev 119462)
+++ grokproject/trunk/grokproject/template/src/+package+/app.txt_tmpl	2011-01-10 09:32:59 UTC (rev 119463)
@@ -1,6 +1,9 @@
 Do a functional doctest test on the app.
 ========================================
 
+.. :doctest:
+.. :layer: ${package}.tests.browser_layer
+
 Let's first create an instance of ${app_class_name} at the top level:
 
     >>> from ${package}.app import ${app_class_name}
@@ -29,14 +32,15 @@
     >>> print browser.contents
     <html>
     <head>
-    <link rel="stylesheet" type="text/css" href="http://localhost/fanstatic/grokexample/style.css" />
     <base href="http://localhost/app/@@index" />
+    <BLANKLINE>
     </head>
     <body>
       <h1>Congratulations!</h1>
+    <BLANKLINE>
       <p>Your Grok application is up and running.
       Edit <code>${package}/app_templates/index.pt</code> to change
       this page.</p>
-      <img src="http://localhost/fanstatic/${project_lowercase}/evencaveman.jpg" />
     </body>
     </html>
+    <BLANKLINE>

Modified: grokproject/trunk/grokproject/template/src/+package+/app_templates/index.pt_tmpl
===================================================================
--- grokproject/trunk/grokproject/template/src/+package+/app_templates/index.pt_tmpl	2011-01-10 09:16:08 UTC (rev 119462)
+++ grokproject/trunk/grokproject/template/src/+package+/app_templates/index.pt_tmpl	2011-01-10 09:32:59 UTC (rev 119463)
@@ -7,6 +7,5 @@
   <p>Your Grok application is up and running.
   Edit <code>${package}/app_templates/index.pt</code> to change
   this page.</p>
-  <img tal:attributes="src static/evencaveman.jpg"/>
 </body>
 </html>

Deleted: grokproject/trunk/grokproject/template/src/+package+/resource.py_tmpl
===================================================================
--- grokproject/trunk/grokproject/template/src/+package+/resource.py_tmpl	2011-01-10 09:16:08 UTC (rev 119462)
+++ grokproject/trunk/grokproject/template/src/+package+/resource.py_tmpl	2011-01-10 09:32:59 UTC (rev 119463)
@@ -1,5 +0,0 @@
-from fanstatic import Library, Resource
-
-library = Library('${project_lowercase}', 'static')
-
-style = Resource(library, 'style.css')

Deleted: grokproject/trunk/grokproject/template/src/+package+/static/evencaveman.jpg
===================================================================
(Binary files differ)

Deleted: grokproject/trunk/grokproject/template/src/+package+/static/style.css
===================================================================
--- grokproject/trunk/grokproject/template/src/+package+/static/style.css	2011-01-10 09:16:08 UTC (rev 119462)
+++ grokproject/trunk/grokproject/template/src/+package+/static/style.css	2011-01-10 09:32:59 UTC (rev 119463)
@@ -1,4 +0,0 @@
-/* This is a silly style sheet solely used for demonstrating fanstatic. */
-body {
-  background-color: #eee;
-}

Modified: grokproject/trunk/grokproject/template/src/+package+/tests.py_tmpl
===================================================================
--- grokproject/trunk/grokproject/template/src/+package+/tests.py_tmpl	2011-01-10 09:16:08 UTC (rev 119462)
+++ grokproject/trunk/grokproject/template/src/+package+/tests.py_tmpl	2011-01-10 09:32:59 UTC (rev 119463)
@@ -1,22 +1,10 @@
-import unittest
-import doctest
+import os.path
+import z3c.testsetup
+from zope.app.wsgi.testlayer import BrowserLayer
 
-from zope.fanstatic.testing import ZopeFanstaticBrowserLayer
-
 import ${package}
 
-browser_layer = ZopeFanstaticBrowserLayer(${package})
+browser_layer = BrowserLayer(${package})
 
-def test_suite():
-    suite = unittest.TestSuite()
-
-    app_test = doctest.DocFileSuite('app.txt',
-        optionflags = (
-            doctest.ELLIPSIS +
-            doctest.NORMALIZE_WHITESPACE +
-            doctest.REPORT_NDIFF),
-        globs={'getRootFolder': browser_layer.getRootFolder})
-    app_test.layer = browser_layer
-
-    suite.addTest(app_test)
-    return suite
+test_suite = z3c.testsetup.register_all_tests(
+    '${package}', globs={'getRootFolder': browser_layer.getRootFolder})

Modified: grokproject/trunk/grokproject/templates.py
===================================================================
--- grokproject/trunk/grokproject/templates.py	2011-01-10 09:16:08 UTC (rev 119462)
+++ grokproject/trunk/grokproject/templates.py	2011-01-10 09:32:59 UTC (rev 119463)
@@ -72,7 +72,6 @@
             # Escape values that go in site.zcml.
             vars[var_name] = xml.sax.saxutils.quoteattr(vars[var_name])
         vars['app_class_name'] = vars['project'].capitalize()
-        vars['project_lowercase'] = vars['project'].lower()
 
         # Handling the version.cfg file.
         version_url = vars.get('version_url')
@@ -128,7 +127,7 @@
             sys.exit(1)
         except IOError, e:
             # Some serious problem: no connect to server...
-            print "Error: cannot download required %s" % url
+            print "Error: cannot download required %s" % version_info_url
             print "Server may be down.  Please try again later."
             sys.exit(1)
         return contents

Modified: grokproject/trunk/grokproject/utils.py
===================================================================
--- grokproject/trunk/grokproject/utils.py	2011-01-10 09:16:08 UTC (rev 119462)
+++ grokproject/trunk/grokproject/utils.py	2011-01-10 09:32:59 UTC (rev 119463)
@@ -1,11 +1,15 @@
+from base64 import urlsafe_b64encode
+from paste.script.templates import var
+from random import randint
 import subprocess
 import codecs
+import logging
 import os
+import pkg_resources
+import shutil
 import sys
-from base64 import urlsafe_b64encode
+import tempfile
 
-from paste.script.templates import var
-
 try:
     from hashlib import sha1
 except ImportError:

Modified: grokproject/trunk/setup.py
===================================================================
--- grokproject/trunk/setup.py	2011-01-10 09:16:08 UTC (rev 119462)
+++ grokproject/trunk/setup.py	2011-01-10 09:32:59 UTC (rev 119463)
@@ -36,9 +36,7 @@
     packages=find_packages(),
     include_package_data=True,
     zip_safe=False,
-    install_requires=[
-        'setuptools',
-        'PasteScript>=1.6'],
+    install_requires=['PasteScript>=1.6'],
     extras_require=dict(tests=['zope.testing',]),
     test_suite='tests.test_suite',
     entry_points={

Modified: grokproject/trunk/tests_paste.txt
===================================================================
--- grokproject/trunk/tests_paste.txt	2011-01-10 09:16:08 UTC (rev 119462)
+++ grokproject/trunk/tests_paste.txt	2011-01-10 09:32:59 UTC (rev 119463)
@@ -13,13 +13,13 @@
     >>> executable = [os.path.join(current_dir, 'bin', 'grokproject')]
     >>> opts = ['--user=a', '--passwd=a', '--eggs-dir=' + eggsdir]
     >>> version = [
-    ... '--version-url=http://grok.zope.org/releaseinfo/1.2.1/versions.cfg']
+    ... '--version-url=http://grok.zope.org/releaseinfo/1.2b/versions.cfg']
     >>> sh(executable + opts + version + ['GrokExample'])
     ['...grokproject',
      '--user=a',
      '--passwd=a',
      '--eggs-dir=...grokproject-test-eggs',
-     '--version-url=http://grok.zope.org/releaseinfo/1.2.1/versions.cfg',
+     '--version-url=http://grok.zope.org/releaseinfo/1.2b/versions.cfg',
      'GrokExample']...
     Creating directory '...bin'.
     Creating directory '...parts'.
@@ -31,19 +31,16 @@
     Generated interpreter '...python-console'.
     Installing daemon.
     Generated script '...daemon'.
-    Installing site_zcml.
-    Installing zope_conf_debug.
-    ...
-    Installing paster_ini_debug.
-    Installing zope_conf_deploy.
-    ...
-    Installing paster_ini_deploy.
+    Installing debug_ini.
+    Installing deploy_ini.
     Installing i18n.
     i18n: setting up i18n tools
     Generated script '...i18nextract'.
     Generated script '...i18nmergeall'.
     Generated script '...i18nstats'.
     Generated script '...i18ncompile'.
+    Installing site_zcml.
+    Installing zope_conf.
     Installing mkdirs.
     mkdirs: created path: ...var
     mkdirs: created path: ...filestorage
@@ -71,15 +68,15 @@
     >>> package_dir = os.path.join(testdir, 'GrokExample')
     >>> print open(os.path.join(package_dir, 'buildout.cfg')).read()
     [buildout]
-    extends = http://grok.zope.org/releaseinfo/1.2.1/versions.cfg
+    extends = http://grok.zope.org/releaseinfo/1.2b/versions.cfg
     extends-cache = extends-cache
+    find-links =
     include-site-packages = false
     develop = .
     ...
 
     >>> ls(package_dir)
     .installed.cfg
-    .mr.developer.cfg
     bin
     bootstrap.py
     buildout.cfg
@@ -100,7 +97,6 @@
     app_templates
     configure.zcml
     ftesting.zcml
-    resource.py
     static
     tests.py
 
@@ -108,7 +104,6 @@
     >>> ls(bin_dir)
     buildout
     daemon
-    develop
     i18ncompile
     i18nextract
     i18nmergeall
@@ -124,14 +119,11 @@
     debug.ini
     deploy.ini
     site.zcml
-    zope.debug.conf
-    zope.deploy.conf
+    zope.conf
 
-In the generated configuration files paths are set to local paths.
-We used a projectname with uppercase letters. This is respected by
-configuration files:
+In the generated configuration files paths are set to local paths:
 
-    >>> cat(etc_dir, 'zope.debug.conf')
+    >>> cat(etc_dir, 'zope.conf')
     # Identify the component configuration used to define the site:
     site-definition /.../GrokExample/parts/etc/site.zcml
     ...
@@ -143,13 +135,22 @@
 
 The extends-cache directive results in cached versions of the referenced
 buildout files to support offline building. We know what the filename of the
-cached versions file for 1.2.1 will look like:
+cached versions file for 1.2b will look like:
 
     >>> ls(os.path.join(package_dir, 'extends-cache'))
-    1db36734c0226e6f922ac9bb3361f6d8
-    286c4c832f552bec68fcac956a6be5c6
-    2a2cf1415ca2d47decad204083d1482c
+    0857a87803d0c8a371e867bd7d58a782
+    1cd99c06b44977edcb9281133f31007b
+    f74256c0d403a6bb45c38b9ce42c783c
 
+We used a projectname with uppercase letters. This is respected by
+configuration files:
+
+    >>> zope_conf = os.path.join(package_dir, 'parts', 'etc', 'zope.conf')
+    >>> print open(zope_conf, 'rb').read()
+    # Identify the component configuration used to define the site:
+    site-definition ...GrokExample/parts/etc/site.zcml
+    ...
+
 The password given is stored SSHA encoded:
 
     >>> site_zcml_in = os.path.join(package_dir, 'etc',
@@ -264,13 +265,13 @@
     >>> print 'Test:\n' + output
     Test...
     Running tests at level 1
-    Running grokexample.ZopeFanstaticBrowserLayer tests:
-      Set up grokexample.ZopeFanstaticBrowserLayer... in ... seconds.
+    Running grokexample.BrowserLayer tests:
+      Set up grokexample.BrowserLayer in ... seconds.
       Running:
-    .
-      Ran 1 tests with 0 failures and 0 errors in ... seconds.
+    ...
+      Ran 3 tests with 0 failures and 0 errors in ... seconds.
     Tearing down left over layers:
-      Tear down grokexample.ZopeFanstaticBrowserLayer in ... seconds.
+      Tear down grokexample.BrowserLayer in ... seconds.
     <BLANKLINE>
 
 Using the generated `buildout` script
@@ -283,19 +284,16 @@
     >>> cd(package_dir)
     >>> cmd = os.path.join(bin_dir, 'buildout')
     >>> output = read_sh(cmd)
-    >>> print 'Test\n', output
-    Test
-    ...
+    >>> print output
     Develop: ...
     Updating app.
     Updating daemon.
-    Updating site_zcml.
-    Updating zope_conf_debug.
-    Updating paster_ini_debug.
-    Updating zope_conf_deploy.
-    Updating paster_ini_deploy.
+    Updating debug_ini.
+    Updating deploy_ini.
     Updating i18n.
     i18n: setting up i18n tools
+    Updating site_zcml.
+    Updating zope_conf.
     Updating mkdirs.
     Updating test.
     Updating zpasswd.



More information about the checkins mailing list