[Checkins] SVN: grokui.quickstart/ initial checkin

Michael Haubenwallner michael at d2m.at
Thu May 28 06:02:50 EDT 2009


Log message for revision 100499:
  initial checkin

Changed:
  A   grokui.quickstart/
  A   grokui.quickstart/branches/
  A   grokui.quickstart/tags/
  A   grokui.quickstart/trunk/
  A   grokui.quickstart/trunk/.installed.cfg
  A   grokui.quickstart/trunk/CHANGES.txt
  A   grokui.quickstart/trunk/README.txt
  A   grokui.quickstart/trunk/bootstrap.py
  A   grokui.quickstart/trunk/buildout.cfg
  A   grokui.quickstart/trunk/setup.py
  A   grokui.quickstart/trunk/src/
  A   grokui.quickstart/trunk/src/grokui/
  A   grokui.quickstart/trunk/src/grokui/__init__.py
  A   grokui.quickstart/trunk/src/grokui/quickstart/
  A   grokui.quickstart/trunk/src/grokui/quickstart/__init__.py
  A   grokui.quickstart/trunk/src/grokui/quickstart/configure.zcml
  A   grokui.quickstart/trunk/src/grokui/quickstart/ftesting.zcml
  A   grokui.quickstart/trunk/src/grokui/quickstart/quickstart.py
  A   grokui.quickstart/trunk/src/grokui/quickstart/quickstart.txt
  A   grokui.quickstart/trunk/src/grokui/quickstart/quickstart_templates/
  A   grokui.quickstart/trunk/src/grokui/quickstart/quickstart_templates/quickstart.pt
  A   grokui.quickstart/trunk/src/grokui/quickstart/static/
  A   grokui.quickstart/trunk/src/grokui/quickstart/static/grok-logo-name.gif
  A   grokui.quickstart/trunk/src/grokui/quickstart/static/grok-relax5.gif
  A   grokui.quickstart/trunk/src/grokui/quickstart/tests.py

-=-
Added: grokui.quickstart/trunk/.installed.cfg
===================================================================
--- grokui.quickstart/trunk/.installed.cfg	                        (rev 0)
+++ grokui.quickstart/trunk/.installed.cfg	2009-05-28 10:02:49 UTC (rev 100499)
@@ -0,0 +1,21 @@
+[buildout]
+installed_develop_eggs = 
+parts = test
+
+[test]
+__buildout_installed__ = /home/d2m/svn.zope.org/main/grokui.quickstart/trunk/parts/test
+	/home/d2m/svn.zope.org/main/grokui.quickstart/trunk/bin/test
+__buildout_signature__ = zc.recipe.testrunner-1.0.0-py2.5.egg zc.recipe.egg-1.2.2-py2.5.egg setuptools-0.6c9-py2.5.egg zope.testing-3.6.0-py2.5.egg zc.buildout-1.2.1-py2.5.egg zc.buildout-1.2.1-py2.5.egg zope.interface-3.4.1-py2.5-linux-i686.egg
+_b = /home/d2m/svn.zope.org/main/grokui.quickstart/trunk/bin
+_d = /home/d2m/svn.zope.org/main/grokui.quickstart/trunk/develop-eggs
+_e = /home/d2m/.buildout/eggs_svn
+bin-directory = /home/d2m/svn.zope.org/main/grokui.quickstart/trunk/bin
+defaults = ['--tests-pattern', '^f?tests$', '-v']
+develop-eggs-directory = /home/d2m/svn.zope.org/main/grokui.quickstart/trunk/develop-eggs
+eggs = grokui.quickstart
+eggs-directory = /home/d2m/.buildout/eggs_svn
+executable = /home/d2m/svn.zope.org/main/grokui.quickstart/trunk/../../bin/python2.5
+find-links = http://download.zope.org/distribution/
+location = /home/d2m/svn.zope.org/main/grokui.quickstart/trunk/parts/test
+recipe = zc.recipe.testrunner
+script = /home/d2m/svn.zope.org/main/grokui.quickstart/trunk/bin/test

Added: grokui.quickstart/trunk/CHANGES.txt
===================================================================
--- grokui.quickstart/trunk/CHANGES.txt	                        (rev 0)
+++ grokui.quickstart/trunk/CHANGES.txt	2009-05-28 10:02:49 UTC (rev 100499)
@@ -0,0 +1,8 @@
+Changes
+=======
+
+0.1dev (unreleased)
+----------------
+
+* initial version
+

