[Checkins] SVN: grokproject/trunk/ Merge with branch 'janjaapdriessen-hurry.resource'.

Jan-Jaap Driessen jdriessen at thehealthagency.com
Sun Jan 2 18:33:48 EST 2011


Log message for revision 119274:
  Merge with branch 'janjaapdriessen-hurry.resource'.
  

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
  A   grokproject/trunk/grokproject/template/src/+package+/resource.py_tmpl
  A   grokproject/trunk/grokproject/template/src/+package+/static/evencaveman.jpg
  A   grokproject/trunk/grokproject/template/src/+package+/static/hello.js
  A   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-02 23:32:07 UTC (rev 119273)
+++ grokproject/trunk/grokproject/template/buildout.cfg_tmpl	2011-01-02 23:33:47 UTC (rev 119274)
@@ -1,20 +1,21 @@
 [buildout]
 extends = ${version_info_url}
+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
-    debug_ini
-    deploy_ini
+    paster_ini_debug
+    paster_ini_deploy
     i18n
     mkdirs
     site_zcml
     test
-    zope_conf
+    zope_conf_debug
+    zope_conf_deploy
     zpasswd
     interactive_debugger
 # For backward compatibility, telling buildout not to throw away
@@ -28,8 +29,32 @@
 # unless you specify an eggs-directory option here.
 ${eggs_dir}
 extensions += buildout.dumppickedversions
+             mr.developer
+always-checkout = true
+auto-checkout = fanstatic
+                zope.fanstatic
+                grokcore.view
+                grok
+                grokcore.site
+                grokcore.rest
+                grokcore.xmlrpc
+                grokcore.traverser
+                grokui.admin
+                grokui.base
 
+[sources]
+fanstatic = hg http://bitbucket.org/fanstatic/fanstatic
+zope.fanstatic = svn http://svn.zope.org/repos/main/zope.fanstatic/trunk
+grok = svn http://svn.zope.org/repos/main/grok/trunk
+grokcore.view = svn http://svn.zope.org/repos/main/grokcore.view/trunk
+grokcore.site = svn http://svn.zope.org/repos/main/grokcore.site/trunk
+grokcore.rest = svn http://svn.zope.org/repos/main/grokcore.rest/trunk
+grokcore.xmlrpc = svn http://svn.zope.org/repos/main/grokcore.xmlrpc/trunk
+grokcore.traverser = svn http://svn.zope.org/repos/main/grokcore.traverser/trunk
+
 [versions]
+WebOb = 1.0
+zope.app.wsgi = 3.10.0
 # Override versions here.
 # This version pin can be removed after the next groktoolkit release.
 collective.recipe.scriptgen = 0.2
@@ -50,14 +75,14 @@
     --daemon --pid-file=$${buildout:directory}/var/daemon.pid
     --log-file=$${buildout:directory}/log/daemon.log
 
-[debug_ini]
+[paster_ini_debug]
 recipe = collective.recipe.template
 input = etc/debug.ini.in
 output = $${buildout:parts-directory}/etc/debug.ini
 host = 127.0.0.1
 port = 8080
 
-[deploy_ini]
+[paster_ini_deploy]
 recipe = collective.recipe.template
 input = etc/deploy.ini.in
 output = $${buildout:parts-directory}/etc/deploy.ini
@@ -91,15 +116,25 @@
 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]
@@ -115,7 +150,7 @@
 eggs = ${egg}
 entry-points =
   interactive_debugger=grokcore.startup.startup:interactive_debug_prompt
-arguments = zope_conf="$${zope_conf:output}"
+arguments = zope_conf="$${zope_conf_debug: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-02 23:32:07 UTC (rev 119273)
+++ grokproject/trunk/grokproject/template/etc/debug.ini.in_tmpl	2011-01-02 23:33:47 UTC (rev 119274)
@@ -1,5 +1,5 @@
 [DEFAULT]
-zope_conf = %(here)s/zope.conf
+zope_conf = %(here)s/zope.debug.conf
 
 [server:main]
 use = egg:Paste#http
@@ -7,7 +7,7 @@
 port = $${:port}
 
 [pipeline:main]
-pipeline = accesslogging evalexception grok
+pipeline = accesslogging evalexception fanstatic grok
 
 [filter:accesslogging]
 use = egg:Paste#translogger
