[Checkins] SVN: grokproject/trunk/ Initial import of grokproject,
the script that creates a project area for your
Philipp von Weitershausen
philikon at philikon.de
Wed Jan 10 11:12:46 EST 2007
Log message for revision 71868:
Initial import of grokproject, the script that creates a project area for your
grok applications with just one command.
Changed:
A grokproject/trunk/README.txt
A grokproject/trunk/TODO.txt
A grokproject/trunk/setup.py
A grokproject/trunk/src/
A grokproject/trunk/src/grokproject/
A grokproject/trunk/src/grokproject/__init__.py
A grokproject/trunk/src/grokproject/template/
A grokproject/trunk/src/grokproject/template/buildout.cfg_tmpl
A grokproject/trunk/src/grokproject/template/setup.py_tmpl
A grokproject/trunk/src/grokproject/template/src/
A grokproject/trunk/src/grokproject/template/src/+package+/
A grokproject/trunk/src/grokproject/template/src/+package+/__init__.py
-=-
Added: grokproject/trunk/README.txt
===================================================================
--- grokproject/trunk/README.txt 2007-01-10 16:08:50 UTC (rev 71867)
+++ grokproject/trunk/README.txt 2007-01-10 16:12:44 UTC (rev 71868)
@@ -0,0 +1,19 @@
+grokproject provides an easy way to get started with a grok web
+application. Simply install ``grokproject``::
+
+ $ easy_install grokproject
+
+and run the ``grokproject`` script with the name of the project you'd
+like to create as an argument::
+
+ $ grokproject MammothHerd
+ ... many lines of output here
+
+This will not only create a project area for you to work in, it will
+also download and install grok and Zope 3 (the application server grok
+is built on).
+
+After the project area has been created successfully, you will find an
+empty Python package in the ``src`` directory in which you can place
+the code for your web application. To start the Zope server, execute
+``parts/instance/bin/runzope``.
Property changes on: grokproject/trunk/README.txt
___________________________________________________________________
Name: svn:eol-style
+ native
Added: grokproject/trunk/TODO.txt
===================================================================
--- grokproject/trunk/TODO.txt 2007-01-10 16:08:50 UTC (rev 71867)
+++ grokproject/trunk/TODO.txt 2007-01-10 16:12:44 UTC (rev 71868)
@@ -0,0 +1,11 @@
+* get a better zope3instance recipe that places a startup script in
+ the top-level bin directory (so you won't have to reach into
+ parts/instance/bin)
+
+* pre-install a <grok:grok package="${package}" /> slug in the
+ instance so no ZCML is required.
+
+* pad out example package a bit (perhaps create a few initial files
+ that are typical for grok apps)
+
+* silence buildout output and be more informative on the other hand
Property changes on: grokproject/trunk/TODO.txt
___________________________________________________________________
Name: svn:eol-style
+ native
Added: grokproject/trunk/setup.py
===================================================================
--- grokproject/trunk/setup.py 2007-01-10 16:08:50 UTC (rev 71867)
+++ grokproject/trunk/setup.py 2007-01-10 16:12:44 UTC (rev 71868)
@@ -0,0 +1,25 @@
+from setuptools import setup, find_packages
+
+setup(
+ name='grokproject',
+ version='0.1',
+ author='Grok Team',
+ author_email='grok-dev at zope.org',
+ url='https://launchpad.net/grok',
+ download_url='svn://svn.zope.org/repos/main/grok/trunk#egg=grok-dev',
+ description='Script that sets up a grok project directory, installs Zope 3 and grok and creates a template for a grok application.',
+ long_description=open('README.txt').read(),
+ license='ZPL',
+
+ package_dir = {'': 'src'},
+ packages=find_packages('src'),
+ include_package_data=True,
+ zip_safe=False,
+ install_requires=['PasteScript'],
+ entry_points="""
+ [console_scripts]
+ grokproject = grokproject:main
+ [paste.paster_create_template]
+ grokproject = grokproject:GrokProject
+ """,
+)
Property changes on: grokproject/trunk/setup.py
___________________________________________________________________
Name: svn:eol-style
+ native
Added: grokproject/trunk/src/grokproject/__init__.py
===================================================================
--- grokproject/trunk/src/grokproject/__init__.py 2007-01-10 16:08:50 UTC (rev 71867)
+++ grokproject/trunk/src/grokproject/__init__.py 2007-01-10 16:12:44 UTC (rev 71868)
@@ -0,0 +1,40 @@
+import pkg_resources
+pkg_resources.require('PasteScript')
+
+from paste.script import templates
+from paste.script.templates import var
+
+class GrokProject(templates.Template):
+ _template_dir = 'template'
+ summary = "A grok project"
+ required_templates = []
+
+ vars = [
+ # TODO required parameters
+ var('user', 'Name of an initial administrator user'),
+ var('passwd', 'Password for the initial administrator user'),
+ ]
+
+def main():
+ import sys
+ import os.path
+ from paste.script import command
+
+ # create sandbox using paste.script
+ project = sys.argv[1] # TODO parse arguments properly
+ commands = command.get_commands()
+ command = commands['create'].load()
+ runner = command('create')
+ exit_code = runner.run(['-t', 'grokproject', project])
+ # TODO exit_code
+
+ # bootstrap the buildout
+ os.chdir(project)
+ bootstrap_py = os.path.join(os.getcwd(), 'bootstrap', 'bootstrap.py')
+ assert os.spawnle(os.P_WAIT, sys.executable, sys.executable,
+ bootstrap_py, os.environ) == 0
+
+ # run the buildout
+ bin_buildout = os.path.join(os.getcwd(), 'bin', 'buildout')
+ assert os.spawnle(os.P_WAIT, sys.executable, sys.executable, bin_buildout,
+ os.environ) == 0
Property changes on: grokproject/trunk/src/grokproject/__init__.py
___________________________________________________________________
Name: svn:eol-style
+ native
Property changes on: grokproject/trunk/src/grokproject/template
___________________________________________________________________
Name: svn:externals
+ bootstrap svn://svn.zope.org/repos/main/zc.buildout/trunk/bootstrap
Added: grokproject/trunk/src/grokproject/template/buildout.cfg_tmpl
===================================================================
--- grokproject/trunk/src/grokproject/template/buildout.cfg_tmpl 2007-01-10 16:08:50 UTC (rev 71867)
+++ grokproject/trunk/src/grokproject/template/buildout.cfg_tmpl 2007-01-10 16:12:44 UTC (rev 71868)
@@ -0,0 +1,51 @@
+[buildout]
+develop = .
+parts = zope3 data instance test
+
+[zope3]
+recipe = zc.recipe.cmmi
+extra_options = --with-python=$${buildout:executable} --force
+url = http://www.zope.org/Products/Zope3/3.3.0/Zope-3.3.0.tgz
+
+[data]
+recipe = zc.recipe.filestorage
+
+[instance]
+recipe = zc.recipe.zope3instance
+database = data
+user = ${user}:${passwd}
+eggs = setuptools
+ grok
+ ${package}
+
+zcml = zope.annotation
+ zope.copypastemove
+ zope.formlib
+ zope.i18n-meta
+ zope.i18n.locales
+ zope.publisher
+ zope.security-meta
+ zope.size
+ zope.traversing
+ zope.traversing.browser
+ zope.app
+ zope.app-meta
+ zope.app.securitypolicy
+ zope.app.securitypolicy-meta
+ zope.app.authentication
+ zope.app.catalog
+ zope.app.intid
+ zope.app.keyreference
+ zope.app.twisted
+ grok
+ grok-meta
+
+[test]
+recipe = zc.recipe.testrunner
+eggs = grok
+ ${package}
+extra-paths = parts/zope3/src
+working-directory = parts/instance
+defaults = ['--tests-pattern', '^f?tests$$',
+ '-v'
+ ]
Added: grokproject/trunk/src/grokproject/template/setup.py_tmpl
===================================================================
--- grokproject/trunk/src/grokproject/template/setup.py_tmpl 2007-01-10 16:08:50 UTC (rev 71867)
+++ grokproject/trunk/src/grokproject/template/setup.py_tmpl 2007-01-10 16:12:44 UTC (rev 71868)
@@ -0,0 +1,27 @@
+from setuptools import setup, find_packages
+import sys, os
+
+version = ${repr(version)|"0.0"}
+
+setup(name=${repr(project)},
+ version=version,
+ description="${description|nothing}",
+ long_description="""\
+${long_description|nothing}""",
+ classifiers=[], # Get strings from http://www.python.org/pypi?%3Aaction=list_classifiers
+ keywords=${repr(keywords)|empty},
+ author=${repr(author)|empty},
+ author_email=${repr(author_email)|empty},
+ url=${repr(url)|empty},
+ license=${repr(license_name)|empty},
+ package_dir={'': 'src'},
+ packages=find_packages('src'),
+ include_package_data=True,
+ zip_safe=${repr(bool(zip_safe))|False},
+ install_requires=[
+ # -*- Extra requirements: -*-
+ ],
+ entry_points="""
+ # -*- Entry points: -*-
+ """,
+ )
Added: grokproject/trunk/src/grokproject/template/src/+package+/__init__.py
===================================================================
--- grokproject/trunk/src/grokproject/template/src/+package+/__init__.py 2007-01-10 16:08:50 UTC (rev 71867)
+++ grokproject/trunk/src/grokproject/template/src/+package+/__init__.py 2007-01-10 16:12:44 UTC (rev 71868)
@@ -0,0 +1 @@
+# this directory is a package
Property changes on: grokproject/trunk/src/grokproject/template/src/+package+/__init__.py
___________________________________________________________________
Name: svn:eol-style
+ native
More information about the Checkins
mailing list