Added: grokui.quickstart/trunk/README.txt
===================================================================
--- grokui.quickstart/trunk/README.txt	                        (rev 0)
+++ grokui.quickstart/trunk/README.txt	2009-05-28 10:02:49 UTC (rev 100499)
@@ -0,0 +1,9 @@
+grokui.quickstart
+=================
+
+The quickstart view is registered as a default view ('index.html') for the ZODB
+root folder. It is accessed from the web as http://localhost:8080/
+
+The package registers a view for IRootFolder. This leads to a startup error if
+grokui.admin <= 0.3.2 is activated, as grokui.admin also registers such a
+default view.
\ No newline at end of file

Added: grokui.quickstart/trunk/bootstrap.py
===================================================================
--- grokui.quickstart/trunk/bootstrap.py	                        (rev 0)
+++ grokui.quickstart/trunk/bootstrap.py	2009-05-28 10:02:49 UTC (rev 100499)
@@ -0,0 +1,84 @@
+##############################################################################
+#
+# Copyright (c) 2006 Zope Corporation and Contributors.
+# All Rights Reserved.
+#
+# This software is subject to the provisions of the Zope Public License,
+# Version 2.1 (ZPL).  A copy of the ZPL should accompany this distribution.
+# THIS SOFTWARE IS PROVIDED "AS IS" AND ANY AND ALL EXPRESS OR IMPLIED
+# WARRANTIES ARE DISCLAIMED, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED
+# WARRANTIES OF TITLE, MERCHANTABILITY, AGAINST INFRINGEMENT, AND FITNESS
+# FOR A PARTICULAR PURPOSE.
+#
+##############################################################################
+"""Bootstrap a buildout-based project
+
+Simply run this script in a directory containing a buildout.cfg.
+The script accepts buildout command-line options, so you can
+use the -c option to specify an alternate configuration file.
+
+$Id: bootstrap.py 99574 2009-04-29 13:37:44Z tarek $
+"""
+
+import os, shutil, sys, tempfile, urllib2
+
+tmpeggs = tempfile.mkdtemp()
+
+is_jython = sys.platform.startswith('java')
+
+try:
+    import pkg_resources
+except ImportError:
+    ez = {}
+    exec urllib2.urlopen('http://peak.telecommunity.com/dist/ez_setup.py'
+                         ).read() in ez
+    ez['use_setuptools'](to_dir=tmpeggs, download_delay=0)
+
+    import pkg_resources
+
+if sys.platform == 'win32':
+    def quote(c):
+        if ' ' in c:
+            return '"%s"' % c # work around spawn lamosity on windows
+        else:
+            return c
+else:
+    def quote (c):
+        return c
+
+cmd = 'from setuptools.command.easy_install import main; main()'
+ws  = pkg_resources.working_set
+
+if len(sys.argv) > 2 and sys.argv[1] == '--version':
+    VERSION = ' == %s' % sys.argv[2]
+    args = sys.argv[3:] + ['bootstrap']
+else:
+    VERSION = ''
+    args = sys.argv[1:] + ['bootstrap']
+
+if is_jython:
+    import subprocess
+
+    assert subprocess.Popen([sys.executable] + ['-c', quote(cmd), '-mqNxd',
+           quote(tmpeggs), 'zc.buildout' + VERSION],
+           env=dict(os.environ,
+               PYTHONPATH=
+               ws.find(pkg_resources.Requirement.parse('setuptools')).location
+               ),
+           ).wait() == 0
+
+else:
+    assert os.spawnle(
+        os.P_WAIT, sys.executable, quote (sys.executable),
+        '-c', quote (cmd), '-mqNxd', quote (tmpeggs), 'zc.buildout' + VERSION,
+        dict(os.environ,
+            PYTHONPATH=
+            ws.find(pkg_resources.Requirement.parse('setuptools')).location
+            ),
+        ) == 0
+
+ws.add_entry(tmpeggs)
+ws.require('zc.buildout' + VERSION)
+import zc.buildout.buildout
+zc.buildout.buildout.main(args)
+shutil.rmtree(tmpeggs)