@@ -15,6 +15,11 @@
 [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-02 23:32:07 UTC (rev 119273)
+++ grokproject/trunk/grokproject/template/etc/deploy.ini.in_tmpl	2011-01-02 23:33:47 UTC (rev 119274)
@@ -1,5 +1,5 @@
 [DEFAULT]
-zope_conf = %(here)s/zope.conf
+zope_conf = %(here)s/zope.deploy.conf
 
 [server:main]
 use = egg:Paste#http
@@ -7,14 +7,25 @@
 port = $${:port}
 
 [pipeline:main]
-pipeline = gzip grok
+pipeline = accesslogging gzip fanstatic grok
 
-[app:grok]
-use = egg:grokcore.startup
+[filter:accesslogging]
+use = egg:Paste#translogger
 
 [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-02 23:32:07 UTC (rev 119273)
+++ grokproject/trunk/grokproject/template/etc/zope.conf.in_tmpl	2011-01-02 23:33:47 UTC (rev 119274)
@@ -31,9 +31,7 @@
 # logfiles are setup in the debug.ini and deploy.ini files.
 </eventlog>
 
-# Comment this line to disable developer mode.  This should be done in
-# production
-devmode on
+devmode $${devmode}
 
 # 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-02 23:32:07 UTC (rev 119273)
+++ grokproject/trunk/grokproject/template/setup.py_tmpl	2011-01-02 23:33:47 UTC (rev 119274)
@@ -22,7 +22,13 @@
                         'grok',
                         'grokui.admin',
                         'z3c.testsetup',
+                        'fanstatic',
+                        'zope.fanstatic',
                         '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-02 23:32:07 UTC (rev 119273)
+++ grokproject/trunk/grokproject/template/src/+package+/app.py_tmpl	2011-01-02 23:33:47 UTC (rev 119274)
@@ -1,7 +1,10 @@
 import grok
 
+from ${package} import resource
+
 class ${app_class_name}(grok.Application, grok.Container):
     pass
 
 class Index(grok.View):
-    pass # see app_templates/index.pt
+    # see app_templates/index.pt
+    pass

Modified: grokproject/trunk/grokproject/template/src/+package+/app.txt_tmpl
===================================================================
--- grokproject/trunk/grokproject/template/src/+package+/app.txt_tmpl	2011-01-02 23:32:07 UTC (rev 119273)
+++ grokproject/trunk/grokproject/template/src/+package+/app.txt_tmpl	2011-01-02 23:33:47 UTC (rev 119274)
@@ -32,6 +32,10 @@
     >>> print browser.contents
     <html>
     <head>
+      <link rel="stylesheet" type="text/css"
+            href="http://localhost/fanstatic/foo/style.css" />
+      <script type="text/javascript"
+              src="http://localhost/fanstatic/foo/hello.js"></script>
     <base href="http://localhost/app/@@index" />
     <BLANKLINE>
     </head>
@@ -41,6 +45,7 @@
       <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/foo/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-02 23:32:07 UTC (rev 119273)
+++ grokproject/trunk/grokproject/template/src/+package+/app_templates/index.pt_tmpl	2011-01-02 23:33:47 UTC (rev 119274)
@@ -7,5 +7,7 @@
   <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>

Copied: grokproject/trunk/grokproject/template/src/+package+/resource.py_tmpl (from rev 119272, grokproject/branches/janjaapdriessen-hurry.resource/grokproject/template/src/+package+/resource.py_tmpl)
===================================================================
--- grokproject/trunk/grokproject/template/src/+package+/resource.py_tmpl	                        (rev 0)
+++ grokproject/trunk/grokproject/template/src/+package+/resource.py_tmpl	2011-01-02 23:33:47 UTC (rev 119274)
@@ -0,0 +1,7 @@
+from fanstatic import Library, Resource
+
+library = Library('${project_lowercase}', 'static')
+
+style = Resource(library, 'style.css')
+
+hello = Resource(library, 'hello.js')

Copied: grokproject/trunk/grokproject/template/src/+package+/static/evencaveman.jpg (from rev 119272, grokproject/branches/janjaapdriessen-hurry.resource/grokproject/template/src/+package+/static/evencaveman.jpg)
===================================================================
(Binary files differ)

Copied: grokproject/trunk/grokproject/template/src/+package+/static/hello.js (from rev 119272, grokproject/branches/janjaapdriessen-hurry.resource/grokproject/template/src/+package+/static/hello.js)
===================================================================
--- grokproject/trunk/grokproject/template/src/+package+/static/hello.js	                        (rev 0)
+++ grokproject/trunk/grokproject/template/src/+package+/static/hello.js	2011-01-02 23:33:47 UTC (rev 119274)
@@ -0,0 +1 @@
+window.alert('hello from javascript');

Copied: grokproject/trunk/grokproject/template/src/+package+/static/style.css (from rev 119272, grokproject/branches/janjaapdriessen-hurry.resource/grokproject/template/src/+package+/static/style.css)
===================================================================
--- grokproject/trunk/grokproject/template/src/+package+/static/style.css	                        (rev 0)
+++ grokproject/trunk/grokproject/template/src/+package+/static/style.css	2011-01-02 23:33:47 UTC (rev 119274)
@@ -0,0 +1,3 @@
+body {
+  color: #f00;
+}

Modified: grokproject/trunk/grokproject/template/src/+package+/tests.py_tmpl
===================================================================
--- grokproject/trunk/grokproject/template/src/+package+/tests.py_tmpl	2011-01-02 23:32:07 UTC (rev 119273)
+++ grokproject/trunk/grokproject/template/src/+package+/tests.py_tmpl	2011-01-02 23:33:47 UTC (rev 119274)
@@ -1,10 +1,15 @@
 import os.path
 import z3c.testsetup
 from zope.app.wsgi.testlayer import BrowserLayer
+import fanstatic
 
 import ${package}
 
-browser_layer = BrowserLayer(${package})
+class FanstaticLayer(BrowserLayer):
+    def setup_middleware(self, app):
+        return fanstatic.Fanstatic(app)
 
+browser_layer = FanstaticLayer(${package})
+
 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-02 23:32:07 UTC (rev 119273)
+++ grokproject/trunk/grokproject/templates.py	2011-01-02 23:33:47 UTC (rev 119274)
@@ -72,6 +72,7 @@
             # 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')
@@ -127,7 +128,7 @@
             sys.exit(1)
         except IOError, e:
             # Some serious problem: no connect to server...
-            print "Error: cannot download required %s" % version_info_url
+            print "Error: cannot download required %s" % 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-02 23:32:07 UTC (rev 119273)
+++ grokproject/trunk/grokproject/utils.py	2011-01-02 23:33:47 UTC (rev 119274)
@@ -1,15 +1,11 @@
-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
-import tempfile
+from base64 import urlsafe_b64encode
 
+from paste.script.templates import var
+
 try:
     from hashlib import sha1
 except ImportError:

Modified: grokproject/trunk/setup.py
===================================================================
--- grokproject/trunk/setup.py	2011-01-02 23:32:07 UTC (rev 119273)
+++ grokproject/trunk/setup.py	2011-01-02 23:33:47 UTC (rev 119274)
@@ -36,7 +36,9 @@
     packages=find_packages(),
     include_package_data=True,
     zip_safe=False,
-    install_requires=['PasteScript>=1.6'],
+    install_requires=[
+        'setuptools',
+        '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-02 23:32:07 UTC (rev 119273)
+++ grokproject/trunk/tests_paste.txt	2011-01-02 23:33:47 UTC (rev 119274)
@@ -31,16 +31,19 @@
     Generated interpreter '...python-console'.
     Installing daemon.
     Generated script '...daemon'.
-    Installing debug_ini.
-    Installing deploy_ini.
+    Installing site_zcml.
+    Installing zope_conf_debug.
+    ...
+    Installing paster_ini_debug.
+    Installing zope_conf_deploy.
+    ...
+    Installing paster_ini_deploy.
     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
@@ -70,13 +73,13 @@
     [buildout]
     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
@@ -95,8 +98,10 @@
     app.py
     app.txt
     app_templates
+    browser
     configure.zcml
     ftesting.zcml
+    resource.py
     static
     tests.py
 
@@ -104,6 +109,7 @@
     >>> ls(bin_dir)
     buildout
     daemon
+    develop
     i18ncompile
     i18nextract
     i18nmergeall
@@ -119,11 +125,14 @@
     debug.ini
     deploy.ini
     site.zcml
-    zope.conf
+    zope.debug.conf
+    zope.deploy.conf
 
-In the generated configuration files paths are set to local paths:
+In the generated configuration files paths are set to local paths.
+We used a projectname with uppercase letters. This is respected by
+configuration files:
 
-    >>> cat(etc_dir, 'zope.conf')
+    >>> cat(etc_dir, 'zope.debug.conf')
     # Identify the component configuration used to define the site:
     site-definition /.../GrokExample/parts/etc/site.zcml
     ...
@@ -142,15 +151,6 @@
     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',
@@ -265,13 +265,13 @@
     >>> print 'Test:\n' + output
     Test...
     Running tests at level 1
-    Running grokexample.BrowserLayer tests:
-      Set up grokexample.BrowserLayer in ... seconds.
+    Running grokexample.FanstaticLayer tests:
+      Set up grokexample.FanstaticLayer in ... seconds.
       Running:
     ...
       Ran 3 tests with 0 failures and 0 errors in ... seconds.
     Tearing down left over layers:
-      Tear down grokexample.BrowserLayer in ... seconds.
+      Tear down grokexample.FanstaticLayer in ... seconds.
     <BLANKLINE>
 
 Using the generated `buildout` script
@@ -284,16 +284,19 @@
     >>> cd(package_dir)
     >>> cmd = os.path.join(bin_dir, 'buildout')
     >>> output = read_sh(cmd)
-    >>> print output
+    >>> print 'Test\n', output
+    Test
+    ...
     Develop: ...
     Updating app.
     Updating daemon.
-    Updating debug_ini.
-    Updating deploy_ini.
+    Updating site_zcml.
+    Updating zope_conf_debug.
+    Updating paster_ini_debug.
+    Updating zope_conf_deploy.
+    Updating paster_ini_deploy.
     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