Added: grokui.quickstart/trunk/buildout.cfg
===================================================================
--- grokui.quickstart/trunk/buildout.cfg	                        (rev 0)
+++ grokui.quickstart/trunk/buildout.cfg	2009-05-28 10:02:49 UTC (rev 100499)
@@ -0,0 +1,10 @@
+[buildout]
+develop = .
+parts = test
+find-links = http://download.zope.org/distribution/
+newest = false
+
+[test]
+recipe = zc.recipe.testrunner
+eggs = grokui.quickstart
+defaults = ['--tests-pattern', '^f?tests$', '-v']

Added: grokui.quickstart/trunk/setup.py
===================================================================
--- grokui.quickstart/trunk/setup.py	                        (rev 0)
+++ grokui.quickstart/trunk/setup.py	2009-05-28 10:02:49 UTC (rev 100499)
@@ -0,0 +1,40 @@
+from setuptools import setup, find_packages
+import sys, os
+
+version = '0.1dev'
+
+long_description = (open('README.txt').read() +
+                    '\n\n' +
+                    open('CHANGES.txt').read())
+
+
+setup(name='grokui.quickstart',
+      version=version,
+      description="A Grok default view for the ZODB root folder",
+      long_description=long_description,
+      classifiers=['Development Status :: 3 - Alpha',
+                   'Environment :: Web Environment',
+                   'Intended Audience :: Developers',
+                   'License :: OSI Approved :: Zope Public License',
+                   'Programming Language :: Python',
+                   'Operating System :: OS Independent',
+                   'Topic :: Internet :: WWW/HTTP',
+                   ], 
+      keywords='grok',
+      author='Michael Haubenwallner',
+      author_email="grok-dev at zope.org",
+      url="http://svn.zope.org/grokui.quickstart",
+      license='ZPL',
+      package_dir={'': 'src'},
+      packages=find_packages('src'),
+      include_package_data=True,
+      zip_safe=False,
+      install_requires=['setuptools',
+                        'grok',
+          # -*- Extra requirements: -*-
+      ],
+      entry_points="""
+      # -*- Entry points: -*-
+      """,
+      )
+

Added: grokui.quickstart/trunk/src/grokui/__init__.py
===================================================================
--- grokui.quickstart/trunk/src/grokui/__init__.py	                        (rev 0)
+++ grokui.quickstart/trunk/src/grokui/__init__.py	2009-05-28 10:02:49 UTC (rev 100499)
@@ -0,0 +1,7 @@
+# namespace package boilerplate
+try:
+    __import__('pkg_resources').declare_namespace(__name__)
+except ImportError, e:
+    from pkgutil import extend_path
+    __path__ = extend_path(__path__, __name__)
+

Added: grokui.quickstart/trunk/src/grokui/quickstart/__init__.py
===================================================================
--- grokui.quickstart/trunk/src/grokui/quickstart/__init__.py	                        (rev 0)
+++ grokui.quickstart/trunk/src/grokui/quickstart/__init__.py	2009-05-28 10:02:49 UTC (rev 100499)
@@ -0,0 +1 @@
+# a package
\ No newline at end of file

Added: grokui.quickstart/trunk/src/grokui/quickstart/configure.zcml
===================================================================
--- grokui.quickstart/trunk/src/grokui/quickstart/configure.zcml	                        (rev 0)
+++ grokui.quickstart/trunk/src/grokui/quickstart/configure.zcml	2009-05-28 10:02:49 UTC (rev 100499)
@@ -0,0 +1,8 @@
+<configure    
+    xmlns="http://namespaces.zope.org/zope"
+    xmlns:grok="http://namespaces.zope.org/grok">
+
+  <include package="grok" />
+  <grok:grok package="." />
+
+</configure>

Added: grokui.quickstart/trunk/src/grokui/quickstart/ftesting.zcml
===================================================================
--- grokui.quickstart/trunk/src/grokui/quickstart/ftesting.zcml	                        (rev 0)
+++ grokui.quickstart/trunk/src/grokui/quickstart/ftesting.zcml	2009-05-28 10:02:49 UTC (rev 100499)
@@ -0,0 +1,37 @@
+<configure
+   xmlns="http://namespaces.zope.org/zope"
+   xmlns:grok="http://namespaces.zope.org/grok"
+   i18n_domain="grokui.quickstart"
+   package="grokui.quickstart"
+   >
+
+  <include package="grok" />
+  <grok:grok package="." />
+  <grok:grok package=".tests" />
+
+  <!-- Typical functional testing security setup -->
+  <securityPolicy
+      component="zope.app.securitypolicy.zopepolicy.ZopeSecurityPolicy"
+      />
+
+  <unauthenticatedPrincipal
+      id="zope.anybody"
+      title="Unauthenticated User"
+      />
+  <grant
+      permission="zope.View"
+      principal="zope.anybody"
+      />
+
+  <principal
+      id="zope.mgr"
+      title="Manager"
+      login="mgr"
+      password="mgrpw"
+      />
+
+  <role id="zope.Manager" title="Site Manager" />
+  <grantAll role="zope.Manager" />
+  <grant role="zope.Manager" principal="zope.mgr" />
+
+</configure>

Added: grokui.quickstart/trunk/src/grokui/quickstart/quickstart.py
===================================================================
--- grokui.quickstart/trunk/src/grokui/quickstart/quickstart.py	                        (rev 0)
+++ grokui.quickstart/trunk/src/grokui/quickstart/quickstart.py	2009-05-28 10:02:49 UTC (rev 100499)
@@ -0,0 +1,25 @@
+import pkg_resources
+
+import grok
+from zope.app.folder.interfaces import IRootFolder
+from zope.app.security.interfaces import IUnauthenticatedPrincipal
+
+class QuickStart(grok.View):
+    grok.context(IRootFolder)
+    grok.name('index.html')
+
+    def grok_version(self):
+        try:
+            version=pkg_resources.require('grok')[0].version
+        except:
+            version='undefined'
+        return version
+
+    def logged_in(self):
+        return not IUnauthenticatedPrincipal.providedBy(self.request.principal)
+
+    def available_apps(self):
+        apps=[]
+        for item in list(self.context.values()):
+            apps.append({'name':item.__name__,'url':self.url(item)})
+        return apps

Added: grokui.quickstart/trunk/src/grokui/quickstart/quickstart.txt
===================================================================
--- grokui.quickstart/trunk/src/grokui/quickstart/quickstart.txt	                        (rev 0)
+++ grokui.quickstart/trunk/src/grokui/quickstart/quickstart.txt	2009-05-28 10:02:49 UTC (rev 100499)
@@ -0,0 +1,32 @@
+Do a functional doctest test on the app.
+========================================
+
+:Test-Layer: functional
+
+   >>> from grokui.quickstart.quickstart import QuickStart
+
+
+Run tests in the testbrowser
+----------------------------
+
+The zope.testbrowser.browser module exposes a Browser class that
+simulates a web browser similar to Mozilla Firefox or IE.  We use that
+to test how our application behaves in a browser.  For more
+information, see http://pypi.python.org/pypi/zope.testbrowser.
+
+Create a browser and visit the instance you just created:
+
+   >>> from zope.testbrowser.testing import Browser
+   >>> browser = Browser()
+   >>> browser.open('http://localhost')
+
+Check some basic information about the page you visit:
+
+   >>> browser.url
+   'http://localhost'
+   >>> browser.headers.get('Status').upper()
+   '200 OK'
+   >>> 'Grok - Quickstart' in browser.contents
+   True
+   >>> 'Login' in browser.contents
+   True

Added: grokui.quickstart/trunk/src/grokui/quickstart/quickstart_templates/quickstart.pt
===================================================================
--- grokui.quickstart/trunk/src/grokui/quickstart/quickstart_templates/quickstart.pt	                        (rev 0)
+++ grokui.quickstart/trunk/src/grokui/quickstart/quickstart_templates/quickstart.pt	2009-05-28 10:02:49 UTC (rev 100499)
@@ -0,0 +1,78 @@
+<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd">
+<html>
+  <head>
+    <title>Grok - Quickstart</title>
+    <style type="text/css">
+    body {margin:0px;background-color:#DDDDDD;color:black;font-family:"Lucida Grande",Verdana,FreeSans,sans-serif;}
+    #header {background-color:#DDDDDD;min-height:120px;}
+    #logo {float:left;margin:23px;}
+    #version {padding-top:78px;}
+    #content {background-color:White;padding: 23px 0px 23px 170px;min-height:250px;}
+    #login {}
+    #manage {}
+    #logout {}
+    #footer {padding-left:46px;}
+    #footer dl {display:inline-block;vertical-align:top;width:19%;}
+    #footer dl dt {font-weight:bold;margin:0;padding:0;}
+    #footer dl dd {margin:0;padding:0;}
+    a {text-decoration:none;}
+    a:hover {background-color:#DDDDDD;color:black;}
+    #footer a:hover {background-color:white;color:black;}
+    </style>
+  </head>
+  <body>
+    <div id="header">
+      <div id="logo"><img tal:attributes="src static/grok-logo-name.gif" alt="Grok Logo" title="Grok Logo"></div>
+      <div id="version">You are running <b>Grok</b> release <b tal:content="view/grok_version" /></div>
+    </div>
+    <div id="content">
+      <div tal:condition="view/logged_in">
+        <div><b>Available applications</b></div>
+        <ul tal:condition="view/available_apps">
+          <li tal:repeat="app view/available_apps">
+            <a tal:attributes="href app/url"
+               tal:content="app/name" />
+          </li>
+        </ul>
+        <div tal:condition="not:view/available_apps">No apps available<br><br></div>
+      </div>
+      <div id="login" tal:condition="not:view/logged_in">&raquo; <a href="/@@login.html?nextURL=/applications">Login & manage applications</a></div>
+      <div id="manage" tal:condition="view/logged_in">&raquo; <a href="/applications">Manage applications</a></div>
+      <div id="logout" tal:condition="view/logged_in">&raquo; <a href="/@@logout.html?nextURL=/">Logout</a></div>
+    </div>
+    <div id="footer">
+      <dl>
+        <dt>Documention</dt>
+        <dd><a href="http://grok.zope.org/doc/current/">Official Docs</a></dd>
+        <dd><a href="http://grok.zope.org/documentation">Community Docs</a></dd>
+        <dd>
+          <form action="http://grok.zope.org/documentation/phc_search">
+            <input type="text" size="10" name="SearchableText">
+            <input type="submit" value="Search">
+          </form>
+        </dd>
+      </dl>
+      <dl>
+        <dt>Code</dt>
+        <dd><a href="http://svn.zope.org/grok/">SVN Repository</a></dd>
+        <dd><a href="http://grok.zope.org/about/download">Download</a></dd>
+        <dd><a href="http://pypi.python.org/pypi/grok">PyPI</a></dd>
+      </dl>
+      <dl>
+        <dt>Community</dt>
+        <dd><a href="irc://irc.freenode.net/#grok">IRC Channel</a></dd>
+        <dd><a href="http://mail.zope.org/mailman/listinfo/grok-dev">Mailing list</a></dd>
+      </dl>
+      <dl>
+        <dt>Links</dt>
+        <dd><a href="http://grok.zope.org">Grok Website</a></dd>
+        <dd><a href="http://wiki.zope.org/grok">Grok Wiki</a></dd>
+        <dd><a href="http://wiki.zope.org/zope3">Zope3 Wiki</a></dd>
+        <dd><a href="http://planetzope.org">PlanetZope</a></dd>
+      </dl>
+      <dl>
+        <dt><img tal:attributes="src static/grok-relax5.gif" alt="Grok relax" title="Grok relax"></dt>
+      </dl>
+    </div>
+  </body>
+</html>

Added: grokui.quickstart/trunk/src/grokui/quickstart/static/grok-logo-name.gif
===================================================================
(Binary files differ)


Property changes on: grokui.quickstart/trunk/src/grokui/quickstart/static/grok-logo-name.gif
___________________________________________________________________
Added: svn:mime-type
   + application/octet-stream

Added: grokui.quickstart/trunk/src/grokui/quickstart/static/grok-relax5.gif
===================================================================
(Binary files differ)


Property changes on: grokui.quickstart/trunk/src/grokui/quickstart/static/grok-relax5.gif
___________________________________________________________________
Added: svn:mime-type
   + application/octet-stream

Added: grokui.quickstart/trunk/src/grokui/quickstart/tests.py
===================================================================
--- grokui.quickstart/trunk/src/grokui/quickstart/tests.py	                        (rev 0)
+++ grokui.quickstart/trunk/src/grokui/quickstart/tests.py	2009-05-28 10:02:49 UTC (rev 100499)
@@ -0,0 +1,12 @@
+import os.path
+import z3c.testsetup
+import grokui.quickstart
+from zope.app.testing.functional import ZCMLLayer
+
+
+ftesting_zcml = os.path.join(
+    os.path.dirname(grokui.quickstart.__file__), 'ftesting.zcml')
+FunctionalLayer = ZCMLLayer(ftesting_zcml, __name__, 'FunctionalLayer',
+                            allow_teardown=True)
+
+test_suite = z3c.testsetup.register_all_tests('grokui.quickstart')



More information about the Checkins mailing list