From d9e71e4d092cac4cc01fe01784195a50ed1157b0 Mon Sep 17 00:00:00 2001 From: Jan-Wijbrand Kolman Date: Wed, 13 Sep 2023 15:43:38 +0200 Subject: [PATCH 01/10] use a very recent ztk versions list. bump a few version to get buildiut going --- grok.cfg | 10 +- requirements.txt | 5 - ztk-versions.cfg | 242 ++++++++++++++++++++++++++--------------------- 3 files changed, 140 insertions(+), 117 deletions(-) delete mode 100644 requirements.txt diff --git a/grok.cfg b/grok.cfg index 041d901..6044f9d 100644 --- a/grok.cfg +++ b/grok.cfg @@ -75,11 +75,10 @@ zope.app.wsgi = 4.1.0 zope.errorview = 1.2.0 zope.fanstatic = 3.0.0 zope.generations = 4.0 -zope.testbrowser = 5.2.4 +zope.testbrowser = 6.0 # Tools and dependencies appnope = 0.1.0 beautifulsoup4 = 4.6.0 -collective.recipe.omelette = 0.16 collective.recipe.template = 2.0 decorator = 4.3.0 gnureadline = 6.3.8 @@ -97,10 +96,15 @@ tqdm = 4.23.3 twine = 1.11.0 waitress = 1.1.0 WebOb = 1.8.1 -WebTest = 2.0.29 zest.releaser = 6.14 WSGIProxy2 = 0.4.4 + +collective.recipe.omelette = 1.1.0 +WebTest = 3.0.0 +soupsieve = 2.5 + + # For Python 2 enum34 = 1.1.6 futures = 3.2.0 diff --git a/requirements.txt b/requirements.txt deleted file mode 100644 index 8178464..0000000 --- a/requirements.txt +++ /dev/null @@ -1,5 +0,0 @@ -# NOTE: setuptools and zc.buildout versions must be in sync with: -# ztk-versions.cfg -setuptools==38.2.4 -zc.buildout==2.10.0 -six==1.11.0 diff --git a/ztk-versions.cfg b/ztk-versions.cfg index 7624b79..abbd01d 100644 --- a/ztk-versions.cfg +++ b/ztk-versions.cfg @@ -1,128 +1,152 @@ [versions] # ZTK -zope.annotation = 4.6.0 -zope.applicationcontrol = 4.1.0 -zope.authentication = 4.3 -zope.browser = 2.2.0 -zope.browsermenu = 4.3.0 -zope.browserpage = 4.2.0 -zope.browserresource = 4.2.1 -zope.cachedescriptors = 4.3.1 -zope.catalog = 4.2.1 -zope.component = 4.4.1 -zope.componentvocabulary = 2.1.0 -zope.configuration = 4.1.0 -zope.container = 4.2.1 -zope.contentprovider = 4.1.0 -zope.contenttype = 4.3.0 -zope.copy = 4.1.0 -zope.copypastemove = 4.1.0 -zope.datetime = 4.2.0 -zope.deferredimport = 4.2.1 -zope.deprecation = 4.3.0 -zope.dottedname = 4.2 -zope.dublincore = 4.2.0 -zope.error = 4.4.0 -zope.event = 4.3.0 -zope.exceptions = 4.2.0 -zope.filerepresentation = 4.2.0 -zope.formlib = 4.4.0 -zope.hookable = 4.2.0 -zope.i18n = 4.2.0 -zope.i18nmessageid = 4.1.0 -zope.index = 4.3.0 -zope.interface = 4.4.3 -zope.intid = 4.3.0 -zope.keyreference = 4.1.0 -zope.lifecycleevent = 4.2.0 -zope.location = 4.1.0 -zope.login = 2.1.0 -zope.mimetype = 2.3.0 -zope.minmax = 2.2.0 -zope.pagetemplate = 4.3.0 -zope.password = 4.3.1 -zope.pluggableauth = 2.3.0 -zope.principalannotation = 4.2.0 -zope.principalregistry = 4.2.0 -zope.processlifetime = 2.2.0 -zope.proxy = 4.3.0 -zope.ptresource = 4.1.0 -zope.publisher = 4.3.2 -zope.ramcache = 2.2.0 -zope.schema = 4.5.0 -zope.security = 4.2.2 -zope.securitypolicy = 4.2.0 -zope.sendmail = 4.1.0 -zope.session = 4.2.0 -zope.site = 4.1.0 -zope.size = 4.2.0 -zope.structuredtext = 4.2.0 -zope.tal = 4.3.0 -zope.tales = 4.2.0 -zope.testing = 4.6.2 -zope.testrunner = 4.8.1 -zope.traversing = 4.2.0 -zope.viewlet = 4.1.0 +zope.annotation = 5.0 +zope.applicationcontrol = 4.3 +zope.authentication = 5.0 +zope.browser = 3.0 +zope.browsermenu = 5.0 +zope.browserpage = 5.0 +zope.browserresource = 5.1 +zope.cachedescriptors = 5.0 +zope.catalog = 4.4.1 +zope.component = 6.0 +zope.componentvocabulary = 2.3.0 +zope.configuration = 4.4.1 +zope.container = 5.1 +zope.contentprovider = 5.0 +zope.contenttype = 5.0 +zope.copy = 4.3 +zope.copypastemove = 4.2.1 +zope.datetime = 5.0.0 +zope.deferredimport = 4.4 +zope.deprecation = 5.0 +zope.dottedname = 6.0 +zope.dublincore = 4.3.0 +zope.error = 4.6 +zope.event = 4.6 +zope.exceptions = 4.6 +zope.filerepresentation = 6.0 +zope.formlib = 6.0 +zope.hookable = 5.4 +zope.i18n = 5.1 +zope.i18nmessageid = 6.0.1 +zope.index = 6.0 +zope.interface = 6.0 +zope.intid = 5.0 +zope.keyreference = 6.0 +zope.lifecycleevent = 4.4 +zope.location = 4.3 +zope.login = 2.2 +zope.mimetype = 3.0 +zope.minmax = 2.3 +zope.pagetemplate = 5.0 +zope.password = 4.4 +zope.pluggableauth = 3.0 +zope.principalannotation = 4.4.0 +zope.principalregistry = 4.3 +zope.processlifetime = 3.0 +zope.proxy = 5.0.0 +zope.ptresource = 5.0 +zope.publisher = 6.1.0 +zope.ramcache = 3.0 +zope.schema = 7.0.1 +zope.security = 6.1 +zope.securitypolicy = 5.0 +zope.sendmail = 5.3 +zope.session = 5.0 +zope.site = 4.6.1 +zope.size = 4.4 +zope.structuredtext = 4.4 +zope.tal = 5.0.1 +zope.tales = 5.2 +zope.testing = 5.0.1 +zope.testrunner = 6.0 +zope.traversing = 5.0 +zope.viewlet = 5.0 # Direct dependencies -BTrees = 4.4.1 -persistent = 4.2.4.2 -python-gettext = 3.0 -pytz = 2017.3 -setuptools = 38.2.4 -six = 1.11.0 -transaction = 2.1.2 +BTrees = 5.0 +multipart = 0.2.4 +persistent = 5.0 +python-gettext = 5.0 +pytz = 2023.3 +# z3c.checkversions == 2.0 requires < 66. +setuptools = 65.7.0 +six = 1.16.0 +transaction = 3.1.0 # zope.password needs these -bcrypt = 3.1.4 -cffi = 1.11.2 -pycparser = 2.18 +bcrypt = 4.0.1 +cffi = 1.15.1 +pycparser = 2.21 -# Python2-only -zope.untrustedpython = 4.0.0 +zope.untrustedpython = 6.0 # Required by zope.untrustedpython -RestrictedPython = 3.6.0 +RestrictedPython = 6.0 # Testing dependencies -ZODB = 5.3.0 -ZConfig = 3.2.0 -zdaemon = 4.2.0 -zc.lockfile = 1.2.1 -zodbpickle = 0.7.0 -colorama = 0.3.9 +ZConfig = 3.6.1 +ZODB = 5.8.0 +argparse = 1.4.0 +colorama = 0.4.6 +extras = 1.0.0 +fixtures = 4.0.1 +linecache2 = 1.0.0 +manuel = 1.12.4 +pbr = 5.11.1 +pyparsing = 3.0.9 +python-mimeparse = 1.6.0 +python-subunit = 1.4.2 +testtools = 2.6.0 +traceback2 = 1.4.0 +unittest2 = 1.1.0 +zc.lockfile = 3.0.post1 +zdaemon = 4.4 +zodbpickle = 3.0.1 + # Testing tools -coverage = 4.4.2 +coverage = 7.2.3 nose = 1.3.7 # Documentation dependencies -Sphinx = 1.6.5 -docutils = 0.14 -imagesize = 0.7.1 -alabaster = 0.7.10 -babel = 2.5.1 -Jinja2 = 2.10 -MarkupSafe = 1.0 -Pygments = 2.2.0 -snowballstemmer = 1.2.1 -lxml = 4.1.1 -repoze.sphinx.autointerface = 0.8 -requests = 2.18.4 -certifi = 2017.11.5 -urllib3 = 1.22 -idna = 2.6 -chardet = 3.0.4 -sphinxcontrib-programoutput = 0.11 -sphinxcontrib-websupport = 1.0.1 -sphinx-rtd-theme = 0.2.4 -typing = 3.6.2 +Sphinx = 6.2.0 +charset-normalizer = 2.1.1 +docutils = 0.19 +imagesize = 1.4.1 +importlib-metadata = 6.0.0 +alabaster = 0.7.13 +babel = 2.12.1 +Jinja2 = 3.1.2 +MarkupSafe = 2.1.2 +Pygments = 2.15.1 +snowballstemmer = 2.2.0 +lxml = 4.9.2 +repoze.sphinx.autointerface = 1.0.0 +requests = 2.28.2 +certifi = 2022.12.7 +urllib3 = 1.26.15 +idna = 3.4 +chardet = 5.1.0 +sphinxcontrib.applehelp = 1.0.3 +sphinxcontrib-devhelp = 1.0.2 +sphinxcontrib-htmlhelp = 2.0.0 +sphinxcontrib-jsmath = 1.0.1 +sphinxcontrib-programoutput = 0.17 +sphinxcontrib-qthelp = 1.0.3 +sphinxcontrib-serializinghtml = 1.1.5 +sphinxcontrib-websupport = 1.2.4 +sphinx-rtd-theme = 1.2.0 +packaging = 23.1 +typing = 3.7.4.3 z3c.recipe.sphinxdoc = 1.1.0 +zipp = 3.15.0 # ZTK buildout dependencies collective.recipe.cmd = 0.11 -mr.developer = 1.38 -z3c.checkversions = 0.5 -z3c.recipe.compattest = 1.0 -zc.buildout = 2.10.0 -zc.recipe.egg = 2.0.5 -zc.recipe.testrunner = 2.0.0 +mr.developer = 2.0.1 +z3c.checkversions = 2.0 +z3c.recipe.compattest = 2.0 +zc.buildout = 3.0.1 +zc.recipe.egg = 2.0.7 +zc.recipe.testrunner = 3.0 From 78c3ae2c0509b6be437669f8fbb6fe626752668d Mon Sep 17 00:00:00 2001 From: Jan-Wijbrand Kolman Date: Wed, 13 Sep 2023 15:51:32 +0200 Subject: [PATCH 02/10] Add a temp file with checked versions. --- checked-versions.cfg | 111 +++++++++++++++++++++++++++++++++++++++++++ 1 file changed, 111 insertions(+) create mode 100644 checked-versions.cfg diff --git a/checked-versions.cfg b/checked-versions.cfg new file mode 100644 index 0000000..e74244d --- /dev/null +++ b/checked-versions.cfg @@ -0,0 +1,111 @@ +# Temporary list of new version that need to be incorporated. +Chameleon=4.1.0 +MarkupSafe=2.1.3 +Paste=3.5.3 +Pygments=2.16.1 +RestrictedPython=6.2 +Sphinx=7.2.5 +WSGIProxy2=0.5.1 +WebOb=1.8.7 +ZConfig=4.0 +ZODB=5.8.1 +appnope=0.1.3 +beautifulsoup4=4.12.2 +certifi=2023.7.22 +chardet=5.2.0 +charset-normalizer=3.2.0 +collective.recipe.template=2.2 +coverage=7.3.1 +decorator=5.1.1 +docutils=0.20.1 +enum34=1.1.10 +fanstatic=1.3 +fixtures=4.1.0 +gnureadline=8.1.2 +grok=3.3 +grokcore.annotation=4.0 +grokcore.catalog=4.0 +grokcore.chameleon=4.0 +grokcore.component=4.1 +grokcore.content=4.1 +grokcore.error=4.0 +grokcore.formlib=4.0 +grokcore.json=4.1 +grokcore.layout=4.0 +grokcore.message=4.0 +grokcore.rest=4.1 +grokcore.security=4.0 +grokcore.site=4.0 +grokcore.startup=4.0 +grokcore.traverser=4.0 +grokcore.view=4.0 +grokcore.viewlet=4.0 +grokcore.xmlrpc=4.1 +grokui.admin=1.0 +grokui.base=0.8.2 +importlib-metadata=6.8.0 +ipython=8.15.0 +ipython-genutils=0.2.0 +lxml=4.9.3 +martian=2.0.post1 +mock=5.1.0 +pathlib2=2.3.7.post1 +pexpect=4.8.0 +pickleshare=0.7.5 +pkginfo=1.9.6 +ptyprocess=0.7.0 +pyparsing=3.1.1 +pytz=2023.3.post1 +requests=2.31.0 +requests-toolbelt=1.0.0 +scandir=1.10.0 +setuptools=68.2.2 +sphinx-rtd-theme=1.3.0 +sphinxcontrib-devhelp=1.0.5 +sphinxcontrib-htmlhelp=2.0.4 +sphinxcontrib-qthelp=1.0.6 +sphinxcontrib-serializinghtml=1.1.9 +sphinxcontrib-websupport=1.2.6 +tqdm=4.66.1 +traitlets=5.9.0 +trollius=2.1.post2 +twine=4.0.2 +urllib3=2.0.4 +waitress=2.1.2 +z3c.autoinclude=1.0 +z3c.checkversions=2.1 +z3c.evalexception=3.0 +z3c.flashmessage=3.0 +z3c.pt=4.0 +z3c.recipe.i18n=2.0 +zc.catalog=3.0 +zdaemon=5.0 +zest.releaser=9.0.0 +zipp=3.16.2 +zope.app.appsetup=5.0 +zope.app.publication=5.0 +zope.app.wsgi=5.0 +zope.applicationcontrol=5.0 +zope.catalog=5.0 +zope.configuration=5.0 +zope.copypastemove=5.0 +zope.deferredimport=5.0 +zope.dublincore=5.0 +zope.error=5.0 +zope.errorview=2.0 +zope.event=5.0 +zope.exceptions=5.0.1 +zope.generations=5.1.0 +zope.lifecycleevent=5.0 +zope.location=5.0 +zope.login=3.0 +zope.principalannotation=5.0 +zope.principalregistry=5.0 +zope.publisher=7.0 +zope.sendmail=6.0 +zope.session=5.1 +zope.site=5.0 +zope.size=5.0 +zope.structuredtext=5.0 +zope.tales=6.0 +zope.testrunner=6.1 From 9ab01ef3ab83bd3ef8406d45596dd10373f7cb67 Mon Sep 17 00:00:00 2001 From: Jan-Wijbrand Kolman Date: Wed, 13 Sep 2023 16:40:22 +0200 Subject: [PATCH 03/10] update versions in grok.cfg --- checked-versions.cfg | 24 ++++---- grok.cfg | 130 ++++++++++++++++++++----------------------- 2 files changed, 72 insertions(+), 82 deletions(-) diff --git a/checked-versions.cfg b/checked-versions.cfg index e74244d..26c7a6e 100644 --- a/checked-versions.cfg +++ b/checked-versions.cfg @@ -1,17 +1,8 @@ # Temporary list of new version that need to be incorporated. -Chameleon=4.1.0 -MarkupSafe=2.1.3 -Paste=3.5.3 -Pygments=2.16.1 -RestrictedPython=6.2 -Sphinx=7.2.5 -WSGIProxy2=0.5.1 -WebOb=1.8.7 -ZConfig=4.0 -ZODB=5.8.1 appnope=0.1.3 beautifulsoup4=4.12.2 certifi=2023.7.22 +Chameleon=4.1.0 chardet=5.2.0 charset-normalizer=3.2.0 collective.recipe.template=2.2 @@ -44,23 +35,28 @@ grokcore.xmlrpc=4.1 grokui.admin=1.0 grokui.base=0.8.2 importlib-metadata=6.8.0 -ipython=8.15.0 ipython-genutils=0.2.0 +ipython=8.15.0 lxml=4.9.3 +MarkupSafe=2.1.3 martian=2.0.post1 mock=5.1.0 +Paste=3.5.3 pathlib2=2.3.7.post1 pexpect=4.8.0 pickleshare=0.7.5 pkginfo=1.9.6 ptyprocess=0.7.0 +Pygments=2.16.1 pyparsing=3.1.1 pytz=2023.3.post1 -requests=2.31.0 requests-toolbelt=1.0.0 +requests=2.31.0 +RestrictedPython=6.2 scandir=1.10.0 setuptools=68.2.2 sphinx-rtd-theme=1.3.0 +Sphinx=7.2.5 sphinxcontrib-devhelp=1.0.5 sphinxcontrib-htmlhelp=2.0.4 sphinxcontrib-qthelp=1.0.6 @@ -72,6 +68,8 @@ trollius=2.1.post2 twine=4.0.2 urllib3=2.0.4 waitress=2.1.2 +WebOb=1.8.7 +WSGIProxy2=0.5.1 z3c.autoinclude=1.0 z3c.checkversions=2.1 z3c.evalexception=3.0 @@ -79,9 +77,11 @@ z3c.flashmessage=3.0 z3c.pt=4.0 z3c.recipe.i18n=2.0 zc.catalog=3.0 +ZConfig=4.0 zdaemon=5.0 zest.releaser=9.0.0 zipp=3.16.2 +ZODB=5.8.1 zope.app.appsetup=5.0 zope.app.publication=5.0 zope.app.wsgi=5.0 diff --git a/grok.cfg b/grok.cfg index 6044f9d..8d3bf4c 100644 --- a/grok.cfg +++ b/grok.cfg @@ -37,81 +37,71 @@ packages = zope.fanstatic [versions] -Chameleon = 3.2 -fanstatic = 1.0.0 -grok = 3.1 -grokcore.annotation = 3.0.1 -grokcore.catalog = 3.0.1 -grokcore.chameleon = 3.0.1 -grokcore.component = 3.1 -grokcore.content = 3.0.2 -grokcore.error = 3.0.1 -grokcore.formlib = 3.0.1 -grokcore.json = 3.0.3 -grokcore.layout = 3.0.3 -grokcore.message = 3.0.1 -grokcore.rest = 3.0.1 -grokcore.security = 3.0.1 -grokcore.site = 3.0.3 -grokcore.startup = 3.0.1 -grokcore.traverser = 3.0.1 -grokcore.view = 3.0.3 -grokcore.viewlet = 3.1.0 -grokcore.xmlrpc = 3.0.0 -grokui.admin = 0.12 -grokui.base = 0.7 -ipython = 4.0.1 -martian = 1.2 -z3c.autoinclude = 0.3.7 -z3c.evalexception = 2.0 -z3c.flashmessage = 2.0 -z3c.pt = 3.1.0 -z3c.recipe.i18n = 1.0.0 -zc.catalog = 2.0.1 -zope.app.appsetup = 4.0.0 -zope.app.debug = 4.0.0 -zope.app.publication = 4.2.1 -zope.app.wsgi = 4.1.0 -zope.errorview = 1.2.0 -zope.fanstatic = 3.0.0 -zope.generations = 4.0 -zope.testbrowser = 6.0 -# Tools and dependencies -appnope = 0.1.0 -beautifulsoup4 = 4.6.0 -collective.recipe.template = 2.0 -decorator = 4.3.0 -gnureadline = 6.3.8 -ipython-genutils = 0.1.0 -Paste = 2.0.3 -pexpect = 4.3.1 -pickleshare = 0.7.4 -pkginfo = 1.4.2 -ptyprocess = 0.5.2 -requests-toolbelt = 0.8.0 +appnope = 0.1.3 +beautifulsoup4=4.12.2 +Chameleon = 4.1.0 +collective.recipe.omelette = 1.1.0 +collective.recipe.template = 2.2 +decorator = 5.1.1 +fanstatic = 1.3 +gnureadline = 8.1.2 +grok = 3.3 +grokcore.annotation = 4.0 +grokcore.catalog = 4.0 +grokcore.chameleon = 4.0 +grokcore.component = 4.1 +grokcore.content = 4.1 +grokcore.error = 4.0 +grokcore.formlib = 4.0 +grokcore.json = 4.1 +grokcore.layout = 4.0 +grokcore.message = 4.0 +grokcore.rest = 4.1 +grokcore.security = 4.0 +grokcore.site = 4.0 +grokcore.startup = 4.0 +grokcore.traverser = 4.0 +grokcore.view = 4.0 +grokcore.viewlet = 4.0 +grokcore.xmlrpc = 4.1 +grokui.admin = 1.0 +grokui.base = 0.8.2 +ipython-genutils = 0.2.0 +ipython = 8.15.0 +martian = 2.0.post1 +Paste = 3.5.3 +pexpect = 4.8.0 +pickleshare = 0.7.5 +pkginfo = 1.9.6 +ptyprocess = 0.7.0 +requests-toolbelt = 1.0.0 shutilwhich = 1.1.0 simplegeneric = 0.8.1 -traitlets = 4.3.2 -tqdm = 4.23.3 -twine = 1.11.0 +soupsieve = 2.5 +tqdm = 4.66.1 +traitlets = 5.9.0 +twine = 4.0.2 waitress = 1.1.0 -WebOb = 1.8.1 -zest.releaser = 6.14 -WSGIProxy2 = 0.4.4 - - -collective.recipe.omelette = 1.1.0 +WebOb = 1.8.7 WebTest = 3.0.0 -soupsieve = 2.5 - +WSGIProxy2 = 0.4.4 +z3c.autoinclude = 1.0 +z3c.checkversions = 2.1 +z3c.evalexception = 3.0 +z3c.flashmessage = 3.0 +z3c.pt = 4.0 +z3c.recipe.i18n = 2.0 +zc.catalog = 3.0 +zest.releaser = 9.0.0 +zope.app.appsetup = 5.0 +zope.app.debug = 4.0.0 +zope.app.publication = 5.0 +zope.app.wsgi = 5.0 +zope.errorview = 2.0 +zope.fanstatic = 3.0.0 +zope.generations = 5.1.0 +zope.testbrowser = 6.0 -# For Python 2 -enum34 = 1.1.6 -futures = 3.2.0 -mock = 1.0.1 -pathlib2 = 2.3.0 -scandir = 1.6 -trollius = 2.1 [sources] # While working on the python 3 branches, make use of this sources list. From 8f6dca649926e3278188205d6c2c3cbdafd82917 Mon Sep 17 00:00:00 2001 From: Jan-Wijbrand Kolman Date: Wed, 13 Sep 2023 16:49:38 +0200 Subject: [PATCH 04/10] update a few more version pins --- checked-versions.cfg | 111 ------------------------------------------- grok.cfg | 4 +- ztk-versions.cfg | 69 +++++++++++++-------------- 3 files changed, 36 insertions(+), 148 deletions(-) delete mode 100644 checked-versions.cfg diff --git a/checked-versions.cfg b/checked-versions.cfg deleted file mode 100644 index 26c7a6e..0000000 --- a/checked-versions.cfg +++ /dev/null @@ -1,111 +0,0 @@ -# Temporary list of new version that need to be incorporated. -appnope=0.1.3 -beautifulsoup4=4.12.2 -certifi=2023.7.22 -Chameleon=4.1.0 -chardet=5.2.0 -charset-normalizer=3.2.0 -collective.recipe.template=2.2 -coverage=7.3.1 -decorator=5.1.1 -docutils=0.20.1 -enum34=1.1.10 -fanstatic=1.3 -fixtures=4.1.0 -gnureadline=8.1.2 -grok=3.3 -grokcore.annotation=4.0 -grokcore.catalog=4.0 -grokcore.chameleon=4.0 -grokcore.component=4.1 -grokcore.content=4.1 -grokcore.error=4.0 -grokcore.formlib=4.0 -grokcore.json=4.1 -grokcore.layout=4.0 -grokcore.message=4.0 -grokcore.rest=4.1 -grokcore.security=4.0 -grokcore.site=4.0 -grokcore.startup=4.0 -grokcore.traverser=4.0 -grokcore.view=4.0 -grokcore.viewlet=4.0 -grokcore.xmlrpc=4.1 -grokui.admin=1.0 -grokui.base=0.8.2 -importlib-metadata=6.8.0 -ipython-genutils=0.2.0 -ipython=8.15.0 -lxml=4.9.3 -MarkupSafe=2.1.3 -martian=2.0.post1 -mock=5.1.0 -Paste=3.5.3 -pathlib2=2.3.7.post1 -pexpect=4.8.0 -pickleshare=0.7.5 -pkginfo=1.9.6 -ptyprocess=0.7.0 -Pygments=2.16.1 -pyparsing=3.1.1 -pytz=2023.3.post1 -requests-toolbelt=1.0.0 -requests=2.31.0 -RestrictedPython=6.2 -scandir=1.10.0 -setuptools=68.2.2 -sphinx-rtd-theme=1.3.0 -Sphinx=7.2.5 -sphinxcontrib-devhelp=1.0.5 -sphinxcontrib-htmlhelp=2.0.4 -sphinxcontrib-qthelp=1.0.6 -sphinxcontrib-serializinghtml=1.1.9 -sphinxcontrib-websupport=1.2.6 -tqdm=4.66.1 -traitlets=5.9.0 -trollius=2.1.post2 -twine=4.0.2 -urllib3=2.0.4 -waitress=2.1.2 -WebOb=1.8.7 -WSGIProxy2=0.5.1 -z3c.autoinclude=1.0 -z3c.checkversions=2.1 -z3c.evalexception=3.0 -z3c.flashmessage=3.0 -z3c.pt=4.0 -z3c.recipe.i18n=2.0 -zc.catalog=3.0 -ZConfig=4.0 -zdaemon=5.0 -zest.releaser=9.0.0 -zipp=3.16.2 -ZODB=5.8.1 -zope.app.appsetup=5.0 -zope.app.publication=5.0 -zope.app.wsgi=5.0 -zope.applicationcontrol=5.0 -zope.catalog=5.0 -zope.configuration=5.0 -zope.copypastemove=5.0 -zope.deferredimport=5.0 -zope.dublincore=5.0 -zope.error=5.0 -zope.errorview=2.0 -zope.event=5.0 -zope.exceptions=5.0.1 -zope.generations=5.1.0 -zope.lifecycleevent=5.0 -zope.location=5.0 -zope.login=3.0 -zope.principalannotation=5.0 -zope.principalregistry=5.0 -zope.publisher=7.0 -zope.sendmail=6.0 -zope.session=5.1 -zope.site=5.0 -zope.size=5.0 -zope.structuredtext=5.0 -zope.tales=6.0 -zope.testrunner=6.1 diff --git a/grok.cfg b/grok.cfg index 8d3bf4c..ffbad0c 100644 --- a/grok.cfg +++ b/grok.cfg @@ -81,10 +81,10 @@ soupsieve = 2.5 tqdm = 4.66.1 traitlets = 5.9.0 twine = 4.0.2 -waitress = 1.1.0 +waitress = 2.1.2 WebOb = 1.8.7 WebTest = 3.0.0 -WSGIProxy2 = 0.4.4 +WSGIProxy2 = 0.5.1 z3c.autoinclude = 1.0 z3c.checkversions = 2.1 z3c.evalexception = 3.0 diff --git a/ztk-versions.cfg b/ztk-versions.cfg index abbd01d..2bca3cf 100644 --- a/ztk-versions.cfg +++ b/ztk-versions.cfg @@ -1,30 +1,30 @@ [versions] # ZTK zope.annotation = 5.0 -zope.applicationcontrol = 4.3 +zope.applicationcontrol = 5.0 zope.authentication = 5.0 zope.browser = 3.0 zope.browsermenu = 5.0 zope.browserpage = 5.0 zope.browserresource = 5.1 zope.cachedescriptors = 5.0 -zope.catalog = 4.4.1 +zope.catalog = 5.0 zope.component = 6.0 zope.componentvocabulary = 2.3.0 -zope.configuration = 4.4.1 +zope.configuration = 5.0 zope.container = 5.1 zope.contentprovider = 5.0 zope.contenttype = 5.0 zope.copy = 4.3 -zope.copypastemove = 4.2.1 +zope.copypastemove = 5.0 zope.datetime = 5.0.0 -zope.deferredimport = 4.4 +zope.deferredimport = 5.0 zope.deprecation = 5.0 zope.dottedname = 6.0 -zope.dublincore = 4.3.0 -zope.error = 4.6 -zope.event = 4.6 -zope.exceptions = 4.6 +zope.dublincore = 5.0 +zope.error = 5.0 +zope.event = 5.0 +zope.exceptions = 5.0.1 zope.filerepresentation = 6.0 zope.formlib = 6.0 zope.hookable = 5.4 @@ -34,33 +34,33 @@ zope.index = 6.0 zope.interface = 6.0 zope.intid = 5.0 zope.keyreference = 6.0 -zope.lifecycleevent = 4.4 -zope.location = 4.3 -zope.login = 2.2 +zope.lifecycleevent = 5.0 +zope.location = 5.0 +zope.login = 3.0 zope.mimetype = 3.0 zope.minmax = 2.3 zope.pagetemplate = 5.0 zope.password = 4.4 zope.pluggableauth = 3.0 -zope.principalannotation = 4.4.0 -zope.principalregistry = 4.3 +zope.principalannotation = 5.0 +zope.principalregistry = 5.0 zope.processlifetime = 3.0 zope.proxy = 5.0.0 zope.ptresource = 5.0 -zope.publisher = 6.1.0 +zope.publisher = 7.0 zope.ramcache = 3.0 zope.schema = 7.0.1 zope.security = 6.1 zope.securitypolicy = 5.0 -zope.sendmail = 5.3 -zope.session = 5.0 -zope.site = 4.6.1 -zope.size = 4.4 -zope.structuredtext = 4.4 +zope.sendmail = 6.0 +zope.session = 5.1 +zope.site = 5.0 +zope.size = 5.0 +zope.structuredtext = 5.0 zope.tal = 5.0.1 -zope.tales = 5.2 +zope.tales = 6.0 zope.testing = 5.0.1 -zope.testrunner = 6.0 +zope.testrunner = 6.1 zope.traversing = 5.0 zope.viewlet = 5.0 @@ -85,8 +85,8 @@ zope.untrustedpython = 6.0 RestrictedPython = 6.0 # Testing dependencies -ZConfig = 3.6.1 -ZODB = 5.8.0 +ZConfig = 4.0 +ZODB = 5.8.1 argparse = 1.4.0 colorama = 0.4.6 extras = 1.0.0 @@ -101,10 +101,9 @@ testtools = 2.6.0 traceback2 = 1.4.0 unittest2 = 1.1.0 zc.lockfile = 3.0.post1 -zdaemon = 4.4 +zdaemon = 5.0 zodbpickle = 3.0.1 - # Testing tools coverage = 7.2.3 nose = 1.3.7 @@ -125,22 +124,22 @@ lxml = 4.9.2 repoze.sphinx.autointerface = 1.0.0 requests = 2.28.2 certifi = 2022.12.7 -urllib3 = 1.26.15 +urllib3 = 2.0.4 idna = 3.4 chardet = 5.1.0 -sphinxcontrib.applehelp = 1.0.3 -sphinxcontrib-devhelp = 1.0.2 -sphinxcontrib-htmlhelp = 2.0.0 +sphinx-rtd-theme = 1.3.0 +sphinxcontrib-devhelp = 1.0.5 +sphinxcontrib-htmlhelp = 2.0.4 sphinxcontrib-jsmath = 1.0.1 sphinxcontrib-programoutput = 0.17 -sphinxcontrib-qthelp = 1.0.3 -sphinxcontrib-serializinghtml = 1.1.5 -sphinxcontrib-websupport = 1.2.4 -sphinx-rtd-theme = 1.2.0 +sphinxcontrib-qthelp = 1.0.6 +sphinxcontrib-serializinghtml = 1.1.9 +sphinxcontrib-websupport = 1.2.6 +sphinxcontrib.applehelp = 1.0.3 packaging = 23.1 typing = 3.7.4.3 z3c.recipe.sphinxdoc = 1.1.0 -zipp = 3.15.0 +zipp = 3.16.2 # ZTK buildout dependencies collective.recipe.cmd = 0.11 From c8bcfc55cf8ad7c359bb19a1476d7a22670be831 Mon Sep 17 00:00:00 2001 From: Jan-Wijbrand Kolman Date: Thu, 14 Sep 2023 08:43:15 +0200 Subject: [PATCH 05/10] incorporate latest ztk versions --- ztk-versions.cfg | 87 ++++++++++-------------------------------------- 1 file changed, 18 insertions(+), 69 deletions(-) diff --git a/ztk-versions.cfg b/ztk-versions.cfg index 2bca3cf..7abd2a0 100644 --- a/ztk-versions.cfg +++ b/ztk-versions.cfg @@ -62,90 +62,39 @@ zope.tales = 6.0 zope.testing = 5.0.1 zope.testrunner = 6.1 zope.traversing = 5.0 +zope.untrustedpython = 6.0 zope.viewlet = 5.0 # Direct dependencies BTrees = 5.0 +RestrictedPython = 6.2 +ZConfig = 4.0 +ZODB = 5.8.1 +bcrypt = 4.0.1 +cffi = 1.15.1 multipart = 0.2.4 persistent = 5.0 +pycparser = 2.21 python-gettext = 5.0 -pytz = 2023.3 -# z3c.checkversions == 2.0 requires < 66. -setuptools = 65.7.0 -six = 1.16.0 +pytz = 2023.3.post1 transaction = 3.1.0 - -# zope.password needs these -bcrypt = 4.0.1 -cffi = 1.15.1 -pycparser = 2.21 - -zope.untrustedpython = 6.0 -# Required by zope.untrustedpython -RestrictedPython = 6.0 - -# Testing dependencies -ZConfig = 4.0 -ZODB = 5.8.1 -argparse = 1.4.0 -colorama = 0.4.6 -extras = 1.0.0 -fixtures = 4.0.1 -linecache2 = 1.0.0 -manuel = 1.12.4 -pbr = 5.11.1 -pyparsing = 3.0.9 -python-mimeparse = 1.6.0 -python-subunit = 1.4.2 -testtools = 2.6.0 -traceback2 = 1.4.0 -unittest2 = 1.1.0 zc.lockfile = 3.0.post1 -zdaemon = 5.0 zodbpickle = 3.0.1 -# Testing tools -coverage = 7.2.3 -nose = 1.3.7 +# Hopefully we can get rid of it sometime: +six = 1.16.0 -# Documentation dependencies -Sphinx = 6.2.0 -charset-normalizer = 2.1.1 -docutils = 0.19 -imagesize = 1.4.1 -importlib-metadata = 6.0.0 -alabaster = 0.7.13 -babel = 2.12.1 -Jinja2 = 3.1.2 -MarkupSafe = 2.1.2 -Pygments = 2.15.1 -snowballstemmer = 2.2.0 -lxml = 4.9.2 -repoze.sphinx.autointerface = 1.0.0 -requests = 2.28.2 -certifi = 2022.12.7 -urllib3 = 2.0.4 -idna = 3.4 -chardet = 5.1.0 -sphinx-rtd-theme = 1.3.0 -sphinxcontrib-devhelp = 1.0.5 -sphinxcontrib-htmlhelp = 2.0.4 -sphinxcontrib-jsmath = 1.0.1 -sphinxcontrib-programoutput = 0.17 -sphinxcontrib-qthelp = 1.0.6 -sphinxcontrib-serializinghtml = 1.1.9 -sphinxcontrib-websupport = 1.2.6 -sphinxcontrib.applehelp = 1.0.3 -packaging = 23.1 -typing = 3.7.4.3 -z3c.recipe.sphinxdoc = 1.1.0 -zipp = 3.16.2 +# Testing tools +coverage = 7.3.1 +manuel = 1.12.4 # ZTK buildout dependencies -collective.recipe.cmd = 0.11 mr.developer = 2.0.1 -z3c.checkversions = 2.0 +z3c.checkversions = 2.1 z3c.recipe.compattest = 2.0 -zc.buildout = 3.0.1 zc.recipe.egg = 2.0.7 zc.recipe.testrunner = 3.0 + +[versions:python37] +# Version 7.3+ requires Python 3.8+ +coverage = 7.2.7 From 291151f4b861ea791a6a480a8ac6f3b964603fde Mon Sep 17 00:00:00 2001 From: Jan-Wijbrand Kolman Date: Thu, 14 Sep 2023 08:51:23 +0200 Subject: [PATCH 06/10] update version pins --- grok.cfg | 56 +++++++++++++++++++++++++++++++------------------------- 1 file changed, 31 insertions(+), 25 deletions(-) diff --git a/grok.cfg b/grok.cfg index ffbad0c..e10326f 100644 --- a/grok.cfg +++ b/grok.cfg @@ -37,14 +37,8 @@ packages = zope.fanstatic [versions] -appnope = 0.1.3 -beautifulsoup4=4.12.2 Chameleon = 4.1.0 -collective.recipe.omelette = 1.1.0 -collective.recipe.template = 2.2 -decorator = 5.1.1 fanstatic = 1.3 -gnureadline = 8.1.2 grok = 3.3 grokcore.annotation = 4.0 grokcore.catalog = 4.0 @@ -66,33 +60,14 @@ grokcore.viewlet = 4.0 grokcore.xmlrpc = 4.1 grokui.admin = 1.0 grokui.base = 0.8.2 -ipython-genutils = 0.2.0 ipython = 8.15.0 martian = 2.0.post1 -Paste = 3.5.3 -pexpect = 4.8.0 -pickleshare = 0.7.5 -pkginfo = 1.9.6 -ptyprocess = 0.7.0 -requests-toolbelt = 1.0.0 -shutilwhich = 1.1.0 -simplegeneric = 0.8.1 -soupsieve = 2.5 -tqdm = 4.66.1 -traitlets = 5.9.0 -twine = 4.0.2 -waitress = 2.1.2 -WebOb = 1.8.7 -WebTest = 3.0.0 -WSGIProxy2 = 0.5.1 z3c.autoinclude = 1.0 -z3c.checkversions = 2.1 z3c.evalexception = 3.0 z3c.flashmessage = 3.0 z3c.pt = 4.0 z3c.recipe.i18n = 2.0 zc.catalog = 3.0 -zest.releaser = 9.0.0 zope.app.appsetup = 5.0 zope.app.debug = 4.0.0 zope.app.publication = 5.0 @@ -101,7 +76,38 @@ zope.errorview = 2.0 zope.fanstatic = 3.0.0 zope.generations = 5.1.0 zope.testbrowser = 6.0 +# Tools and dependencies +appnope = 0.1.3 +beautifulsoup4=4.12.2 +collective.recipe.omelette = 1.1.0 +collective.recipe.template = 2.2 +decorator = 5.1.1 +gnureadline = 8.1.2 +ipython-genutils = 0.2.0 +Paste = 3.5.3 +pexpect = 4.8.0 +pickleshare = 0.7.5 +pkginfo = 1.9.6 +ptyprocess = 0.7.0 +requests-toolbelt = 1.0.0 +shutilwhich = 1.1.0 +simplegeneric = 0.8.1 +traitlets = 5.9.0 +tqdm = 4.66.1 +twine = 4.0.2 +waitress = 2.1.2 +WebOb = 1.8.7 +WebTest = 3.0.0 +zest.releaser = 9.0.0 +WSGIProxy2=0.5.1 +# For Python 2 +enum34=1.1.10 +futures = 3.2.0 +mock = 5.1.0 +pathlib2=2.3.7.post1 +scandir = 1.10.0 +trollius = 2.1.post2 [sources] # While working on the python 3 branches, make use of this sources list. From c58e4dece5b0410c55ffb0ca96484cfde201cb68 Mon Sep 17 00:00:00 2001 From: Michael Howitz Date: Wed, 20 Dec 2023 14:13:33 +0100 Subject: [PATCH 07/10] Configuring for toolkit --- .editorconfig | 39 +++ .github/workflows/tests.yml | 63 +++++ .gitignore | 41 +-- .meta.toml | 33 +++ .readthedocs.yaml | 23 ++ .travis.yml | 15 - CONTRIBUTING.md | 23 ++ MANIFEST.in | 24 ++ README.rst | 5 + bootstrap.py | 178 ------------ buildout.cfg | 18 +- doc/changes.rst | 8 - doc/design/skin-minimal.py | 18 -- doc/groktut/a_second_model/bootstrap.py | 260 ------------------ doc/groktut/a_second_view/bootstrap.py | 260 ------------------ doc/groktut/a_view_for_a_model/bootstrap.py | 260 ------------------ doc/groktut/a_view_for_a_model2/bootstrap.py | 260 ------------------ .../an_empty_grok_project/bootstrap.py | 260 ------------------ doc/groktut/an_empty_grok_project/setup.py | 36 --- .../bootstrap.py | 260 ------------------ .../completely_python_driven_views/setup.py | 36 --- doc/groktut/containers/bootstrap.py | 260 ------------------ doc/groktut/containers/setup.py | 36 --- .../bootstrap.py | 260 ------------------ .../setup.py | 36 --- .../bootstrap.py | 260 ------------------ .../setup.py | 36 --- .../generating_html_from_python/bootstrap.py | 260 ------------------ .../generating_html_from_python/setup.py | 36 --- .../making_our_page_dynamic/bootstrap.py | 260 ------------------ doc/groktut/making_our_page_dynamic/setup.py | 36 --- .../publishing_a_simple_web_page/bootstrap.py | 260 ------------------ .../publishing_a_simple_web_page/setup.py | 36 --- .../reading_url_parameters/bootstrap.py | 260 ------------------ doc/groktut/reading_url_parameters/setup.py | 36 --- .../reading_url_parameters2/bootstrap.py | 260 ------------------ doc/groktut/reading_url_parameters2/setup.py | 36 --- doc/groktut/redirection/bootstrap.py | 260 ------------------ doc/groktut/redirection/setup.py | 36 --- .../setting_the_content_type/bootstrap.py | 260 ------------------ doc/groktut/setting_the_content_type/setup.py | 36 --- .../bootstrap.py | 260 ------------------ .../showing_the_value_in_the_form/setup.py | 36 --- doc/groktut/simple_forms/bootstrap.py | 260 ------------------ doc/groktut/simple_forms/setup.py | 36 --- doc/groktut/simple_forms2/bootstrap.py | 260 ------------------ doc/groktut/simple_forms2/setup.py | 36 --- .../bootstrap.py | 260 ------------------ .../setup.py | 36 --- doc/groktut/storing_data/bootstrap.py | 260 ------------------ doc/groktut/storing_data/setup.py | 36 --- doc/groktut/template/bootstrap.py | 260 ------------------ doc/groktut/template/setup.py | 36 --- .../the_rules_of_persistence/bootstrap.py | 260 ------------------ doc/groktut/the_rules_of_persistence/setup.py | 36 --- .../the_rules_of_persistence2/bootstrap.py | 260 ------------------ .../the_rules_of_persistence2/setup.py | 36 --- .../the_rules_of_persistence3/bootstrap.py | 260 ------------------ .../the_rules_of_persistence3/setup.py | 36 --- doc/groktut/using_view_methods/bootstrap.py | 260 ------------------ doc/groktut/using_view_methods/setup.py | 36 --- {doc => docs}/ACKS.txt | 0 {doc => docs}/Makefile | 0 {doc => docs}/README.rst | 0 {doc => docs}/_static/default.css | 0 {doc => docs}/_static/grok.css | 0 {doc => docs}/_static/grok_club.gif | Bin {doc => docs}/_static/logo.gif | Bin {doc => docs}/_static/logo.png | Bin {doc => docs}/_static/top_bg.jpg | Bin {doc => docs}/bugs.rst | 0 docs/changes.rst | 11 + {doc => docs}/conf.py | 91 +++--- {doc => docs}/contents.rst | 0 {doc => docs}/copyright.rst | 0 {doc => docs}/design/adapters.py | 18 +- {doc => docs}/design/annotations.py | 7 +- {doc => docs}/design/container.py | 3 +- {doc => docs}/design/grok_beginner.txt | 0 {doc => docs}/design/grok_dev.txt | 0 {doc => docs}/design/menu.py | 57 ++-- {doc => docs}/design/model.py | 11 +- {doc => docs}/design/permission.py | 10 +- docs/design/skin-minimal.py | 17 ++ {doc => docs}/design/skin.py | 1 - {doc => docs}/design/subscriber.py | 6 +- {doc => docs}/design/traversal.py | 24 +- {doc => docs}/design/utility.py | 23 +- {doc => docs}/design/views.py | 19 +- {doc => docs}/docindex.template | 0 {doc => docs}/glossary.rst | 0 {doc => docs}/grok_overview.rst | 0 .../groktut/a_second_model/buildout.cfg | 0 .../groktut/a_second_model/etc/README.txt | 0 .../groktut/a_second_model/etc/debug.ini.in | 0 .../groktut/a_second_model/etc/deploy.ini.in | 0 .../groktut/a_second_model/etc/site.zcml.in | 0 .../groktut/a_second_model/etc/zope.conf.in | 0 .../groktut/a_second_model}/setup.py | 6 +- .../a_second_model/src/sample/__init__.py | 0 .../groktut/a_second_model/src/sample/app.py | 8 +- .../src/sample/app_templates/anotherindex.pt | 0 .../src/sample/app_templates/sampleindex.pt | 0 .../a_second_model/src/sample/configure.zcml | 0 .../groktut/a_second_view/buildout.cfg | 0 .../groktut/a_second_view/etc/README.txt | 0 .../groktut/a_second_view/etc/debug.ini.in | 0 .../groktut/a_second_view/etc/deploy.ini.in | 0 .../groktut/a_second_view/etc/site.zcml.in | 0 .../groktut/a_second_view/etc/zope.conf.in | 0 {doc => docs}/groktut/a_second_view/setup.py | 6 +- .../a_second_view/src/sample/__init__.py | 0 .../groktut/a_second_view/src/sample/app.py | 6 +- .../src/sample/app_templates/bye.pt | 0 .../src/sample/app_templates/index.pt | 0 .../a_second_view/src/sample/configure.zcml | 0 .../groktut/a_view_for_a_model/buildout.cfg | 0 .../groktut/a_view_for_a_model/etc/README.txt | 0 .../a_view_for_a_model/etc/debug.ini.in | 0 .../a_view_for_a_model/etc/deploy.ini.in | 0 .../a_view_for_a_model/etc/site.zcml.in | 0 .../a_view_for_a_model/etc/zope.conf.in | 0 .../groktut/a_view_for_a_model}/setup.py | 6 +- .../a_view_for_a_model/src/sample/__init__.py | 0 .../a_view_for_a_model/src/sample/app.py | 2 + .../src/sample/app_templates/index.pt | 0 .../src/sample/configure.zcml | 0 .../groktut/a_view_for_a_model2/buildout.cfg | 0 .../a_view_for_a_model2/etc/README.txt | 0 .../a_view_for_a_model2/etc/debug.ini.in | 0 .../a_view_for_a_model2/etc/deploy.ini.in | 0 .../a_view_for_a_model2/etc/site.zcml.in | 0 .../a_view_for_a_model2/etc/zope.conf.in | 0 .../groktut/a_view_for_a_model2}/setup.py | 6 +- .../src/sample/__init__.py | 0 .../a_view_for_a_model2/src/sample/app.py | 2 + .../src/sample/app_templates/index.pt | 0 .../src/sample/configure.zcml | 0 .../an_empty_grok_project/buildout.cfg | 0 .../an_empty_grok_project/etc/README.txt | 0 .../an_empty_grok_project/etc/debug.ini.in | 0 .../an_empty_grok_project/etc/deploy.ini.in | 0 .../an_empty_grok_project/etc/site.zcml.in | 0 .../an_empty_grok_project/etc/zope.conf.in | 0 docs/groktut/an_empty_grok_project/setup.py | 38 +++ .../src/sample/__init__.py | 0 .../an_empty_grok_project}/src/sample/app.py | 4 +- .../an_empty_grok_project/src/sample/app.txt | 0 .../src/sample/app_templates/index.pt | 0 .../src/sample/configure.zcml | 0 .../src/sample/ftesting.zcml | 0 .../src/sample/static/README.txt | 0 .../src/sample/tests.py | 3 +- .../buildout.cfg | 0 .../etc/README.txt | 0 .../etc/debug.ini.in | 0 .../etc/deploy.ini.in | 0 .../etc/site.zcml.in | 0 .../etc/zope.conf.in | 0 .../completely_python_driven_views/setup.py | 38 +++ .../src/sample/__init__.py | 0 .../src/sample/app.py | 4 +- .../src/sample/configure.zcml | 0 {doc => docs}/groktut/containers/buildout.cfg | 0 .../groktut/containers/etc/README.txt | 0 .../groktut/containers/etc/debug.ini.in | 0 .../groktut/containers/etc/deploy.ini.in | 0 .../groktut/containers/etc/site.zcml.in | 0 .../groktut/containers/etc/zope.conf.in | 0 docs/groktut/containers/setup.py | 38 +++ .../groktut/containers/src/sample/__init__.py | 0 .../groktut/containers/src/sample/app.py | 4 + .../src/sample/app_templates/entryindex.pt | 0 .../src/sample/app_templates/sampleindex.pt | 0 .../containers/src/sample/configure.zcml | 0 .../buildout.cfg | 0 .../etc/README.txt | 0 .../etc/debug.ini.in | 0 .../etc/deploy.ini.in | 0 .../etc/site.zcml.in | 0 .../etc/zope.conf.in | 0 .../setup.py | 38 +++ .../src/sample/__init__.py | 0 .../src/sample/app.py | 3 +- .../src/sample/app_templates/index.pt | 0 .../src/sample/configure.zcml | 0 .../buildout.cfg | 0 .../etc/README.txt | 0 .../etc/debug.ini.in | 0 .../etc/deploy.ini.in | 0 .../etc/site.zcml.in | 0 .../etc/zope.conf.in | 0 .../setup.py | 38 +++ .../src/sample/__init__.py | 0 .../src/sample/app.py | 7 +- .../src/sample/app_templates/bye.pt | 0 .../src/sample/app_templates/index.pt | 0 .../src/sample/configure.zcml | 0 .../generating_html_from_python/buildout.cfg | 0 .../etc/README.txt | 0 .../etc/debug.ini.in | 0 .../etc/deploy.ini.in | 0 .../etc/site.zcml.in | 0 .../etc/zope.conf.in | 0 .../generating_html_from_python/setup.py | 38 +++ .../src/sample/__init__.py | 0 .../src/sample/app.py | 5 +- .../src/sample/app_templates/index.pt | 0 .../src/sample/configure.zcml | 0 .../making_our_page_dynamic/buildout.cfg | 0 .../making_our_page_dynamic/etc/README.txt | 0 .../making_our_page_dynamic/etc/debug.ini.in | 0 .../making_our_page_dynamic/etc/deploy.ini.in | 0 .../making_our_page_dynamic/etc/site.zcml.in | 0 .../making_our_page_dynamic/etc/zope.conf.in | 0 docs/groktut/making_our_page_dynamic/setup.py | 38 +++ .../src/sample/__init__.py | 0 .../making_our_page_dynamic/src/sample/app.py | 3 +- .../src/sample/app_templates/index.pt | 0 .../src/sample/configure.zcml | 0 .../publishing_a_simple_web_page/buildout.cfg | 0 .../etc/README.txt | 0 .../etc/debug.ini.in | 0 .../etc/deploy.ini.in | 0 .../etc/site.zcml.in | 0 .../etc/zope.conf.in | 0 .../publishing_a_simple_web_page/setup.py | 38 +++ .../src/sample/__init__.py | 0 .../src/sample/app.py | 4 +- .../src/sample/app.txt | 0 .../src/sample/app_templates/index.pt | 0 .../src/sample/configure.zcml | 0 .../src/sample/ftesting.zcml | 0 .../src/sample/static/README.txt | 0 .../src/sample/tests.py | 3 +- .../reading_url_parameters/buildout.cfg | 0 .../reading_url_parameters/etc/README.txt | 0 .../reading_url_parameters/etc/debug.ini.in | 0 .../reading_url_parameters/etc/deploy.ini.in | 0 .../reading_url_parameters/etc/site.zcml.in | 0 .../reading_url_parameters/etc/zope.conf.in | 0 docs/groktut/reading_url_parameters/setup.py | 38 +++ .../src/sample/__init__.py | 0 .../reading_url_parameters/src/sample/app.py | 2 + .../src/sample/app_templates/index.pt | 0 .../src/sample/configure.zcml | 0 .../reading_url_parameters2/buildout.cfg | 0 .../reading_url_parameters2/etc/README.txt | 0 .../reading_url_parameters2/etc/debug.ini.in | 0 .../reading_url_parameters2/etc/deploy.ini.in | 0 .../reading_url_parameters2/etc/site.zcml.in | 0 .../reading_url_parameters2/etc/zope.conf.in | 0 docs/groktut/reading_url_parameters2/setup.py | 38 +++ .../src/sample/__init__.py | 0 .../reading_url_parameters2/src/sample/app.py | 2 + .../src/sample/app_templates/index.pt | 0 .../src/sample/configure.zcml | 0 .../groktut/redirection/buildout.cfg | 0 .../groktut/redirection/etc/README.txt | 0 .../groktut/redirection/etc/debug.ini.in | 0 .../groktut/redirection/etc/deploy.ini.in | 0 .../groktut/redirection/etc/site.zcml.in | 0 .../groktut/redirection/etc/zope.conf.in | 0 docs/groktut/redirection/setup.py | 38 +++ .../redirection/src/sample/__init__.py | 0 .../groktut/redirection/src/sample/app.py | 3 + .../src/sample/app_templates/edit.pt | 0 .../src/sample/app_templates/index.pt | 0 .../redirection/src/sample/configure.zcml | 0 .../setting_the_content_type/buildout.cfg | 0 .../setting_the_content_type/etc/README.txt | 0 .../setting_the_content_type/etc/debug.ini.in | 0 .../etc/deploy.ini.in | 0 .../setting_the_content_type/etc/site.zcml.in | 0 .../setting_the_content_type/etc/zope.conf.in | 0 .../groktut/setting_the_content_type/setup.py | 38 +++ .../src/sample/__init__.py | 0 .../src/sample/app.py | 4 +- .../src/sample/configure.zcml | 0 .../buildout.cfg | 0 .../etc/README.txt | 0 .../etc/debug.ini.in | 0 .../etc/deploy.ini.in | 0 .../etc/site.zcml.in | 0 .../etc/zope.conf.in | 0 .../showing_the_value_in_the_form/setup.py | 38 +++ .../src/sample/__init__.py | 0 .../src/sample/app.py | 3 + .../src/sample/app_templates/edit.pt | 0 .../src/sample/app_templates/index.pt | 0 .../src/sample/configure.zcml | 0 .../groktut/simple_forms/buildout.cfg | 0 .../groktut/simple_forms/etc/README.txt | 0 .../groktut/simple_forms/etc/debug.ini.in | 0 .../groktut/simple_forms/etc/deploy.ini.in | 0 .../groktut/simple_forms/etc/site.zcml.in | 0 .../groktut/simple_forms/etc/zope.conf.in | 0 docs/groktut/simple_forms/setup.py | 38 +++ .../simple_forms/src/sample/__init__.py | 0 .../groktut/simple_forms/src/sample/app.py | 2 + .../src/sample/app_templates/index.pt | 0 .../simple_forms/src/sample/configure.zcml | 0 .../groktut/simple_forms2/buildout.cfg | 0 .../groktut/simple_forms2/etc/README.txt | 0 .../groktut/simple_forms2/etc/debug.ini.in | 0 .../groktut/simple_forms2/etc/deploy.ini.in | 0 .../groktut/simple_forms2/etc/site.zcml.in | 0 .../groktut/simple_forms2/etc/zope.conf.in | 0 docs/groktut/simple_forms2/setup.py | 38 +++ .../simple_forms2/src/sample/__init__.py | 0 .../groktut/simple_forms2/src/sample/app.py | 2 + .../src/sample/app_templates/index.pt | 0 .../simple_forms2/src/sample/configure.zcml | 0 .../buildout.cfg | 0 .../etc/README.txt | 0 .../etc/debug.ini.in | 0 .../etc/deploy.ini.in | 0 .../etc/site.zcml.in | 0 .../etc/zope.conf.in | 0 .../setup.py | 38 +++ .../src/sample/__init__.py | 0 .../src/sample/app.py | 4 +- .../src/sample/app_templates/index.pt | 0 .../src/sample/configure.zcml | 0 .../src/sample/static/style.css | 0 .../groktut/storing_data/buildout.cfg | 0 .../groktut/storing_data/etc/README.txt | 0 .../groktut/storing_data/etc/debug.ini.in | 0 .../groktut/storing_data/etc/deploy.ini.in | 0 .../groktut/storing_data/etc/site.zcml.in | 0 .../groktut/storing_data/etc/zope.conf.in | 0 docs/groktut/storing_data/setup.py | 38 +++ .../storing_data/src/sample/__init__.py | 0 .../groktut/storing_data/src/sample/app.py | 3 + .../src/sample/app_templates/edit.pt | 0 .../src/sample/app_templates/index.pt | 0 .../storing_data/src/sample/configure.zcml | 0 {doc => docs}/groktut/template/buildout.cfg | 0 {doc => docs}/groktut/template/etc/README.txt | 0 .../groktut/template/etc/debug.ini.in | 0 .../groktut/template/etc/deploy.ini.in | 0 .../groktut/template/etc/site.zcml.in | 0 .../groktut/template/etc/zope.conf.in | 0 docs/groktut/template/setup.py | 38 +++ .../groktut/template/src/sample/__init__.py | 0 .../groktut/template}/src/sample/app.py | 4 +- .../src/sample/app_templates/index.pt | 0 .../template/src/sample/configure.zcml | 0 .../the_rules_of_persistence/buildout.cfg | 0 .../the_rules_of_persistence/etc/README.txt | 0 .../the_rules_of_persistence/etc/debug.ini.in | 0 .../etc/deploy.ini.in | 0 .../the_rules_of_persistence/etc/site.zcml.in | 0 .../the_rules_of_persistence/etc/zope.conf.in | 0 .../groktut/the_rules_of_persistence/setup.py | 38 +++ .../src/sample/__init__.py | 0 .../src/sample/app.py | 5 +- .../src/sample/app_templates/edit.pt | 0 .../src/sample/app_templates/index.pt | 0 .../src/sample/configure.zcml | 0 .../the_rules_of_persistence2/buildout.cfg | 0 .../the_rules_of_persistence2/etc/README.txt | 0 .../etc/debug.ini.in | 0 .../etc/deploy.ini.in | 0 .../etc/site.zcml.in | 0 .../etc/zope.conf.in | 0 .../the_rules_of_persistence2/setup.py | 38 +++ .../src/sample/__init__.py | 0 .../src/sample/app.py | 5 +- .../src/sample/app_templates/edit.pt | 0 .../src/sample/app_templates/index.pt | 0 .../src/sample/configure.zcml | 0 .../the_rules_of_persistence3/buildout.cfg | 0 .../the_rules_of_persistence3/etc/README.txt | 0 .../etc/debug.ini.in | 0 .../etc/deploy.ini.in | 0 .../etc/site.zcml.in | 0 .../etc/zope.conf.in | 0 .../the_rules_of_persistence3/setup.py | 38 +++ .../src/sample/__init__.py | 0 .../src/sample/app.py | 5 +- .../src/sample/app_templates/edit.pt | 0 .../src/sample/app_templates/index.pt | 0 .../src/sample/configure.zcml | 0 .../groktut/using_view_methods/buildout.cfg | 0 .../groktut/using_view_methods/etc/README.txt | 0 .../using_view_methods/etc/debug.ini.in | 0 .../using_view_methods/etc/deploy.ini.in | 0 .../using_view_methods/etc/site.zcml.in | 0 .../using_view_methods/etc/zope.conf.in | 0 docs/groktut/using_view_methods/setup.py | 38 +++ .../using_view_methods/src/sample/__init__.py | 0 .../using_view_methods/src/sample/app.py | 7 +- .../src/sample/app_templates/index.pt | 0 .../src/sample/configure.zcml | 0 {doc => docs}/index.rst | 0 {doc => docs}/layout.html | 4 +- {doc => docs}/license.rst | 0 {doc => docs}/make.bat | 0 {doc => docs}/naming_conventions.rst | 0 {doc => docs}/reference/components.rst | 13 +- {doc => docs}/reference/conf.py | 59 ++-- {doc => docs}/reference/decorators.rst | 0 {doc => docs}/reference/directives.rst | 0 {doc => docs}/reference/events.rst | 0 {doc => docs}/reference/exceptions.rst | 0 {doc => docs}/reference/functions.rst | 6 + {doc => docs}/reference/index.rst | 0 {doc => docs}/reference/testing.rst | 8 +- {doc => docs}/reference/utils.rst | 6 - {doc => docs}/release.rst | 0 {doc => docs}/releases.rst | 0 docs/requirements.txt | 2 + {doc => docs}/resources/evencaveman.jpg | Bin {doc => docs}/resources/grok-standing.jpg | Bin {doc => docs}/scripts/update-releaseinfo.py | 63 +++-- {doc => docs}/style.tex | 0 {doc => docs}/template.pt | 0 {doc => docs}/tutorial.rst | 0 {doc => docs}/tutorial_outline.txt | 0 {doc => docs}/upgrade.rst | 0 {doc => docs}/upgrade.txt | 4 +- documentation.cfg | 1 - grok.cfg | 50 ++-- setup.cfg | 28 ++ setup.py | 37 +-- src/groktoolkit/__init__.py | 33 --- tox.ini | 82 +++++- 428 files changed, 1580 insertions(+), 8123 deletions(-) create mode 100644 .editorconfig create mode 100644 .github/workflows/tests.yml create mode 100644 .meta.toml create mode 100644 .readthedocs.yaml delete mode 100644 .travis.yml create mode 100644 CONTRIBUTING.md create mode 100644 MANIFEST.in create mode 100644 README.rst delete mode 100644 bootstrap.py delete mode 100644 doc/changes.rst delete mode 100644 doc/design/skin-minimal.py delete mode 100644 doc/groktut/a_second_model/bootstrap.py delete mode 100644 doc/groktut/a_second_view/bootstrap.py delete mode 100644 doc/groktut/a_view_for_a_model/bootstrap.py delete mode 100644 doc/groktut/a_view_for_a_model2/bootstrap.py delete mode 100644 doc/groktut/an_empty_grok_project/bootstrap.py delete mode 100644 doc/groktut/an_empty_grok_project/setup.py delete mode 100644 doc/groktut/completely_python_driven_views/bootstrap.py delete mode 100644 doc/groktut/completely_python_driven_views/setup.py delete mode 100644 doc/groktut/containers/bootstrap.py delete mode 100644 doc/groktut/containers/setup.py delete mode 100644 doc/groktut/doing_some_calculation_before_viewing_a_page/bootstrap.py delete mode 100644 doc/groktut/doing_some_calculation_before_viewing_a_page/setup.py delete mode 100644 doc/groktut/explicitly_associating_a_view_with_a_model/bootstrap.py delete mode 100644 doc/groktut/explicitly_associating_a_view_with_a_model/setup.py delete mode 100644 doc/groktut/generating_html_from_python/bootstrap.py delete mode 100644 doc/groktut/generating_html_from_python/setup.py delete mode 100644 doc/groktut/making_our_page_dynamic/bootstrap.py delete mode 100644 doc/groktut/making_our_page_dynamic/setup.py delete mode 100644 doc/groktut/publishing_a_simple_web_page/bootstrap.py delete mode 100644 doc/groktut/publishing_a_simple_web_page/setup.py delete mode 100644 doc/groktut/reading_url_parameters/bootstrap.py delete mode 100644 doc/groktut/reading_url_parameters/setup.py delete mode 100644 doc/groktut/reading_url_parameters2/bootstrap.py delete mode 100644 doc/groktut/reading_url_parameters2/setup.py delete mode 100644 doc/groktut/redirection/bootstrap.py delete mode 100644 doc/groktut/redirection/setup.py delete mode 100644 doc/groktut/setting_the_content_type/bootstrap.py delete mode 100644 doc/groktut/setting_the_content_type/setup.py delete mode 100644 doc/groktut/showing_the_value_in_the_form/bootstrap.py delete mode 100644 doc/groktut/showing_the_value_in_the_form/setup.py delete mode 100644 doc/groktut/simple_forms/bootstrap.py delete mode 100644 doc/groktut/simple_forms/setup.py delete mode 100644 doc/groktut/simple_forms2/bootstrap.py delete mode 100644 doc/groktut/simple_forms2/setup.py delete mode 100644 doc/groktut/static_resources_for_our_web_page/bootstrap.py delete mode 100644 doc/groktut/static_resources_for_our_web_page/setup.py delete mode 100644 doc/groktut/storing_data/bootstrap.py delete mode 100644 doc/groktut/storing_data/setup.py delete mode 100644 doc/groktut/template/bootstrap.py delete mode 100644 doc/groktut/template/setup.py delete mode 100644 doc/groktut/the_rules_of_persistence/bootstrap.py delete mode 100644 doc/groktut/the_rules_of_persistence/setup.py delete mode 100644 doc/groktut/the_rules_of_persistence2/bootstrap.py delete mode 100644 doc/groktut/the_rules_of_persistence2/setup.py delete mode 100644 doc/groktut/the_rules_of_persistence3/bootstrap.py delete mode 100644 doc/groktut/the_rules_of_persistence3/setup.py delete mode 100644 doc/groktut/using_view_methods/bootstrap.py delete mode 100644 doc/groktut/using_view_methods/setup.py rename {doc => docs}/ACKS.txt (100%) rename {doc => docs}/Makefile (100%) rename {doc => docs}/README.rst (100%) rename {doc => docs}/_static/default.css (100%) rename {doc => docs}/_static/grok.css (100%) rename {doc => docs}/_static/grok_club.gif (100%) rename {doc => docs}/_static/logo.gif (100%) rename {doc => docs}/_static/logo.png (100%) rename {doc => docs}/_static/top_bg.jpg (100%) rename {doc => docs}/bugs.rst (100%) create mode 100644 docs/changes.rst rename {doc => docs}/conf.py (79%) rename {doc => docs}/contents.rst (100%) rename {doc => docs}/copyright.rst (100%) rename {doc => docs}/design/adapters.py (66%) rename {doc => docs}/design/annotations.py (95%) rename {doc => docs}/design/container.py (99%) rename {doc => docs}/design/grok_beginner.txt (100%) rename {doc => docs}/design/grok_dev.txt (100%) rename {doc => docs}/design/menu.py (82%) rename {doc => docs}/design/model.py (87%) rename {doc => docs}/design/permission.py (80%) create mode 100644 docs/design/skin-minimal.py rename {doc => docs}/design/skin.py (94%) rename {doc => docs}/design/subscriber.py (100%) rename {doc => docs}/design/traversal.py (67%) rename {doc => docs}/design/utility.py (65%) rename {doc => docs}/design/views.py (91%) rename {doc => docs}/docindex.template (100%) rename {doc => docs}/glossary.rst (100%) rename {doc => docs}/grok_overview.rst (100%) rename {doc => docs}/groktut/a_second_model/buildout.cfg (100%) rename {doc => docs}/groktut/a_second_model/etc/README.txt (100%) rename {doc => docs}/groktut/a_second_model/etc/debug.ini.in (100%) rename {doc => docs}/groktut/a_second_model/etc/deploy.ini.in (100%) rename {doc => docs}/groktut/a_second_model/etc/site.zcml.in (100%) rename {doc => docs}/groktut/a_second_model/etc/zope.conf.in (100%) rename {doc/groktut/a_view_for_a_model => docs/groktut/a_second_model}/setup.py (91%) rename {doc => docs}/groktut/a_second_model/src/sample/__init__.py (100%) rename {doc => docs}/groktut/a_second_model/src/sample/app.py (97%) rename {doc => docs}/groktut/a_second_model/src/sample/app_templates/anotherindex.pt (100%) rename {doc => docs}/groktut/a_second_model/src/sample/app_templates/sampleindex.pt (100%) rename {doc => docs}/groktut/a_second_model/src/sample/configure.zcml (100%) rename {doc => docs}/groktut/a_second_view/buildout.cfg (100%) rename {doc => docs}/groktut/a_second_view/etc/README.txt (100%) rename {doc => docs}/groktut/a_second_view/etc/debug.ini.in (100%) rename {doc => docs}/groktut/a_second_view/etc/deploy.ini.in (100%) rename {doc => docs}/groktut/a_second_view/etc/site.zcml.in (100%) rename {doc => docs}/groktut/a_second_view/etc/zope.conf.in (100%) rename {doc => docs}/groktut/a_second_view/setup.py (91%) rename {doc => docs}/groktut/a_second_view/src/sample/__init__.py (100%) rename {doc => docs}/groktut/a_second_view/src/sample/app.py (97%) rename {doc => docs}/groktut/a_second_view/src/sample/app_templates/bye.pt (100%) rename {doc => docs}/groktut/a_second_view/src/sample/app_templates/index.pt (100%) rename {doc => docs}/groktut/a_second_view/src/sample/configure.zcml (100%) rename {doc => docs}/groktut/a_view_for_a_model/buildout.cfg (100%) rename {doc => docs}/groktut/a_view_for_a_model/etc/README.txt (100%) rename {doc => docs}/groktut/a_view_for_a_model/etc/debug.ini.in (100%) rename {doc => docs}/groktut/a_view_for_a_model/etc/deploy.ini.in (100%) rename {doc => docs}/groktut/a_view_for_a_model/etc/site.zcml.in (100%) rename {doc => docs}/groktut/a_view_for_a_model/etc/zope.conf.in (100%) rename {doc/groktut/a_view_for_a_model2 => docs/groktut/a_view_for_a_model}/setup.py (91%) rename {doc => docs}/groktut/a_view_for_a_model/src/sample/__init__.py (100%) rename {doc => docs}/groktut/a_view_for_a_model/src/sample/app.py (98%) rename {doc => docs}/groktut/a_view_for_a_model/src/sample/app_templates/index.pt (100%) rename {doc => docs}/groktut/a_view_for_a_model/src/sample/configure.zcml (100%) rename {doc => docs}/groktut/a_view_for_a_model2/buildout.cfg (100%) rename {doc => docs}/groktut/a_view_for_a_model2/etc/README.txt (100%) rename {doc => docs}/groktut/a_view_for_a_model2/etc/debug.ini.in (100%) rename {doc => docs}/groktut/a_view_for_a_model2/etc/deploy.ini.in (100%) rename {doc => docs}/groktut/a_view_for_a_model2/etc/site.zcml.in (100%) rename {doc => docs}/groktut/a_view_for_a_model2/etc/zope.conf.in (100%) rename {doc/groktut/a_second_model => docs/groktut/a_view_for_a_model2}/setup.py (91%) rename {doc => docs}/groktut/a_view_for_a_model2/src/sample/__init__.py (100%) rename {doc => docs}/groktut/a_view_for_a_model2/src/sample/app.py (99%) rename {doc => docs}/groktut/a_view_for_a_model2/src/sample/app_templates/index.pt (100%) rename {doc => docs}/groktut/a_view_for_a_model2/src/sample/configure.zcml (100%) rename {doc => docs}/groktut/an_empty_grok_project/buildout.cfg (100%) rename {doc => docs}/groktut/an_empty_grok_project/etc/README.txt (100%) rename {doc => docs}/groktut/an_empty_grok_project/etc/debug.ini.in (100%) rename {doc => docs}/groktut/an_empty_grok_project/etc/deploy.ini.in (100%) rename {doc => docs}/groktut/an_empty_grok_project/etc/site.zcml.in (100%) rename {doc => docs}/groktut/an_empty_grok_project/etc/zope.conf.in (100%) create mode 100644 docs/groktut/an_empty_grok_project/setup.py rename {doc => docs}/groktut/an_empty_grok_project/src/sample/__init__.py (100%) rename {doc/groktut/template => docs/groktut/an_empty_grok_project}/src/sample/app.py (69%) rename {doc => docs}/groktut/an_empty_grok_project/src/sample/app.txt (100%) rename {doc => docs}/groktut/an_empty_grok_project/src/sample/app_templates/index.pt (100%) rename {doc => docs}/groktut/an_empty_grok_project/src/sample/configure.zcml (100%) rename {doc => docs}/groktut/an_empty_grok_project/src/sample/ftesting.zcml (100%) rename {doc => docs}/groktut/an_empty_grok_project/src/sample/static/README.txt (100%) rename {doc/groktut/publishing_a_simple_web_page => docs/groktut/an_empty_grok_project}/src/sample/tests.py (94%) rename {doc => docs}/groktut/completely_python_driven_views/buildout.cfg (100%) rename {doc => docs}/groktut/completely_python_driven_views/etc/README.txt (100%) rename {doc => docs}/groktut/completely_python_driven_views/etc/debug.ini.in (100%) rename {doc => docs}/groktut/completely_python_driven_views/etc/deploy.ini.in (100%) rename {doc => docs}/groktut/completely_python_driven_views/etc/site.zcml.in (100%) rename {doc => docs}/groktut/completely_python_driven_views/etc/zope.conf.in (100%) create mode 100644 docs/groktut/completely_python_driven_views/setup.py rename {doc => docs}/groktut/completely_python_driven_views/src/sample/__init__.py (100%) rename {doc => docs}/groktut/completely_python_driven_views/src/sample/app.py (98%) rename {doc => docs}/groktut/completely_python_driven_views/src/sample/configure.zcml (100%) rename {doc => docs}/groktut/containers/buildout.cfg (100%) rename {doc => docs}/groktut/containers/etc/README.txt (100%) rename {doc => docs}/groktut/containers/etc/debug.ini.in (100%) rename {doc => docs}/groktut/containers/etc/deploy.ini.in (100%) rename {doc => docs}/groktut/containers/etc/site.zcml.in (100%) rename {doc => docs}/groktut/containers/etc/zope.conf.in (100%) create mode 100644 docs/groktut/containers/setup.py rename {doc => docs}/groktut/containers/src/sample/__init__.py (100%) rename {doc => docs}/groktut/containers/src/sample/app.py (99%) rename {doc => docs}/groktut/containers/src/sample/app_templates/entryindex.pt (100%) rename {doc => docs}/groktut/containers/src/sample/app_templates/sampleindex.pt (100%) rename {doc => docs}/groktut/containers/src/sample/configure.zcml (100%) rename {doc => docs}/groktut/doing_some_calculation_before_viewing_a_page/buildout.cfg (100%) rename {doc => docs}/groktut/doing_some_calculation_before_viewing_a_page/etc/README.txt (100%) rename {doc => docs}/groktut/doing_some_calculation_before_viewing_a_page/etc/debug.ini.in (100%) rename {doc => docs}/groktut/doing_some_calculation_before_viewing_a_page/etc/deploy.ini.in (100%) rename {doc => docs}/groktut/doing_some_calculation_before_viewing_a_page/etc/site.zcml.in (100%) rename {doc => docs}/groktut/doing_some_calculation_before_viewing_a_page/etc/zope.conf.in (100%) create mode 100644 docs/groktut/doing_some_calculation_before_viewing_a_page/setup.py rename {doc => docs}/groktut/doing_some_calculation_before_viewing_a_page/src/sample/__init__.py (100%) rename {doc => docs}/groktut/doing_some_calculation_before_viewing_a_page/src/sample/app.py (99%) rename {doc => docs}/groktut/doing_some_calculation_before_viewing_a_page/src/sample/app_templates/index.pt (100%) rename {doc => docs}/groktut/doing_some_calculation_before_viewing_a_page/src/sample/configure.zcml (100%) rename {doc => docs}/groktut/explicitly_associating_a_view_with_a_model/buildout.cfg (100%) rename {doc => docs}/groktut/explicitly_associating_a_view_with_a_model/etc/README.txt (100%) rename {doc => docs}/groktut/explicitly_associating_a_view_with_a_model/etc/debug.ini.in (100%) rename {doc => docs}/groktut/explicitly_associating_a_view_with_a_model/etc/deploy.ini.in (100%) rename {doc => docs}/groktut/explicitly_associating_a_view_with_a_model/etc/site.zcml.in (100%) rename {doc => docs}/groktut/explicitly_associating_a_view_with_a_model/etc/zope.conf.in (100%) create mode 100644 docs/groktut/explicitly_associating_a_view_with_a_model/setup.py rename {doc => docs}/groktut/explicitly_associating_a_view_with_a_model/src/sample/__init__.py (100%) rename {doc => docs}/groktut/explicitly_associating_a_view_with_a_model/src/sample/app.py (95%) rename {doc => docs}/groktut/explicitly_associating_a_view_with_a_model/src/sample/app_templates/bye.pt (100%) rename {doc => docs}/groktut/explicitly_associating_a_view_with_a_model/src/sample/app_templates/index.pt (100%) rename {doc => docs}/groktut/explicitly_associating_a_view_with_a_model/src/sample/configure.zcml (100%) rename {doc => docs}/groktut/generating_html_from_python/buildout.cfg (100%) rename {doc => docs}/groktut/generating_html_from_python/etc/README.txt (100%) rename {doc => docs}/groktut/generating_html_from_python/etc/debug.ini.in (100%) rename {doc => docs}/groktut/generating_html_from_python/etc/deploy.ini.in (100%) rename {doc => docs}/groktut/generating_html_from_python/etc/site.zcml.in (100%) rename {doc => docs}/groktut/generating_html_from_python/etc/zope.conf.in (100%) create mode 100644 docs/groktut/generating_html_from_python/setup.py rename {doc => docs}/groktut/generating_html_from_python/src/sample/__init__.py (100%) rename {doc => docs}/groktut/generating_html_from_python/src/sample/app.py (98%) rename {doc => docs}/groktut/generating_html_from_python/src/sample/app_templates/index.pt (100%) rename {doc => docs}/groktut/generating_html_from_python/src/sample/configure.zcml (100%) rename {doc => docs}/groktut/making_our_page_dynamic/buildout.cfg (100%) rename {doc => docs}/groktut/making_our_page_dynamic/etc/README.txt (100%) rename {doc => docs}/groktut/making_our_page_dynamic/etc/debug.ini.in (100%) rename {doc => docs}/groktut/making_our_page_dynamic/etc/deploy.ini.in (100%) rename {doc => docs}/groktut/making_our_page_dynamic/etc/site.zcml.in (100%) rename {doc => docs}/groktut/making_our_page_dynamic/etc/zope.conf.in (100%) create mode 100644 docs/groktut/making_our_page_dynamic/setup.py rename {doc => docs}/groktut/making_our_page_dynamic/src/sample/__init__.py (100%) rename {doc => docs}/groktut/making_our_page_dynamic/src/sample/app.py (99%) rename {doc => docs}/groktut/making_our_page_dynamic/src/sample/app_templates/index.pt (100%) rename {doc => docs}/groktut/making_our_page_dynamic/src/sample/configure.zcml (100%) rename {doc => docs}/groktut/publishing_a_simple_web_page/buildout.cfg (100%) rename {doc => docs}/groktut/publishing_a_simple_web_page/etc/README.txt (100%) rename {doc => docs}/groktut/publishing_a_simple_web_page/etc/debug.ini.in (100%) rename {doc => docs}/groktut/publishing_a_simple_web_page/etc/deploy.ini.in (100%) rename {doc => docs}/groktut/publishing_a_simple_web_page/etc/site.zcml.in (100%) rename {doc => docs}/groktut/publishing_a_simple_web_page/etc/zope.conf.in (100%) create mode 100644 docs/groktut/publishing_a_simple_web_page/setup.py rename {doc => docs}/groktut/publishing_a_simple_web_page/src/sample/__init__.py (100%) rename {doc/groktut/static_resources_for_our_web_page => docs/groktut/publishing_a_simple_web_page}/src/sample/app.py (97%) rename {doc => docs}/groktut/publishing_a_simple_web_page/src/sample/app.txt (100%) rename {doc => docs}/groktut/publishing_a_simple_web_page/src/sample/app_templates/index.pt (100%) rename {doc => docs}/groktut/publishing_a_simple_web_page/src/sample/configure.zcml (100%) rename {doc => docs}/groktut/publishing_a_simple_web_page/src/sample/ftesting.zcml (100%) rename {doc => docs}/groktut/publishing_a_simple_web_page/src/sample/static/README.txt (100%) rename {doc/groktut/an_empty_grok_project => docs/groktut/publishing_a_simple_web_page}/src/sample/tests.py (94%) rename {doc => docs}/groktut/reading_url_parameters/buildout.cfg (100%) rename {doc => docs}/groktut/reading_url_parameters/etc/README.txt (100%) rename {doc => docs}/groktut/reading_url_parameters/etc/debug.ini.in (100%) rename {doc => docs}/groktut/reading_url_parameters/etc/deploy.ini.in (100%) rename {doc => docs}/groktut/reading_url_parameters/etc/site.zcml.in (100%) rename {doc => docs}/groktut/reading_url_parameters/etc/zope.conf.in (100%) create mode 100644 docs/groktut/reading_url_parameters/setup.py rename {doc => docs}/groktut/reading_url_parameters/src/sample/__init__.py (100%) rename {doc => docs}/groktut/reading_url_parameters/src/sample/app.py (98%) rename {doc => docs}/groktut/reading_url_parameters/src/sample/app_templates/index.pt (100%) rename {doc => docs}/groktut/reading_url_parameters/src/sample/configure.zcml (100%) rename {doc => docs}/groktut/reading_url_parameters2/buildout.cfg (100%) rename {doc => docs}/groktut/reading_url_parameters2/etc/README.txt (100%) rename {doc => docs}/groktut/reading_url_parameters2/etc/debug.ini.in (100%) rename {doc => docs}/groktut/reading_url_parameters2/etc/deploy.ini.in (100%) rename {doc => docs}/groktut/reading_url_parameters2/etc/site.zcml.in (100%) rename {doc => docs}/groktut/reading_url_parameters2/etc/zope.conf.in (100%) create mode 100644 docs/groktut/reading_url_parameters2/setup.py rename {doc => docs}/groktut/reading_url_parameters2/src/sample/__init__.py (100%) rename {doc => docs}/groktut/reading_url_parameters2/src/sample/app.py (98%) rename {doc => docs}/groktut/reading_url_parameters2/src/sample/app_templates/index.pt (100%) rename {doc => docs}/groktut/reading_url_parameters2/src/sample/configure.zcml (100%) rename {doc => docs}/groktut/redirection/buildout.cfg (100%) rename {doc => docs}/groktut/redirection/etc/README.txt (100%) rename {doc => docs}/groktut/redirection/etc/debug.ini.in (100%) rename {doc => docs}/groktut/redirection/etc/deploy.ini.in (100%) rename {doc => docs}/groktut/redirection/etc/site.zcml.in (100%) rename {doc => docs}/groktut/redirection/etc/zope.conf.in (100%) create mode 100644 docs/groktut/redirection/setup.py rename {doc => docs}/groktut/redirection/src/sample/__init__.py (100%) rename {doc => docs}/groktut/redirection/src/sample/app.py (98%) rename {doc => docs}/groktut/redirection/src/sample/app_templates/edit.pt (100%) rename {doc => docs}/groktut/redirection/src/sample/app_templates/index.pt (100%) rename {doc => docs}/groktut/redirection/src/sample/configure.zcml (100%) rename {doc => docs}/groktut/setting_the_content_type/buildout.cfg (100%) rename {doc => docs}/groktut/setting_the_content_type/etc/README.txt (100%) rename {doc => docs}/groktut/setting_the_content_type/etc/debug.ini.in (100%) rename {doc => docs}/groktut/setting_the_content_type/etc/deploy.ini.in (100%) rename {doc => docs}/groktut/setting_the_content_type/etc/site.zcml.in (100%) rename {doc => docs}/groktut/setting_the_content_type/etc/zope.conf.in (100%) create mode 100644 docs/groktut/setting_the_content_type/setup.py rename {doc => docs}/groktut/setting_the_content_type/src/sample/__init__.py (100%) rename {doc => docs}/groktut/setting_the_content_type/src/sample/app.py (98%) rename {doc => docs}/groktut/setting_the_content_type/src/sample/configure.zcml (100%) rename {doc => docs}/groktut/showing_the_value_in_the_form/buildout.cfg (100%) rename {doc => docs}/groktut/showing_the_value_in_the_form/etc/README.txt (100%) rename {doc => docs}/groktut/showing_the_value_in_the_form/etc/debug.ini.in (100%) rename {doc => docs}/groktut/showing_the_value_in_the_form/etc/deploy.ini.in (100%) rename {doc => docs}/groktut/showing_the_value_in_the_form/etc/site.zcml.in (100%) rename {doc => docs}/groktut/showing_the_value_in_the_form/etc/zope.conf.in (100%) create mode 100644 docs/groktut/showing_the_value_in_the_form/setup.py rename {doc => docs}/groktut/showing_the_value_in_the_form/src/sample/__init__.py (100%) rename {doc => docs}/groktut/showing_the_value_in_the_form/src/sample/app.py (98%) rename {doc => docs}/groktut/showing_the_value_in_the_form/src/sample/app_templates/edit.pt (100%) rename {doc => docs}/groktut/showing_the_value_in_the_form/src/sample/app_templates/index.pt (100%) rename {doc => docs}/groktut/showing_the_value_in_the_form/src/sample/configure.zcml (100%) rename {doc => docs}/groktut/simple_forms/buildout.cfg (100%) rename {doc => docs}/groktut/simple_forms/etc/README.txt (100%) rename {doc => docs}/groktut/simple_forms/etc/debug.ini.in (100%) rename {doc => docs}/groktut/simple_forms/etc/deploy.ini.in (100%) rename {doc => docs}/groktut/simple_forms/etc/site.zcml.in (100%) rename {doc => docs}/groktut/simple_forms/etc/zope.conf.in (100%) create mode 100644 docs/groktut/simple_forms/setup.py rename {doc => docs}/groktut/simple_forms/src/sample/__init__.py (100%) rename {doc => docs}/groktut/simple_forms/src/sample/app.py (98%) rename {doc => docs}/groktut/simple_forms/src/sample/app_templates/index.pt (100%) rename {doc => docs}/groktut/simple_forms/src/sample/configure.zcml (100%) rename {doc => docs}/groktut/simple_forms2/buildout.cfg (100%) rename {doc => docs}/groktut/simple_forms2/etc/README.txt (100%) rename {doc => docs}/groktut/simple_forms2/etc/debug.ini.in (100%) rename {doc => docs}/groktut/simple_forms2/etc/deploy.ini.in (100%) rename {doc => docs}/groktut/simple_forms2/etc/site.zcml.in (100%) rename {doc => docs}/groktut/simple_forms2/etc/zope.conf.in (100%) create mode 100644 docs/groktut/simple_forms2/setup.py rename {doc => docs}/groktut/simple_forms2/src/sample/__init__.py (100%) rename {doc => docs}/groktut/simple_forms2/src/sample/app.py (99%) rename {doc => docs}/groktut/simple_forms2/src/sample/app_templates/index.pt (100%) rename {doc => docs}/groktut/simple_forms2/src/sample/configure.zcml (100%) rename {doc => docs}/groktut/static_resources_for_our_web_page/buildout.cfg (100%) rename {doc => docs}/groktut/static_resources_for_our_web_page/etc/README.txt (100%) rename {doc => docs}/groktut/static_resources_for_our_web_page/etc/debug.ini.in (100%) rename {doc => docs}/groktut/static_resources_for_our_web_page/etc/deploy.ini.in (100%) rename {doc => docs}/groktut/static_resources_for_our_web_page/etc/site.zcml.in (100%) rename {doc => docs}/groktut/static_resources_for_our_web_page/etc/zope.conf.in (100%) create mode 100644 docs/groktut/static_resources_for_our_web_page/setup.py rename {doc => docs}/groktut/static_resources_for_our_web_page/src/sample/__init__.py (100%) rename {doc/groktut/publishing_a_simple_web_page => docs/groktut/static_resources_for_our_web_page}/src/sample/app.py (97%) rename {doc => docs}/groktut/static_resources_for_our_web_page/src/sample/app_templates/index.pt (100%) rename {doc => docs}/groktut/static_resources_for_our_web_page/src/sample/configure.zcml (100%) rename {doc => docs}/groktut/static_resources_for_our_web_page/src/sample/static/style.css (100%) rename {doc => docs}/groktut/storing_data/buildout.cfg (100%) rename {doc => docs}/groktut/storing_data/etc/README.txt (100%) rename {doc => docs}/groktut/storing_data/etc/debug.ini.in (100%) rename {doc => docs}/groktut/storing_data/etc/deploy.ini.in (100%) rename {doc => docs}/groktut/storing_data/etc/site.zcml.in (100%) rename {doc => docs}/groktut/storing_data/etc/zope.conf.in (100%) create mode 100644 docs/groktut/storing_data/setup.py rename {doc => docs}/groktut/storing_data/src/sample/__init__.py (100%) rename {doc => docs}/groktut/storing_data/src/sample/app.py (98%) rename {doc => docs}/groktut/storing_data/src/sample/app_templates/edit.pt (100%) rename {doc => docs}/groktut/storing_data/src/sample/app_templates/index.pt (100%) rename {doc => docs}/groktut/storing_data/src/sample/configure.zcml (100%) rename {doc => docs}/groktut/template/buildout.cfg (100%) rename {doc => docs}/groktut/template/etc/README.txt (100%) rename {doc => docs}/groktut/template/etc/debug.ini.in (100%) rename {doc => docs}/groktut/template/etc/deploy.ini.in (100%) rename {doc => docs}/groktut/template/etc/site.zcml.in (100%) rename {doc => docs}/groktut/template/etc/zope.conf.in (100%) create mode 100644 docs/groktut/template/setup.py rename {doc => docs}/groktut/template/src/sample/__init__.py (100%) rename {doc/groktut/an_empty_grok_project => docs/groktut/template}/src/sample/app.py (69%) rename {doc => docs}/groktut/template/src/sample/app_templates/index.pt (100%) rename {doc => docs}/groktut/template/src/sample/configure.zcml (100%) rename {doc => docs}/groktut/the_rules_of_persistence/buildout.cfg (100%) rename {doc => docs}/groktut/the_rules_of_persistence/etc/README.txt (100%) rename {doc => docs}/groktut/the_rules_of_persistence/etc/debug.ini.in (100%) rename {doc => docs}/groktut/the_rules_of_persistence/etc/deploy.ini.in (100%) rename {doc => docs}/groktut/the_rules_of_persistence/etc/site.zcml.in (100%) rename {doc => docs}/groktut/the_rules_of_persistence/etc/zope.conf.in (100%) create mode 100644 docs/groktut/the_rules_of_persistence/setup.py rename {doc => docs}/groktut/the_rules_of_persistence/src/sample/__init__.py (100%) rename {doc => docs}/groktut/the_rules_of_persistence/src/sample/app.py (98%) rename {doc => docs}/groktut/the_rules_of_persistence/src/sample/app_templates/edit.pt (100%) rename {doc => docs}/groktut/the_rules_of_persistence/src/sample/app_templates/index.pt (100%) rename {doc => docs}/groktut/the_rules_of_persistence/src/sample/configure.zcml (100%) rename {doc => docs}/groktut/the_rules_of_persistence2/buildout.cfg (100%) rename {doc => docs}/groktut/the_rules_of_persistence2/etc/README.txt (100%) rename {doc => docs}/groktut/the_rules_of_persistence2/etc/debug.ini.in (100%) rename {doc => docs}/groktut/the_rules_of_persistence2/etc/deploy.ini.in (100%) rename {doc => docs}/groktut/the_rules_of_persistence2/etc/site.zcml.in (100%) rename {doc => docs}/groktut/the_rules_of_persistence2/etc/zope.conf.in (100%) create mode 100644 docs/groktut/the_rules_of_persistence2/setup.py rename {doc => docs}/groktut/the_rules_of_persistence2/src/sample/__init__.py (100%) rename {doc => docs}/groktut/the_rules_of_persistence2/src/sample/app.py (98%) rename {doc => docs}/groktut/the_rules_of_persistence2/src/sample/app_templates/edit.pt (100%) rename {doc => docs}/groktut/the_rules_of_persistence2/src/sample/app_templates/index.pt (100%) rename {doc => docs}/groktut/the_rules_of_persistence2/src/sample/configure.zcml (100%) rename {doc => docs}/groktut/the_rules_of_persistence3/buildout.cfg (100%) rename {doc => docs}/groktut/the_rules_of_persistence3/etc/README.txt (100%) rename {doc => docs}/groktut/the_rules_of_persistence3/etc/debug.ini.in (100%) rename {doc => docs}/groktut/the_rules_of_persistence3/etc/deploy.ini.in (100%) rename {doc => docs}/groktut/the_rules_of_persistence3/etc/site.zcml.in (100%) rename {doc => docs}/groktut/the_rules_of_persistence3/etc/zope.conf.in (100%) create mode 100644 docs/groktut/the_rules_of_persistence3/setup.py rename {doc => docs}/groktut/the_rules_of_persistence3/src/sample/__init__.py (100%) rename {doc => docs}/groktut/the_rules_of_persistence3/src/sample/app.py (98%) rename {doc => docs}/groktut/the_rules_of_persistence3/src/sample/app_templates/edit.pt (100%) rename {doc => docs}/groktut/the_rules_of_persistence3/src/sample/app_templates/index.pt (100%) rename {doc => docs}/groktut/the_rules_of_persistence3/src/sample/configure.zcml (100%) rename {doc => docs}/groktut/using_view_methods/buildout.cfg (100%) rename {doc => docs}/groktut/using_view_methods/etc/README.txt (100%) rename {doc => docs}/groktut/using_view_methods/etc/debug.ini.in (100%) rename {doc => docs}/groktut/using_view_methods/etc/deploy.ini.in (100%) rename {doc => docs}/groktut/using_view_methods/etc/site.zcml.in (100%) rename {doc => docs}/groktut/using_view_methods/etc/zope.conf.in (100%) create mode 100644 docs/groktut/using_view_methods/setup.py rename {doc => docs}/groktut/using_view_methods/src/sample/__init__.py (100%) rename {doc => docs}/groktut/using_view_methods/src/sample/app.py (88%) rename {doc => docs}/groktut/using_view_methods/src/sample/app_templates/index.pt (100%) rename {doc => docs}/groktut/using_view_methods/src/sample/configure.zcml (100%) rename {doc => docs}/index.rst (100%) rename {doc => docs}/layout.html (85%) rename {doc => docs}/license.rst (100%) rename {doc => docs}/make.bat (100%) rename {doc => docs}/naming_conventions.rst (100%) rename {doc => docs}/reference/components.rst (99%) rename {doc => docs}/reference/conf.py (82%) rename {doc => docs}/reference/decorators.rst (100%) rename {doc => docs}/reference/directives.rst (100%) rename {doc => docs}/reference/events.rst (100%) rename {doc => docs}/reference/exceptions.rst (100%) rename {doc => docs}/reference/functions.rst (97%) rename {doc => docs}/reference/index.rst (100%) rename {doc => docs}/reference/testing.rst (99%) rename {doc => docs}/reference/utils.rst (87%) rename {doc => docs}/release.rst (100%) rename {doc => docs}/releases.rst (100%) create mode 100644 docs/requirements.txt rename {doc => docs}/resources/evencaveman.jpg (100%) rename {doc => docs}/resources/grok-standing.jpg (100%) rename {doc => docs}/scripts/update-releaseinfo.py (74%) rename {doc => docs}/style.tex (100%) rename {doc => docs}/template.pt (100%) rename {doc => docs}/tutorial.rst (100%) rename {doc => docs}/tutorial_outline.txt (100%) rename {doc => docs}/upgrade.rst (100%) rename {doc => docs}/upgrade.txt (99%) create mode 100644 setup.cfg delete mode 100644 src/groktoolkit/__init__.py diff --git a/.editorconfig b/.editorconfig new file mode 100644 index 0000000..d14e2ae --- /dev/null +++ b/.editorconfig @@ -0,0 +1,39 @@ +# Generated from: +# https://github.com/zopefoundation/meta/tree/master/config/toolkit +# +# EditorConfig Configuration file, for more details see: +# http://EditorConfig.org +# EditorConfig is a convention description, that could be interpreted +# by multiple editors to enforce common coding conventions for specific +# file types + +# top-most EditorConfig file: +# Will ignore other EditorConfig files in Home directory or upper tree level. +root = true + + +[*] # For All Files +# Unix-style newlines with a newline ending every file +end_of_line = lf +insert_final_newline = true +trim_trailing_whitespace = true +# Set default charset +charset = utf-8 +# Indent style default +indent_style = space +# Max Line Length - a hard line wrap, should be disabled +max_line_length = off + +[*.{py,cfg,ini}] +# 4 space indentation +indent_size = 4 + +[*.{yml,zpt,pt,dtml,zcml}] +# 2 space indentation +indent_size = 2 + +[{Makefile,.gitmodules}] +# Tab indentation (no size specified, but view as 4 spaces) +indent_style = tab +indent_size = unset +tab_width = unset diff --git a/.github/workflows/tests.yml b/.github/workflows/tests.yml new file mode 100644 index 0000000..0ff8d50 --- /dev/null +++ b/.github/workflows/tests.yml @@ -0,0 +1,63 @@ +# Generated from: +# https://github.com/zopefoundation/meta/tree/master/config/toolkit +name: tests + +on: + push: + pull_request: + schedule: + - cron: '0 12 * * 0' # run once a week on Sunday + # Allow to run this workflow manually from the Actions tab + workflow_dispatch: + +jobs: + build: + strategy: + # We want to see all failures: + fail-fast: false + matrix: + os: + - ["ubuntu", "ubuntu-20.04"] + config: + # [Python version, tox env] + - ["3.9", "release-check"] + - ["3.9", "lint"] + - ["3.7", "py37"] + - ["3.8", "py38"] + - ["3.9", "py39"] + - ["3.10", "py310"] + - ["3.11", "py311"] + - ["3.12", "py312"] + - ["pypy-3.9", "pypy3"] + - ["3.9", "docs"] + + runs-on: ${{ matrix.os[1] }} + if: github.event_name != 'pull_request' || github.event.pull_request.head.repo.full_name != github.event.pull_request.base.repo.full_name + name: ${{ matrix.config[1] }} + steps: + - uses: actions/checkout@v3 + - name: Set up Python + uses: actions/setup-python@v4 + with: + python-version: ${{ matrix.config[0] }} + - name: Pip cache + uses: actions/cache@v3 + with: + path: ~/.cache/pip + key: ${{ runner.os }}-pip-${{ matrix.config[0] }}-${{ hashFiles('setup.*', 'tox.ini') }} + restore-keys: | + ${{ runner.os }}-pip-${{ matrix.config[0] }}- + ${{ runner.os }}-pip- + - name: Install dependencies + run: | + python -m pip install --upgrade pip + pip install tox + - name: Test + run: tox -e ${{ matrix.config[1] }} + - name: Coverage + if: matrix.config[1] == 'coverage' + run: | + pip install coveralls + coveralls --service=github + env: + GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} diff --git a/.gitignore b/.gitignore index 2b5cc56..6e61baa 100644 --- a/.gitignore +++ b/.gitignore @@ -1,29 +1,32 @@ -*.bak +# Generated from: +# https://github.com/zopefoundation/meta/tree/master/config/toolkit +*.dll +*.egg-info/ +*.profraw *.pyc *.pyo -*.swp -.cache/ -.coverage* +*.so +.coverage +.coverage.* +.eggs/ .installed.cfg .mr.developer.cfg -.tox +.tox/ +.vscode/ +__pycache__/ bin/ -dev/* -develop-eggs -develop/* -docs/Makefile +build/ +coverage.xml +develop-eggs/ +develop/ +dist/ docs/_build -docs/doctrees -docs/html -docs/latex -docs/make.bat eggs/ -htmlcov/ -include/ +etc/ lib/ +lib64 +log/ parts/ -pip-selfcheck.json pyvenv.cfg -src/*.egg-info -share/ -Library +testing.log +var/ diff --git a/.meta.toml b/.meta.toml new file mode 100644 index 0000000..f0a83cb --- /dev/null +++ b/.meta.toml @@ -0,0 +1,33 @@ +# Generated from: +# https://github.com/zopefoundation/meta/tree/master/config/toolkit +[meta] +template = "toolkit" +commit-id = "1a1f5e27" + +[python] +with-sphinx-doctests = false +with-docs = true +with-future-python = false +with-pypy = true +with-macos = false +with-windows = false + +[tox] +use-flake8 = true +testenv-commands = [ + "{envdir}/bin/test-grok {posargs:-cv}", + ] +testenv-setenv = [ + "zope_i18n_compile_mo_files=True", + ] + +[coverage] +fail-under = "not applicable" + +[check-manifest] +additional-ignores = [ + "docs/_build/html/*", + "docs/_build/html/*/*", + "docs/_build/html/*/*/*", + "docs/_build/html/*/*/*/*", + ] diff --git a/.readthedocs.yaml b/.readthedocs.yaml new file mode 100644 index 0000000..803d495 --- /dev/null +++ b/.readthedocs.yaml @@ -0,0 +1,23 @@ +# Generated from: +# https://github.com/zopefoundation/meta/tree/master/config/toolkit +# Read the Docs configuration file +# See https://docs.readthedocs.io/en/stable/config-file/v2.html for details + +# Required +version: 2 + +# Set the version of Python and other tools you might need +build: + os: ubuntu-22.04 + tools: + python: "3.11" + +# Build documentation in the docs/ directory with Sphinx +sphinx: + configuration: docs/conf.py + +# We recommend specifying your dependencies to enable reproducible builds: +# https://docs.readthedocs.io/en/stable/guides/reproducible-builds.html +python: + install: + - requirements: docs/requirements.txt diff --git a/.travis.yml b/.travis.yml deleted file mode 100644 index 3457320..0000000 --- a/.travis.yml +++ /dev/null @@ -1,15 +0,0 @@ -language: python -python: - - 2.7 - - 3.4 - - 3.5 - - 3.6 - - pypy - - pypy3 -install: - - pip install -U -r requirements.txt - - buildout -v -script: - - bin/test-grok -notifications: - email: false diff --git a/CONTRIBUTING.md b/CONTRIBUTING.md new file mode 100644 index 0000000..973aee6 --- /dev/null +++ b/CONTRIBUTING.md @@ -0,0 +1,23 @@ + +# Contributing to zopefoundation projects + +The projects under the zopefoundation GitHub organization are open source and +welcome contributions in different forms: + +* bug reports +* code improvements and bug fixes +* documentation improvements +* pull request reviews + +For any changes in the repository besides trivial typo fixes you are required +to sign the contributor agreement. See +https://www.zope.dev/developer/becoming-a-committer.html for details. + +Please visit our [Developer +Guidelines](https://www.zope.dev/developer/guidelines.html) if you'd like to +contribute code changes and our [guidelines for reporting +bugs](https://www.zope.dev/developer/reporting-bugs.html) if you want to file a +bug report. diff --git a/MANIFEST.in b/MANIFEST.in new file mode 100644 index 0000000..69f4398 --- /dev/null +++ b/MANIFEST.in @@ -0,0 +1,24 @@ +include *.md +include *.txt +include *.yaml +include buildout.cfg +include documentation.cfg +include grok.cfg +include tox.ini +include ztk-versions.cfg +recursive-include docs *.bat +recursive-include docs *.cfg +recursive-include docs *.css +recursive-include docs *.gif +recursive-include docs *.html +recursive-include docs *.in +recursive-include docs *.jpg +recursive-include docs *.png +recursive-include docs *.pt +recursive-include docs *.py +recursive-include docs *.rst +recursive-include docs *.template +recursive-include docs *.tex +recursive-include docs *.txt +recursive-include docs *.zcml +recursive-include docs Makefile diff --git a/README.rst b/README.rst new file mode 100644 index 0000000..0844452 --- /dev/null +++ b/README.rst @@ -0,0 +1,5 @@ +GROK toolkit +============ + +This repository bundles the GROK libraries into a known good set of versions +successfully running together. diff --git a/bootstrap.py b/bootstrap.py deleted file mode 100644 index ed57894..0000000 --- a/bootstrap.py +++ /dev/null @@ -1,178 +0,0 @@ -############################################################################## -# -# Copyright (c) 2006 Zope Foundation 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. -""" - -import os -import shutil -import sys -import tempfile - -from optparse import OptionParser - -tmpeggs = tempfile.mkdtemp() - -usage = '''\ -[DESIRED PYTHON FOR BUILDOUT] bootstrap.py [options] - -Bootstraps a buildout-based project. - -Simply run this script in a directory containing a buildout.cfg, using the -Python that you want bin/buildout to use. - -Note that by using --find-links to point to local resources, you can keep -this script from going over the network. -''' - -parser = OptionParser(usage=usage) -parser.add_option("-v", "--version", help="use a specific zc.buildout version") - -parser.add_option("-t", "--accept-buildout-test-releases", - dest='accept_buildout_test_releases', - action="store_true", default=False, - help=("Normally, if you do not specify a --version, the " - "bootstrap script and buildout gets the newest " - "*final* versions of zc.buildout and its recipes and " - "extensions for you. If you use this flag, " - "bootstrap and buildout will get the newest releases " - "even if they are alphas or betas.")) -parser.add_option("-c", "--config-file", - help=("Specify the path to the buildout configuration " - "file to be used.")) -parser.add_option("-f", "--find-links", - help=("Specify a URL to search for buildout releases")) -parser.add_option("--allow-site-packages", - action="store_true", default=False, - help=("Let bootstrap.py use existing site packages")) - - -options, args = parser.parse_args() - -###################################################################### -# load/install setuptools - -try: - if options.allow_site_packages: - import setuptools - import pkg_resources - from urllib.request import urlopen -except ImportError: - from urllib2 import urlopen - -ez = {} -exec(urlopen('https://bootstrap.pypa.io/ez_setup.py').read(), ez) - -if not options.allow_site_packages: - # ez_setup imports site, which adds site packages - # this will remove them from the path to ensure that incompatible versions - # of setuptools are not in the path - import site - # inside a virtualenv, there is no 'getsitepackages'. - # We can't remove these reliably - if hasattr(site, 'getsitepackages'): - for sitepackage_path in site.getsitepackages(): - sys.path[:] = [x for x in sys.path if sitepackage_path not in x] - -setup_args = dict(to_dir=tmpeggs, download_delay=0) -ez['use_setuptools'](**setup_args) -import setuptools -import pkg_resources - -# This does not (always?) update the default working set. We will -# do it. -for path in sys.path: - if path not in pkg_resources.working_set.entries: - pkg_resources.working_set.add_entry(path) - -###################################################################### -# Install buildout - -ws = pkg_resources.working_set - -cmd = [sys.executable, '-c', - 'from setuptools.command.easy_install import main; main()', - '-mZqNxd', tmpeggs] - -find_links = os.environ.get( - 'bootstrap-testing-find-links', - options.find_links or - ('http://downloads.buildout.org/' - if options.accept_buildout_test_releases else None) - ) -if find_links: - cmd.extend(['-f', find_links]) - -setuptools_path = ws.find( - pkg_resources.Requirement.parse('setuptools')).location - -requirement = 'zc.buildout' -version = options.version -if version is None and not options.accept_buildout_test_releases: - # Figure out the most recent final version of zc.buildout. - import setuptools.package_index - _final_parts = '*final-', '*final' - - def _final_version(parsed_version): - for part in parsed_version: - if (part[:1] == '*') and (part not in _final_parts): - return False - return True - index = setuptools.package_index.PackageIndex( - search_path=[setuptools_path]) - if find_links: - index.add_find_links((find_links,)) - req = pkg_resources.Requirement.parse(requirement) - if index.obtain(req) is not None: - best = [] - bestv = None - for dist in index[req.project_name]: - distv = dist.parsed_version - if _final_version(distv): - if bestv is None or distv > bestv: - best = [dist] - bestv = distv - elif distv == bestv: - best.append(dist) - if best: - best.sort() - version = best[-1].version -if version: - requirement = '=='.join((requirement, version)) -cmd.append(requirement) - -import subprocess -if subprocess.call(cmd, env=dict(os.environ, PYTHONPATH=setuptools_path)) != 0: - raise Exception( - "Failed to execute command:\n%s" % repr(cmd)[1:-1]) - -###################################################################### -# Import and run buildout - -ws.add_entry(tmpeggs) -ws.require(requirement) -import zc.buildout.buildout - -if not [a for a in args if '=' not in a]: - args.append('bootstrap') - -# if -c was provided, we push it back into args for buildout' main function -if options.config_file is not None: - args[0:0] = ['-c', options.config_file] - -zc.buildout.buildout.main(args) -shutil.rmtree(tmpeggs) diff --git a/buildout.cfg b/buildout.cfg index db6ce5f..9111461 100644 --- a/buildout.cfg +++ b/buildout.cfg @@ -3,14 +3,9 @@ extends = grok.cfg parts = checkversions - omelette test-grok - uploadversions -develop = . -extensions = mr.developer allow-picked-versions = false -include-site-packages = false -auto-checkout = +show-picked-versions = true [sources] # see grok.cfg for the time being for the branch autocheckouts. @@ -19,10 +14,6 @@ auto-checkout = recipe = zc.recipe.egg eggs = z3c.checkversions [buildout] -[omelette] -recipe = collective.recipe.omelette -eggs = ${grok:packages} - [test-grok] recipe = z3c.recipe.compattest include = ${grok:packages} @@ -36,10 +27,3 @@ exclude = eggs = zope.testrunner runner-defaults = ['--auto-color', '-v', '--auto-progress'] - -[uploadversions] -recipe = zc.recipe.egg -entry-points = uploadversions=groktoolkit:upload_gtk_versions -eggs = - groktoolkit - zest.releaser diff --git a/doc/changes.rst b/doc/changes.rst deleted file mode 100644 index 2240c2a..0000000 --- a/doc/changes.rst +++ /dev/null @@ -1,8 +0,0 @@ -3.0.0a2 (unreleased) --------------------- - -- Nothing changed yet. - - -3.0.0a1 (2018-01-22) --------------------- \ No newline at end of file diff --git a/doc/design/skin-minimal.py b/doc/design/skin-minimal.py deleted file mode 100644 index 6ffc119..0000000 --- a/doc/design/skin-minimal.py +++ /dev/null @@ -1,18 +0,0 @@ -import grok -from zope import interface - - -grok.definelayer('my') -grok.defineskin('my') # Picks up the layer 'my' if it exists - -grok.layer('my') # If there is only a single layer defined - # in a module, it will be the default - - -class Painting(grok.View): - pass - - -fireplace = grok.PageTemplate("""\ - -""") diff --git a/doc/groktut/a_second_model/bootstrap.py b/doc/groktut/a_second_model/bootstrap.py deleted file mode 100644 index 5f2cb08..0000000 --- a/doc/groktut/a_second_model/bootstrap.py +++ /dev/null @@ -1,260 +0,0 @@ -############################################################################## -# -# Copyright (c) 2006 Zope Foundation 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. -""" - -import os, shutil, sys, tempfile, textwrap, urllib, urllib2, subprocess -from optparse import OptionParser - -if sys.platform == 'win32': - def quote(c): - if ' ' in c: - return '"%s"' % c # work around spawn lamosity on windows - else: - return c -else: - quote = str - -# See zc.buildout.easy_install._has_broken_dash_S for motivation and comments. -stdout, stderr = subprocess.Popen( - [sys.executable, '-Sc', - 'try:\n' - ' import ConfigParser\n' - 'except ImportError:\n' - ' print 1\n' - 'else:\n' - ' print 0\n'], - stdout=subprocess.PIPE, stderr=subprocess.PIPE).communicate() -has_broken_dash_S = bool(int(stdout.strip())) - -# In order to be more robust in the face of system Pythons, we want to -# run without site-packages loaded. This is somewhat tricky, in -# particular because Python 2.6's distutils imports site, so starting -# with the -S flag is not sufficient. However, we'll start with that: -if not has_broken_dash_S and 'site' in sys.modules: - # We will restart with python -S. - args = sys.argv[:] - args[0:0] = [sys.executable, '-S'] - args = map(quote, args) - os.execv(sys.executable, args) -# Now we are running with -S. We'll get the clean sys.path, import site -# because distutils will do it later, and then reset the path and clean -# out any namespace packages from site-packages that might have been -# loaded by .pth files. -clean_path = sys.path[:] -import site -sys.path[:] = clean_path -for k, v in sys.modules.items(): - if k in ('setuptools', 'pkg_resources') or ( - hasattr(v, '__path__') and - len(v.__path__)==1 and - not os.path.exists(os.path.join(v.__path__[0],'__init__.py'))): - # This is a namespace package. Remove it. - sys.modules.pop(k) - -is_jython = sys.platform.startswith('java') - -setuptools_source = 'http://peak.telecommunity.com/dist/ez_setup.py' -distribute_source = 'http://python-distribute.org/distribute_setup.py' - -# parsing arguments -def normalize_to_url(option, opt_str, value, parser): - if value: - if '://' not in value: # It doesn't smell like a URL. - value = 'file://%s' % ( - urllib.pathname2url( - os.path.abspath(os.path.expanduser(value))),) - if opt_str == '--download-base' and not value.endswith('/'): - # Download base needs a trailing slash to make the world happy. - value += '/' - else: - value = None - name = opt_str[2:].replace('-', '_') - setattr(parser.values, name, value) - -usage = '''\ -[DESIRED PYTHON FOR BUILDOUT] bootstrap.py [options] - -Bootstraps a buildout-based project. - -Simply run this script in a directory containing a buildout.cfg, using the -Python that you want bin/buildout to use. - -Note that by using --setup-source and --download-base to point to -local resources, you can keep this script from going over the network. -''' - -parser = OptionParser(usage=usage) -parser.add_option("-v", "--version", dest="version", - help="use a specific zc.buildout version") -parser.add_option("-d", "--distribute", - action="store_true", dest="use_distribute", default=False, - help="Use Distribute rather than Setuptools.") -parser.add_option("--setup-source", action="callback", dest="setup_source", - callback=normalize_to_url, nargs=1, type="string", - help=("Specify a URL or file location for the setup file. " - "If you use Setuptools, this will default to " + - setuptools_source + "; if you use Distribute, this " - "will default to " + distribute_source +".")) -parser.add_option("--download-base", action="callback", dest="download_base", - callback=normalize_to_url, nargs=1, type="string", - help=("Specify a URL or directory for downloading " - "zc.buildout and either Setuptools or Distribute. " - "Defaults to PyPI.")) -parser.add_option("--eggs", - help=("Specify a directory for storing eggs. Defaults to " - "a temporary directory that is deleted when the " - "bootstrap script completes.")) -parser.add_option("-t", "--accept-buildout-test-releases", - dest='accept_buildout_test_releases', - action="store_true", default=False, - help=("Normally, if you do not specify a --version, the " - "bootstrap script and buildout gets the newest " - "*final* versions of zc.buildout and its recipes and " - "extensions for you. If you use this flag, " - "bootstrap and buildout will get the newest releases " - "even if they are alphas or betas.")) -parser.add_option("-c", None, action="store", dest="config_file", - help=("Specify the path to the buildout configuration " - "file to be used.")) - -options, args = parser.parse_args() - -# if -c was provided, we push it back into args for buildout's main function -if options.config_file is not None: - args += ['-c', options.config_file] - -if options.eggs: - eggs_dir = os.path.abspath(os.path.expanduser(options.eggs)) -else: - eggs_dir = tempfile.mkdtemp() - -if options.setup_source is None: - if options.use_distribute: - options.setup_source = distribute_source - else: - options.setup_source = setuptools_source - -if options.accept_buildout_test_releases: - args.append('buildout:accept-buildout-test-releases=true') -args.append('bootstrap') - -try: - import pkg_resources - import setuptools # A flag. Sometimes pkg_resources is installed alone. - if not hasattr(pkg_resources, '_distribute'): - raise ImportError -except ImportError: - ez_code = urllib2.urlopen( - options.setup_source).read().replace('\r\n', '\n') - ez = {} - exec ez_code in ez - setup_args = dict(to_dir=eggs_dir, download_delay=0) - if options.download_base: - setup_args['download_base'] = options.download_base - if options.use_distribute: - setup_args['no_fake'] = True - ez['use_setuptools'](**setup_args) - if 'pkg_resources' in sys.modules: - reload(sys.modules['pkg_resources']) - import pkg_resources - # This does not (always?) update the default working set. We will - # do it. - for path in sys.path: - if path not in pkg_resources.working_set.entries: - pkg_resources.working_set.add_entry(path) - -cmd = [quote(sys.executable), - '-c', - quote('from setuptools.command.easy_install import main; main()'), - '-mqNxd', - quote(eggs_dir)] - -if not has_broken_dash_S: - cmd.insert(1, '-S') - -find_links = options.download_base -if not find_links: - find_links = os.environ.get('bootstrap-testing-find-links') -if find_links: - cmd.extend(['-f', quote(find_links)]) - -if options.use_distribute: - setup_requirement = 'distribute' -else: - setup_requirement = 'setuptools' -ws = pkg_resources.working_set -setup_requirement_path = ws.find( - pkg_resources.Requirement.parse(setup_requirement)).location -env = dict( - os.environ, - PYTHONPATH=setup_requirement_path) - -requirement = 'zc.buildout' -version = options.version -if version is None and not options.accept_buildout_test_releases: - # Figure out the most recent final version of zc.buildout. - import setuptools.package_index - _final_parts = '*final-', '*final' - def _final_version(parsed_version): - for part in parsed_version: - if (part[:1] == '*') and (part not in _final_parts): - return False - return True - index = setuptools.package_index.PackageIndex( - search_path=[setup_requirement_path]) - if find_links: - index.add_find_links((find_links,)) - req = pkg_resources.Requirement.parse(requirement) - if index.obtain(req) is not None: - best = [] - bestv = None - for dist in index[req.project_name]: - distv = dist.parsed_version - if _final_version(distv): - if bestv is None or distv > bestv: - best = [dist] - bestv = distv - elif distv == bestv: - best.append(dist) - if best: - best.sort() - version = best[-1].version -if version: - requirement = '=='.join((requirement, version)) -cmd.append(requirement) - -if is_jython: - import subprocess - exitcode = subprocess.Popen(cmd, env=env).wait() -else: # Windows prefers this, apparently; otherwise we would prefer subprocess - exitcode = os.spawnle(*([os.P_WAIT, sys.executable] + cmd + [env])) -if exitcode != 0: - sys.stdout.flush() - sys.stderr.flush() - print ("An error occurred when trying to install zc.buildout. " - "Look above this message for any errors that " - "were output by easy_install.") - sys.exit(exitcode) - -ws.add_entry(eggs_dir) -ws.require(requirement) -import zc.buildout.buildout -zc.buildout.buildout.main(args) -if not options.eggs: # clean up temporary egg directory - shutil.rmtree(eggs_dir) diff --git a/doc/groktut/a_second_view/bootstrap.py b/doc/groktut/a_second_view/bootstrap.py deleted file mode 100644 index 5f2cb08..0000000 --- a/doc/groktut/a_second_view/bootstrap.py +++ /dev/null @@ -1,260 +0,0 @@ -############################################################################## -# -# Copyright (c) 2006 Zope Foundation 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. -""" - -import os, shutil, sys, tempfile, textwrap, urllib, urllib2, subprocess -from optparse import OptionParser - -if sys.platform == 'win32': - def quote(c): - if ' ' in c: - return '"%s"' % c # work around spawn lamosity on windows - else: - return c -else: - quote = str - -# See zc.buildout.easy_install._has_broken_dash_S for motivation and comments. -stdout, stderr = subprocess.Popen( - [sys.executable, '-Sc', - 'try:\n' - ' import ConfigParser\n' - 'except ImportError:\n' - ' print 1\n' - 'else:\n' - ' print 0\n'], - stdout=subprocess.PIPE, stderr=subprocess.PIPE).communicate() -has_broken_dash_S = bool(int(stdout.strip())) - -# In order to be more robust in the face of system Pythons, we want to -# run without site-packages loaded. This is somewhat tricky, in -# particular because Python 2.6's distutils imports site, so starting -# with the -S flag is not sufficient. However, we'll start with that: -if not has_broken_dash_S and 'site' in sys.modules: - # We will restart with python -S. - args = sys.argv[:] - args[0:0] = [sys.executable, '-S'] - args = map(quote, args) - os.execv(sys.executable, args) -# Now we are running with -S. We'll get the clean sys.path, import site -# because distutils will do it later, and then reset the path and clean -# out any namespace packages from site-packages that might have been -# loaded by .pth files. -clean_path = sys.path[:] -import site -sys.path[:] = clean_path -for k, v in sys.modules.items(): - if k in ('setuptools', 'pkg_resources') or ( - hasattr(v, '__path__') and - len(v.__path__)==1 and - not os.path.exists(os.path.join(v.__path__[0],'__init__.py'))): - # This is a namespace package. Remove it. - sys.modules.pop(k) - -is_jython = sys.platform.startswith('java') - -setuptools_source = 'http://peak.telecommunity.com/dist/ez_setup.py' -distribute_source = 'http://python-distribute.org/distribute_setup.py' - -# parsing arguments -def normalize_to_url(option, opt_str, value, parser): - if value: - if '://' not in value: # It doesn't smell like a URL. - value = 'file://%s' % ( - urllib.pathname2url( - os.path.abspath(os.path.expanduser(value))),) - if opt_str == '--download-base' and not value.endswith('/'): - # Download base needs a trailing slash to make the world happy. - value += '/' - else: - value = None - name = opt_str[2:].replace('-', '_') - setattr(parser.values, name, value) - -usage = '''\ -[DESIRED PYTHON FOR BUILDOUT] bootstrap.py [options] - -Bootstraps a buildout-based project. - -Simply run this script in a directory containing a buildout.cfg, using the -Python that you want bin/buildout to use. - -Note that by using --setup-source and --download-base to point to -local resources, you can keep this script from going over the network. -''' - -parser = OptionParser(usage=usage) -parser.add_option("-v", "--version", dest="version", - help="use a specific zc.buildout version") -parser.add_option("-d", "--distribute", - action="store_true", dest="use_distribute", default=False, - help="Use Distribute rather than Setuptools.") -parser.add_option("--setup-source", action="callback", dest="setup_source", - callback=normalize_to_url, nargs=1, type="string", - help=("Specify a URL or file location for the setup file. " - "If you use Setuptools, this will default to " + - setuptools_source + "; if you use Distribute, this " - "will default to " + distribute_source +".")) -parser.add_option("--download-base", action="callback", dest="download_base", - callback=normalize_to_url, nargs=1, type="string", - help=("Specify a URL or directory for downloading " - "zc.buildout and either Setuptools or Distribute. " - "Defaults to PyPI.")) -parser.add_option("--eggs", - help=("Specify a directory for storing eggs. Defaults to " - "a temporary directory that is deleted when the " - "bootstrap script completes.")) -parser.add_option("-t", "--accept-buildout-test-releases", - dest='accept_buildout_test_releases', - action="store_true", default=False, - help=("Normally, if you do not specify a --version, the " - "bootstrap script and buildout gets the newest " - "*final* versions of zc.buildout and its recipes and " - "extensions for you. If you use this flag, " - "bootstrap and buildout will get the newest releases " - "even if they are alphas or betas.")) -parser.add_option("-c", None, action="store", dest="config_file", - help=("Specify the path to the buildout configuration " - "file to be used.")) - -options, args = parser.parse_args() - -# if -c was provided, we push it back into args for buildout's main function -if options.config_file is not None: - args += ['-c', options.config_file] - -if options.eggs: - eggs_dir = os.path.abspath(os.path.expanduser(options.eggs)) -else: - eggs_dir = tempfile.mkdtemp() - -if options.setup_source is None: - if options.use_distribute: - options.setup_source = distribute_source - else: - options.setup_source = setuptools_source - -if options.accept_buildout_test_releases: - args.append('buildout:accept-buildout-test-releases=true') -args.append('bootstrap') - -try: - import pkg_resources - import setuptools # A flag. Sometimes pkg_resources is installed alone. - if not hasattr(pkg_resources, '_distribute'): - raise ImportError -except ImportError: - ez_code = urllib2.urlopen( - options.setup_source).read().replace('\r\n', '\n') - ez = {} - exec ez_code in ez - setup_args = dict(to_dir=eggs_dir, download_delay=0) - if options.download_base: - setup_args['download_base'] = options.download_base - if options.use_distribute: - setup_args['no_fake'] = True - ez['use_setuptools'](**setup_args) - if 'pkg_resources' in sys.modules: - reload(sys.modules['pkg_resources']) - import pkg_resources - # This does not (always?) update the default working set. We will - # do it. - for path in sys.path: - if path not in pkg_resources.working_set.entries: - pkg_resources.working_set.add_entry(path) - -cmd = [quote(sys.executable), - '-c', - quote('from setuptools.command.easy_install import main; main()'), - '-mqNxd', - quote(eggs_dir)] - -if not has_broken_dash_S: - cmd.insert(1, '-S') - -find_links = options.download_base -if not find_links: - find_links = os.environ.get('bootstrap-testing-find-links') -if find_links: - cmd.extend(['-f', quote(find_links)]) - -if options.use_distribute: - setup_requirement = 'distribute' -else: - setup_requirement = 'setuptools' -ws = pkg_resources.working_set -setup_requirement_path = ws.find( - pkg_resources.Requirement.parse(setup_requirement)).location -env = dict( - os.environ, - PYTHONPATH=setup_requirement_path) - -requirement = 'zc.buildout' -version = options.version -if version is None and not options.accept_buildout_test_releases: - # Figure out the most recent final version of zc.buildout. - import setuptools.package_index - _final_parts = '*final-', '*final' - def _final_version(parsed_version): - for part in parsed_version: - if (part[:1] == '*') and (part not in _final_parts): - return False - return True - index = setuptools.package_index.PackageIndex( - search_path=[setup_requirement_path]) - if find_links: - index.add_find_links((find_links,)) - req = pkg_resources.Requirement.parse(requirement) - if index.obtain(req) is not None: - best = [] - bestv = None - for dist in index[req.project_name]: - distv = dist.parsed_version - if _final_version(distv): - if bestv is None or distv > bestv: - best = [dist] - bestv = distv - elif distv == bestv: - best.append(dist) - if best: - best.sort() - version = best[-1].version -if version: - requirement = '=='.join((requirement, version)) -cmd.append(requirement) - -if is_jython: - import subprocess - exitcode = subprocess.Popen(cmd, env=env).wait() -else: # Windows prefers this, apparently; otherwise we would prefer subprocess - exitcode = os.spawnle(*([os.P_WAIT, sys.executable] + cmd + [env])) -if exitcode != 0: - sys.stdout.flush() - sys.stderr.flush() - print ("An error occurred when trying to install zc.buildout. " - "Look above this message for any errors that " - "were output by easy_install.") - sys.exit(exitcode) - -ws.add_entry(eggs_dir) -ws.require(requirement) -import zc.buildout.buildout -zc.buildout.buildout.main(args) -if not options.eggs: # clean up temporary egg directory - shutil.rmtree(eggs_dir) diff --git a/doc/groktut/a_view_for_a_model/bootstrap.py b/doc/groktut/a_view_for_a_model/bootstrap.py deleted file mode 100644 index 5f2cb08..0000000 --- a/doc/groktut/a_view_for_a_model/bootstrap.py +++ /dev/null @@ -1,260 +0,0 @@ -############################################################################## -# -# Copyright (c) 2006 Zope Foundation 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. -""" - -import os, shutil, sys, tempfile, textwrap, urllib, urllib2, subprocess -from optparse import OptionParser - -if sys.platform == 'win32': - def quote(c): - if ' ' in c: - return '"%s"' % c # work around spawn lamosity on windows - else: - return c -else: - quote = str - -# See zc.buildout.easy_install._has_broken_dash_S for motivation and comments. -stdout, stderr = subprocess.Popen( - [sys.executable, '-Sc', - 'try:\n' - ' import ConfigParser\n' - 'except ImportError:\n' - ' print 1\n' - 'else:\n' - ' print 0\n'], - stdout=subprocess.PIPE, stderr=subprocess.PIPE).communicate() -has_broken_dash_S = bool(int(stdout.strip())) - -# In order to be more robust in the face of system Pythons, we want to -# run without site-packages loaded. This is somewhat tricky, in -# particular because Python 2.6's distutils imports site, so starting -# with the -S flag is not sufficient. However, we'll start with that: -if not has_broken_dash_S and 'site' in sys.modules: - # We will restart with python -S. - args = sys.argv[:] - args[0:0] = [sys.executable, '-S'] - args = map(quote, args) - os.execv(sys.executable, args) -# Now we are running with -S. We'll get the clean sys.path, import site -# because distutils will do it later, and then reset the path and clean -# out any namespace packages from site-packages that might have been -# loaded by .pth files. -clean_path = sys.path[:] -import site -sys.path[:] = clean_path -for k, v in sys.modules.items(): - if k in ('setuptools', 'pkg_resources') or ( - hasattr(v, '__path__') and - len(v.__path__)==1 and - not os.path.exists(os.path.join(v.__path__[0],'__init__.py'))): - # This is a namespace package. Remove it. - sys.modules.pop(k) - -is_jython = sys.platform.startswith('java') - -setuptools_source = 'http://peak.telecommunity.com/dist/ez_setup.py' -distribute_source = 'http://python-distribute.org/distribute_setup.py' - -# parsing arguments -def normalize_to_url(option, opt_str, value, parser): - if value: - if '://' not in value: # It doesn't smell like a URL. - value = 'file://%s' % ( - urllib.pathname2url( - os.path.abspath(os.path.expanduser(value))),) - if opt_str == '--download-base' and not value.endswith('/'): - # Download base needs a trailing slash to make the world happy. - value += '/' - else: - value = None - name = opt_str[2:].replace('-', '_') - setattr(parser.values, name, value) - -usage = '''\ -[DESIRED PYTHON FOR BUILDOUT] bootstrap.py [options] - -Bootstraps a buildout-based project. - -Simply run this script in a directory containing a buildout.cfg, using the -Python that you want bin/buildout to use. - -Note that by using --setup-source and --download-base to point to -local resources, you can keep this script from going over the network. -''' - -parser = OptionParser(usage=usage) -parser.add_option("-v", "--version", dest="version", - help="use a specific zc.buildout version") -parser.add_option("-d", "--distribute", - action="store_true", dest="use_distribute", default=False, - help="Use Distribute rather than Setuptools.") -parser.add_option("--setup-source", action="callback", dest="setup_source", - callback=normalize_to_url, nargs=1, type="string", - help=("Specify a URL or file location for the setup file. " - "If you use Setuptools, this will default to " + - setuptools_source + "; if you use Distribute, this " - "will default to " + distribute_source +".")) -parser.add_option("--download-base", action="callback", dest="download_base", - callback=normalize_to_url, nargs=1, type="string", - help=("Specify a URL or directory for downloading " - "zc.buildout and either Setuptools or Distribute. " - "Defaults to PyPI.")) -parser.add_option("--eggs", - help=("Specify a directory for storing eggs. Defaults to " - "a temporary directory that is deleted when the " - "bootstrap script completes.")) -parser.add_option("-t", "--accept-buildout-test-releases", - dest='accept_buildout_test_releases', - action="store_true", default=False, - help=("Normally, if you do not specify a --version, the " - "bootstrap script and buildout gets the newest " - "*final* versions of zc.buildout and its recipes and " - "extensions for you. If you use this flag, " - "bootstrap and buildout will get the newest releases " - "even if they are alphas or betas.")) -parser.add_option("-c", None, action="store", dest="config_file", - help=("Specify the path to the buildout configuration " - "file to be used.")) - -options, args = parser.parse_args() - -# if -c was provided, we push it back into args for buildout's main function -if options.config_file is not None: - args += ['-c', options.config_file] - -if options.eggs: - eggs_dir = os.path.abspath(os.path.expanduser(options.eggs)) -else: - eggs_dir = tempfile.mkdtemp() - -if options.setup_source is None: - if options.use_distribute: - options.setup_source = distribute_source - else: - options.setup_source = setuptools_source - -if options.accept_buildout_test_releases: - args.append('buildout:accept-buildout-test-releases=true') -args.append('bootstrap') - -try: - import pkg_resources - import setuptools # A flag. Sometimes pkg_resources is installed alone. - if not hasattr(pkg_resources, '_distribute'): - raise ImportError -except ImportError: - ez_code = urllib2.urlopen( - options.setup_source).read().replace('\r\n', '\n') - ez = {} - exec ez_code in ez - setup_args = dict(to_dir=eggs_dir, download_delay=0) - if options.download_base: - setup_args['download_base'] = options.download_base - if options.use_distribute: - setup_args['no_fake'] = True - ez['use_setuptools'](**setup_args) - if 'pkg_resources' in sys.modules: - reload(sys.modules['pkg_resources']) - import pkg_resources - # This does not (always?) update the default working set. We will - # do it. - for path in sys.path: - if path not in pkg_resources.working_set.entries: - pkg_resources.working_set.add_entry(path) - -cmd = [quote(sys.executable), - '-c', - quote('from setuptools.command.easy_install import main; main()'), - '-mqNxd', - quote(eggs_dir)] - -if not has_broken_dash_S: - cmd.insert(1, '-S') - -find_links = options.download_base -if not find_links: - find_links = os.environ.get('bootstrap-testing-find-links') -if find_links: - cmd.extend(['-f', quote(find_links)]) - -if options.use_distribute: - setup_requirement = 'distribute' -else: - setup_requirement = 'setuptools' -ws = pkg_resources.working_set -setup_requirement_path = ws.find( - pkg_resources.Requirement.parse(setup_requirement)).location -env = dict( - os.environ, - PYTHONPATH=setup_requirement_path) - -requirement = 'zc.buildout' -version = options.version -if version is None and not options.accept_buildout_test_releases: - # Figure out the most recent final version of zc.buildout. - import setuptools.package_index - _final_parts = '*final-', '*final' - def _final_version(parsed_version): - for part in parsed_version: - if (part[:1] == '*') and (part not in _final_parts): - return False - return True - index = setuptools.package_index.PackageIndex( - search_path=[setup_requirement_path]) - if find_links: - index.add_find_links((find_links,)) - req = pkg_resources.Requirement.parse(requirement) - if index.obtain(req) is not None: - best = [] - bestv = None - for dist in index[req.project_name]: - distv = dist.parsed_version - if _final_version(distv): - if bestv is None or distv > bestv: - best = [dist] - bestv = distv - elif distv == bestv: - best.append(dist) - if best: - best.sort() - version = best[-1].version -if version: - requirement = '=='.join((requirement, version)) -cmd.append(requirement) - -if is_jython: - import subprocess - exitcode = subprocess.Popen(cmd, env=env).wait() -else: # Windows prefers this, apparently; otherwise we would prefer subprocess - exitcode = os.spawnle(*([os.P_WAIT, sys.executable] + cmd + [env])) -if exitcode != 0: - sys.stdout.flush() - sys.stderr.flush() - print ("An error occurred when trying to install zc.buildout. " - "Look above this message for any errors that " - "were output by easy_install.") - sys.exit(exitcode) - -ws.add_entry(eggs_dir) -ws.require(requirement) -import zc.buildout.buildout -zc.buildout.buildout.main(args) -if not options.eggs: # clean up temporary egg directory - shutil.rmtree(eggs_dir) diff --git a/doc/groktut/a_view_for_a_model2/bootstrap.py b/doc/groktut/a_view_for_a_model2/bootstrap.py deleted file mode 100644 index 5f2cb08..0000000 --- a/doc/groktut/a_view_for_a_model2/bootstrap.py +++ /dev/null @@ -1,260 +0,0 @@ -############################################################################## -# -# Copyright (c) 2006 Zope Foundation 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. -""" - -import os, shutil, sys, tempfile, textwrap, urllib, urllib2, subprocess -from optparse import OptionParser - -if sys.platform == 'win32': - def quote(c): - if ' ' in c: - return '"%s"' % c # work around spawn lamosity on windows - else: - return c -else: - quote = str - -# See zc.buildout.easy_install._has_broken_dash_S for motivation and comments. -stdout, stderr = subprocess.Popen( - [sys.executable, '-Sc', - 'try:\n' - ' import ConfigParser\n' - 'except ImportError:\n' - ' print 1\n' - 'else:\n' - ' print 0\n'], - stdout=subprocess.PIPE, stderr=subprocess.PIPE).communicate() -has_broken_dash_S = bool(int(stdout.strip())) - -# In order to be more robust in the face of system Pythons, we want to -# run without site-packages loaded. This is somewhat tricky, in -# particular because Python 2.6's distutils imports site, so starting -# with the -S flag is not sufficient. However, we'll start with that: -if not has_broken_dash_S and 'site' in sys.modules: - # We will restart with python -S. - args = sys.argv[:] - args[0:0] = [sys.executable, '-S'] - args = map(quote, args) - os.execv(sys.executable, args) -# Now we are running with -S. We'll get the clean sys.path, import site -# because distutils will do it later, and then reset the path and clean -# out any namespace packages from site-packages that might have been -# loaded by .pth files. -clean_path = sys.path[:] -import site -sys.path[:] = clean_path -for k, v in sys.modules.items(): - if k in ('setuptools', 'pkg_resources') or ( - hasattr(v, '__path__') and - len(v.__path__)==1 and - not os.path.exists(os.path.join(v.__path__[0],'__init__.py'))): - # This is a namespace package. Remove it. - sys.modules.pop(k) - -is_jython = sys.platform.startswith('java') - -setuptools_source = 'http://peak.telecommunity.com/dist/ez_setup.py' -distribute_source = 'http://python-distribute.org/distribute_setup.py' - -# parsing arguments -def normalize_to_url(option, opt_str, value, parser): - if value: - if '://' not in value: # It doesn't smell like a URL. - value = 'file://%s' % ( - urllib.pathname2url( - os.path.abspath(os.path.expanduser(value))),) - if opt_str == '--download-base' and not value.endswith('/'): - # Download base needs a trailing slash to make the world happy. - value += '/' - else: - value = None - name = opt_str[2:].replace('-', '_') - setattr(parser.values, name, value) - -usage = '''\ -[DESIRED PYTHON FOR BUILDOUT] bootstrap.py [options] - -Bootstraps a buildout-based project. - -Simply run this script in a directory containing a buildout.cfg, using the -Python that you want bin/buildout to use. - -Note that by using --setup-source and --download-base to point to -local resources, you can keep this script from going over the network. -''' - -parser = OptionParser(usage=usage) -parser.add_option("-v", "--version", dest="version", - help="use a specific zc.buildout version") -parser.add_option("-d", "--distribute", - action="store_true", dest="use_distribute", default=False, - help="Use Distribute rather than Setuptools.") -parser.add_option("--setup-source", action="callback", dest="setup_source", - callback=normalize_to_url, nargs=1, type="string", - help=("Specify a URL or file location for the setup file. " - "If you use Setuptools, this will default to " + - setuptools_source + "; if you use Distribute, this " - "will default to " + distribute_source +".")) -parser.add_option("--download-base", action="callback", dest="download_base", - callback=normalize_to_url, nargs=1, type="string", - help=("Specify a URL or directory for downloading " - "zc.buildout and either Setuptools or Distribute. " - "Defaults to PyPI.")) -parser.add_option("--eggs", - help=("Specify a directory for storing eggs. Defaults to " - "a temporary directory that is deleted when the " - "bootstrap script completes.")) -parser.add_option("-t", "--accept-buildout-test-releases", - dest='accept_buildout_test_releases', - action="store_true", default=False, - help=("Normally, if you do not specify a --version, the " - "bootstrap script and buildout gets the newest " - "*final* versions of zc.buildout and its recipes and " - "extensions for you. If you use this flag, " - "bootstrap and buildout will get the newest releases " - "even if they are alphas or betas.")) -parser.add_option("-c", None, action="store", dest="config_file", - help=("Specify the path to the buildout configuration " - "file to be used.")) - -options, args = parser.parse_args() - -# if -c was provided, we push it back into args for buildout's main function -if options.config_file is not None: - args += ['-c', options.config_file] - -if options.eggs: - eggs_dir = os.path.abspath(os.path.expanduser(options.eggs)) -else: - eggs_dir = tempfile.mkdtemp() - -if options.setup_source is None: - if options.use_distribute: - options.setup_source = distribute_source - else: - options.setup_source = setuptools_source - -if options.accept_buildout_test_releases: - args.append('buildout:accept-buildout-test-releases=true') -args.append('bootstrap') - -try: - import pkg_resources - import setuptools # A flag. Sometimes pkg_resources is installed alone. - if not hasattr(pkg_resources, '_distribute'): - raise ImportError -except ImportError: - ez_code = urllib2.urlopen( - options.setup_source).read().replace('\r\n', '\n') - ez = {} - exec ez_code in ez - setup_args = dict(to_dir=eggs_dir, download_delay=0) - if options.download_base: - setup_args['download_base'] = options.download_base - if options.use_distribute: - setup_args['no_fake'] = True - ez['use_setuptools'](**setup_args) - if 'pkg_resources' in sys.modules: - reload(sys.modules['pkg_resources']) - import pkg_resources - # This does not (always?) update the default working set. We will - # do it. - for path in sys.path: - if path not in pkg_resources.working_set.entries: - pkg_resources.working_set.add_entry(path) - -cmd = [quote(sys.executable), - '-c', - quote('from setuptools.command.easy_install import main; main()'), - '-mqNxd', - quote(eggs_dir)] - -if not has_broken_dash_S: - cmd.insert(1, '-S') - -find_links = options.download_base -if not find_links: - find_links = os.environ.get('bootstrap-testing-find-links') -if find_links: - cmd.extend(['-f', quote(find_links)]) - -if options.use_distribute: - setup_requirement = 'distribute' -else: - setup_requirement = 'setuptools' -ws = pkg_resources.working_set -setup_requirement_path = ws.find( - pkg_resources.Requirement.parse(setup_requirement)).location -env = dict( - os.environ, - PYTHONPATH=setup_requirement_path) - -requirement = 'zc.buildout' -version = options.version -if version is None and not options.accept_buildout_test_releases: - # Figure out the most recent final version of zc.buildout. - import setuptools.package_index - _final_parts = '*final-', '*final' - def _final_version(parsed_version): - for part in parsed_version: - if (part[:1] == '*') and (part not in _final_parts): - return False - return True - index = setuptools.package_index.PackageIndex( - search_path=[setup_requirement_path]) - if find_links: - index.add_find_links((find_links,)) - req = pkg_resources.Requirement.parse(requirement) - if index.obtain(req) is not None: - best = [] - bestv = None - for dist in index[req.project_name]: - distv = dist.parsed_version - if _final_version(distv): - if bestv is None or distv > bestv: - best = [dist] - bestv = distv - elif distv == bestv: - best.append(dist) - if best: - best.sort() - version = best[-1].version -if version: - requirement = '=='.join((requirement, version)) -cmd.append(requirement) - -if is_jython: - import subprocess - exitcode = subprocess.Popen(cmd, env=env).wait() -else: # Windows prefers this, apparently; otherwise we would prefer subprocess - exitcode = os.spawnle(*([os.P_WAIT, sys.executable] + cmd + [env])) -if exitcode != 0: - sys.stdout.flush() - sys.stderr.flush() - print ("An error occurred when trying to install zc.buildout. " - "Look above this message for any errors that " - "were output by easy_install.") - sys.exit(exitcode) - -ws.add_entry(eggs_dir) -ws.require(requirement) -import zc.buildout.buildout -zc.buildout.buildout.main(args) -if not options.eggs: # clean up temporary egg directory - shutil.rmtree(eggs_dir) diff --git a/doc/groktut/an_empty_grok_project/bootstrap.py b/doc/groktut/an_empty_grok_project/bootstrap.py deleted file mode 100644 index 5f2cb08..0000000 --- a/doc/groktut/an_empty_grok_project/bootstrap.py +++ /dev/null @@ -1,260 +0,0 @@ -############################################################################## -# -# Copyright (c) 2006 Zope Foundation 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. -""" - -import os, shutil, sys, tempfile, textwrap, urllib, urllib2, subprocess -from optparse import OptionParser - -if sys.platform == 'win32': - def quote(c): - if ' ' in c: - return '"%s"' % c # work around spawn lamosity on windows - else: - return c -else: - quote = str - -# See zc.buildout.easy_install._has_broken_dash_S for motivation and comments. -stdout, stderr = subprocess.Popen( - [sys.executable, '-Sc', - 'try:\n' - ' import ConfigParser\n' - 'except ImportError:\n' - ' print 1\n' - 'else:\n' - ' print 0\n'], - stdout=subprocess.PIPE, stderr=subprocess.PIPE).communicate() -has_broken_dash_S = bool(int(stdout.strip())) - -# In order to be more robust in the face of system Pythons, we want to -# run without site-packages loaded. This is somewhat tricky, in -# particular because Python 2.6's distutils imports site, so starting -# with the -S flag is not sufficient. However, we'll start with that: -if not has_broken_dash_S and 'site' in sys.modules: - # We will restart with python -S. - args = sys.argv[:] - args[0:0] = [sys.executable, '-S'] - args = map(quote, args) - os.execv(sys.executable, args) -# Now we are running with -S. We'll get the clean sys.path, import site -# because distutils will do it later, and then reset the path and clean -# out any namespace packages from site-packages that might have been -# loaded by .pth files. -clean_path = sys.path[:] -import site -sys.path[:] = clean_path -for k, v in sys.modules.items(): - if k in ('setuptools', 'pkg_resources') or ( - hasattr(v, '__path__') and - len(v.__path__)==1 and - not os.path.exists(os.path.join(v.__path__[0],'__init__.py'))): - # This is a namespace package. Remove it. - sys.modules.pop(k) - -is_jython = sys.platform.startswith('java') - -setuptools_source = 'http://peak.telecommunity.com/dist/ez_setup.py' -distribute_source = 'http://python-distribute.org/distribute_setup.py' - -# parsing arguments -def normalize_to_url(option, opt_str, value, parser): - if value: - if '://' not in value: # It doesn't smell like a URL. - value = 'file://%s' % ( - urllib.pathname2url( - os.path.abspath(os.path.expanduser(value))),) - if opt_str == '--download-base' and not value.endswith('/'): - # Download base needs a trailing slash to make the world happy. - value += '/' - else: - value = None - name = opt_str[2:].replace('-', '_') - setattr(parser.values, name, value) - -usage = '''\ -[DESIRED PYTHON FOR BUILDOUT] bootstrap.py [options] - -Bootstraps a buildout-based project. - -Simply run this script in a directory containing a buildout.cfg, using the -Python that you want bin/buildout to use. - -Note that by using --setup-source and --download-base to point to -local resources, you can keep this script from going over the network. -''' - -parser = OptionParser(usage=usage) -parser.add_option("-v", "--version", dest="version", - help="use a specific zc.buildout version") -parser.add_option("-d", "--distribute", - action="store_true", dest="use_distribute", default=False, - help="Use Distribute rather than Setuptools.") -parser.add_option("--setup-source", action="callback", dest="setup_source", - callback=normalize_to_url, nargs=1, type="string", - help=("Specify a URL or file location for the setup file. " - "If you use Setuptools, this will default to " + - setuptools_source + "; if you use Distribute, this " - "will default to " + distribute_source +".")) -parser.add_option("--download-base", action="callback", dest="download_base", - callback=normalize_to_url, nargs=1, type="string", - help=("Specify a URL or directory for downloading " - "zc.buildout and either Setuptools or Distribute. " - "Defaults to PyPI.")) -parser.add_option("--eggs", - help=("Specify a directory for storing eggs. Defaults to " - "a temporary directory that is deleted when the " - "bootstrap script completes.")) -parser.add_option("-t", "--accept-buildout-test-releases", - dest='accept_buildout_test_releases', - action="store_true", default=False, - help=("Normally, if you do not specify a --version, the " - "bootstrap script and buildout gets the newest " - "*final* versions of zc.buildout and its recipes and " - "extensions for you. If you use this flag, " - "bootstrap and buildout will get the newest releases " - "even if they are alphas or betas.")) -parser.add_option("-c", None, action="store", dest="config_file", - help=("Specify the path to the buildout configuration " - "file to be used.")) - -options, args = parser.parse_args() - -# if -c was provided, we push it back into args for buildout's main function -if options.config_file is not None: - args += ['-c', options.config_file] - -if options.eggs: - eggs_dir = os.path.abspath(os.path.expanduser(options.eggs)) -else: - eggs_dir = tempfile.mkdtemp() - -if options.setup_source is None: - if options.use_distribute: - options.setup_source = distribute_source - else: - options.setup_source = setuptools_source - -if options.accept_buildout_test_releases: - args.append('buildout:accept-buildout-test-releases=true') -args.append('bootstrap') - -try: - import pkg_resources - import setuptools # A flag. Sometimes pkg_resources is installed alone. - if not hasattr(pkg_resources, '_distribute'): - raise ImportError -except ImportError: - ez_code = urllib2.urlopen( - options.setup_source).read().replace('\r\n', '\n') - ez = {} - exec ez_code in ez - setup_args = dict(to_dir=eggs_dir, download_delay=0) - if options.download_base: - setup_args['download_base'] = options.download_base - if options.use_distribute: - setup_args['no_fake'] = True - ez['use_setuptools'](**setup_args) - if 'pkg_resources' in sys.modules: - reload(sys.modules['pkg_resources']) - import pkg_resources - # This does not (always?) update the default working set. We will - # do it. - for path in sys.path: - if path not in pkg_resources.working_set.entries: - pkg_resources.working_set.add_entry(path) - -cmd = [quote(sys.executable), - '-c', - quote('from setuptools.command.easy_install import main; main()'), - '-mqNxd', - quote(eggs_dir)] - -if not has_broken_dash_S: - cmd.insert(1, '-S') - -find_links = options.download_base -if not find_links: - find_links = os.environ.get('bootstrap-testing-find-links') -if find_links: - cmd.extend(['-f', quote(find_links)]) - -if options.use_distribute: - setup_requirement = 'distribute' -else: - setup_requirement = 'setuptools' -ws = pkg_resources.working_set -setup_requirement_path = ws.find( - pkg_resources.Requirement.parse(setup_requirement)).location -env = dict( - os.environ, - PYTHONPATH=setup_requirement_path) - -requirement = 'zc.buildout' -version = options.version -if version is None and not options.accept_buildout_test_releases: - # Figure out the most recent final version of zc.buildout. - import setuptools.package_index - _final_parts = '*final-', '*final' - def _final_version(parsed_version): - for part in parsed_version: - if (part[:1] == '*') and (part not in _final_parts): - return False - return True - index = setuptools.package_index.PackageIndex( - search_path=[setup_requirement_path]) - if find_links: - index.add_find_links((find_links,)) - req = pkg_resources.Requirement.parse(requirement) - if index.obtain(req) is not None: - best = [] - bestv = None - for dist in index[req.project_name]: - distv = dist.parsed_version - if _final_version(distv): - if bestv is None or distv > bestv: - best = [dist] - bestv = distv - elif distv == bestv: - best.append(dist) - if best: - best.sort() - version = best[-1].version -if version: - requirement = '=='.join((requirement, version)) -cmd.append(requirement) - -if is_jython: - import subprocess - exitcode = subprocess.Popen(cmd, env=env).wait() -else: # Windows prefers this, apparently; otherwise we would prefer subprocess - exitcode = os.spawnle(*([os.P_WAIT, sys.executable] + cmd + [env])) -if exitcode != 0: - sys.stdout.flush() - sys.stderr.flush() - print ("An error occurred when trying to install zc.buildout. " - "Look above this message for any errors that " - "were output by easy_install.") - sys.exit(exitcode) - -ws.add_entry(eggs_dir) -ws.require(requirement) -import zc.buildout.buildout -zc.buildout.buildout.main(args) -if not options.eggs: # clean up temporary egg directory - shutil.rmtree(eggs_dir) diff --git a/doc/groktut/an_empty_grok_project/setup.py b/doc/groktut/an_empty_grok_project/setup.py deleted file mode 100644 index 4f10c5b..0000000 --- a/doc/groktut/an_empty_grok_project/setup.py +++ /dev/null @@ -1,36 +0,0 @@ -from setuptools import setup, find_packages - -version = '0.0' - -setup(name='Sample', - version=version, - description="", - long_description="""\ -""", - # Get strings from http://www.python.org/pypi?%3Aaction=list_classifiers - classifiers=[], - keywords="", - author="", - author_email="", - url="", - license="", - package_dir={'': 'src'}, - packages=find_packages('src'), - include_package_data=True, - zip_safe=False, - install_requires=['setuptools', - 'grok', - 'grokui.admin', - 'z3c.testsetup', - 'grokcore.startup', - # Add extra requirements here - ], - entry_points = """ - [console_scripts] - sample-debug = grokcore.startup:interactive_debug_prompt - sample-ctl = grokcore.startup:zdaemon_controller - [paste.app_factory] - main = grokcore.startup:application_factory - debug = grokcore.startup:debug_application_factory - """, - ) diff --git a/doc/groktut/completely_python_driven_views/bootstrap.py b/doc/groktut/completely_python_driven_views/bootstrap.py deleted file mode 100644 index 5f2cb08..0000000 --- a/doc/groktut/completely_python_driven_views/bootstrap.py +++ /dev/null @@ -1,260 +0,0 @@ -############################################################################## -# -# Copyright (c) 2006 Zope Foundation 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. -""" - -import os, shutil, sys, tempfile, textwrap, urllib, urllib2, subprocess -from optparse import OptionParser - -if sys.platform == 'win32': - def quote(c): - if ' ' in c: - return '"%s"' % c # work around spawn lamosity on windows - else: - return c -else: - quote = str - -# See zc.buildout.easy_install._has_broken_dash_S for motivation and comments. -stdout, stderr = subprocess.Popen( - [sys.executable, '-Sc', - 'try:\n' - ' import ConfigParser\n' - 'except ImportError:\n' - ' print 1\n' - 'else:\n' - ' print 0\n'], - stdout=subprocess.PIPE, stderr=subprocess.PIPE).communicate() -has_broken_dash_S = bool(int(stdout.strip())) - -# In order to be more robust in the face of system Pythons, we want to -# run without site-packages loaded. This is somewhat tricky, in -# particular because Python 2.6's distutils imports site, so starting -# with the -S flag is not sufficient. However, we'll start with that: -if not has_broken_dash_S and 'site' in sys.modules: - # We will restart with python -S. - args = sys.argv[:] - args[0:0] = [sys.executable, '-S'] - args = map(quote, args) - os.execv(sys.executable, args) -# Now we are running with -S. We'll get the clean sys.path, import site -# because distutils will do it later, and then reset the path and clean -# out any namespace packages from site-packages that might have been -# loaded by .pth files. -clean_path = sys.path[:] -import site -sys.path[:] = clean_path -for k, v in sys.modules.items(): - if k in ('setuptools', 'pkg_resources') or ( - hasattr(v, '__path__') and - len(v.__path__)==1 and - not os.path.exists(os.path.join(v.__path__[0],'__init__.py'))): - # This is a namespace package. Remove it. - sys.modules.pop(k) - -is_jython = sys.platform.startswith('java') - -setuptools_source = 'http://peak.telecommunity.com/dist/ez_setup.py' -distribute_source = 'http://python-distribute.org/distribute_setup.py' - -# parsing arguments -def normalize_to_url(option, opt_str, value, parser): - if value: - if '://' not in value: # It doesn't smell like a URL. - value = 'file://%s' % ( - urllib.pathname2url( - os.path.abspath(os.path.expanduser(value))),) - if opt_str == '--download-base' and not value.endswith('/'): - # Download base needs a trailing slash to make the world happy. - value += '/' - else: - value = None - name = opt_str[2:].replace('-', '_') - setattr(parser.values, name, value) - -usage = '''\ -[DESIRED PYTHON FOR BUILDOUT] bootstrap.py [options] - -Bootstraps a buildout-based project. - -Simply run this script in a directory containing a buildout.cfg, using the -Python that you want bin/buildout to use. - -Note that by using --setup-source and --download-base to point to -local resources, you can keep this script from going over the network. -''' - -parser = OptionParser(usage=usage) -parser.add_option("-v", "--version", dest="version", - help="use a specific zc.buildout version") -parser.add_option("-d", "--distribute", - action="store_true", dest="use_distribute", default=False, - help="Use Distribute rather than Setuptools.") -parser.add_option("--setup-source", action="callback", dest="setup_source", - callback=normalize_to_url, nargs=1, type="string", - help=("Specify a URL or file location for the setup file. " - "If you use Setuptools, this will default to " + - setuptools_source + "; if you use Distribute, this " - "will default to " + distribute_source +".")) -parser.add_option("--download-base", action="callback", dest="download_base", - callback=normalize_to_url, nargs=1, type="string", - help=("Specify a URL or directory for downloading " - "zc.buildout and either Setuptools or Distribute. " - "Defaults to PyPI.")) -parser.add_option("--eggs", - help=("Specify a directory for storing eggs. Defaults to " - "a temporary directory that is deleted when the " - "bootstrap script completes.")) -parser.add_option("-t", "--accept-buildout-test-releases", - dest='accept_buildout_test_releases', - action="store_true", default=False, - help=("Normally, if you do not specify a --version, the " - "bootstrap script and buildout gets the newest " - "*final* versions of zc.buildout and its recipes and " - "extensions for you. If you use this flag, " - "bootstrap and buildout will get the newest releases " - "even if they are alphas or betas.")) -parser.add_option("-c", None, action="store", dest="config_file", - help=("Specify the path to the buildout configuration " - "file to be used.")) - -options, args = parser.parse_args() - -# if -c was provided, we push it back into args for buildout's main function -if options.config_file is not None: - args += ['-c', options.config_file] - -if options.eggs: - eggs_dir = os.path.abspath(os.path.expanduser(options.eggs)) -else: - eggs_dir = tempfile.mkdtemp() - -if options.setup_source is None: - if options.use_distribute: - options.setup_source = distribute_source - else: - options.setup_source = setuptools_source - -if options.accept_buildout_test_releases: - args.append('buildout:accept-buildout-test-releases=true') -args.append('bootstrap') - -try: - import pkg_resources - import setuptools # A flag. Sometimes pkg_resources is installed alone. - if not hasattr(pkg_resources, '_distribute'): - raise ImportError -except ImportError: - ez_code = urllib2.urlopen( - options.setup_source).read().replace('\r\n', '\n') - ez = {} - exec ez_code in ez - setup_args = dict(to_dir=eggs_dir, download_delay=0) - if options.download_base: - setup_args['download_base'] = options.download_base - if options.use_distribute: - setup_args['no_fake'] = True - ez['use_setuptools'](**setup_args) - if 'pkg_resources' in sys.modules: - reload(sys.modules['pkg_resources']) - import pkg_resources - # This does not (always?) update the default working set. We will - # do it. - for path in sys.path: - if path not in pkg_resources.working_set.entries: - pkg_resources.working_set.add_entry(path) - -cmd = [quote(sys.executable), - '-c', - quote('from setuptools.command.easy_install import main; main()'), - '-mqNxd', - quote(eggs_dir)] - -if not has_broken_dash_S: - cmd.insert(1, '-S') - -find_links = options.download_base -if not find_links: - find_links = os.environ.get('bootstrap-testing-find-links') -if find_links: - cmd.extend(['-f', quote(find_links)]) - -if options.use_distribute: - setup_requirement = 'distribute' -else: - setup_requirement = 'setuptools' -ws = pkg_resources.working_set -setup_requirement_path = ws.find( - pkg_resources.Requirement.parse(setup_requirement)).location -env = dict( - os.environ, - PYTHONPATH=setup_requirement_path) - -requirement = 'zc.buildout' -version = options.version -if version is None and not options.accept_buildout_test_releases: - # Figure out the most recent final version of zc.buildout. - import setuptools.package_index - _final_parts = '*final-', '*final' - def _final_version(parsed_version): - for part in parsed_version: - if (part[:1] == '*') and (part not in _final_parts): - return False - return True - index = setuptools.package_index.PackageIndex( - search_path=[setup_requirement_path]) - if find_links: - index.add_find_links((find_links,)) - req = pkg_resources.Requirement.parse(requirement) - if index.obtain(req) is not None: - best = [] - bestv = None - for dist in index[req.project_name]: - distv = dist.parsed_version - if _final_version(distv): - if bestv is None or distv > bestv: - best = [dist] - bestv = distv - elif distv == bestv: - best.append(dist) - if best: - best.sort() - version = best[-1].version -if version: - requirement = '=='.join((requirement, version)) -cmd.append(requirement) - -if is_jython: - import subprocess - exitcode = subprocess.Popen(cmd, env=env).wait() -else: # Windows prefers this, apparently; otherwise we would prefer subprocess - exitcode = os.spawnle(*([os.P_WAIT, sys.executable] + cmd + [env])) -if exitcode != 0: - sys.stdout.flush() - sys.stderr.flush() - print ("An error occurred when trying to install zc.buildout. " - "Look above this message for any errors that " - "were output by easy_install.") - sys.exit(exitcode) - -ws.add_entry(eggs_dir) -ws.require(requirement) -import zc.buildout.buildout -zc.buildout.buildout.main(args) -if not options.eggs: # clean up temporary egg directory - shutil.rmtree(eggs_dir) diff --git a/doc/groktut/completely_python_driven_views/setup.py b/doc/groktut/completely_python_driven_views/setup.py deleted file mode 100644 index 4f10c5b..0000000 --- a/doc/groktut/completely_python_driven_views/setup.py +++ /dev/null @@ -1,36 +0,0 @@ -from setuptools import setup, find_packages - -version = '0.0' - -setup(name='Sample', - version=version, - description="", - long_description="""\ -""", - # Get strings from http://www.python.org/pypi?%3Aaction=list_classifiers - classifiers=[], - keywords="", - author="", - author_email="", - url="", - license="", - package_dir={'': 'src'}, - packages=find_packages('src'), - include_package_data=True, - zip_safe=False, - install_requires=['setuptools', - 'grok', - 'grokui.admin', - 'z3c.testsetup', - 'grokcore.startup', - # Add extra requirements here - ], - entry_points = """ - [console_scripts] - sample-debug = grokcore.startup:interactive_debug_prompt - sample-ctl = grokcore.startup:zdaemon_controller - [paste.app_factory] - main = grokcore.startup:application_factory - debug = grokcore.startup:debug_application_factory - """, - ) diff --git a/doc/groktut/containers/bootstrap.py b/doc/groktut/containers/bootstrap.py deleted file mode 100644 index 5f2cb08..0000000 --- a/doc/groktut/containers/bootstrap.py +++ /dev/null @@ -1,260 +0,0 @@ -############################################################################## -# -# Copyright (c) 2006 Zope Foundation 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. -""" - -import os, shutil, sys, tempfile, textwrap, urllib, urllib2, subprocess -from optparse import OptionParser - -if sys.platform == 'win32': - def quote(c): - if ' ' in c: - return '"%s"' % c # work around spawn lamosity on windows - else: - return c -else: - quote = str - -# See zc.buildout.easy_install._has_broken_dash_S for motivation and comments. -stdout, stderr = subprocess.Popen( - [sys.executable, '-Sc', - 'try:\n' - ' import ConfigParser\n' - 'except ImportError:\n' - ' print 1\n' - 'else:\n' - ' print 0\n'], - stdout=subprocess.PIPE, stderr=subprocess.PIPE).communicate() -has_broken_dash_S = bool(int(stdout.strip())) - -# In order to be more robust in the face of system Pythons, we want to -# run without site-packages loaded. This is somewhat tricky, in -# particular because Python 2.6's distutils imports site, so starting -# with the -S flag is not sufficient. However, we'll start with that: -if not has_broken_dash_S and 'site' in sys.modules: - # We will restart with python -S. - args = sys.argv[:] - args[0:0] = [sys.executable, '-S'] - args = map(quote, args) - os.execv(sys.executable, args) -# Now we are running with -S. We'll get the clean sys.path, import site -# because distutils will do it later, and then reset the path and clean -# out any namespace packages from site-packages that might have been -# loaded by .pth files. -clean_path = sys.path[:] -import site -sys.path[:] = clean_path -for k, v in sys.modules.items(): - if k in ('setuptools', 'pkg_resources') or ( - hasattr(v, '__path__') and - len(v.__path__)==1 and - not os.path.exists(os.path.join(v.__path__[0],'__init__.py'))): - # This is a namespace package. Remove it. - sys.modules.pop(k) - -is_jython = sys.platform.startswith('java') - -setuptools_source = 'http://peak.telecommunity.com/dist/ez_setup.py' -distribute_source = 'http://python-distribute.org/distribute_setup.py' - -# parsing arguments -def normalize_to_url(option, opt_str, value, parser): - if value: - if '://' not in value: # It doesn't smell like a URL. - value = 'file://%s' % ( - urllib.pathname2url( - os.path.abspath(os.path.expanduser(value))),) - if opt_str == '--download-base' and not value.endswith('/'): - # Download base needs a trailing slash to make the world happy. - value += '/' - else: - value = None - name = opt_str[2:].replace('-', '_') - setattr(parser.values, name, value) - -usage = '''\ -[DESIRED PYTHON FOR BUILDOUT] bootstrap.py [options] - -Bootstraps a buildout-based project. - -Simply run this script in a directory containing a buildout.cfg, using the -Python that you want bin/buildout to use. - -Note that by using --setup-source and --download-base to point to -local resources, you can keep this script from going over the network. -''' - -parser = OptionParser(usage=usage) -parser.add_option("-v", "--version", dest="version", - help="use a specific zc.buildout version") -parser.add_option("-d", "--distribute", - action="store_true", dest="use_distribute", default=False, - help="Use Distribute rather than Setuptools.") -parser.add_option("--setup-source", action="callback", dest="setup_source", - callback=normalize_to_url, nargs=1, type="string", - help=("Specify a URL or file location for the setup file. " - "If you use Setuptools, this will default to " + - setuptools_source + "; if you use Distribute, this " - "will default to " + distribute_source +".")) -parser.add_option("--download-base", action="callback", dest="download_base", - callback=normalize_to_url, nargs=1, type="string", - help=("Specify a URL or directory for downloading " - "zc.buildout and either Setuptools or Distribute. " - "Defaults to PyPI.")) -parser.add_option("--eggs", - help=("Specify a directory for storing eggs. Defaults to " - "a temporary directory that is deleted when the " - "bootstrap script completes.")) -parser.add_option("-t", "--accept-buildout-test-releases", - dest='accept_buildout_test_releases', - action="store_true", default=False, - help=("Normally, if you do not specify a --version, the " - "bootstrap script and buildout gets the newest " - "*final* versions of zc.buildout and its recipes and " - "extensions for you. If you use this flag, " - "bootstrap and buildout will get the newest releases " - "even if they are alphas or betas.")) -parser.add_option("-c", None, action="store", dest="config_file", - help=("Specify the path to the buildout configuration " - "file to be used.")) - -options, args = parser.parse_args() - -# if -c was provided, we push it back into args for buildout's main function -if options.config_file is not None: - args += ['-c', options.config_file] - -if options.eggs: - eggs_dir = os.path.abspath(os.path.expanduser(options.eggs)) -else: - eggs_dir = tempfile.mkdtemp() - -if options.setup_source is None: - if options.use_distribute: - options.setup_source = distribute_source - else: - options.setup_source = setuptools_source - -if options.accept_buildout_test_releases: - args.append('buildout:accept-buildout-test-releases=true') -args.append('bootstrap') - -try: - import pkg_resources - import setuptools # A flag. Sometimes pkg_resources is installed alone. - if not hasattr(pkg_resources, '_distribute'): - raise ImportError -except ImportError: - ez_code = urllib2.urlopen( - options.setup_source).read().replace('\r\n', '\n') - ez = {} - exec ez_code in ez - setup_args = dict(to_dir=eggs_dir, download_delay=0) - if options.download_base: - setup_args['download_base'] = options.download_base - if options.use_distribute: - setup_args['no_fake'] = True - ez['use_setuptools'](**setup_args) - if 'pkg_resources' in sys.modules: - reload(sys.modules['pkg_resources']) - import pkg_resources - # This does not (always?) update the default working set. We will - # do it. - for path in sys.path: - if path not in pkg_resources.working_set.entries: - pkg_resources.working_set.add_entry(path) - -cmd = [quote(sys.executable), - '-c', - quote('from setuptools.command.easy_install import main; main()'), - '-mqNxd', - quote(eggs_dir)] - -if not has_broken_dash_S: - cmd.insert(1, '-S') - -find_links = options.download_base -if not find_links: - find_links = os.environ.get('bootstrap-testing-find-links') -if find_links: - cmd.extend(['-f', quote(find_links)]) - -if options.use_distribute: - setup_requirement = 'distribute' -else: - setup_requirement = 'setuptools' -ws = pkg_resources.working_set -setup_requirement_path = ws.find( - pkg_resources.Requirement.parse(setup_requirement)).location -env = dict( - os.environ, - PYTHONPATH=setup_requirement_path) - -requirement = 'zc.buildout' -version = options.version -if version is None and not options.accept_buildout_test_releases: - # Figure out the most recent final version of zc.buildout. - import setuptools.package_index - _final_parts = '*final-', '*final' - def _final_version(parsed_version): - for part in parsed_version: - if (part[:1] == '*') and (part not in _final_parts): - return False - return True - index = setuptools.package_index.PackageIndex( - search_path=[setup_requirement_path]) - if find_links: - index.add_find_links((find_links,)) - req = pkg_resources.Requirement.parse(requirement) - if index.obtain(req) is not None: - best = [] - bestv = None - for dist in index[req.project_name]: - distv = dist.parsed_version - if _final_version(distv): - if bestv is None or distv > bestv: - best = [dist] - bestv = distv - elif distv == bestv: - best.append(dist) - if best: - best.sort() - version = best[-1].version -if version: - requirement = '=='.join((requirement, version)) -cmd.append(requirement) - -if is_jython: - import subprocess - exitcode = subprocess.Popen(cmd, env=env).wait() -else: # Windows prefers this, apparently; otherwise we would prefer subprocess - exitcode = os.spawnle(*([os.P_WAIT, sys.executable] + cmd + [env])) -if exitcode != 0: - sys.stdout.flush() - sys.stderr.flush() - print ("An error occurred when trying to install zc.buildout. " - "Look above this message for any errors that " - "were output by easy_install.") - sys.exit(exitcode) - -ws.add_entry(eggs_dir) -ws.require(requirement) -import zc.buildout.buildout -zc.buildout.buildout.main(args) -if not options.eggs: # clean up temporary egg directory - shutil.rmtree(eggs_dir) diff --git a/doc/groktut/containers/setup.py b/doc/groktut/containers/setup.py deleted file mode 100644 index 4f10c5b..0000000 --- a/doc/groktut/containers/setup.py +++ /dev/null @@ -1,36 +0,0 @@ -from setuptools import setup, find_packages - -version = '0.0' - -setup(name='Sample', - version=version, - description="", - long_description="""\ -""", - # Get strings from http://www.python.org/pypi?%3Aaction=list_classifiers - classifiers=[], - keywords="", - author="", - author_email="", - url="", - license="", - package_dir={'': 'src'}, - packages=find_packages('src'), - include_package_data=True, - zip_safe=False, - install_requires=['setuptools', - 'grok', - 'grokui.admin', - 'z3c.testsetup', - 'grokcore.startup', - # Add extra requirements here - ], - entry_points = """ - [console_scripts] - sample-debug = grokcore.startup:interactive_debug_prompt - sample-ctl = grokcore.startup:zdaemon_controller - [paste.app_factory] - main = grokcore.startup:application_factory - debug = grokcore.startup:debug_application_factory - """, - ) diff --git a/doc/groktut/doing_some_calculation_before_viewing_a_page/bootstrap.py b/doc/groktut/doing_some_calculation_before_viewing_a_page/bootstrap.py deleted file mode 100644 index 5f2cb08..0000000 --- a/doc/groktut/doing_some_calculation_before_viewing_a_page/bootstrap.py +++ /dev/null @@ -1,260 +0,0 @@ -############################################################################## -# -# Copyright (c) 2006 Zope Foundation 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. -""" - -import os, shutil, sys, tempfile, textwrap, urllib, urllib2, subprocess -from optparse import OptionParser - -if sys.platform == 'win32': - def quote(c): - if ' ' in c: - return '"%s"' % c # work around spawn lamosity on windows - else: - return c -else: - quote = str - -# See zc.buildout.easy_install._has_broken_dash_S for motivation and comments. -stdout, stderr = subprocess.Popen( - [sys.executable, '-Sc', - 'try:\n' - ' import ConfigParser\n' - 'except ImportError:\n' - ' print 1\n' - 'else:\n' - ' print 0\n'], - stdout=subprocess.PIPE, stderr=subprocess.PIPE).communicate() -has_broken_dash_S = bool(int(stdout.strip())) - -# In order to be more robust in the face of system Pythons, we want to -# run without site-packages loaded. This is somewhat tricky, in -# particular because Python 2.6's distutils imports site, so starting -# with the -S flag is not sufficient. However, we'll start with that: -if not has_broken_dash_S and 'site' in sys.modules: - # We will restart with python -S. - args = sys.argv[:] - args[0:0] = [sys.executable, '-S'] - args = map(quote, args) - os.execv(sys.executable, args) -# Now we are running with -S. We'll get the clean sys.path, import site -# because distutils will do it later, and then reset the path and clean -# out any namespace packages from site-packages that might have been -# loaded by .pth files. -clean_path = sys.path[:] -import site -sys.path[:] = clean_path -for k, v in sys.modules.items(): - if k in ('setuptools', 'pkg_resources') or ( - hasattr(v, '__path__') and - len(v.__path__)==1 and - not os.path.exists(os.path.join(v.__path__[0],'__init__.py'))): - # This is a namespace package. Remove it. - sys.modules.pop(k) - -is_jython = sys.platform.startswith('java') - -setuptools_source = 'http://peak.telecommunity.com/dist/ez_setup.py' -distribute_source = 'http://python-distribute.org/distribute_setup.py' - -# parsing arguments -def normalize_to_url(option, opt_str, value, parser): - if value: - if '://' not in value: # It doesn't smell like a URL. - value = 'file://%s' % ( - urllib.pathname2url( - os.path.abspath(os.path.expanduser(value))),) - if opt_str == '--download-base' and not value.endswith('/'): - # Download base needs a trailing slash to make the world happy. - value += '/' - else: - value = None - name = opt_str[2:].replace('-', '_') - setattr(parser.values, name, value) - -usage = '''\ -[DESIRED PYTHON FOR BUILDOUT] bootstrap.py [options] - -Bootstraps a buildout-based project. - -Simply run this script in a directory containing a buildout.cfg, using the -Python that you want bin/buildout to use. - -Note that by using --setup-source and --download-base to point to -local resources, you can keep this script from going over the network. -''' - -parser = OptionParser(usage=usage) -parser.add_option("-v", "--version", dest="version", - help="use a specific zc.buildout version") -parser.add_option("-d", "--distribute", - action="store_true", dest="use_distribute", default=False, - help="Use Distribute rather than Setuptools.") -parser.add_option("--setup-source", action="callback", dest="setup_source", - callback=normalize_to_url, nargs=1, type="string", - help=("Specify a URL or file location for the setup file. " - "If you use Setuptools, this will default to " + - setuptools_source + "; if you use Distribute, this " - "will default to " + distribute_source +".")) -parser.add_option("--download-base", action="callback", dest="download_base", - callback=normalize_to_url, nargs=1, type="string", - help=("Specify a URL or directory for downloading " - "zc.buildout and either Setuptools or Distribute. " - "Defaults to PyPI.")) -parser.add_option("--eggs", - help=("Specify a directory for storing eggs. Defaults to " - "a temporary directory that is deleted when the " - "bootstrap script completes.")) -parser.add_option("-t", "--accept-buildout-test-releases", - dest='accept_buildout_test_releases', - action="store_true", default=False, - help=("Normally, if you do not specify a --version, the " - "bootstrap script and buildout gets the newest " - "*final* versions of zc.buildout and its recipes and " - "extensions for you. If you use this flag, " - "bootstrap and buildout will get the newest releases " - "even if they are alphas or betas.")) -parser.add_option("-c", None, action="store", dest="config_file", - help=("Specify the path to the buildout configuration " - "file to be used.")) - -options, args = parser.parse_args() - -# if -c was provided, we push it back into args for buildout's main function -if options.config_file is not None: - args += ['-c', options.config_file] - -if options.eggs: - eggs_dir = os.path.abspath(os.path.expanduser(options.eggs)) -else: - eggs_dir = tempfile.mkdtemp() - -if options.setup_source is None: - if options.use_distribute: - options.setup_source = distribute_source - else: - options.setup_source = setuptools_source - -if options.accept_buildout_test_releases: - args.append('buildout:accept-buildout-test-releases=true') -args.append('bootstrap') - -try: - import pkg_resources - import setuptools # A flag. Sometimes pkg_resources is installed alone. - if not hasattr(pkg_resources, '_distribute'): - raise ImportError -except ImportError: - ez_code = urllib2.urlopen( - options.setup_source).read().replace('\r\n', '\n') - ez = {} - exec ez_code in ez - setup_args = dict(to_dir=eggs_dir, download_delay=0) - if options.download_base: - setup_args['download_base'] = options.download_base - if options.use_distribute: - setup_args['no_fake'] = True - ez['use_setuptools'](**setup_args) - if 'pkg_resources' in sys.modules: - reload(sys.modules['pkg_resources']) - import pkg_resources - # This does not (always?) update the default working set. We will - # do it. - for path in sys.path: - if path not in pkg_resources.working_set.entries: - pkg_resources.working_set.add_entry(path) - -cmd = [quote(sys.executable), - '-c', - quote('from setuptools.command.easy_install import main; main()'), - '-mqNxd', - quote(eggs_dir)] - -if not has_broken_dash_S: - cmd.insert(1, '-S') - -find_links = options.download_base -if not find_links: - find_links = os.environ.get('bootstrap-testing-find-links') -if find_links: - cmd.extend(['-f', quote(find_links)]) - -if options.use_distribute: - setup_requirement = 'distribute' -else: - setup_requirement = 'setuptools' -ws = pkg_resources.working_set -setup_requirement_path = ws.find( - pkg_resources.Requirement.parse(setup_requirement)).location -env = dict( - os.environ, - PYTHONPATH=setup_requirement_path) - -requirement = 'zc.buildout' -version = options.version -if version is None and not options.accept_buildout_test_releases: - # Figure out the most recent final version of zc.buildout. - import setuptools.package_index - _final_parts = '*final-', '*final' - def _final_version(parsed_version): - for part in parsed_version: - if (part[:1] == '*') and (part not in _final_parts): - return False - return True - index = setuptools.package_index.PackageIndex( - search_path=[setup_requirement_path]) - if find_links: - index.add_find_links((find_links,)) - req = pkg_resources.Requirement.parse(requirement) - if index.obtain(req) is not None: - best = [] - bestv = None - for dist in index[req.project_name]: - distv = dist.parsed_version - if _final_version(distv): - if bestv is None or distv > bestv: - best = [dist] - bestv = distv - elif distv == bestv: - best.append(dist) - if best: - best.sort() - version = best[-1].version -if version: - requirement = '=='.join((requirement, version)) -cmd.append(requirement) - -if is_jython: - import subprocess - exitcode = subprocess.Popen(cmd, env=env).wait() -else: # Windows prefers this, apparently; otherwise we would prefer subprocess - exitcode = os.spawnle(*([os.P_WAIT, sys.executable] + cmd + [env])) -if exitcode != 0: - sys.stdout.flush() - sys.stderr.flush() - print ("An error occurred when trying to install zc.buildout. " - "Look above this message for any errors that " - "were output by easy_install.") - sys.exit(exitcode) - -ws.add_entry(eggs_dir) -ws.require(requirement) -import zc.buildout.buildout -zc.buildout.buildout.main(args) -if not options.eggs: # clean up temporary egg directory - shutil.rmtree(eggs_dir) diff --git a/doc/groktut/doing_some_calculation_before_viewing_a_page/setup.py b/doc/groktut/doing_some_calculation_before_viewing_a_page/setup.py deleted file mode 100644 index 4f10c5b..0000000 --- a/doc/groktut/doing_some_calculation_before_viewing_a_page/setup.py +++ /dev/null @@ -1,36 +0,0 @@ -from setuptools import setup, find_packages - -version = '0.0' - -setup(name='Sample', - version=version, - description="", - long_description="""\ -""", - # Get strings from http://www.python.org/pypi?%3Aaction=list_classifiers - classifiers=[], - keywords="", - author="", - author_email="", - url="", - license="", - package_dir={'': 'src'}, - packages=find_packages('src'), - include_package_data=True, - zip_safe=False, - install_requires=['setuptools', - 'grok', - 'grokui.admin', - 'z3c.testsetup', - 'grokcore.startup', - # Add extra requirements here - ], - entry_points = """ - [console_scripts] - sample-debug = grokcore.startup:interactive_debug_prompt - sample-ctl = grokcore.startup:zdaemon_controller - [paste.app_factory] - main = grokcore.startup:application_factory - debug = grokcore.startup:debug_application_factory - """, - ) diff --git a/doc/groktut/explicitly_associating_a_view_with_a_model/bootstrap.py b/doc/groktut/explicitly_associating_a_view_with_a_model/bootstrap.py deleted file mode 100644 index 5f2cb08..0000000 --- a/doc/groktut/explicitly_associating_a_view_with_a_model/bootstrap.py +++ /dev/null @@ -1,260 +0,0 @@ -############################################################################## -# -# Copyright (c) 2006 Zope Foundation 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. -""" - -import os, shutil, sys, tempfile, textwrap, urllib, urllib2, subprocess -from optparse import OptionParser - -if sys.platform == 'win32': - def quote(c): - if ' ' in c: - return '"%s"' % c # work around spawn lamosity on windows - else: - return c -else: - quote = str - -# See zc.buildout.easy_install._has_broken_dash_S for motivation and comments. -stdout, stderr = subprocess.Popen( - [sys.executable, '-Sc', - 'try:\n' - ' import ConfigParser\n' - 'except ImportError:\n' - ' print 1\n' - 'else:\n' - ' print 0\n'], - stdout=subprocess.PIPE, stderr=subprocess.PIPE).communicate() -has_broken_dash_S = bool(int(stdout.strip())) - -# In order to be more robust in the face of system Pythons, we want to -# run without site-packages loaded. This is somewhat tricky, in -# particular because Python 2.6's distutils imports site, so starting -# with the -S flag is not sufficient. However, we'll start with that: -if not has_broken_dash_S and 'site' in sys.modules: - # We will restart with python -S. - args = sys.argv[:] - args[0:0] = [sys.executable, '-S'] - args = map(quote, args) - os.execv(sys.executable, args) -# Now we are running with -S. We'll get the clean sys.path, import site -# because distutils will do it later, and then reset the path and clean -# out any namespace packages from site-packages that might have been -# loaded by .pth files. -clean_path = sys.path[:] -import site -sys.path[:] = clean_path -for k, v in sys.modules.items(): - if k in ('setuptools', 'pkg_resources') or ( - hasattr(v, '__path__') and - len(v.__path__)==1 and - not os.path.exists(os.path.join(v.__path__[0],'__init__.py'))): - # This is a namespace package. Remove it. - sys.modules.pop(k) - -is_jython = sys.platform.startswith('java') - -setuptools_source = 'http://peak.telecommunity.com/dist/ez_setup.py' -distribute_source = 'http://python-distribute.org/distribute_setup.py' - -# parsing arguments -def normalize_to_url(option, opt_str, value, parser): - if value: - if '://' not in value: # It doesn't smell like a URL. - value = 'file://%s' % ( - urllib.pathname2url( - os.path.abspath(os.path.expanduser(value))),) - if opt_str == '--download-base' and not value.endswith('/'): - # Download base needs a trailing slash to make the world happy. - value += '/' - else: - value = None - name = opt_str[2:].replace('-', '_') - setattr(parser.values, name, value) - -usage = '''\ -[DESIRED PYTHON FOR BUILDOUT] bootstrap.py [options] - -Bootstraps a buildout-based project. - -Simply run this script in a directory containing a buildout.cfg, using the -Python that you want bin/buildout to use. - -Note that by using --setup-source and --download-base to point to -local resources, you can keep this script from going over the network. -''' - -parser = OptionParser(usage=usage) -parser.add_option("-v", "--version", dest="version", - help="use a specific zc.buildout version") -parser.add_option("-d", "--distribute", - action="store_true", dest="use_distribute", default=False, - help="Use Distribute rather than Setuptools.") -parser.add_option("--setup-source", action="callback", dest="setup_source", - callback=normalize_to_url, nargs=1, type="string", - help=("Specify a URL or file location for the setup file. " - "If you use Setuptools, this will default to " + - setuptools_source + "; if you use Distribute, this " - "will default to " + distribute_source +".")) -parser.add_option("--download-base", action="callback", dest="download_base", - callback=normalize_to_url, nargs=1, type="string", - help=("Specify a URL or directory for downloading " - "zc.buildout and either Setuptools or Distribute. " - "Defaults to PyPI.")) -parser.add_option("--eggs", - help=("Specify a directory for storing eggs. Defaults to " - "a temporary directory that is deleted when the " - "bootstrap script completes.")) -parser.add_option("-t", "--accept-buildout-test-releases", - dest='accept_buildout_test_releases', - action="store_true", default=False, - help=("Normally, if you do not specify a --version, the " - "bootstrap script and buildout gets the newest " - "*final* versions of zc.buildout and its recipes and " - "extensions for you. If you use this flag, " - "bootstrap and buildout will get the newest releases " - "even if they are alphas or betas.")) -parser.add_option("-c", None, action="store", dest="config_file", - help=("Specify the path to the buildout configuration " - "file to be used.")) - -options, args = parser.parse_args() - -# if -c was provided, we push it back into args for buildout's main function -if options.config_file is not None: - args += ['-c', options.config_file] - -if options.eggs: - eggs_dir = os.path.abspath(os.path.expanduser(options.eggs)) -else: - eggs_dir = tempfile.mkdtemp() - -if options.setup_source is None: - if options.use_distribute: - options.setup_source = distribute_source - else: - options.setup_source = setuptools_source - -if options.accept_buildout_test_releases: - args.append('buildout:accept-buildout-test-releases=true') -args.append('bootstrap') - -try: - import pkg_resources - import setuptools # A flag. Sometimes pkg_resources is installed alone. - if not hasattr(pkg_resources, '_distribute'): - raise ImportError -except ImportError: - ez_code = urllib2.urlopen( - options.setup_source).read().replace('\r\n', '\n') - ez = {} - exec ez_code in ez - setup_args = dict(to_dir=eggs_dir, download_delay=0) - if options.download_base: - setup_args['download_base'] = options.download_base - if options.use_distribute: - setup_args['no_fake'] = True - ez['use_setuptools'](**setup_args) - if 'pkg_resources' in sys.modules: - reload(sys.modules['pkg_resources']) - import pkg_resources - # This does not (always?) update the default working set. We will - # do it. - for path in sys.path: - if path not in pkg_resources.working_set.entries: - pkg_resources.working_set.add_entry(path) - -cmd = [quote(sys.executable), - '-c', - quote('from setuptools.command.easy_install import main; main()'), - '-mqNxd', - quote(eggs_dir)] - -if not has_broken_dash_S: - cmd.insert(1, '-S') - -find_links = options.download_base -if not find_links: - find_links = os.environ.get('bootstrap-testing-find-links') -if find_links: - cmd.extend(['-f', quote(find_links)]) - -if options.use_distribute: - setup_requirement = 'distribute' -else: - setup_requirement = 'setuptools' -ws = pkg_resources.working_set -setup_requirement_path = ws.find( - pkg_resources.Requirement.parse(setup_requirement)).location -env = dict( - os.environ, - PYTHONPATH=setup_requirement_path) - -requirement = 'zc.buildout' -version = options.version -if version is None and not options.accept_buildout_test_releases: - # Figure out the most recent final version of zc.buildout. - import setuptools.package_index - _final_parts = '*final-', '*final' - def _final_version(parsed_version): - for part in parsed_version: - if (part[:1] == '*') and (part not in _final_parts): - return False - return True - index = setuptools.package_index.PackageIndex( - search_path=[setup_requirement_path]) - if find_links: - index.add_find_links((find_links,)) - req = pkg_resources.Requirement.parse(requirement) - if index.obtain(req) is not None: - best = [] - bestv = None - for dist in index[req.project_name]: - distv = dist.parsed_version - if _final_version(distv): - if bestv is None or distv > bestv: - best = [dist] - bestv = distv - elif distv == bestv: - best.append(dist) - if best: - best.sort() - version = best[-1].version -if version: - requirement = '=='.join((requirement, version)) -cmd.append(requirement) - -if is_jython: - import subprocess - exitcode = subprocess.Popen(cmd, env=env).wait() -else: # Windows prefers this, apparently; otherwise we would prefer subprocess - exitcode = os.spawnle(*([os.P_WAIT, sys.executable] + cmd + [env])) -if exitcode != 0: - sys.stdout.flush() - sys.stderr.flush() - print ("An error occurred when trying to install zc.buildout. " - "Look above this message for any errors that " - "were output by easy_install.") - sys.exit(exitcode) - -ws.add_entry(eggs_dir) -ws.require(requirement) -import zc.buildout.buildout -zc.buildout.buildout.main(args) -if not options.eggs: # clean up temporary egg directory - shutil.rmtree(eggs_dir) diff --git a/doc/groktut/explicitly_associating_a_view_with_a_model/setup.py b/doc/groktut/explicitly_associating_a_view_with_a_model/setup.py deleted file mode 100644 index 4f10c5b..0000000 --- a/doc/groktut/explicitly_associating_a_view_with_a_model/setup.py +++ /dev/null @@ -1,36 +0,0 @@ -from setuptools import setup, find_packages - -version = '0.0' - -setup(name='Sample', - version=version, - description="", - long_description="""\ -""", - # Get strings from http://www.python.org/pypi?%3Aaction=list_classifiers - classifiers=[], - keywords="", - author="", - author_email="", - url="", - license="", - package_dir={'': 'src'}, - packages=find_packages('src'), - include_package_data=True, - zip_safe=False, - install_requires=['setuptools', - 'grok', - 'grokui.admin', - 'z3c.testsetup', - 'grokcore.startup', - # Add extra requirements here - ], - entry_points = """ - [console_scripts] - sample-debug = grokcore.startup:interactive_debug_prompt - sample-ctl = grokcore.startup:zdaemon_controller - [paste.app_factory] - main = grokcore.startup:application_factory - debug = grokcore.startup:debug_application_factory - """, - ) diff --git a/doc/groktut/generating_html_from_python/bootstrap.py b/doc/groktut/generating_html_from_python/bootstrap.py deleted file mode 100644 index 5f2cb08..0000000 --- a/doc/groktut/generating_html_from_python/bootstrap.py +++ /dev/null @@ -1,260 +0,0 @@ -############################################################################## -# -# Copyright (c) 2006 Zope Foundation 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. -""" - -import os, shutil, sys, tempfile, textwrap, urllib, urllib2, subprocess -from optparse import OptionParser - -if sys.platform == 'win32': - def quote(c): - if ' ' in c: - return '"%s"' % c # work around spawn lamosity on windows - else: - return c -else: - quote = str - -# See zc.buildout.easy_install._has_broken_dash_S for motivation and comments. -stdout, stderr = subprocess.Popen( - [sys.executable, '-Sc', - 'try:\n' - ' import ConfigParser\n' - 'except ImportError:\n' - ' print 1\n' - 'else:\n' - ' print 0\n'], - stdout=subprocess.PIPE, stderr=subprocess.PIPE).communicate() -has_broken_dash_S = bool(int(stdout.strip())) - -# In order to be more robust in the face of system Pythons, we want to -# run without site-packages loaded. This is somewhat tricky, in -# particular because Python 2.6's distutils imports site, so starting -# with the -S flag is not sufficient. However, we'll start with that: -if not has_broken_dash_S and 'site' in sys.modules: - # We will restart with python -S. - args = sys.argv[:] - args[0:0] = [sys.executable, '-S'] - args = map(quote, args) - os.execv(sys.executable, args) -# Now we are running with -S. We'll get the clean sys.path, import site -# because distutils will do it later, and then reset the path and clean -# out any namespace packages from site-packages that might have been -# loaded by .pth files. -clean_path = sys.path[:] -import site -sys.path[:] = clean_path -for k, v in sys.modules.items(): - if k in ('setuptools', 'pkg_resources') or ( - hasattr(v, '__path__') and - len(v.__path__)==1 and - not os.path.exists(os.path.join(v.__path__[0],'__init__.py'))): - # This is a namespace package. Remove it. - sys.modules.pop(k) - -is_jython = sys.platform.startswith('java') - -setuptools_source = 'http://peak.telecommunity.com/dist/ez_setup.py' -distribute_source = 'http://python-distribute.org/distribute_setup.py' - -# parsing arguments -def normalize_to_url(option, opt_str, value, parser): - if value: - if '://' not in value: # It doesn't smell like a URL. - value = 'file://%s' % ( - urllib.pathname2url( - os.path.abspath(os.path.expanduser(value))),) - if opt_str == '--download-base' and not value.endswith('/'): - # Download base needs a trailing slash to make the world happy. - value += '/' - else: - value = None - name = opt_str[2:].replace('-', '_') - setattr(parser.values, name, value) - -usage = '''\ -[DESIRED PYTHON FOR BUILDOUT] bootstrap.py [options] - -Bootstraps a buildout-based project. - -Simply run this script in a directory containing a buildout.cfg, using the -Python that you want bin/buildout to use. - -Note that by using --setup-source and --download-base to point to -local resources, you can keep this script from going over the network. -''' - -parser = OptionParser(usage=usage) -parser.add_option("-v", "--version", dest="version", - help="use a specific zc.buildout version") -parser.add_option("-d", "--distribute", - action="store_true", dest="use_distribute", default=False, - help="Use Distribute rather than Setuptools.") -parser.add_option("--setup-source", action="callback", dest="setup_source", - callback=normalize_to_url, nargs=1, type="string", - help=("Specify a URL or file location for the setup file. " - "If you use Setuptools, this will default to " + - setuptools_source + "; if you use Distribute, this " - "will default to " + distribute_source +".")) -parser.add_option("--download-base", action="callback", dest="download_base", - callback=normalize_to_url, nargs=1, type="string", - help=("Specify a URL or directory for downloading " - "zc.buildout and either Setuptools or Distribute. " - "Defaults to PyPI.")) -parser.add_option("--eggs", - help=("Specify a directory for storing eggs. Defaults to " - "a temporary directory that is deleted when the " - "bootstrap script completes.")) -parser.add_option("-t", "--accept-buildout-test-releases", - dest='accept_buildout_test_releases', - action="store_true", default=False, - help=("Normally, if you do not specify a --version, the " - "bootstrap script and buildout gets the newest " - "*final* versions of zc.buildout and its recipes and " - "extensions for you. If you use this flag, " - "bootstrap and buildout will get the newest releases " - "even if they are alphas or betas.")) -parser.add_option("-c", None, action="store", dest="config_file", - help=("Specify the path to the buildout configuration " - "file to be used.")) - -options, args = parser.parse_args() - -# if -c was provided, we push it back into args for buildout's main function -if options.config_file is not None: - args += ['-c', options.config_file] - -if options.eggs: - eggs_dir = os.path.abspath(os.path.expanduser(options.eggs)) -else: - eggs_dir = tempfile.mkdtemp() - -if options.setup_source is None: - if options.use_distribute: - options.setup_source = distribute_source - else: - options.setup_source = setuptools_source - -if options.accept_buildout_test_releases: - args.append('buildout:accept-buildout-test-releases=true') -args.append('bootstrap') - -try: - import pkg_resources - import setuptools # A flag. Sometimes pkg_resources is installed alone. - if not hasattr(pkg_resources, '_distribute'): - raise ImportError -except ImportError: - ez_code = urllib2.urlopen( - options.setup_source).read().replace('\r\n', '\n') - ez = {} - exec ez_code in ez - setup_args = dict(to_dir=eggs_dir, download_delay=0) - if options.download_base: - setup_args['download_base'] = options.download_base - if options.use_distribute: - setup_args['no_fake'] = True - ez['use_setuptools'](**setup_args) - if 'pkg_resources' in sys.modules: - reload(sys.modules['pkg_resources']) - import pkg_resources - # This does not (always?) update the default working set. We will - # do it. - for path in sys.path: - if path not in pkg_resources.working_set.entries: - pkg_resources.working_set.add_entry(path) - -cmd = [quote(sys.executable), - '-c', - quote('from setuptools.command.easy_install import main; main()'), - '-mqNxd', - quote(eggs_dir)] - -if not has_broken_dash_S: - cmd.insert(1, '-S') - -find_links = options.download_base -if not find_links: - find_links = os.environ.get('bootstrap-testing-find-links') -if find_links: - cmd.extend(['-f', quote(find_links)]) - -if options.use_distribute: - setup_requirement = 'distribute' -else: - setup_requirement = 'setuptools' -ws = pkg_resources.working_set -setup_requirement_path = ws.find( - pkg_resources.Requirement.parse(setup_requirement)).location -env = dict( - os.environ, - PYTHONPATH=setup_requirement_path) - -requirement = 'zc.buildout' -version = options.version -if version is None and not options.accept_buildout_test_releases: - # Figure out the most recent final version of zc.buildout. - import setuptools.package_index - _final_parts = '*final-', '*final' - def _final_version(parsed_version): - for part in parsed_version: - if (part[:1] == '*') and (part not in _final_parts): - return False - return True - index = setuptools.package_index.PackageIndex( - search_path=[setup_requirement_path]) - if find_links: - index.add_find_links((find_links,)) - req = pkg_resources.Requirement.parse(requirement) - if index.obtain(req) is not None: - best = [] - bestv = None - for dist in index[req.project_name]: - distv = dist.parsed_version - if _final_version(distv): - if bestv is None or distv > bestv: - best = [dist] - bestv = distv - elif distv == bestv: - best.append(dist) - if best: - best.sort() - version = best[-1].version -if version: - requirement = '=='.join((requirement, version)) -cmd.append(requirement) - -if is_jython: - import subprocess - exitcode = subprocess.Popen(cmd, env=env).wait() -else: # Windows prefers this, apparently; otherwise we would prefer subprocess - exitcode = os.spawnle(*([os.P_WAIT, sys.executable] + cmd + [env])) -if exitcode != 0: - sys.stdout.flush() - sys.stderr.flush() - print ("An error occurred when trying to install zc.buildout. " - "Look above this message for any errors that " - "were output by easy_install.") - sys.exit(exitcode) - -ws.add_entry(eggs_dir) -ws.require(requirement) -import zc.buildout.buildout -zc.buildout.buildout.main(args) -if not options.eggs: # clean up temporary egg directory - shutil.rmtree(eggs_dir) diff --git a/doc/groktut/generating_html_from_python/setup.py b/doc/groktut/generating_html_from_python/setup.py deleted file mode 100644 index 4f10c5b..0000000 --- a/doc/groktut/generating_html_from_python/setup.py +++ /dev/null @@ -1,36 +0,0 @@ -from setuptools import setup, find_packages - -version = '0.0' - -setup(name='Sample', - version=version, - description="", - long_description="""\ -""", - # Get strings from http://www.python.org/pypi?%3Aaction=list_classifiers - classifiers=[], - keywords="", - author="", - author_email="", - url="", - license="", - package_dir={'': 'src'}, - packages=find_packages('src'), - include_package_data=True, - zip_safe=False, - install_requires=['setuptools', - 'grok', - 'grokui.admin', - 'z3c.testsetup', - 'grokcore.startup', - # Add extra requirements here - ], - entry_points = """ - [console_scripts] - sample-debug = grokcore.startup:interactive_debug_prompt - sample-ctl = grokcore.startup:zdaemon_controller - [paste.app_factory] - main = grokcore.startup:application_factory - debug = grokcore.startup:debug_application_factory - """, - ) diff --git a/doc/groktut/making_our_page_dynamic/bootstrap.py b/doc/groktut/making_our_page_dynamic/bootstrap.py deleted file mode 100644 index 5f2cb08..0000000 --- a/doc/groktut/making_our_page_dynamic/bootstrap.py +++ /dev/null @@ -1,260 +0,0 @@ -############################################################################## -# -# Copyright (c) 2006 Zope Foundation 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. -""" - -import os, shutil, sys, tempfile, textwrap, urllib, urllib2, subprocess -from optparse import OptionParser - -if sys.platform == 'win32': - def quote(c): - if ' ' in c: - return '"%s"' % c # work around spawn lamosity on windows - else: - return c -else: - quote = str - -# See zc.buildout.easy_install._has_broken_dash_S for motivation and comments. -stdout, stderr = subprocess.Popen( - [sys.executable, '-Sc', - 'try:\n' - ' import ConfigParser\n' - 'except ImportError:\n' - ' print 1\n' - 'else:\n' - ' print 0\n'], - stdout=subprocess.PIPE, stderr=subprocess.PIPE).communicate() -has_broken_dash_S = bool(int(stdout.strip())) - -# In order to be more robust in the face of system Pythons, we want to -# run without site-packages loaded. This is somewhat tricky, in -# particular because Python 2.6's distutils imports site, so starting -# with the -S flag is not sufficient. However, we'll start with that: -if not has_broken_dash_S and 'site' in sys.modules: - # We will restart with python -S. - args = sys.argv[:] - args[0:0] = [sys.executable, '-S'] - args = map(quote, args) - os.execv(sys.executable, args) -# Now we are running with -S. We'll get the clean sys.path, import site -# because distutils will do it later, and then reset the path and clean -# out any namespace packages from site-packages that might have been -# loaded by .pth files. -clean_path = sys.path[:] -import site -sys.path[:] = clean_path -for k, v in sys.modules.items(): - if k in ('setuptools', 'pkg_resources') or ( - hasattr(v, '__path__') and - len(v.__path__)==1 and - not os.path.exists(os.path.join(v.__path__[0],'__init__.py'))): - # This is a namespace package. Remove it. - sys.modules.pop(k) - -is_jython = sys.platform.startswith('java') - -setuptools_source = 'http://peak.telecommunity.com/dist/ez_setup.py' -distribute_source = 'http://python-distribute.org/distribute_setup.py' - -# parsing arguments -def normalize_to_url(option, opt_str, value, parser): - if value: - if '://' not in value: # It doesn't smell like a URL. - value = 'file://%s' % ( - urllib.pathname2url( - os.path.abspath(os.path.expanduser(value))),) - if opt_str == '--download-base' and not value.endswith('/'): - # Download base needs a trailing slash to make the world happy. - value += '/' - else: - value = None - name = opt_str[2:].replace('-', '_') - setattr(parser.values, name, value) - -usage = '''\ -[DESIRED PYTHON FOR BUILDOUT] bootstrap.py [options] - -Bootstraps a buildout-based project. - -Simply run this script in a directory containing a buildout.cfg, using the -Python that you want bin/buildout to use. - -Note that by using --setup-source and --download-base to point to -local resources, you can keep this script from going over the network. -''' - -parser = OptionParser(usage=usage) -parser.add_option("-v", "--version", dest="version", - help="use a specific zc.buildout version") -parser.add_option("-d", "--distribute", - action="store_true", dest="use_distribute", default=False, - help="Use Distribute rather than Setuptools.") -parser.add_option("--setup-source", action="callback", dest="setup_source", - callback=normalize_to_url, nargs=1, type="string", - help=("Specify a URL or file location for the setup file. " - "If you use Setuptools, this will default to " + - setuptools_source + "; if you use Distribute, this " - "will default to " + distribute_source +".")) -parser.add_option("--download-base", action="callback", dest="download_base", - callback=normalize_to_url, nargs=1, type="string", - help=("Specify a URL or directory for downloading " - "zc.buildout and either Setuptools or Distribute. " - "Defaults to PyPI.")) -parser.add_option("--eggs", - help=("Specify a directory for storing eggs. Defaults to " - "a temporary directory that is deleted when the " - "bootstrap script completes.")) -parser.add_option("-t", "--accept-buildout-test-releases", - dest='accept_buildout_test_releases', - action="store_true", default=False, - help=("Normally, if you do not specify a --version, the " - "bootstrap script and buildout gets the newest " - "*final* versions of zc.buildout and its recipes and " - "extensions for you. If you use this flag, " - "bootstrap and buildout will get the newest releases " - "even if they are alphas or betas.")) -parser.add_option("-c", None, action="store", dest="config_file", - help=("Specify the path to the buildout configuration " - "file to be used.")) - -options, args = parser.parse_args() - -# if -c was provided, we push it back into args for buildout's main function -if options.config_file is not None: - args += ['-c', options.config_file] - -if options.eggs: - eggs_dir = os.path.abspath(os.path.expanduser(options.eggs)) -else: - eggs_dir = tempfile.mkdtemp() - -if options.setup_source is None: - if options.use_distribute: - options.setup_source = distribute_source - else: - options.setup_source = setuptools_source - -if options.accept_buildout_test_releases: - args.append('buildout:accept-buildout-test-releases=true') -args.append('bootstrap') - -try: - import pkg_resources - import setuptools # A flag. Sometimes pkg_resources is installed alone. - if not hasattr(pkg_resources, '_distribute'): - raise ImportError -except ImportError: - ez_code = urllib2.urlopen( - options.setup_source).read().replace('\r\n', '\n') - ez = {} - exec ez_code in ez - setup_args = dict(to_dir=eggs_dir, download_delay=0) - if options.download_base: - setup_args['download_base'] = options.download_base - if options.use_distribute: - setup_args['no_fake'] = True - ez['use_setuptools'](**setup_args) - if 'pkg_resources' in sys.modules: - reload(sys.modules['pkg_resources']) - import pkg_resources - # This does not (always?) update the default working set. We will - # do it. - for path in sys.path: - if path not in pkg_resources.working_set.entries: - pkg_resources.working_set.add_entry(path) - -cmd = [quote(sys.executable), - '-c', - quote('from setuptools.command.easy_install import main; main()'), - '-mqNxd', - quote(eggs_dir)] - -if not has_broken_dash_S: - cmd.insert(1, '-S') - -find_links = options.download_base -if not find_links: - find_links = os.environ.get('bootstrap-testing-find-links') -if find_links: - cmd.extend(['-f', quote(find_links)]) - -if options.use_distribute: - setup_requirement = 'distribute' -else: - setup_requirement = 'setuptools' -ws = pkg_resources.working_set -setup_requirement_path = ws.find( - pkg_resources.Requirement.parse(setup_requirement)).location -env = dict( - os.environ, - PYTHONPATH=setup_requirement_path) - -requirement = 'zc.buildout' -version = options.version -if version is None and not options.accept_buildout_test_releases: - # Figure out the most recent final version of zc.buildout. - import setuptools.package_index - _final_parts = '*final-', '*final' - def _final_version(parsed_version): - for part in parsed_version: - if (part[:1] == '*') and (part not in _final_parts): - return False - return True - index = setuptools.package_index.PackageIndex( - search_path=[setup_requirement_path]) - if find_links: - index.add_find_links((find_links,)) - req = pkg_resources.Requirement.parse(requirement) - if index.obtain(req) is not None: - best = [] - bestv = None - for dist in index[req.project_name]: - distv = dist.parsed_version - if _final_version(distv): - if bestv is None or distv > bestv: - best = [dist] - bestv = distv - elif distv == bestv: - best.append(dist) - if best: - best.sort() - version = best[-1].version -if version: - requirement = '=='.join((requirement, version)) -cmd.append(requirement) - -if is_jython: - import subprocess - exitcode = subprocess.Popen(cmd, env=env).wait() -else: # Windows prefers this, apparently; otherwise we would prefer subprocess - exitcode = os.spawnle(*([os.P_WAIT, sys.executable] + cmd + [env])) -if exitcode != 0: - sys.stdout.flush() - sys.stderr.flush() - print ("An error occurred when trying to install zc.buildout. " - "Look above this message for any errors that " - "were output by easy_install.") - sys.exit(exitcode) - -ws.add_entry(eggs_dir) -ws.require(requirement) -import zc.buildout.buildout -zc.buildout.buildout.main(args) -if not options.eggs: # clean up temporary egg directory - shutil.rmtree(eggs_dir) diff --git a/doc/groktut/making_our_page_dynamic/setup.py b/doc/groktut/making_our_page_dynamic/setup.py deleted file mode 100644 index 4f10c5b..0000000 --- a/doc/groktut/making_our_page_dynamic/setup.py +++ /dev/null @@ -1,36 +0,0 @@ -from setuptools import setup, find_packages - -version = '0.0' - -setup(name='Sample', - version=version, - description="", - long_description="""\ -""", - # Get strings from http://www.python.org/pypi?%3Aaction=list_classifiers - classifiers=[], - keywords="", - author="", - author_email="", - url="", - license="", - package_dir={'': 'src'}, - packages=find_packages('src'), - include_package_data=True, - zip_safe=False, - install_requires=['setuptools', - 'grok', - 'grokui.admin', - 'z3c.testsetup', - 'grokcore.startup', - # Add extra requirements here - ], - entry_points = """ - [console_scripts] - sample-debug = grokcore.startup:interactive_debug_prompt - sample-ctl = grokcore.startup:zdaemon_controller - [paste.app_factory] - main = grokcore.startup:application_factory - debug = grokcore.startup:debug_application_factory - """, - ) diff --git a/doc/groktut/publishing_a_simple_web_page/bootstrap.py b/doc/groktut/publishing_a_simple_web_page/bootstrap.py deleted file mode 100644 index 5f2cb08..0000000 --- a/doc/groktut/publishing_a_simple_web_page/bootstrap.py +++ /dev/null @@ -1,260 +0,0 @@ -############################################################################## -# -# Copyright (c) 2006 Zope Foundation 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. -""" - -import os, shutil, sys, tempfile, textwrap, urllib, urllib2, subprocess -from optparse import OptionParser - -if sys.platform == 'win32': - def quote(c): - if ' ' in c: - return '"%s"' % c # work around spawn lamosity on windows - else: - return c -else: - quote = str - -# See zc.buildout.easy_install._has_broken_dash_S for motivation and comments. -stdout, stderr = subprocess.Popen( - [sys.executable, '-Sc', - 'try:\n' - ' import ConfigParser\n' - 'except ImportError:\n' - ' print 1\n' - 'else:\n' - ' print 0\n'], - stdout=subprocess.PIPE, stderr=subprocess.PIPE).communicate() -has_broken_dash_S = bool(int(stdout.strip())) - -# In order to be more robust in the face of system Pythons, we want to -# run without site-packages loaded. This is somewhat tricky, in -# particular because Python 2.6's distutils imports site, so starting -# with the -S flag is not sufficient. However, we'll start with that: -if not has_broken_dash_S and 'site' in sys.modules: - # We will restart with python -S. - args = sys.argv[:] - args[0:0] = [sys.executable, '-S'] - args = map(quote, args) - os.execv(sys.executable, args) -# Now we are running with -S. We'll get the clean sys.path, import site -# because distutils will do it later, and then reset the path and clean -# out any namespace packages from site-packages that might have been -# loaded by .pth files. -clean_path = sys.path[:] -import site -sys.path[:] = clean_path -for k, v in sys.modules.items(): - if k in ('setuptools', 'pkg_resources') or ( - hasattr(v, '__path__') and - len(v.__path__)==1 and - not os.path.exists(os.path.join(v.__path__[0],'__init__.py'))): - # This is a namespace package. Remove it. - sys.modules.pop(k) - -is_jython = sys.platform.startswith('java') - -setuptools_source = 'http://peak.telecommunity.com/dist/ez_setup.py' -distribute_source = 'http://python-distribute.org/distribute_setup.py' - -# parsing arguments -def normalize_to_url(option, opt_str, value, parser): - if value: - if '://' not in value: # It doesn't smell like a URL. - value = 'file://%s' % ( - urllib.pathname2url( - os.path.abspath(os.path.expanduser(value))),) - if opt_str == '--download-base' and not value.endswith('/'): - # Download base needs a trailing slash to make the world happy. - value += '/' - else: - value = None - name = opt_str[2:].replace('-', '_') - setattr(parser.values, name, value) - -usage = '''\ -[DESIRED PYTHON FOR BUILDOUT] bootstrap.py [options] - -Bootstraps a buildout-based project. - -Simply run this script in a directory containing a buildout.cfg, using the -Python that you want bin/buildout to use. - -Note that by using --setup-source and --download-base to point to -local resources, you can keep this script from going over the network. -''' - -parser = OptionParser(usage=usage) -parser.add_option("-v", "--version", dest="version", - help="use a specific zc.buildout version") -parser.add_option("-d", "--distribute", - action="store_true", dest="use_distribute", default=False, - help="Use Distribute rather than Setuptools.") -parser.add_option("--setup-source", action="callback", dest="setup_source", - callback=normalize_to_url, nargs=1, type="string", - help=("Specify a URL or file location for the setup file. " - "If you use Setuptools, this will default to " + - setuptools_source + "; if you use Distribute, this " - "will default to " + distribute_source +".")) -parser.add_option("--download-base", action="callback", dest="download_base", - callback=normalize_to_url, nargs=1, type="string", - help=("Specify a URL or directory for downloading " - "zc.buildout and either Setuptools or Distribute. " - "Defaults to PyPI.")) -parser.add_option("--eggs", - help=("Specify a directory for storing eggs. Defaults to " - "a temporary directory that is deleted when the " - "bootstrap script completes.")) -parser.add_option("-t", "--accept-buildout-test-releases", - dest='accept_buildout_test_releases', - action="store_true", default=False, - help=("Normally, if you do not specify a --version, the " - "bootstrap script and buildout gets the newest " - "*final* versions of zc.buildout and its recipes and " - "extensions for you. If you use this flag, " - "bootstrap and buildout will get the newest releases " - "even if they are alphas or betas.")) -parser.add_option("-c", None, action="store", dest="config_file", - help=("Specify the path to the buildout configuration " - "file to be used.")) - -options, args = parser.parse_args() - -# if -c was provided, we push it back into args for buildout's main function -if options.config_file is not None: - args += ['-c', options.config_file] - -if options.eggs: - eggs_dir = os.path.abspath(os.path.expanduser(options.eggs)) -else: - eggs_dir = tempfile.mkdtemp() - -if options.setup_source is None: - if options.use_distribute: - options.setup_source = distribute_source - else: - options.setup_source = setuptools_source - -if options.accept_buildout_test_releases: - args.append('buildout:accept-buildout-test-releases=true') -args.append('bootstrap') - -try: - import pkg_resources - import setuptools # A flag. Sometimes pkg_resources is installed alone. - if not hasattr(pkg_resources, '_distribute'): - raise ImportError -except ImportError: - ez_code = urllib2.urlopen( - options.setup_source).read().replace('\r\n', '\n') - ez = {} - exec ez_code in ez - setup_args = dict(to_dir=eggs_dir, download_delay=0) - if options.download_base: - setup_args['download_base'] = options.download_base - if options.use_distribute: - setup_args['no_fake'] = True - ez['use_setuptools'](**setup_args) - if 'pkg_resources' in sys.modules: - reload(sys.modules['pkg_resources']) - import pkg_resources - # This does not (always?) update the default working set. We will - # do it. - for path in sys.path: - if path not in pkg_resources.working_set.entries: - pkg_resources.working_set.add_entry(path) - -cmd = [quote(sys.executable), - '-c', - quote('from setuptools.command.easy_install import main; main()'), - '-mqNxd', - quote(eggs_dir)] - -if not has_broken_dash_S: - cmd.insert(1, '-S') - -find_links = options.download_base -if not find_links: - find_links = os.environ.get('bootstrap-testing-find-links') -if find_links: - cmd.extend(['-f', quote(find_links)]) - -if options.use_distribute: - setup_requirement = 'distribute' -else: - setup_requirement = 'setuptools' -ws = pkg_resources.working_set -setup_requirement_path = ws.find( - pkg_resources.Requirement.parse(setup_requirement)).location -env = dict( - os.environ, - PYTHONPATH=setup_requirement_path) - -requirement = 'zc.buildout' -version = options.version -if version is None and not options.accept_buildout_test_releases: - # Figure out the most recent final version of zc.buildout. - import setuptools.package_index - _final_parts = '*final-', '*final' - def _final_version(parsed_version): - for part in parsed_version: - if (part[:1] == '*') and (part not in _final_parts): - return False - return True - index = setuptools.package_index.PackageIndex( - search_path=[setup_requirement_path]) - if find_links: - index.add_find_links((find_links,)) - req = pkg_resources.Requirement.parse(requirement) - if index.obtain(req) is not None: - best = [] - bestv = None - for dist in index[req.project_name]: - distv = dist.parsed_version - if _final_version(distv): - if bestv is None or distv > bestv: - best = [dist] - bestv = distv - elif distv == bestv: - best.append(dist) - if best: - best.sort() - version = best[-1].version -if version: - requirement = '=='.join((requirement, version)) -cmd.append(requirement) - -if is_jython: - import subprocess - exitcode = subprocess.Popen(cmd, env=env).wait() -else: # Windows prefers this, apparently; otherwise we would prefer subprocess - exitcode = os.spawnle(*([os.P_WAIT, sys.executable] + cmd + [env])) -if exitcode != 0: - sys.stdout.flush() - sys.stderr.flush() - print ("An error occurred when trying to install zc.buildout. " - "Look above this message for any errors that " - "were output by easy_install.") - sys.exit(exitcode) - -ws.add_entry(eggs_dir) -ws.require(requirement) -import zc.buildout.buildout -zc.buildout.buildout.main(args) -if not options.eggs: # clean up temporary egg directory - shutil.rmtree(eggs_dir) diff --git a/doc/groktut/publishing_a_simple_web_page/setup.py b/doc/groktut/publishing_a_simple_web_page/setup.py deleted file mode 100644 index 4f10c5b..0000000 --- a/doc/groktut/publishing_a_simple_web_page/setup.py +++ /dev/null @@ -1,36 +0,0 @@ -from setuptools import setup, find_packages - -version = '0.0' - -setup(name='Sample', - version=version, - description="", - long_description="""\ -""", - # Get strings from http://www.python.org/pypi?%3Aaction=list_classifiers - classifiers=[], - keywords="", - author="", - author_email="", - url="", - license="", - package_dir={'': 'src'}, - packages=find_packages('src'), - include_package_data=True, - zip_safe=False, - install_requires=['setuptools', - 'grok', - 'grokui.admin', - 'z3c.testsetup', - 'grokcore.startup', - # Add extra requirements here - ], - entry_points = """ - [console_scripts] - sample-debug = grokcore.startup:interactive_debug_prompt - sample-ctl = grokcore.startup:zdaemon_controller - [paste.app_factory] - main = grokcore.startup:application_factory - debug = grokcore.startup:debug_application_factory - """, - ) diff --git a/doc/groktut/reading_url_parameters/bootstrap.py b/doc/groktut/reading_url_parameters/bootstrap.py deleted file mode 100644 index 5f2cb08..0000000 --- a/doc/groktut/reading_url_parameters/bootstrap.py +++ /dev/null @@ -1,260 +0,0 @@ -############################################################################## -# -# Copyright (c) 2006 Zope Foundation 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. -""" - -import os, shutil, sys, tempfile, textwrap, urllib, urllib2, subprocess -from optparse import OptionParser - -if sys.platform == 'win32': - def quote(c): - if ' ' in c: - return '"%s"' % c # work around spawn lamosity on windows - else: - return c -else: - quote = str - -# See zc.buildout.easy_install._has_broken_dash_S for motivation and comments. -stdout, stderr = subprocess.Popen( - [sys.executable, '-Sc', - 'try:\n' - ' import ConfigParser\n' - 'except ImportError:\n' - ' print 1\n' - 'else:\n' - ' print 0\n'], - stdout=subprocess.PIPE, stderr=subprocess.PIPE).communicate() -has_broken_dash_S = bool(int(stdout.strip())) - -# In order to be more robust in the face of system Pythons, we want to -# run without site-packages loaded. This is somewhat tricky, in -# particular because Python 2.6's distutils imports site, so starting -# with the -S flag is not sufficient. However, we'll start with that: -if not has_broken_dash_S and 'site' in sys.modules: - # We will restart with python -S. - args = sys.argv[:] - args[0:0] = [sys.executable, '-S'] - args = map(quote, args) - os.execv(sys.executable, args) -# Now we are running with -S. We'll get the clean sys.path, import site -# because distutils will do it later, and then reset the path and clean -# out any namespace packages from site-packages that might have been -# loaded by .pth files. -clean_path = sys.path[:] -import site -sys.path[:] = clean_path -for k, v in sys.modules.items(): - if k in ('setuptools', 'pkg_resources') or ( - hasattr(v, '__path__') and - len(v.__path__)==1 and - not os.path.exists(os.path.join(v.__path__[0],'__init__.py'))): - # This is a namespace package. Remove it. - sys.modules.pop(k) - -is_jython = sys.platform.startswith('java') - -setuptools_source = 'http://peak.telecommunity.com/dist/ez_setup.py' -distribute_source = 'http://python-distribute.org/distribute_setup.py' - -# parsing arguments -def normalize_to_url(option, opt_str, value, parser): - if value: - if '://' not in value: # It doesn't smell like a URL. - value = 'file://%s' % ( - urllib.pathname2url( - os.path.abspath(os.path.expanduser(value))),) - if opt_str == '--download-base' and not value.endswith('/'): - # Download base needs a trailing slash to make the world happy. - value += '/' - else: - value = None - name = opt_str[2:].replace('-', '_') - setattr(parser.values, name, value) - -usage = '''\ -[DESIRED PYTHON FOR BUILDOUT] bootstrap.py [options] - -Bootstraps a buildout-based project. - -Simply run this script in a directory containing a buildout.cfg, using the -Python that you want bin/buildout to use. - -Note that by using --setup-source and --download-base to point to -local resources, you can keep this script from going over the network. -''' - -parser = OptionParser(usage=usage) -parser.add_option("-v", "--version", dest="version", - help="use a specific zc.buildout version") -parser.add_option("-d", "--distribute", - action="store_true", dest="use_distribute", default=False, - help="Use Distribute rather than Setuptools.") -parser.add_option("--setup-source", action="callback", dest="setup_source", - callback=normalize_to_url, nargs=1, type="string", - help=("Specify a URL or file location for the setup file. " - "If you use Setuptools, this will default to " + - setuptools_source + "; if you use Distribute, this " - "will default to " + distribute_source +".")) -parser.add_option("--download-base", action="callback", dest="download_base", - callback=normalize_to_url, nargs=1, type="string", - help=("Specify a URL or directory for downloading " - "zc.buildout and either Setuptools or Distribute. " - "Defaults to PyPI.")) -parser.add_option("--eggs", - help=("Specify a directory for storing eggs. Defaults to " - "a temporary directory that is deleted when the " - "bootstrap script completes.")) -parser.add_option("-t", "--accept-buildout-test-releases", - dest='accept_buildout_test_releases', - action="store_true", default=False, - help=("Normally, if you do not specify a --version, the " - "bootstrap script and buildout gets the newest " - "*final* versions of zc.buildout and its recipes and " - "extensions for you. If you use this flag, " - "bootstrap and buildout will get the newest releases " - "even if they are alphas or betas.")) -parser.add_option("-c", None, action="store", dest="config_file", - help=("Specify the path to the buildout configuration " - "file to be used.")) - -options, args = parser.parse_args() - -# if -c was provided, we push it back into args for buildout's main function -if options.config_file is not None: - args += ['-c', options.config_file] - -if options.eggs: - eggs_dir = os.path.abspath(os.path.expanduser(options.eggs)) -else: - eggs_dir = tempfile.mkdtemp() - -if options.setup_source is None: - if options.use_distribute: - options.setup_source = distribute_source - else: - options.setup_source = setuptools_source - -if options.accept_buildout_test_releases: - args.append('buildout:accept-buildout-test-releases=true') -args.append('bootstrap') - -try: - import pkg_resources - import setuptools # A flag. Sometimes pkg_resources is installed alone. - if not hasattr(pkg_resources, '_distribute'): - raise ImportError -except ImportError: - ez_code = urllib2.urlopen( - options.setup_source).read().replace('\r\n', '\n') - ez = {} - exec ez_code in ez - setup_args = dict(to_dir=eggs_dir, download_delay=0) - if options.download_base: - setup_args['download_base'] = options.download_base - if options.use_distribute: - setup_args['no_fake'] = True - ez['use_setuptools'](**setup_args) - if 'pkg_resources' in sys.modules: - reload(sys.modules['pkg_resources']) - import pkg_resources - # This does not (always?) update the default working set. We will - # do it. - for path in sys.path: - if path not in pkg_resources.working_set.entries: - pkg_resources.working_set.add_entry(path) - -cmd = [quote(sys.executable), - '-c', - quote('from setuptools.command.easy_install import main; main()'), - '-mqNxd', - quote(eggs_dir)] - -if not has_broken_dash_S: - cmd.insert(1, '-S') - -find_links = options.download_base -if not find_links: - find_links = os.environ.get('bootstrap-testing-find-links') -if find_links: - cmd.extend(['-f', quote(find_links)]) - -if options.use_distribute: - setup_requirement = 'distribute' -else: - setup_requirement = 'setuptools' -ws = pkg_resources.working_set -setup_requirement_path = ws.find( - pkg_resources.Requirement.parse(setup_requirement)).location -env = dict( - os.environ, - PYTHONPATH=setup_requirement_path) - -requirement = 'zc.buildout' -version = options.version -if version is None and not options.accept_buildout_test_releases: - # Figure out the most recent final version of zc.buildout. - import setuptools.package_index - _final_parts = '*final-', '*final' - def _final_version(parsed_version): - for part in parsed_version: - if (part[:1] == '*') and (part not in _final_parts): - return False - return True - index = setuptools.package_index.PackageIndex( - search_path=[setup_requirement_path]) - if find_links: - index.add_find_links((find_links,)) - req = pkg_resources.Requirement.parse(requirement) - if index.obtain(req) is not None: - best = [] - bestv = None - for dist in index[req.project_name]: - distv = dist.parsed_version - if _final_version(distv): - if bestv is None or distv > bestv: - best = [dist] - bestv = distv - elif distv == bestv: - best.append(dist) - if best: - best.sort() - version = best[-1].version -if version: - requirement = '=='.join((requirement, version)) -cmd.append(requirement) - -if is_jython: - import subprocess - exitcode = subprocess.Popen(cmd, env=env).wait() -else: # Windows prefers this, apparently; otherwise we would prefer subprocess - exitcode = os.spawnle(*([os.P_WAIT, sys.executable] + cmd + [env])) -if exitcode != 0: - sys.stdout.flush() - sys.stderr.flush() - print ("An error occurred when trying to install zc.buildout. " - "Look above this message for any errors that " - "were output by easy_install.") - sys.exit(exitcode) - -ws.add_entry(eggs_dir) -ws.require(requirement) -import zc.buildout.buildout -zc.buildout.buildout.main(args) -if not options.eggs: # clean up temporary egg directory - shutil.rmtree(eggs_dir) diff --git a/doc/groktut/reading_url_parameters/setup.py b/doc/groktut/reading_url_parameters/setup.py deleted file mode 100644 index 4f10c5b..0000000 --- a/doc/groktut/reading_url_parameters/setup.py +++ /dev/null @@ -1,36 +0,0 @@ -from setuptools import setup, find_packages - -version = '0.0' - -setup(name='Sample', - version=version, - description="", - long_description="""\ -""", - # Get strings from http://www.python.org/pypi?%3Aaction=list_classifiers - classifiers=[], - keywords="", - author="", - author_email="", - url="", - license="", - package_dir={'': 'src'}, - packages=find_packages('src'), - include_package_data=True, - zip_safe=False, - install_requires=['setuptools', - 'grok', - 'grokui.admin', - 'z3c.testsetup', - 'grokcore.startup', - # Add extra requirements here - ], - entry_points = """ - [console_scripts] - sample-debug = grokcore.startup:interactive_debug_prompt - sample-ctl = grokcore.startup:zdaemon_controller - [paste.app_factory] - main = grokcore.startup:application_factory - debug = grokcore.startup:debug_application_factory - """, - ) diff --git a/doc/groktut/reading_url_parameters2/bootstrap.py b/doc/groktut/reading_url_parameters2/bootstrap.py deleted file mode 100644 index 5f2cb08..0000000 --- a/doc/groktut/reading_url_parameters2/bootstrap.py +++ /dev/null @@ -1,260 +0,0 @@ -############################################################################## -# -# Copyright (c) 2006 Zope Foundation 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. -""" - -import os, shutil, sys, tempfile, textwrap, urllib, urllib2, subprocess -from optparse import OptionParser - -if sys.platform == 'win32': - def quote(c): - if ' ' in c: - return '"%s"' % c # work around spawn lamosity on windows - else: - return c -else: - quote = str - -# See zc.buildout.easy_install._has_broken_dash_S for motivation and comments. -stdout, stderr = subprocess.Popen( - [sys.executable, '-Sc', - 'try:\n' - ' import ConfigParser\n' - 'except ImportError:\n' - ' print 1\n' - 'else:\n' - ' print 0\n'], - stdout=subprocess.PIPE, stderr=subprocess.PIPE).communicate() -has_broken_dash_S = bool(int(stdout.strip())) - -# In order to be more robust in the face of system Pythons, we want to -# run without site-packages loaded. This is somewhat tricky, in -# particular because Python 2.6's distutils imports site, so starting -# with the -S flag is not sufficient. However, we'll start with that: -if not has_broken_dash_S and 'site' in sys.modules: - # We will restart with python -S. - args = sys.argv[:] - args[0:0] = [sys.executable, '-S'] - args = map(quote, args) - os.execv(sys.executable, args) -# Now we are running with -S. We'll get the clean sys.path, import site -# because distutils will do it later, and then reset the path and clean -# out any namespace packages from site-packages that might have been -# loaded by .pth files. -clean_path = sys.path[:] -import site -sys.path[:] = clean_path -for k, v in sys.modules.items(): - if k in ('setuptools', 'pkg_resources') or ( - hasattr(v, '__path__') and - len(v.__path__)==1 and - not os.path.exists(os.path.join(v.__path__[0],'__init__.py'))): - # This is a namespace package. Remove it. - sys.modules.pop(k) - -is_jython = sys.platform.startswith('java') - -setuptools_source = 'http://peak.telecommunity.com/dist/ez_setup.py' -distribute_source = 'http://python-distribute.org/distribute_setup.py' - -# parsing arguments -def normalize_to_url(option, opt_str, value, parser): - if value: - if '://' not in value: # It doesn't smell like a URL. - value = 'file://%s' % ( - urllib.pathname2url( - os.path.abspath(os.path.expanduser(value))),) - if opt_str == '--download-base' and not value.endswith('/'): - # Download base needs a trailing slash to make the world happy. - value += '/' - else: - value = None - name = opt_str[2:].replace('-', '_') - setattr(parser.values, name, value) - -usage = '''\ -[DESIRED PYTHON FOR BUILDOUT] bootstrap.py [options] - -Bootstraps a buildout-based project. - -Simply run this script in a directory containing a buildout.cfg, using the -Python that you want bin/buildout to use. - -Note that by using --setup-source and --download-base to point to -local resources, you can keep this script from going over the network. -''' - -parser = OptionParser(usage=usage) -parser.add_option("-v", "--version", dest="version", - help="use a specific zc.buildout version") -parser.add_option("-d", "--distribute", - action="store_true", dest="use_distribute", default=False, - help="Use Distribute rather than Setuptools.") -parser.add_option("--setup-source", action="callback", dest="setup_source", - callback=normalize_to_url, nargs=1, type="string", - help=("Specify a URL or file location for the setup file. " - "If you use Setuptools, this will default to " + - setuptools_source + "; if you use Distribute, this " - "will default to " + distribute_source +".")) -parser.add_option("--download-base", action="callback", dest="download_base", - callback=normalize_to_url, nargs=1, type="string", - help=("Specify a URL or directory for downloading " - "zc.buildout and either Setuptools or Distribute. " - "Defaults to PyPI.")) -parser.add_option("--eggs", - help=("Specify a directory for storing eggs. Defaults to " - "a temporary directory that is deleted when the " - "bootstrap script completes.")) -parser.add_option("-t", "--accept-buildout-test-releases", - dest='accept_buildout_test_releases', - action="store_true", default=False, - help=("Normally, if you do not specify a --version, the " - "bootstrap script and buildout gets the newest " - "*final* versions of zc.buildout and its recipes and " - "extensions for you. If you use this flag, " - "bootstrap and buildout will get the newest releases " - "even if they are alphas or betas.")) -parser.add_option("-c", None, action="store", dest="config_file", - help=("Specify the path to the buildout configuration " - "file to be used.")) - -options, args = parser.parse_args() - -# if -c was provided, we push it back into args for buildout's main function -if options.config_file is not None: - args += ['-c', options.config_file] - -if options.eggs: - eggs_dir = os.path.abspath(os.path.expanduser(options.eggs)) -else: - eggs_dir = tempfile.mkdtemp() - -if options.setup_source is None: - if options.use_distribute: - options.setup_source = distribute_source - else: - options.setup_source = setuptools_source - -if options.accept_buildout_test_releases: - args.append('buildout:accept-buildout-test-releases=true') -args.append('bootstrap') - -try: - import pkg_resources - import setuptools # A flag. Sometimes pkg_resources is installed alone. - if not hasattr(pkg_resources, '_distribute'): - raise ImportError -except ImportError: - ez_code = urllib2.urlopen( - options.setup_source).read().replace('\r\n', '\n') - ez = {} - exec ez_code in ez - setup_args = dict(to_dir=eggs_dir, download_delay=0) - if options.download_base: - setup_args['download_base'] = options.download_base - if options.use_distribute: - setup_args['no_fake'] = True - ez['use_setuptools'](**setup_args) - if 'pkg_resources' in sys.modules: - reload(sys.modules['pkg_resources']) - import pkg_resources - # This does not (always?) update the default working set. We will - # do it. - for path in sys.path: - if path not in pkg_resources.working_set.entries: - pkg_resources.working_set.add_entry(path) - -cmd = [quote(sys.executable), - '-c', - quote('from setuptools.command.easy_install import main; main()'), - '-mqNxd', - quote(eggs_dir)] - -if not has_broken_dash_S: - cmd.insert(1, '-S') - -find_links = options.download_base -if not find_links: - find_links = os.environ.get('bootstrap-testing-find-links') -if find_links: - cmd.extend(['-f', quote(find_links)]) - -if options.use_distribute: - setup_requirement = 'distribute' -else: - setup_requirement = 'setuptools' -ws = pkg_resources.working_set -setup_requirement_path = ws.find( - pkg_resources.Requirement.parse(setup_requirement)).location -env = dict( - os.environ, - PYTHONPATH=setup_requirement_path) - -requirement = 'zc.buildout' -version = options.version -if version is None and not options.accept_buildout_test_releases: - # Figure out the most recent final version of zc.buildout. - import setuptools.package_index - _final_parts = '*final-', '*final' - def _final_version(parsed_version): - for part in parsed_version: - if (part[:1] == '*') and (part not in _final_parts): - return False - return True - index = setuptools.package_index.PackageIndex( - search_path=[setup_requirement_path]) - if find_links: - index.add_find_links((find_links,)) - req = pkg_resources.Requirement.parse(requirement) - if index.obtain(req) is not None: - best = [] - bestv = None - for dist in index[req.project_name]: - distv = dist.parsed_version - if _final_version(distv): - if bestv is None or distv > bestv: - best = [dist] - bestv = distv - elif distv == bestv: - best.append(dist) - if best: - best.sort() - version = best[-1].version -if version: - requirement = '=='.join((requirement, version)) -cmd.append(requirement) - -if is_jython: - import subprocess - exitcode = subprocess.Popen(cmd, env=env).wait() -else: # Windows prefers this, apparently; otherwise we would prefer subprocess - exitcode = os.spawnle(*([os.P_WAIT, sys.executable] + cmd + [env])) -if exitcode != 0: - sys.stdout.flush() - sys.stderr.flush() - print ("An error occurred when trying to install zc.buildout. " - "Look above this message for any errors that " - "were output by easy_install.") - sys.exit(exitcode) - -ws.add_entry(eggs_dir) -ws.require(requirement) -import zc.buildout.buildout -zc.buildout.buildout.main(args) -if not options.eggs: # clean up temporary egg directory - shutil.rmtree(eggs_dir) diff --git a/doc/groktut/reading_url_parameters2/setup.py b/doc/groktut/reading_url_parameters2/setup.py deleted file mode 100644 index 4f10c5b..0000000 --- a/doc/groktut/reading_url_parameters2/setup.py +++ /dev/null @@ -1,36 +0,0 @@ -from setuptools import setup, find_packages - -version = '0.0' - -setup(name='Sample', - version=version, - description="", - long_description="""\ -""", - # Get strings from http://www.python.org/pypi?%3Aaction=list_classifiers - classifiers=[], - keywords="", - author="", - author_email="", - url="", - license="", - package_dir={'': 'src'}, - packages=find_packages('src'), - include_package_data=True, - zip_safe=False, - install_requires=['setuptools', - 'grok', - 'grokui.admin', - 'z3c.testsetup', - 'grokcore.startup', - # Add extra requirements here - ], - entry_points = """ - [console_scripts] - sample-debug = grokcore.startup:interactive_debug_prompt - sample-ctl = grokcore.startup:zdaemon_controller - [paste.app_factory] - main = grokcore.startup:application_factory - debug = grokcore.startup:debug_application_factory - """, - ) diff --git a/doc/groktut/redirection/bootstrap.py b/doc/groktut/redirection/bootstrap.py deleted file mode 100644 index 5f2cb08..0000000 --- a/doc/groktut/redirection/bootstrap.py +++ /dev/null @@ -1,260 +0,0 @@ -############################################################################## -# -# Copyright (c) 2006 Zope Foundation 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. -""" - -import os, shutil, sys, tempfile, textwrap, urllib, urllib2, subprocess -from optparse import OptionParser - -if sys.platform == 'win32': - def quote(c): - if ' ' in c: - return '"%s"' % c # work around spawn lamosity on windows - else: - return c -else: - quote = str - -# See zc.buildout.easy_install._has_broken_dash_S for motivation and comments. -stdout, stderr = subprocess.Popen( - [sys.executable, '-Sc', - 'try:\n' - ' import ConfigParser\n' - 'except ImportError:\n' - ' print 1\n' - 'else:\n' - ' print 0\n'], - stdout=subprocess.PIPE, stderr=subprocess.PIPE).communicate() -has_broken_dash_S = bool(int(stdout.strip())) - -# In order to be more robust in the face of system Pythons, we want to -# run without site-packages loaded. This is somewhat tricky, in -# particular because Python 2.6's distutils imports site, so starting -# with the -S flag is not sufficient. However, we'll start with that: -if not has_broken_dash_S and 'site' in sys.modules: - # We will restart with python -S. - args = sys.argv[:] - args[0:0] = [sys.executable, '-S'] - args = map(quote, args) - os.execv(sys.executable, args) -# Now we are running with -S. We'll get the clean sys.path, import site -# because distutils will do it later, and then reset the path and clean -# out any namespace packages from site-packages that might have been -# loaded by .pth files. -clean_path = sys.path[:] -import site -sys.path[:] = clean_path -for k, v in sys.modules.items(): - if k in ('setuptools', 'pkg_resources') or ( - hasattr(v, '__path__') and - len(v.__path__)==1 and - not os.path.exists(os.path.join(v.__path__[0],'__init__.py'))): - # This is a namespace package. Remove it. - sys.modules.pop(k) - -is_jython = sys.platform.startswith('java') - -setuptools_source = 'http://peak.telecommunity.com/dist/ez_setup.py' -distribute_source = 'http://python-distribute.org/distribute_setup.py' - -# parsing arguments -def normalize_to_url(option, opt_str, value, parser): - if value: - if '://' not in value: # It doesn't smell like a URL. - value = 'file://%s' % ( - urllib.pathname2url( - os.path.abspath(os.path.expanduser(value))),) - if opt_str == '--download-base' and not value.endswith('/'): - # Download base needs a trailing slash to make the world happy. - value += '/' - else: - value = None - name = opt_str[2:].replace('-', '_') - setattr(parser.values, name, value) - -usage = '''\ -[DESIRED PYTHON FOR BUILDOUT] bootstrap.py [options] - -Bootstraps a buildout-based project. - -Simply run this script in a directory containing a buildout.cfg, using the -Python that you want bin/buildout to use. - -Note that by using --setup-source and --download-base to point to -local resources, you can keep this script from going over the network. -''' - -parser = OptionParser(usage=usage) -parser.add_option("-v", "--version", dest="version", - help="use a specific zc.buildout version") -parser.add_option("-d", "--distribute", - action="store_true", dest="use_distribute", default=False, - help="Use Distribute rather than Setuptools.") -parser.add_option("--setup-source", action="callback", dest="setup_source", - callback=normalize_to_url, nargs=1, type="string", - help=("Specify a URL or file location for the setup file. " - "If you use Setuptools, this will default to " + - setuptools_source + "; if you use Distribute, this " - "will default to " + distribute_source +".")) -parser.add_option("--download-base", action="callback", dest="download_base", - callback=normalize_to_url, nargs=1, type="string", - help=("Specify a URL or directory for downloading " - "zc.buildout and either Setuptools or Distribute. " - "Defaults to PyPI.")) -parser.add_option("--eggs", - help=("Specify a directory for storing eggs. Defaults to " - "a temporary directory that is deleted when the " - "bootstrap script completes.")) -parser.add_option("-t", "--accept-buildout-test-releases", - dest='accept_buildout_test_releases', - action="store_true", default=False, - help=("Normally, if you do not specify a --version, the " - "bootstrap script and buildout gets the newest " - "*final* versions of zc.buildout and its recipes and " - "extensions for you. If you use this flag, " - "bootstrap and buildout will get the newest releases " - "even if they are alphas or betas.")) -parser.add_option("-c", None, action="store", dest="config_file", - help=("Specify the path to the buildout configuration " - "file to be used.")) - -options, args = parser.parse_args() - -# if -c was provided, we push it back into args for buildout's main function -if options.config_file is not None: - args += ['-c', options.config_file] - -if options.eggs: - eggs_dir = os.path.abspath(os.path.expanduser(options.eggs)) -else: - eggs_dir = tempfile.mkdtemp() - -if options.setup_source is None: - if options.use_distribute: - options.setup_source = distribute_source - else: - options.setup_source = setuptools_source - -if options.accept_buildout_test_releases: - args.append('buildout:accept-buildout-test-releases=true') -args.append('bootstrap') - -try: - import pkg_resources - import setuptools # A flag. Sometimes pkg_resources is installed alone. - if not hasattr(pkg_resources, '_distribute'): - raise ImportError -except ImportError: - ez_code = urllib2.urlopen( - options.setup_source).read().replace('\r\n', '\n') - ez = {} - exec ez_code in ez - setup_args = dict(to_dir=eggs_dir, download_delay=0) - if options.download_base: - setup_args['download_base'] = options.download_base - if options.use_distribute: - setup_args['no_fake'] = True - ez['use_setuptools'](**setup_args) - if 'pkg_resources' in sys.modules: - reload(sys.modules['pkg_resources']) - import pkg_resources - # This does not (always?) update the default working set. We will - # do it. - for path in sys.path: - if path not in pkg_resources.working_set.entries: - pkg_resources.working_set.add_entry(path) - -cmd = [quote(sys.executable), - '-c', - quote('from setuptools.command.easy_install import main; main()'), - '-mqNxd', - quote(eggs_dir)] - -if not has_broken_dash_S: - cmd.insert(1, '-S') - -find_links = options.download_base -if not find_links: - find_links = os.environ.get('bootstrap-testing-find-links') -if find_links: - cmd.extend(['-f', quote(find_links)]) - -if options.use_distribute: - setup_requirement = 'distribute' -else: - setup_requirement = 'setuptools' -ws = pkg_resources.working_set -setup_requirement_path = ws.find( - pkg_resources.Requirement.parse(setup_requirement)).location -env = dict( - os.environ, - PYTHONPATH=setup_requirement_path) - -requirement = 'zc.buildout' -version = options.version -if version is None and not options.accept_buildout_test_releases: - # Figure out the most recent final version of zc.buildout. - import setuptools.package_index - _final_parts = '*final-', '*final' - def _final_version(parsed_version): - for part in parsed_version: - if (part[:1] == '*') and (part not in _final_parts): - return False - return True - index = setuptools.package_index.PackageIndex( - search_path=[setup_requirement_path]) - if find_links: - index.add_find_links((find_links,)) - req = pkg_resources.Requirement.parse(requirement) - if index.obtain(req) is not None: - best = [] - bestv = None - for dist in index[req.project_name]: - distv = dist.parsed_version - if _final_version(distv): - if bestv is None or distv > bestv: - best = [dist] - bestv = distv - elif distv == bestv: - best.append(dist) - if best: - best.sort() - version = best[-1].version -if version: - requirement = '=='.join((requirement, version)) -cmd.append(requirement) - -if is_jython: - import subprocess - exitcode = subprocess.Popen(cmd, env=env).wait() -else: # Windows prefers this, apparently; otherwise we would prefer subprocess - exitcode = os.spawnle(*([os.P_WAIT, sys.executable] + cmd + [env])) -if exitcode != 0: - sys.stdout.flush() - sys.stderr.flush() - print ("An error occurred when trying to install zc.buildout. " - "Look above this message for any errors that " - "were output by easy_install.") - sys.exit(exitcode) - -ws.add_entry(eggs_dir) -ws.require(requirement) -import zc.buildout.buildout -zc.buildout.buildout.main(args) -if not options.eggs: # clean up temporary egg directory - shutil.rmtree(eggs_dir) diff --git a/doc/groktut/redirection/setup.py b/doc/groktut/redirection/setup.py deleted file mode 100644 index 4f10c5b..0000000 --- a/doc/groktut/redirection/setup.py +++ /dev/null @@ -1,36 +0,0 @@ -from setuptools import setup, find_packages - -version = '0.0' - -setup(name='Sample', - version=version, - description="", - long_description="""\ -""", - # Get strings from http://www.python.org/pypi?%3Aaction=list_classifiers - classifiers=[], - keywords="", - author="", - author_email="", - url="", - license="", - package_dir={'': 'src'}, - packages=find_packages('src'), - include_package_data=True, - zip_safe=False, - install_requires=['setuptools', - 'grok', - 'grokui.admin', - 'z3c.testsetup', - 'grokcore.startup', - # Add extra requirements here - ], - entry_points = """ - [console_scripts] - sample-debug = grokcore.startup:interactive_debug_prompt - sample-ctl = grokcore.startup:zdaemon_controller - [paste.app_factory] - main = grokcore.startup:application_factory - debug = grokcore.startup:debug_application_factory - """, - ) diff --git a/doc/groktut/setting_the_content_type/bootstrap.py b/doc/groktut/setting_the_content_type/bootstrap.py deleted file mode 100644 index 5f2cb08..0000000 --- a/doc/groktut/setting_the_content_type/bootstrap.py +++ /dev/null @@ -1,260 +0,0 @@ -############################################################################## -# -# Copyright (c) 2006 Zope Foundation 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. -""" - -import os, shutil, sys, tempfile, textwrap, urllib, urllib2, subprocess -from optparse import OptionParser - -if sys.platform == 'win32': - def quote(c): - if ' ' in c: - return '"%s"' % c # work around spawn lamosity on windows - else: - return c -else: - quote = str - -# See zc.buildout.easy_install._has_broken_dash_S for motivation and comments. -stdout, stderr = subprocess.Popen( - [sys.executable, '-Sc', - 'try:\n' - ' import ConfigParser\n' - 'except ImportError:\n' - ' print 1\n' - 'else:\n' - ' print 0\n'], - stdout=subprocess.PIPE, stderr=subprocess.PIPE).communicate() -has_broken_dash_S = bool(int(stdout.strip())) - -# In order to be more robust in the face of system Pythons, we want to -# run without site-packages loaded. This is somewhat tricky, in -# particular because Python 2.6's distutils imports site, so starting -# with the -S flag is not sufficient. However, we'll start with that: -if not has_broken_dash_S and 'site' in sys.modules: - # We will restart with python -S. - args = sys.argv[:] - args[0:0] = [sys.executable, '-S'] - args = map(quote, args) - os.execv(sys.executable, args) -# Now we are running with -S. We'll get the clean sys.path, import site -# because distutils will do it later, and then reset the path and clean -# out any namespace packages from site-packages that might have been -# loaded by .pth files. -clean_path = sys.path[:] -import site -sys.path[:] = clean_path -for k, v in sys.modules.items(): - if k in ('setuptools', 'pkg_resources') or ( - hasattr(v, '__path__') and - len(v.__path__)==1 and - not os.path.exists(os.path.join(v.__path__[0],'__init__.py'))): - # This is a namespace package. Remove it. - sys.modules.pop(k) - -is_jython = sys.platform.startswith('java') - -setuptools_source = 'http://peak.telecommunity.com/dist/ez_setup.py' -distribute_source = 'http://python-distribute.org/distribute_setup.py' - -# parsing arguments -def normalize_to_url(option, opt_str, value, parser): - if value: - if '://' not in value: # It doesn't smell like a URL. - value = 'file://%s' % ( - urllib.pathname2url( - os.path.abspath(os.path.expanduser(value))),) - if opt_str == '--download-base' and not value.endswith('/'): - # Download base needs a trailing slash to make the world happy. - value += '/' - else: - value = None - name = opt_str[2:].replace('-', '_') - setattr(parser.values, name, value) - -usage = '''\ -[DESIRED PYTHON FOR BUILDOUT] bootstrap.py [options] - -Bootstraps a buildout-based project. - -Simply run this script in a directory containing a buildout.cfg, using the -Python that you want bin/buildout to use. - -Note that by using --setup-source and --download-base to point to -local resources, you can keep this script from going over the network. -''' - -parser = OptionParser(usage=usage) -parser.add_option("-v", "--version", dest="version", - help="use a specific zc.buildout version") -parser.add_option("-d", "--distribute", - action="store_true", dest="use_distribute", default=False, - help="Use Distribute rather than Setuptools.") -parser.add_option("--setup-source", action="callback", dest="setup_source", - callback=normalize_to_url, nargs=1, type="string", - help=("Specify a URL or file location for the setup file. " - "If you use Setuptools, this will default to " + - setuptools_source + "; if you use Distribute, this " - "will default to " + distribute_source +".")) -parser.add_option("--download-base", action="callback", dest="download_base", - callback=normalize_to_url, nargs=1, type="string", - help=("Specify a URL or directory for downloading " - "zc.buildout and either Setuptools or Distribute. " - "Defaults to PyPI.")) -parser.add_option("--eggs", - help=("Specify a directory for storing eggs. Defaults to " - "a temporary directory that is deleted when the " - "bootstrap script completes.")) -parser.add_option("-t", "--accept-buildout-test-releases", - dest='accept_buildout_test_releases', - action="store_true", default=False, - help=("Normally, if you do not specify a --version, the " - "bootstrap script and buildout gets the newest " - "*final* versions of zc.buildout and its recipes and " - "extensions for you. If you use this flag, " - "bootstrap and buildout will get the newest releases " - "even if they are alphas or betas.")) -parser.add_option("-c", None, action="store", dest="config_file", - help=("Specify the path to the buildout configuration " - "file to be used.")) - -options, args = parser.parse_args() - -# if -c was provided, we push it back into args for buildout's main function -if options.config_file is not None: - args += ['-c', options.config_file] - -if options.eggs: - eggs_dir = os.path.abspath(os.path.expanduser(options.eggs)) -else: - eggs_dir = tempfile.mkdtemp() - -if options.setup_source is None: - if options.use_distribute: - options.setup_source = distribute_source - else: - options.setup_source = setuptools_source - -if options.accept_buildout_test_releases: - args.append('buildout:accept-buildout-test-releases=true') -args.append('bootstrap') - -try: - import pkg_resources - import setuptools # A flag. Sometimes pkg_resources is installed alone. - if not hasattr(pkg_resources, '_distribute'): - raise ImportError -except ImportError: - ez_code = urllib2.urlopen( - options.setup_source).read().replace('\r\n', '\n') - ez = {} - exec ez_code in ez - setup_args = dict(to_dir=eggs_dir, download_delay=0) - if options.download_base: - setup_args['download_base'] = options.download_base - if options.use_distribute: - setup_args['no_fake'] = True - ez['use_setuptools'](**setup_args) - if 'pkg_resources' in sys.modules: - reload(sys.modules['pkg_resources']) - import pkg_resources - # This does not (always?) update the default working set. We will - # do it. - for path in sys.path: - if path not in pkg_resources.working_set.entries: - pkg_resources.working_set.add_entry(path) - -cmd = [quote(sys.executable), - '-c', - quote('from setuptools.command.easy_install import main; main()'), - '-mqNxd', - quote(eggs_dir)] - -if not has_broken_dash_S: - cmd.insert(1, '-S') - -find_links = options.download_base -if not find_links: - find_links = os.environ.get('bootstrap-testing-find-links') -if find_links: - cmd.extend(['-f', quote(find_links)]) - -if options.use_distribute: - setup_requirement = 'distribute' -else: - setup_requirement = 'setuptools' -ws = pkg_resources.working_set -setup_requirement_path = ws.find( - pkg_resources.Requirement.parse(setup_requirement)).location -env = dict( - os.environ, - PYTHONPATH=setup_requirement_path) - -requirement = 'zc.buildout' -version = options.version -if version is None and not options.accept_buildout_test_releases: - # Figure out the most recent final version of zc.buildout. - import setuptools.package_index - _final_parts = '*final-', '*final' - def _final_version(parsed_version): - for part in parsed_version: - if (part[:1] == '*') and (part not in _final_parts): - return False - return True - index = setuptools.package_index.PackageIndex( - search_path=[setup_requirement_path]) - if find_links: - index.add_find_links((find_links,)) - req = pkg_resources.Requirement.parse(requirement) - if index.obtain(req) is not None: - best = [] - bestv = None - for dist in index[req.project_name]: - distv = dist.parsed_version - if _final_version(distv): - if bestv is None or distv > bestv: - best = [dist] - bestv = distv - elif distv == bestv: - best.append(dist) - if best: - best.sort() - version = best[-1].version -if version: - requirement = '=='.join((requirement, version)) -cmd.append(requirement) - -if is_jython: - import subprocess - exitcode = subprocess.Popen(cmd, env=env).wait() -else: # Windows prefers this, apparently; otherwise we would prefer subprocess - exitcode = os.spawnle(*([os.P_WAIT, sys.executable] + cmd + [env])) -if exitcode != 0: - sys.stdout.flush() - sys.stderr.flush() - print ("An error occurred when trying to install zc.buildout. " - "Look above this message for any errors that " - "were output by easy_install.") - sys.exit(exitcode) - -ws.add_entry(eggs_dir) -ws.require(requirement) -import zc.buildout.buildout -zc.buildout.buildout.main(args) -if not options.eggs: # clean up temporary egg directory - shutil.rmtree(eggs_dir) diff --git a/doc/groktut/setting_the_content_type/setup.py b/doc/groktut/setting_the_content_type/setup.py deleted file mode 100644 index 4f10c5b..0000000 --- a/doc/groktut/setting_the_content_type/setup.py +++ /dev/null @@ -1,36 +0,0 @@ -from setuptools import setup, find_packages - -version = '0.0' - -setup(name='Sample', - version=version, - description="", - long_description="""\ -""", - # Get strings from http://www.python.org/pypi?%3Aaction=list_classifiers - classifiers=[], - keywords="", - author="", - author_email="", - url="", - license="", - package_dir={'': 'src'}, - packages=find_packages('src'), - include_package_data=True, - zip_safe=False, - install_requires=['setuptools', - 'grok', - 'grokui.admin', - 'z3c.testsetup', - 'grokcore.startup', - # Add extra requirements here - ], - entry_points = """ - [console_scripts] - sample-debug = grokcore.startup:interactive_debug_prompt - sample-ctl = grokcore.startup:zdaemon_controller - [paste.app_factory] - main = grokcore.startup:application_factory - debug = grokcore.startup:debug_application_factory - """, - ) diff --git a/doc/groktut/showing_the_value_in_the_form/bootstrap.py b/doc/groktut/showing_the_value_in_the_form/bootstrap.py deleted file mode 100644 index 5f2cb08..0000000 --- a/doc/groktut/showing_the_value_in_the_form/bootstrap.py +++ /dev/null @@ -1,260 +0,0 @@ -############################################################################## -# -# Copyright (c) 2006 Zope Foundation 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. -""" - -import os, shutil, sys, tempfile, textwrap, urllib, urllib2, subprocess -from optparse import OptionParser - -if sys.platform == 'win32': - def quote(c): - if ' ' in c: - return '"%s"' % c # work around spawn lamosity on windows - else: - return c -else: - quote = str - -# See zc.buildout.easy_install._has_broken_dash_S for motivation and comments. -stdout, stderr = subprocess.Popen( - [sys.executable, '-Sc', - 'try:\n' - ' import ConfigParser\n' - 'except ImportError:\n' - ' print 1\n' - 'else:\n' - ' print 0\n'], - stdout=subprocess.PIPE, stderr=subprocess.PIPE).communicate() -has_broken_dash_S = bool(int(stdout.strip())) - -# In order to be more robust in the face of system Pythons, we want to -# run without site-packages loaded. This is somewhat tricky, in -# particular because Python 2.6's distutils imports site, so starting -# with the -S flag is not sufficient. However, we'll start with that: -if not has_broken_dash_S and 'site' in sys.modules: - # We will restart with python -S. - args = sys.argv[:] - args[0:0] = [sys.executable, '-S'] - args = map(quote, args) - os.execv(sys.executable, args) -# Now we are running with -S. We'll get the clean sys.path, import site -# because distutils will do it later, and then reset the path and clean -# out any namespace packages from site-packages that might have been -# loaded by .pth files. -clean_path = sys.path[:] -import site -sys.path[:] = clean_path -for k, v in sys.modules.items(): - if k in ('setuptools', 'pkg_resources') or ( - hasattr(v, '__path__') and - len(v.__path__)==1 and - not os.path.exists(os.path.join(v.__path__[0],'__init__.py'))): - # This is a namespace package. Remove it. - sys.modules.pop(k) - -is_jython = sys.platform.startswith('java') - -setuptools_source = 'http://peak.telecommunity.com/dist/ez_setup.py' -distribute_source = 'http://python-distribute.org/distribute_setup.py' - -# parsing arguments -def normalize_to_url(option, opt_str, value, parser): - if value: - if '://' not in value: # It doesn't smell like a URL. - value = 'file://%s' % ( - urllib.pathname2url( - os.path.abspath(os.path.expanduser(value))),) - if opt_str == '--download-base' and not value.endswith('/'): - # Download base needs a trailing slash to make the world happy. - value += '/' - else: - value = None - name = opt_str[2:].replace('-', '_') - setattr(parser.values, name, value) - -usage = '''\ -[DESIRED PYTHON FOR BUILDOUT] bootstrap.py [options] - -Bootstraps a buildout-based project. - -Simply run this script in a directory containing a buildout.cfg, using the -Python that you want bin/buildout to use. - -Note that by using --setup-source and --download-base to point to -local resources, you can keep this script from going over the network. -''' - -parser = OptionParser(usage=usage) -parser.add_option("-v", "--version", dest="version", - help="use a specific zc.buildout version") -parser.add_option("-d", "--distribute", - action="store_true", dest="use_distribute", default=False, - help="Use Distribute rather than Setuptools.") -parser.add_option("--setup-source", action="callback", dest="setup_source", - callback=normalize_to_url, nargs=1, type="string", - help=("Specify a URL or file location for the setup file. " - "If you use Setuptools, this will default to " + - setuptools_source + "; if you use Distribute, this " - "will default to " + distribute_source +".")) -parser.add_option("--download-base", action="callback", dest="download_base", - callback=normalize_to_url, nargs=1, type="string", - help=("Specify a URL or directory for downloading " - "zc.buildout and either Setuptools or Distribute. " - "Defaults to PyPI.")) -parser.add_option("--eggs", - help=("Specify a directory for storing eggs. Defaults to " - "a temporary directory that is deleted when the " - "bootstrap script completes.")) -parser.add_option("-t", "--accept-buildout-test-releases", - dest='accept_buildout_test_releases', - action="store_true", default=False, - help=("Normally, if you do not specify a --version, the " - "bootstrap script and buildout gets the newest " - "*final* versions of zc.buildout and its recipes and " - "extensions for you. If you use this flag, " - "bootstrap and buildout will get the newest releases " - "even if they are alphas or betas.")) -parser.add_option("-c", None, action="store", dest="config_file", - help=("Specify the path to the buildout configuration " - "file to be used.")) - -options, args = parser.parse_args() - -# if -c was provided, we push it back into args for buildout's main function -if options.config_file is not None: - args += ['-c', options.config_file] - -if options.eggs: - eggs_dir = os.path.abspath(os.path.expanduser(options.eggs)) -else: - eggs_dir = tempfile.mkdtemp() - -if options.setup_source is None: - if options.use_distribute: - options.setup_source = distribute_source - else: - options.setup_source = setuptools_source - -if options.accept_buildout_test_releases: - args.append('buildout:accept-buildout-test-releases=true') -args.append('bootstrap') - -try: - import pkg_resources - import setuptools # A flag. Sometimes pkg_resources is installed alone. - if not hasattr(pkg_resources, '_distribute'): - raise ImportError -except ImportError: - ez_code = urllib2.urlopen( - options.setup_source).read().replace('\r\n', '\n') - ez = {} - exec ez_code in ez - setup_args = dict(to_dir=eggs_dir, download_delay=0) - if options.download_base: - setup_args['download_base'] = options.download_base - if options.use_distribute: - setup_args['no_fake'] = True - ez['use_setuptools'](**setup_args) - if 'pkg_resources' in sys.modules: - reload(sys.modules['pkg_resources']) - import pkg_resources - # This does not (always?) update the default working set. We will - # do it. - for path in sys.path: - if path not in pkg_resources.working_set.entries: - pkg_resources.working_set.add_entry(path) - -cmd = [quote(sys.executable), - '-c', - quote('from setuptools.command.easy_install import main; main()'), - '-mqNxd', - quote(eggs_dir)] - -if not has_broken_dash_S: - cmd.insert(1, '-S') - -find_links = options.download_base -if not find_links: - find_links = os.environ.get('bootstrap-testing-find-links') -if find_links: - cmd.extend(['-f', quote(find_links)]) - -if options.use_distribute: - setup_requirement = 'distribute' -else: - setup_requirement = 'setuptools' -ws = pkg_resources.working_set -setup_requirement_path = ws.find( - pkg_resources.Requirement.parse(setup_requirement)).location -env = dict( - os.environ, - PYTHONPATH=setup_requirement_path) - -requirement = 'zc.buildout' -version = options.version -if version is None and not options.accept_buildout_test_releases: - # Figure out the most recent final version of zc.buildout. - import setuptools.package_index - _final_parts = '*final-', '*final' - def _final_version(parsed_version): - for part in parsed_version: - if (part[:1] == '*') and (part not in _final_parts): - return False - return True - index = setuptools.package_index.PackageIndex( - search_path=[setup_requirement_path]) - if find_links: - index.add_find_links((find_links,)) - req = pkg_resources.Requirement.parse(requirement) - if index.obtain(req) is not None: - best = [] - bestv = None - for dist in index[req.project_name]: - distv = dist.parsed_version - if _final_version(distv): - if bestv is None or distv > bestv: - best = [dist] - bestv = distv - elif distv == bestv: - best.append(dist) - if best: - best.sort() - version = best[-1].version -if version: - requirement = '=='.join((requirement, version)) -cmd.append(requirement) - -if is_jython: - import subprocess - exitcode = subprocess.Popen(cmd, env=env).wait() -else: # Windows prefers this, apparently; otherwise we would prefer subprocess - exitcode = os.spawnle(*([os.P_WAIT, sys.executable] + cmd + [env])) -if exitcode != 0: - sys.stdout.flush() - sys.stderr.flush() - print ("An error occurred when trying to install zc.buildout. " - "Look above this message for any errors that " - "were output by easy_install.") - sys.exit(exitcode) - -ws.add_entry(eggs_dir) -ws.require(requirement) -import zc.buildout.buildout -zc.buildout.buildout.main(args) -if not options.eggs: # clean up temporary egg directory - shutil.rmtree(eggs_dir) diff --git a/doc/groktut/showing_the_value_in_the_form/setup.py b/doc/groktut/showing_the_value_in_the_form/setup.py deleted file mode 100644 index 4f10c5b..0000000 --- a/doc/groktut/showing_the_value_in_the_form/setup.py +++ /dev/null @@ -1,36 +0,0 @@ -from setuptools import setup, find_packages - -version = '0.0' - -setup(name='Sample', - version=version, - description="", - long_description="""\ -""", - # Get strings from http://www.python.org/pypi?%3Aaction=list_classifiers - classifiers=[], - keywords="", - author="", - author_email="", - url="", - license="", - package_dir={'': 'src'}, - packages=find_packages('src'), - include_package_data=True, - zip_safe=False, - install_requires=['setuptools', - 'grok', - 'grokui.admin', - 'z3c.testsetup', - 'grokcore.startup', - # Add extra requirements here - ], - entry_points = """ - [console_scripts] - sample-debug = grokcore.startup:interactive_debug_prompt - sample-ctl = grokcore.startup:zdaemon_controller - [paste.app_factory] - main = grokcore.startup:application_factory - debug = grokcore.startup:debug_application_factory - """, - ) diff --git a/doc/groktut/simple_forms/bootstrap.py b/doc/groktut/simple_forms/bootstrap.py deleted file mode 100644 index 5f2cb08..0000000 --- a/doc/groktut/simple_forms/bootstrap.py +++ /dev/null @@ -1,260 +0,0 @@ -############################################################################## -# -# Copyright (c) 2006 Zope Foundation 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. -""" - -import os, shutil, sys, tempfile, textwrap, urllib, urllib2, subprocess -from optparse import OptionParser - -if sys.platform == 'win32': - def quote(c): - if ' ' in c: - return '"%s"' % c # work around spawn lamosity on windows - else: - return c -else: - quote = str - -# See zc.buildout.easy_install._has_broken_dash_S for motivation and comments. -stdout, stderr = subprocess.Popen( - [sys.executable, '-Sc', - 'try:\n' - ' import ConfigParser\n' - 'except ImportError:\n' - ' print 1\n' - 'else:\n' - ' print 0\n'], - stdout=subprocess.PIPE, stderr=subprocess.PIPE).communicate() -has_broken_dash_S = bool(int(stdout.strip())) - -# In order to be more robust in the face of system Pythons, we want to -# run without site-packages loaded. This is somewhat tricky, in -# particular because Python 2.6's distutils imports site, so starting -# with the -S flag is not sufficient. However, we'll start with that: -if not has_broken_dash_S and 'site' in sys.modules: - # We will restart with python -S. - args = sys.argv[:] - args[0:0] = [sys.executable, '-S'] - args = map(quote, args) - os.execv(sys.executable, args) -# Now we are running with -S. We'll get the clean sys.path, import site -# because distutils will do it later, and then reset the path and clean -# out any namespace packages from site-packages that might have been -# loaded by .pth files. -clean_path = sys.path[:] -import site -sys.path[:] = clean_path -for k, v in sys.modules.items(): - if k in ('setuptools', 'pkg_resources') or ( - hasattr(v, '__path__') and - len(v.__path__)==1 and - not os.path.exists(os.path.join(v.__path__[0],'__init__.py'))): - # This is a namespace package. Remove it. - sys.modules.pop(k) - -is_jython = sys.platform.startswith('java') - -setuptools_source = 'http://peak.telecommunity.com/dist/ez_setup.py' -distribute_source = 'http://python-distribute.org/distribute_setup.py' - -# parsing arguments -def normalize_to_url(option, opt_str, value, parser): - if value: - if '://' not in value: # It doesn't smell like a URL. - value = 'file://%s' % ( - urllib.pathname2url( - os.path.abspath(os.path.expanduser(value))),) - if opt_str == '--download-base' and not value.endswith('/'): - # Download base needs a trailing slash to make the world happy. - value += '/' - else: - value = None - name = opt_str[2:].replace('-', '_') - setattr(parser.values, name, value) - -usage = '''\ -[DESIRED PYTHON FOR BUILDOUT] bootstrap.py [options] - -Bootstraps a buildout-based project. - -Simply run this script in a directory containing a buildout.cfg, using the -Python that you want bin/buildout to use. - -Note that by using --setup-source and --download-base to point to -local resources, you can keep this script from going over the network. -''' - -parser = OptionParser(usage=usage) -parser.add_option("-v", "--version", dest="version", - help="use a specific zc.buildout version") -parser.add_option("-d", "--distribute", - action="store_true", dest="use_distribute", default=False, - help="Use Distribute rather than Setuptools.") -parser.add_option("--setup-source", action="callback", dest="setup_source", - callback=normalize_to_url, nargs=1, type="string", - help=("Specify a URL or file location for the setup file. " - "If you use Setuptools, this will default to " + - setuptools_source + "; if you use Distribute, this " - "will default to " + distribute_source +".")) -parser.add_option("--download-base", action="callback", dest="download_base", - callback=normalize_to_url, nargs=1, type="string", - help=("Specify a URL or directory for downloading " - "zc.buildout and either Setuptools or Distribute. " - "Defaults to PyPI.")) -parser.add_option("--eggs", - help=("Specify a directory for storing eggs. Defaults to " - "a temporary directory that is deleted when the " - "bootstrap script completes.")) -parser.add_option("-t", "--accept-buildout-test-releases", - dest='accept_buildout_test_releases', - action="store_true", default=False, - help=("Normally, if you do not specify a --version, the " - "bootstrap script and buildout gets the newest " - "*final* versions of zc.buildout and its recipes and " - "extensions for you. If you use this flag, " - "bootstrap and buildout will get the newest releases " - "even if they are alphas or betas.")) -parser.add_option("-c", None, action="store", dest="config_file", - help=("Specify the path to the buildout configuration " - "file to be used.")) - -options, args = parser.parse_args() - -# if -c was provided, we push it back into args for buildout's main function -if options.config_file is not None: - args += ['-c', options.config_file] - -if options.eggs: - eggs_dir = os.path.abspath(os.path.expanduser(options.eggs)) -else: - eggs_dir = tempfile.mkdtemp() - -if options.setup_source is None: - if options.use_distribute: - options.setup_source = distribute_source - else: - options.setup_source = setuptools_source - -if options.accept_buildout_test_releases: - args.append('buildout:accept-buildout-test-releases=true') -args.append('bootstrap') - -try: - import pkg_resources - import setuptools # A flag. Sometimes pkg_resources is installed alone. - if not hasattr(pkg_resources, '_distribute'): - raise ImportError -except ImportError: - ez_code = urllib2.urlopen( - options.setup_source).read().replace('\r\n', '\n') - ez = {} - exec ez_code in ez - setup_args = dict(to_dir=eggs_dir, download_delay=0) - if options.download_base: - setup_args['download_base'] = options.download_base - if options.use_distribute: - setup_args['no_fake'] = True - ez['use_setuptools'](**setup_args) - if 'pkg_resources' in sys.modules: - reload(sys.modules['pkg_resources']) - import pkg_resources - # This does not (always?) update the default working set. We will - # do it. - for path in sys.path: - if path not in pkg_resources.working_set.entries: - pkg_resources.working_set.add_entry(path) - -cmd = [quote(sys.executable), - '-c', - quote('from setuptools.command.easy_install import main; main()'), - '-mqNxd', - quote(eggs_dir)] - -if not has_broken_dash_S: - cmd.insert(1, '-S') - -find_links = options.download_base -if not find_links: - find_links = os.environ.get('bootstrap-testing-find-links') -if find_links: - cmd.extend(['-f', quote(find_links)]) - -if options.use_distribute: - setup_requirement = 'distribute' -else: - setup_requirement = 'setuptools' -ws = pkg_resources.working_set -setup_requirement_path = ws.find( - pkg_resources.Requirement.parse(setup_requirement)).location -env = dict( - os.environ, - PYTHONPATH=setup_requirement_path) - -requirement = 'zc.buildout' -version = options.version -if version is None and not options.accept_buildout_test_releases: - # Figure out the most recent final version of zc.buildout. - import setuptools.package_index - _final_parts = '*final-', '*final' - def _final_version(parsed_version): - for part in parsed_version: - if (part[:1] == '*') and (part not in _final_parts): - return False - return True - index = setuptools.package_index.PackageIndex( - search_path=[setup_requirement_path]) - if find_links: - index.add_find_links((find_links,)) - req = pkg_resources.Requirement.parse(requirement) - if index.obtain(req) is not None: - best = [] - bestv = None - for dist in index[req.project_name]: - distv = dist.parsed_version - if _final_version(distv): - if bestv is None or distv > bestv: - best = [dist] - bestv = distv - elif distv == bestv: - best.append(dist) - if best: - best.sort() - version = best[-1].version -if version: - requirement = '=='.join((requirement, version)) -cmd.append(requirement) - -if is_jython: - import subprocess - exitcode = subprocess.Popen(cmd, env=env).wait() -else: # Windows prefers this, apparently; otherwise we would prefer subprocess - exitcode = os.spawnle(*([os.P_WAIT, sys.executable] + cmd + [env])) -if exitcode != 0: - sys.stdout.flush() - sys.stderr.flush() - print ("An error occurred when trying to install zc.buildout. " - "Look above this message for any errors that " - "were output by easy_install.") - sys.exit(exitcode) - -ws.add_entry(eggs_dir) -ws.require(requirement) -import zc.buildout.buildout -zc.buildout.buildout.main(args) -if not options.eggs: # clean up temporary egg directory - shutil.rmtree(eggs_dir) diff --git a/doc/groktut/simple_forms/setup.py b/doc/groktut/simple_forms/setup.py deleted file mode 100644 index 4f10c5b..0000000 --- a/doc/groktut/simple_forms/setup.py +++ /dev/null @@ -1,36 +0,0 @@ -from setuptools import setup, find_packages - -version = '0.0' - -setup(name='Sample', - version=version, - description="", - long_description="""\ -""", - # Get strings from http://www.python.org/pypi?%3Aaction=list_classifiers - classifiers=[], - keywords="", - author="", - author_email="", - url="", - license="", - package_dir={'': 'src'}, - packages=find_packages('src'), - include_package_data=True, - zip_safe=False, - install_requires=['setuptools', - 'grok', - 'grokui.admin', - 'z3c.testsetup', - 'grokcore.startup', - # Add extra requirements here - ], - entry_points = """ - [console_scripts] - sample-debug = grokcore.startup:interactive_debug_prompt - sample-ctl = grokcore.startup:zdaemon_controller - [paste.app_factory] - main = grokcore.startup:application_factory - debug = grokcore.startup:debug_application_factory - """, - ) diff --git a/doc/groktut/simple_forms2/bootstrap.py b/doc/groktut/simple_forms2/bootstrap.py deleted file mode 100644 index 5f2cb08..0000000 --- a/doc/groktut/simple_forms2/bootstrap.py +++ /dev/null @@ -1,260 +0,0 @@ -############################################################################## -# -# Copyright (c) 2006 Zope Foundation 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. -""" - -import os, shutil, sys, tempfile, textwrap, urllib, urllib2, subprocess -from optparse import OptionParser - -if sys.platform == 'win32': - def quote(c): - if ' ' in c: - return '"%s"' % c # work around spawn lamosity on windows - else: - return c -else: - quote = str - -# See zc.buildout.easy_install._has_broken_dash_S for motivation and comments. -stdout, stderr = subprocess.Popen( - [sys.executable, '-Sc', - 'try:\n' - ' import ConfigParser\n' - 'except ImportError:\n' - ' print 1\n' - 'else:\n' - ' print 0\n'], - stdout=subprocess.PIPE, stderr=subprocess.PIPE).communicate() -has_broken_dash_S = bool(int(stdout.strip())) - -# In order to be more robust in the face of system Pythons, we want to -# run without site-packages loaded. This is somewhat tricky, in -# particular because Python 2.6's distutils imports site, so starting -# with the -S flag is not sufficient. However, we'll start with that: -if not has_broken_dash_S and 'site' in sys.modules: - # We will restart with python -S. - args = sys.argv[:] - args[0:0] = [sys.executable, '-S'] - args = map(quote, args) - os.execv(sys.executable, args) -# Now we are running with -S. We'll get the clean sys.path, import site -# because distutils will do it later, and then reset the path and clean -# out any namespace packages from site-packages that might have been -# loaded by .pth files. -clean_path = sys.path[:] -import site -sys.path[:] = clean_path -for k, v in sys.modules.items(): - if k in ('setuptools', 'pkg_resources') or ( - hasattr(v, '__path__') and - len(v.__path__)==1 and - not os.path.exists(os.path.join(v.__path__[0],'__init__.py'))): - # This is a namespace package. Remove it. - sys.modules.pop(k) - -is_jython = sys.platform.startswith('java') - -setuptools_source = 'http://peak.telecommunity.com/dist/ez_setup.py' -distribute_source = 'http://python-distribute.org/distribute_setup.py' - -# parsing arguments -def normalize_to_url(option, opt_str, value, parser): - if value: - if '://' not in value: # It doesn't smell like a URL. - value = 'file://%s' % ( - urllib.pathname2url( - os.path.abspath(os.path.expanduser(value))),) - if opt_str == '--download-base' and not value.endswith('/'): - # Download base needs a trailing slash to make the world happy. - value += '/' - else: - value = None - name = opt_str[2:].replace('-', '_') - setattr(parser.values, name, value) - -usage = '''\ -[DESIRED PYTHON FOR BUILDOUT] bootstrap.py [options] - -Bootstraps a buildout-based project. - -Simply run this script in a directory containing a buildout.cfg, using the -Python that you want bin/buildout to use. - -Note that by using --setup-source and --download-base to point to -local resources, you can keep this script from going over the network. -''' - -parser = OptionParser(usage=usage) -parser.add_option("-v", "--version", dest="version", - help="use a specific zc.buildout version") -parser.add_option("-d", "--distribute", - action="store_true", dest="use_distribute", default=False, - help="Use Distribute rather than Setuptools.") -parser.add_option("--setup-source", action="callback", dest="setup_source", - callback=normalize_to_url, nargs=1, type="string", - help=("Specify a URL or file location for the setup file. " - "If you use Setuptools, this will default to " + - setuptools_source + "; if you use Distribute, this " - "will default to " + distribute_source +".")) -parser.add_option("--download-base", action="callback", dest="download_base", - callback=normalize_to_url, nargs=1, type="string", - help=("Specify a URL or directory for downloading " - "zc.buildout and either Setuptools or Distribute. " - "Defaults to PyPI.")) -parser.add_option("--eggs", - help=("Specify a directory for storing eggs. Defaults to " - "a temporary directory that is deleted when the " - "bootstrap script completes.")) -parser.add_option("-t", "--accept-buildout-test-releases", - dest='accept_buildout_test_releases', - action="store_true", default=False, - help=("Normally, if you do not specify a --version, the " - "bootstrap script and buildout gets the newest " - "*final* versions of zc.buildout and its recipes and " - "extensions for you. If you use this flag, " - "bootstrap and buildout will get the newest releases " - "even if they are alphas or betas.")) -parser.add_option("-c", None, action="store", dest="config_file", - help=("Specify the path to the buildout configuration " - "file to be used.")) - -options, args = parser.parse_args() - -# if -c was provided, we push it back into args for buildout's main function -if options.config_file is not None: - args += ['-c', options.config_file] - -if options.eggs: - eggs_dir = os.path.abspath(os.path.expanduser(options.eggs)) -else: - eggs_dir = tempfile.mkdtemp() - -if options.setup_source is None: - if options.use_distribute: - options.setup_source = distribute_source - else: - options.setup_source = setuptools_source - -if options.accept_buildout_test_releases: - args.append('buildout:accept-buildout-test-releases=true') -args.append('bootstrap') - -try: - import pkg_resources - import setuptools # A flag. Sometimes pkg_resources is installed alone. - if not hasattr(pkg_resources, '_distribute'): - raise ImportError -except ImportError: - ez_code = urllib2.urlopen( - options.setup_source).read().replace('\r\n', '\n') - ez = {} - exec ez_code in ez - setup_args = dict(to_dir=eggs_dir, download_delay=0) - if options.download_base: - setup_args['download_base'] = options.download_base - if options.use_distribute: - setup_args['no_fake'] = True - ez['use_setuptools'](**setup_args) - if 'pkg_resources' in sys.modules: - reload(sys.modules['pkg_resources']) - import pkg_resources - # This does not (always?) update the default working set. We will - # do it. - for path in sys.path: - if path not in pkg_resources.working_set.entries: - pkg_resources.working_set.add_entry(path) - -cmd = [quote(sys.executable), - '-c', - quote('from setuptools.command.easy_install import main; main()'), - '-mqNxd', - quote(eggs_dir)] - -if not has_broken_dash_S: - cmd.insert(1, '-S') - -find_links = options.download_base -if not find_links: - find_links = os.environ.get('bootstrap-testing-find-links') -if find_links: - cmd.extend(['-f', quote(find_links)]) - -if options.use_distribute: - setup_requirement = 'distribute' -else: - setup_requirement = 'setuptools' -ws = pkg_resources.working_set -setup_requirement_path = ws.find( - pkg_resources.Requirement.parse(setup_requirement)).location -env = dict( - os.environ, - PYTHONPATH=setup_requirement_path) - -requirement = 'zc.buildout' -version = options.version -if version is None and not options.accept_buildout_test_releases: - # Figure out the most recent final version of zc.buildout. - import setuptools.package_index - _final_parts = '*final-', '*final' - def _final_version(parsed_version): - for part in parsed_version: - if (part[:1] == '*') and (part not in _final_parts): - return False - return True - index = setuptools.package_index.PackageIndex( - search_path=[setup_requirement_path]) - if find_links: - index.add_find_links((find_links,)) - req = pkg_resources.Requirement.parse(requirement) - if index.obtain(req) is not None: - best = [] - bestv = None - for dist in index[req.project_name]: - distv = dist.parsed_version - if _final_version(distv): - if bestv is None or distv > bestv: - best = [dist] - bestv = distv - elif distv == bestv: - best.append(dist) - if best: - best.sort() - version = best[-1].version -if version: - requirement = '=='.join((requirement, version)) -cmd.append(requirement) - -if is_jython: - import subprocess - exitcode = subprocess.Popen(cmd, env=env).wait() -else: # Windows prefers this, apparently; otherwise we would prefer subprocess - exitcode = os.spawnle(*([os.P_WAIT, sys.executable] + cmd + [env])) -if exitcode != 0: - sys.stdout.flush() - sys.stderr.flush() - print ("An error occurred when trying to install zc.buildout. " - "Look above this message for any errors that " - "were output by easy_install.") - sys.exit(exitcode) - -ws.add_entry(eggs_dir) -ws.require(requirement) -import zc.buildout.buildout -zc.buildout.buildout.main(args) -if not options.eggs: # clean up temporary egg directory - shutil.rmtree(eggs_dir) diff --git a/doc/groktut/simple_forms2/setup.py b/doc/groktut/simple_forms2/setup.py deleted file mode 100644 index 4f10c5b..0000000 --- a/doc/groktut/simple_forms2/setup.py +++ /dev/null @@ -1,36 +0,0 @@ -from setuptools import setup, find_packages - -version = '0.0' - -setup(name='Sample', - version=version, - description="", - long_description="""\ -""", - # Get strings from http://www.python.org/pypi?%3Aaction=list_classifiers - classifiers=[], - keywords="", - author="", - author_email="", - url="", - license="", - package_dir={'': 'src'}, - packages=find_packages('src'), - include_package_data=True, - zip_safe=False, - install_requires=['setuptools', - 'grok', - 'grokui.admin', - 'z3c.testsetup', - 'grokcore.startup', - # Add extra requirements here - ], - entry_points = """ - [console_scripts] - sample-debug = grokcore.startup:interactive_debug_prompt - sample-ctl = grokcore.startup:zdaemon_controller - [paste.app_factory] - main = grokcore.startup:application_factory - debug = grokcore.startup:debug_application_factory - """, - ) diff --git a/doc/groktut/static_resources_for_our_web_page/bootstrap.py b/doc/groktut/static_resources_for_our_web_page/bootstrap.py deleted file mode 100644 index 5f2cb08..0000000 --- a/doc/groktut/static_resources_for_our_web_page/bootstrap.py +++ /dev/null @@ -1,260 +0,0 @@ -############################################################################## -# -# Copyright (c) 2006 Zope Foundation 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. -""" - -import os, shutil, sys, tempfile, textwrap, urllib, urllib2, subprocess -from optparse import OptionParser - -if sys.platform == 'win32': - def quote(c): - if ' ' in c: - return '"%s"' % c # work around spawn lamosity on windows - else: - return c -else: - quote = str - -# See zc.buildout.easy_install._has_broken_dash_S for motivation and comments. -stdout, stderr = subprocess.Popen( - [sys.executable, '-Sc', - 'try:\n' - ' import ConfigParser\n' - 'except ImportError:\n' - ' print 1\n' - 'else:\n' - ' print 0\n'], - stdout=subprocess.PIPE, stderr=subprocess.PIPE).communicate() -has_broken_dash_S = bool(int(stdout.strip())) - -# In order to be more robust in the face of system Pythons, we want to -# run without site-packages loaded. This is somewhat tricky, in -# particular because Python 2.6's distutils imports site, so starting -# with the -S flag is not sufficient. However, we'll start with that: -if not has_broken_dash_S and 'site' in sys.modules: - # We will restart with python -S. - args = sys.argv[:] - args[0:0] = [sys.executable, '-S'] - args = map(quote, args) - os.execv(sys.executable, args) -# Now we are running with -S. We'll get the clean sys.path, import site -# because distutils will do it later, and then reset the path and clean -# out any namespace packages from site-packages that might have been -# loaded by .pth files. -clean_path = sys.path[:] -import site -sys.path[:] = clean_path -for k, v in sys.modules.items(): - if k in ('setuptools', 'pkg_resources') or ( - hasattr(v, '__path__') and - len(v.__path__)==1 and - not os.path.exists(os.path.join(v.__path__[0],'__init__.py'))): - # This is a namespace package. Remove it. - sys.modules.pop(k) - -is_jython = sys.platform.startswith('java') - -setuptools_source = 'http://peak.telecommunity.com/dist/ez_setup.py' -distribute_source = 'http://python-distribute.org/distribute_setup.py' - -# parsing arguments -def normalize_to_url(option, opt_str, value, parser): - if value: - if '://' not in value: # It doesn't smell like a URL. - value = 'file://%s' % ( - urllib.pathname2url( - os.path.abspath(os.path.expanduser(value))),) - if opt_str == '--download-base' and not value.endswith('/'): - # Download base needs a trailing slash to make the world happy. - value += '/' - else: - value = None - name = opt_str[2:].replace('-', '_') - setattr(parser.values, name, value) - -usage = '''\ -[DESIRED PYTHON FOR BUILDOUT] bootstrap.py [options] - -Bootstraps a buildout-based project. - -Simply run this script in a directory containing a buildout.cfg, using the -Python that you want bin/buildout to use. - -Note that by using --setup-source and --download-base to point to -local resources, you can keep this script from going over the network. -''' - -parser = OptionParser(usage=usage) -parser.add_option("-v", "--version", dest="version", - help="use a specific zc.buildout version") -parser.add_option("-d", "--distribute", - action="store_true", dest="use_distribute", default=False, - help="Use Distribute rather than Setuptools.") -parser.add_option("--setup-source", action="callback", dest="setup_source", - callback=normalize_to_url, nargs=1, type="string", - help=("Specify a URL or file location for the setup file. " - "If you use Setuptools, this will default to " + - setuptools_source + "; if you use Distribute, this " - "will default to " + distribute_source +".")) -parser.add_option("--download-base", action="callback", dest="download_base", - callback=normalize_to_url, nargs=1, type="string", - help=("Specify a URL or directory for downloading " - "zc.buildout and either Setuptools or Distribute. " - "Defaults to PyPI.")) -parser.add_option("--eggs", - help=("Specify a directory for storing eggs. Defaults to " - "a temporary directory that is deleted when the " - "bootstrap script completes.")) -parser.add_option("-t", "--accept-buildout-test-releases", - dest='accept_buildout_test_releases', - action="store_true", default=False, - help=("Normally, if you do not specify a --version, the " - "bootstrap script and buildout gets the newest " - "*final* versions of zc.buildout and its recipes and " - "extensions for you. If you use this flag, " - "bootstrap and buildout will get the newest releases " - "even if they are alphas or betas.")) -parser.add_option("-c", None, action="store", dest="config_file", - help=("Specify the path to the buildout configuration " - "file to be used.")) - -options, args = parser.parse_args() - -# if -c was provided, we push it back into args for buildout's main function -if options.config_file is not None: - args += ['-c', options.config_file] - -if options.eggs: - eggs_dir = os.path.abspath(os.path.expanduser(options.eggs)) -else: - eggs_dir = tempfile.mkdtemp() - -if options.setup_source is None: - if options.use_distribute: - options.setup_source = distribute_source - else: - options.setup_source = setuptools_source - -if options.accept_buildout_test_releases: - args.append('buildout:accept-buildout-test-releases=true') -args.append('bootstrap') - -try: - import pkg_resources - import setuptools # A flag. Sometimes pkg_resources is installed alone. - if not hasattr(pkg_resources, '_distribute'): - raise ImportError -except ImportError: - ez_code = urllib2.urlopen( - options.setup_source).read().replace('\r\n', '\n') - ez = {} - exec ez_code in ez - setup_args = dict(to_dir=eggs_dir, download_delay=0) - if options.download_base: - setup_args['download_base'] = options.download_base - if options.use_distribute: - setup_args['no_fake'] = True - ez['use_setuptools'](**setup_args) - if 'pkg_resources' in sys.modules: - reload(sys.modules['pkg_resources']) - import pkg_resources - # This does not (always?) update the default working set. We will - # do it. - for path in sys.path: - if path not in pkg_resources.working_set.entries: - pkg_resources.working_set.add_entry(path) - -cmd = [quote(sys.executable), - '-c', - quote('from setuptools.command.easy_install import main; main()'), - '-mqNxd', - quote(eggs_dir)] - -if not has_broken_dash_S: - cmd.insert(1, '-S') - -find_links = options.download_base -if not find_links: - find_links = os.environ.get('bootstrap-testing-find-links') -if find_links: - cmd.extend(['-f', quote(find_links)]) - -if options.use_distribute: - setup_requirement = 'distribute' -else: - setup_requirement = 'setuptools' -ws = pkg_resources.working_set -setup_requirement_path = ws.find( - pkg_resources.Requirement.parse(setup_requirement)).location -env = dict( - os.environ, - PYTHONPATH=setup_requirement_path) - -requirement = 'zc.buildout' -version = options.version -if version is None and not options.accept_buildout_test_releases: - # Figure out the most recent final version of zc.buildout. - import setuptools.package_index - _final_parts = '*final-', '*final' - def _final_version(parsed_version): - for part in parsed_version: - if (part[:1] == '*') and (part not in _final_parts): - return False - return True - index = setuptools.package_index.PackageIndex( - search_path=[setup_requirement_path]) - if find_links: - index.add_find_links((find_links,)) - req = pkg_resources.Requirement.parse(requirement) - if index.obtain(req) is not None: - best = [] - bestv = None - for dist in index[req.project_name]: - distv = dist.parsed_version - if _final_version(distv): - if bestv is None or distv > bestv: - best = [dist] - bestv = distv - elif distv == bestv: - best.append(dist) - if best: - best.sort() - version = best[-1].version -if version: - requirement = '=='.join((requirement, version)) -cmd.append(requirement) - -if is_jython: - import subprocess - exitcode = subprocess.Popen(cmd, env=env).wait() -else: # Windows prefers this, apparently; otherwise we would prefer subprocess - exitcode = os.spawnle(*([os.P_WAIT, sys.executable] + cmd + [env])) -if exitcode != 0: - sys.stdout.flush() - sys.stderr.flush() - print ("An error occurred when trying to install zc.buildout. " - "Look above this message for any errors that " - "were output by easy_install.") - sys.exit(exitcode) - -ws.add_entry(eggs_dir) -ws.require(requirement) -import zc.buildout.buildout -zc.buildout.buildout.main(args) -if not options.eggs: # clean up temporary egg directory - shutil.rmtree(eggs_dir) diff --git a/doc/groktut/static_resources_for_our_web_page/setup.py b/doc/groktut/static_resources_for_our_web_page/setup.py deleted file mode 100644 index 4f10c5b..0000000 --- a/doc/groktut/static_resources_for_our_web_page/setup.py +++ /dev/null @@ -1,36 +0,0 @@ -from setuptools import setup, find_packages - -version = '0.0' - -setup(name='Sample', - version=version, - description="", - long_description="""\ -""", - # Get strings from http://www.python.org/pypi?%3Aaction=list_classifiers - classifiers=[], - keywords="", - author="", - author_email="", - url="", - license="", - package_dir={'': 'src'}, - packages=find_packages('src'), - include_package_data=True, - zip_safe=False, - install_requires=['setuptools', - 'grok', - 'grokui.admin', - 'z3c.testsetup', - 'grokcore.startup', - # Add extra requirements here - ], - entry_points = """ - [console_scripts] - sample-debug = grokcore.startup:interactive_debug_prompt - sample-ctl = grokcore.startup:zdaemon_controller - [paste.app_factory] - main = grokcore.startup:application_factory - debug = grokcore.startup:debug_application_factory - """, - ) diff --git a/doc/groktut/storing_data/bootstrap.py b/doc/groktut/storing_data/bootstrap.py deleted file mode 100644 index 5f2cb08..0000000 --- a/doc/groktut/storing_data/bootstrap.py +++ /dev/null @@ -1,260 +0,0 @@ -############################################################################## -# -# Copyright (c) 2006 Zope Foundation 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. -""" - -import os, shutil, sys, tempfile, textwrap, urllib, urllib2, subprocess -from optparse import OptionParser - -if sys.platform == 'win32': - def quote(c): - if ' ' in c: - return '"%s"' % c # work around spawn lamosity on windows - else: - return c -else: - quote = str - -# See zc.buildout.easy_install._has_broken_dash_S for motivation and comments. -stdout, stderr = subprocess.Popen( - [sys.executable, '-Sc', - 'try:\n' - ' import ConfigParser\n' - 'except ImportError:\n' - ' print 1\n' - 'else:\n' - ' print 0\n'], - stdout=subprocess.PIPE, stderr=subprocess.PIPE).communicate() -has_broken_dash_S = bool(int(stdout.strip())) - -# In order to be more robust in the face of system Pythons, we want to -# run without site-packages loaded. This is somewhat tricky, in -# particular because Python 2.6's distutils imports site, so starting -# with the -S flag is not sufficient. However, we'll start with that: -if not has_broken_dash_S and 'site' in sys.modules: - # We will restart with python -S. - args = sys.argv[:] - args[0:0] = [sys.executable, '-S'] - args = map(quote, args) - os.execv(sys.executable, args) -# Now we are running with -S. We'll get the clean sys.path, import site -# because distutils will do it later, and then reset the path and clean -# out any namespace packages from site-packages that might have been -# loaded by .pth files. -clean_path = sys.path[:] -import site -sys.path[:] = clean_path -for k, v in sys.modules.items(): - if k in ('setuptools', 'pkg_resources') or ( - hasattr(v, '__path__') and - len(v.__path__)==1 and - not os.path.exists(os.path.join(v.__path__[0],'__init__.py'))): - # This is a namespace package. Remove it. - sys.modules.pop(k) - -is_jython = sys.platform.startswith('java') - -setuptools_source = 'http://peak.telecommunity.com/dist/ez_setup.py' -distribute_source = 'http://python-distribute.org/distribute_setup.py' - -# parsing arguments -def normalize_to_url(option, opt_str, value, parser): - if value: - if '://' not in value: # It doesn't smell like a URL. - value = 'file://%s' % ( - urllib.pathname2url( - os.path.abspath(os.path.expanduser(value))),) - if opt_str == '--download-base' and not value.endswith('/'): - # Download base needs a trailing slash to make the world happy. - value += '/' - else: - value = None - name = opt_str[2:].replace('-', '_') - setattr(parser.values, name, value) - -usage = '''\ -[DESIRED PYTHON FOR BUILDOUT] bootstrap.py [options] - -Bootstraps a buildout-based project. - -Simply run this script in a directory containing a buildout.cfg, using the -Python that you want bin/buildout to use. - -Note that by using --setup-source and --download-base to point to -local resources, you can keep this script from going over the network. -''' - -parser = OptionParser(usage=usage) -parser.add_option("-v", "--version", dest="version", - help="use a specific zc.buildout version") -parser.add_option("-d", "--distribute", - action="store_true", dest="use_distribute", default=False, - help="Use Distribute rather than Setuptools.") -parser.add_option("--setup-source", action="callback", dest="setup_source", - callback=normalize_to_url, nargs=1, type="string", - help=("Specify a URL or file location for the setup file. " - "If you use Setuptools, this will default to " + - setuptools_source + "; if you use Distribute, this " - "will default to " + distribute_source +".")) -parser.add_option("--download-base", action="callback", dest="download_base", - callback=normalize_to_url, nargs=1, type="string", - help=("Specify a URL or directory for downloading " - "zc.buildout and either Setuptools or Distribute. " - "Defaults to PyPI.")) -parser.add_option("--eggs", - help=("Specify a directory for storing eggs. Defaults to " - "a temporary directory that is deleted when the " - "bootstrap script completes.")) -parser.add_option("-t", "--accept-buildout-test-releases", - dest='accept_buildout_test_releases', - action="store_true", default=False, - help=("Normally, if you do not specify a --version, the " - "bootstrap script and buildout gets the newest " - "*final* versions of zc.buildout and its recipes and " - "extensions for you. If you use this flag, " - "bootstrap and buildout will get the newest releases " - "even if they are alphas or betas.")) -parser.add_option("-c", None, action="store", dest="config_file", - help=("Specify the path to the buildout configuration " - "file to be used.")) - -options, args = parser.parse_args() - -# if -c was provided, we push it back into args for buildout's main function -if options.config_file is not None: - args += ['-c', options.config_file] - -if options.eggs: - eggs_dir = os.path.abspath(os.path.expanduser(options.eggs)) -else: - eggs_dir = tempfile.mkdtemp() - -if options.setup_source is None: - if options.use_distribute: - options.setup_source = distribute_source - else: - options.setup_source = setuptools_source - -if options.accept_buildout_test_releases: - args.append('buildout:accept-buildout-test-releases=true') -args.append('bootstrap') - -try: - import pkg_resources - import setuptools # A flag. Sometimes pkg_resources is installed alone. - if not hasattr(pkg_resources, '_distribute'): - raise ImportError -except ImportError: - ez_code = urllib2.urlopen( - options.setup_source).read().replace('\r\n', '\n') - ez = {} - exec ez_code in ez - setup_args = dict(to_dir=eggs_dir, download_delay=0) - if options.download_base: - setup_args['download_base'] = options.download_base - if options.use_distribute: - setup_args['no_fake'] = True - ez['use_setuptools'](**setup_args) - if 'pkg_resources' in sys.modules: - reload(sys.modules['pkg_resources']) - import pkg_resources - # This does not (always?) update the default working set. We will - # do it. - for path in sys.path: - if path not in pkg_resources.working_set.entries: - pkg_resources.working_set.add_entry(path) - -cmd = [quote(sys.executable), - '-c', - quote('from setuptools.command.easy_install import main; main()'), - '-mqNxd', - quote(eggs_dir)] - -if not has_broken_dash_S: - cmd.insert(1, '-S') - -find_links = options.download_base -if not find_links: - find_links = os.environ.get('bootstrap-testing-find-links') -if find_links: - cmd.extend(['-f', quote(find_links)]) - -if options.use_distribute: - setup_requirement = 'distribute' -else: - setup_requirement = 'setuptools' -ws = pkg_resources.working_set -setup_requirement_path = ws.find( - pkg_resources.Requirement.parse(setup_requirement)).location -env = dict( - os.environ, - PYTHONPATH=setup_requirement_path) - -requirement = 'zc.buildout' -version = options.version -if version is None and not options.accept_buildout_test_releases: - # Figure out the most recent final version of zc.buildout. - import setuptools.package_index - _final_parts = '*final-', '*final' - def _final_version(parsed_version): - for part in parsed_version: - if (part[:1] == '*') and (part not in _final_parts): - return False - return True - index = setuptools.package_index.PackageIndex( - search_path=[setup_requirement_path]) - if find_links: - index.add_find_links((find_links,)) - req = pkg_resources.Requirement.parse(requirement) - if index.obtain(req) is not None: - best = [] - bestv = None - for dist in index[req.project_name]: - distv = dist.parsed_version - if _final_version(distv): - if bestv is None or distv > bestv: - best = [dist] - bestv = distv - elif distv == bestv: - best.append(dist) - if best: - best.sort() - version = best[-1].version -if version: - requirement = '=='.join((requirement, version)) -cmd.append(requirement) - -if is_jython: - import subprocess - exitcode = subprocess.Popen(cmd, env=env).wait() -else: # Windows prefers this, apparently; otherwise we would prefer subprocess - exitcode = os.spawnle(*([os.P_WAIT, sys.executable] + cmd + [env])) -if exitcode != 0: - sys.stdout.flush() - sys.stderr.flush() - print ("An error occurred when trying to install zc.buildout. " - "Look above this message for any errors that " - "were output by easy_install.") - sys.exit(exitcode) - -ws.add_entry(eggs_dir) -ws.require(requirement) -import zc.buildout.buildout -zc.buildout.buildout.main(args) -if not options.eggs: # clean up temporary egg directory - shutil.rmtree(eggs_dir) diff --git a/doc/groktut/storing_data/setup.py b/doc/groktut/storing_data/setup.py deleted file mode 100644 index 4f10c5b..0000000 --- a/doc/groktut/storing_data/setup.py +++ /dev/null @@ -1,36 +0,0 @@ -from setuptools import setup, find_packages - -version = '0.0' - -setup(name='Sample', - version=version, - description="", - long_description="""\ -""", - # Get strings from http://www.python.org/pypi?%3Aaction=list_classifiers - classifiers=[], - keywords="", - author="", - author_email="", - url="", - license="", - package_dir={'': 'src'}, - packages=find_packages('src'), - include_package_data=True, - zip_safe=False, - install_requires=['setuptools', - 'grok', - 'grokui.admin', - 'z3c.testsetup', - 'grokcore.startup', - # Add extra requirements here - ], - entry_points = """ - [console_scripts] - sample-debug = grokcore.startup:interactive_debug_prompt - sample-ctl = grokcore.startup:zdaemon_controller - [paste.app_factory] - main = grokcore.startup:application_factory - debug = grokcore.startup:debug_application_factory - """, - ) diff --git a/doc/groktut/template/bootstrap.py b/doc/groktut/template/bootstrap.py deleted file mode 100644 index 5f2cb08..0000000 --- a/doc/groktut/template/bootstrap.py +++ /dev/null @@ -1,260 +0,0 @@ -############################################################################## -# -# Copyright (c) 2006 Zope Foundation 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. -""" - -import os, shutil, sys, tempfile, textwrap, urllib, urllib2, subprocess -from optparse import OptionParser - -if sys.platform == 'win32': - def quote(c): - if ' ' in c: - return '"%s"' % c # work around spawn lamosity on windows - else: - return c -else: - quote = str - -# See zc.buildout.easy_install._has_broken_dash_S for motivation and comments. -stdout, stderr = subprocess.Popen( - [sys.executable, '-Sc', - 'try:\n' - ' import ConfigParser\n' - 'except ImportError:\n' - ' print 1\n' - 'else:\n' - ' print 0\n'], - stdout=subprocess.PIPE, stderr=subprocess.PIPE).communicate() -has_broken_dash_S = bool(int(stdout.strip())) - -# In order to be more robust in the face of system Pythons, we want to -# run without site-packages loaded. This is somewhat tricky, in -# particular because Python 2.6's distutils imports site, so starting -# with the -S flag is not sufficient. However, we'll start with that: -if not has_broken_dash_S and 'site' in sys.modules: - # We will restart with python -S. - args = sys.argv[:] - args[0:0] = [sys.executable, '-S'] - args = map(quote, args) - os.execv(sys.executable, args) -# Now we are running with -S. We'll get the clean sys.path, import site -# because distutils will do it later, and then reset the path and clean -# out any namespace packages from site-packages that might have been -# loaded by .pth files. -clean_path = sys.path[:] -import site -sys.path[:] = clean_path -for k, v in sys.modules.items(): - if k in ('setuptools', 'pkg_resources') or ( - hasattr(v, '__path__') and - len(v.__path__)==1 and - not os.path.exists(os.path.join(v.__path__[0],'__init__.py'))): - # This is a namespace package. Remove it. - sys.modules.pop(k) - -is_jython = sys.platform.startswith('java') - -setuptools_source = 'http://peak.telecommunity.com/dist/ez_setup.py' -distribute_source = 'http://python-distribute.org/distribute_setup.py' - -# parsing arguments -def normalize_to_url(option, opt_str, value, parser): - if value: - if '://' not in value: # It doesn't smell like a URL. - value = 'file://%s' % ( - urllib.pathname2url( - os.path.abspath(os.path.expanduser(value))),) - if opt_str == '--download-base' and not value.endswith('/'): - # Download base needs a trailing slash to make the world happy. - value += '/' - else: - value = None - name = opt_str[2:].replace('-', '_') - setattr(parser.values, name, value) - -usage = '''\ -[DESIRED PYTHON FOR BUILDOUT] bootstrap.py [options] - -Bootstraps a buildout-based project. - -Simply run this script in a directory containing a buildout.cfg, using the -Python that you want bin/buildout to use. - -Note that by using --setup-source and --download-base to point to -local resources, you can keep this script from going over the network. -''' - -parser = OptionParser(usage=usage) -parser.add_option("-v", "--version", dest="version", - help="use a specific zc.buildout version") -parser.add_option("-d", "--distribute", - action="store_true", dest="use_distribute", default=False, - help="Use Distribute rather than Setuptools.") -parser.add_option("--setup-source", action="callback", dest="setup_source", - callback=normalize_to_url, nargs=1, type="string", - help=("Specify a URL or file location for the setup file. " - "If you use Setuptools, this will default to " + - setuptools_source + "; if you use Distribute, this " - "will default to " + distribute_source +".")) -parser.add_option("--download-base", action="callback", dest="download_base", - callback=normalize_to_url, nargs=1, type="string", - help=("Specify a URL or directory for downloading " - "zc.buildout and either Setuptools or Distribute. " - "Defaults to PyPI.")) -parser.add_option("--eggs", - help=("Specify a directory for storing eggs. Defaults to " - "a temporary directory that is deleted when the " - "bootstrap script completes.")) -parser.add_option("-t", "--accept-buildout-test-releases", - dest='accept_buildout_test_releases', - action="store_true", default=False, - help=("Normally, if you do not specify a --version, the " - "bootstrap script and buildout gets the newest " - "*final* versions of zc.buildout and its recipes and " - "extensions for you. If you use this flag, " - "bootstrap and buildout will get the newest releases " - "even if they are alphas or betas.")) -parser.add_option("-c", None, action="store", dest="config_file", - help=("Specify the path to the buildout configuration " - "file to be used.")) - -options, args = parser.parse_args() - -# if -c was provided, we push it back into args for buildout's main function -if options.config_file is not None: - args += ['-c', options.config_file] - -if options.eggs: - eggs_dir = os.path.abspath(os.path.expanduser(options.eggs)) -else: - eggs_dir = tempfile.mkdtemp() - -if options.setup_source is None: - if options.use_distribute: - options.setup_source = distribute_source - else: - options.setup_source = setuptools_source - -if options.accept_buildout_test_releases: - args.append('buildout:accept-buildout-test-releases=true') -args.append('bootstrap') - -try: - import pkg_resources - import setuptools # A flag. Sometimes pkg_resources is installed alone. - if not hasattr(pkg_resources, '_distribute'): - raise ImportError -except ImportError: - ez_code = urllib2.urlopen( - options.setup_source).read().replace('\r\n', '\n') - ez = {} - exec ez_code in ez - setup_args = dict(to_dir=eggs_dir, download_delay=0) - if options.download_base: - setup_args['download_base'] = options.download_base - if options.use_distribute: - setup_args['no_fake'] = True - ez['use_setuptools'](**setup_args) - if 'pkg_resources' in sys.modules: - reload(sys.modules['pkg_resources']) - import pkg_resources - # This does not (always?) update the default working set. We will - # do it. - for path in sys.path: - if path not in pkg_resources.working_set.entries: - pkg_resources.working_set.add_entry(path) - -cmd = [quote(sys.executable), - '-c', - quote('from setuptools.command.easy_install import main; main()'), - '-mqNxd', - quote(eggs_dir)] - -if not has_broken_dash_S: - cmd.insert(1, '-S') - -find_links = options.download_base -if not find_links: - find_links = os.environ.get('bootstrap-testing-find-links') -if find_links: - cmd.extend(['-f', quote(find_links)]) - -if options.use_distribute: - setup_requirement = 'distribute' -else: - setup_requirement = 'setuptools' -ws = pkg_resources.working_set -setup_requirement_path = ws.find( - pkg_resources.Requirement.parse(setup_requirement)).location -env = dict( - os.environ, - PYTHONPATH=setup_requirement_path) - -requirement = 'zc.buildout' -version = options.version -if version is None and not options.accept_buildout_test_releases: - # Figure out the most recent final version of zc.buildout. - import setuptools.package_index - _final_parts = '*final-', '*final' - def _final_version(parsed_version): - for part in parsed_version: - if (part[:1] == '*') and (part not in _final_parts): - return False - return True - index = setuptools.package_index.PackageIndex( - search_path=[setup_requirement_path]) - if find_links: - index.add_find_links((find_links,)) - req = pkg_resources.Requirement.parse(requirement) - if index.obtain(req) is not None: - best = [] - bestv = None - for dist in index[req.project_name]: - distv = dist.parsed_version - if _final_version(distv): - if bestv is None or distv > bestv: - best = [dist] - bestv = distv - elif distv == bestv: - best.append(dist) - if best: - best.sort() - version = best[-1].version -if version: - requirement = '=='.join((requirement, version)) -cmd.append(requirement) - -if is_jython: - import subprocess - exitcode = subprocess.Popen(cmd, env=env).wait() -else: # Windows prefers this, apparently; otherwise we would prefer subprocess - exitcode = os.spawnle(*([os.P_WAIT, sys.executable] + cmd + [env])) -if exitcode != 0: - sys.stdout.flush() - sys.stderr.flush() - print ("An error occurred when trying to install zc.buildout. " - "Look above this message for any errors that " - "were output by easy_install.") - sys.exit(exitcode) - -ws.add_entry(eggs_dir) -ws.require(requirement) -import zc.buildout.buildout -zc.buildout.buildout.main(args) -if not options.eggs: # clean up temporary egg directory - shutil.rmtree(eggs_dir) diff --git a/doc/groktut/template/setup.py b/doc/groktut/template/setup.py deleted file mode 100644 index 4f10c5b..0000000 --- a/doc/groktut/template/setup.py +++ /dev/null @@ -1,36 +0,0 @@ -from setuptools import setup, find_packages - -version = '0.0' - -setup(name='Sample', - version=version, - description="", - long_description="""\ -""", - # Get strings from http://www.python.org/pypi?%3Aaction=list_classifiers - classifiers=[], - keywords="", - author="", - author_email="", - url="", - license="", - package_dir={'': 'src'}, - packages=find_packages('src'), - include_package_data=True, - zip_safe=False, - install_requires=['setuptools', - 'grok', - 'grokui.admin', - 'z3c.testsetup', - 'grokcore.startup', - # Add extra requirements here - ], - entry_points = """ - [console_scripts] - sample-debug = grokcore.startup:interactive_debug_prompt - sample-ctl = grokcore.startup:zdaemon_controller - [paste.app_factory] - main = grokcore.startup:application_factory - debug = grokcore.startup:debug_application_factory - """, - ) diff --git a/doc/groktut/the_rules_of_persistence/bootstrap.py b/doc/groktut/the_rules_of_persistence/bootstrap.py deleted file mode 100644 index 5f2cb08..0000000 --- a/doc/groktut/the_rules_of_persistence/bootstrap.py +++ /dev/null @@ -1,260 +0,0 @@ -############################################################################## -# -# Copyright (c) 2006 Zope Foundation 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. -""" - -import os, shutil, sys, tempfile, textwrap, urllib, urllib2, subprocess -from optparse import OptionParser - -if sys.platform == 'win32': - def quote(c): - if ' ' in c: - return '"%s"' % c # work around spawn lamosity on windows - else: - return c -else: - quote = str - -# See zc.buildout.easy_install._has_broken_dash_S for motivation and comments. -stdout, stderr = subprocess.Popen( - [sys.executable, '-Sc', - 'try:\n' - ' import ConfigParser\n' - 'except ImportError:\n' - ' print 1\n' - 'else:\n' - ' print 0\n'], - stdout=subprocess.PIPE, stderr=subprocess.PIPE).communicate() -has_broken_dash_S = bool(int(stdout.strip())) - -# In order to be more robust in the face of system Pythons, we want to -# run without site-packages loaded. This is somewhat tricky, in -# particular because Python 2.6's distutils imports site, so starting -# with the -S flag is not sufficient. However, we'll start with that: -if not has_broken_dash_S and 'site' in sys.modules: - # We will restart with python -S. - args = sys.argv[:] - args[0:0] = [sys.executable, '-S'] - args = map(quote, args) - os.execv(sys.executable, args) -# Now we are running with -S. We'll get the clean sys.path, import site -# because distutils will do it later, and then reset the path and clean -# out any namespace packages from site-packages that might have been -# loaded by .pth files. -clean_path = sys.path[:] -import site -sys.path[:] = clean_path -for k, v in sys.modules.items(): - if k in ('setuptools', 'pkg_resources') or ( - hasattr(v, '__path__') and - len(v.__path__)==1 and - not os.path.exists(os.path.join(v.__path__[0],'__init__.py'))): - # This is a namespace package. Remove it. - sys.modules.pop(k) - -is_jython = sys.platform.startswith('java') - -setuptools_source = 'http://peak.telecommunity.com/dist/ez_setup.py' -distribute_source = 'http://python-distribute.org/distribute_setup.py' - -# parsing arguments -def normalize_to_url(option, opt_str, value, parser): - if value: - if '://' not in value: # It doesn't smell like a URL. - value = 'file://%s' % ( - urllib.pathname2url( - os.path.abspath(os.path.expanduser(value))),) - if opt_str == '--download-base' and not value.endswith('/'): - # Download base needs a trailing slash to make the world happy. - value += '/' - else: - value = None - name = opt_str[2:].replace('-', '_') - setattr(parser.values, name, value) - -usage = '''\ -[DESIRED PYTHON FOR BUILDOUT] bootstrap.py [options] - -Bootstraps a buildout-based project. - -Simply run this script in a directory containing a buildout.cfg, using the -Python that you want bin/buildout to use. - -Note that by using --setup-source and --download-base to point to -local resources, you can keep this script from going over the network. -''' - -parser = OptionParser(usage=usage) -parser.add_option("-v", "--version", dest="version", - help="use a specific zc.buildout version") -parser.add_option("-d", "--distribute", - action="store_true", dest="use_distribute", default=False, - help="Use Distribute rather than Setuptools.") -parser.add_option("--setup-source", action="callback", dest="setup_source", - callback=normalize_to_url, nargs=1, type="string", - help=("Specify a URL or file location for the setup file. " - "If you use Setuptools, this will default to " + - setuptools_source + "; if you use Distribute, this " - "will default to " + distribute_source +".")) -parser.add_option("--download-base", action="callback", dest="download_base", - callback=normalize_to_url, nargs=1, type="string", - help=("Specify a URL or directory for downloading " - "zc.buildout and either Setuptools or Distribute. " - "Defaults to PyPI.")) -parser.add_option("--eggs", - help=("Specify a directory for storing eggs. Defaults to " - "a temporary directory that is deleted when the " - "bootstrap script completes.")) -parser.add_option("-t", "--accept-buildout-test-releases", - dest='accept_buildout_test_releases', - action="store_true", default=False, - help=("Normally, if you do not specify a --version, the " - "bootstrap script and buildout gets the newest " - "*final* versions of zc.buildout and its recipes and " - "extensions for you. If you use this flag, " - "bootstrap and buildout will get the newest releases " - "even if they are alphas or betas.")) -parser.add_option("-c", None, action="store", dest="config_file", - help=("Specify the path to the buildout configuration " - "file to be used.")) - -options, args = parser.parse_args() - -# if -c was provided, we push it back into args for buildout's main function -if options.config_file is not None: - args += ['-c', options.config_file] - -if options.eggs: - eggs_dir = os.path.abspath(os.path.expanduser(options.eggs)) -else: - eggs_dir = tempfile.mkdtemp() - -if options.setup_source is None: - if options.use_distribute: - options.setup_source = distribute_source - else: - options.setup_source = setuptools_source - -if options.accept_buildout_test_releases: - args.append('buildout:accept-buildout-test-releases=true') -args.append('bootstrap') - -try: - import pkg_resources - import setuptools # A flag. Sometimes pkg_resources is installed alone. - if not hasattr(pkg_resources, '_distribute'): - raise ImportError -except ImportError: - ez_code = urllib2.urlopen( - options.setup_source).read().replace('\r\n', '\n') - ez = {} - exec ez_code in ez - setup_args = dict(to_dir=eggs_dir, download_delay=0) - if options.download_base: - setup_args['download_base'] = options.download_base - if options.use_distribute: - setup_args['no_fake'] = True - ez['use_setuptools'](**setup_args) - if 'pkg_resources' in sys.modules: - reload(sys.modules['pkg_resources']) - import pkg_resources - # This does not (always?) update the default working set. We will - # do it. - for path in sys.path: - if path not in pkg_resources.working_set.entries: - pkg_resources.working_set.add_entry(path) - -cmd = [quote(sys.executable), - '-c', - quote('from setuptools.command.easy_install import main; main()'), - '-mqNxd', - quote(eggs_dir)] - -if not has_broken_dash_S: - cmd.insert(1, '-S') - -find_links = options.download_base -if not find_links: - find_links = os.environ.get('bootstrap-testing-find-links') -if find_links: - cmd.extend(['-f', quote(find_links)]) - -if options.use_distribute: - setup_requirement = 'distribute' -else: - setup_requirement = 'setuptools' -ws = pkg_resources.working_set -setup_requirement_path = ws.find( - pkg_resources.Requirement.parse(setup_requirement)).location -env = dict( - os.environ, - PYTHONPATH=setup_requirement_path) - -requirement = 'zc.buildout' -version = options.version -if version is None and not options.accept_buildout_test_releases: - # Figure out the most recent final version of zc.buildout. - import setuptools.package_index - _final_parts = '*final-', '*final' - def _final_version(parsed_version): - for part in parsed_version: - if (part[:1] == '*') and (part not in _final_parts): - return False - return True - index = setuptools.package_index.PackageIndex( - search_path=[setup_requirement_path]) - if find_links: - index.add_find_links((find_links,)) - req = pkg_resources.Requirement.parse(requirement) - if index.obtain(req) is not None: - best = [] - bestv = None - for dist in index[req.project_name]: - distv = dist.parsed_version - if _final_version(distv): - if bestv is None or distv > bestv: - best = [dist] - bestv = distv - elif distv == bestv: - best.append(dist) - if best: - best.sort() - version = best[-1].version -if version: - requirement = '=='.join((requirement, version)) -cmd.append(requirement) - -if is_jython: - import subprocess - exitcode = subprocess.Popen(cmd, env=env).wait() -else: # Windows prefers this, apparently; otherwise we would prefer subprocess - exitcode = os.spawnle(*([os.P_WAIT, sys.executable] + cmd + [env])) -if exitcode != 0: - sys.stdout.flush() - sys.stderr.flush() - print ("An error occurred when trying to install zc.buildout. " - "Look above this message for any errors that " - "were output by easy_install.") - sys.exit(exitcode) - -ws.add_entry(eggs_dir) -ws.require(requirement) -import zc.buildout.buildout -zc.buildout.buildout.main(args) -if not options.eggs: # clean up temporary egg directory - shutil.rmtree(eggs_dir) diff --git a/doc/groktut/the_rules_of_persistence/setup.py b/doc/groktut/the_rules_of_persistence/setup.py deleted file mode 100644 index 4f10c5b..0000000 --- a/doc/groktut/the_rules_of_persistence/setup.py +++ /dev/null @@ -1,36 +0,0 @@ -from setuptools import setup, find_packages - -version = '0.0' - -setup(name='Sample', - version=version, - description="", - long_description="""\ -""", - # Get strings from http://www.python.org/pypi?%3Aaction=list_classifiers - classifiers=[], - keywords="", - author="", - author_email="", - url="", - license="", - package_dir={'': 'src'}, - packages=find_packages('src'), - include_package_data=True, - zip_safe=False, - install_requires=['setuptools', - 'grok', - 'grokui.admin', - 'z3c.testsetup', - 'grokcore.startup', - # Add extra requirements here - ], - entry_points = """ - [console_scripts] - sample-debug = grokcore.startup:interactive_debug_prompt - sample-ctl = grokcore.startup:zdaemon_controller - [paste.app_factory] - main = grokcore.startup:application_factory - debug = grokcore.startup:debug_application_factory - """, - ) diff --git a/doc/groktut/the_rules_of_persistence2/bootstrap.py b/doc/groktut/the_rules_of_persistence2/bootstrap.py deleted file mode 100644 index 5f2cb08..0000000 --- a/doc/groktut/the_rules_of_persistence2/bootstrap.py +++ /dev/null @@ -1,260 +0,0 @@ -############################################################################## -# -# Copyright (c) 2006 Zope Foundation 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. -""" - -import os, shutil, sys, tempfile, textwrap, urllib, urllib2, subprocess -from optparse import OptionParser - -if sys.platform == 'win32': - def quote(c): - if ' ' in c: - return '"%s"' % c # work around spawn lamosity on windows - else: - return c -else: - quote = str - -# See zc.buildout.easy_install._has_broken_dash_S for motivation and comments. -stdout, stderr = subprocess.Popen( - [sys.executable, '-Sc', - 'try:\n' - ' import ConfigParser\n' - 'except ImportError:\n' - ' print 1\n' - 'else:\n' - ' print 0\n'], - stdout=subprocess.PIPE, stderr=subprocess.PIPE).communicate() -has_broken_dash_S = bool(int(stdout.strip())) - -# In order to be more robust in the face of system Pythons, we want to -# run without site-packages loaded. This is somewhat tricky, in -# particular because Python 2.6's distutils imports site, so starting -# with the -S flag is not sufficient. However, we'll start with that: -if not has_broken_dash_S and 'site' in sys.modules: - # We will restart with python -S. - args = sys.argv[:] - args[0:0] = [sys.executable, '-S'] - args = map(quote, args) - os.execv(sys.executable, args) -# Now we are running with -S. We'll get the clean sys.path, import site -# because distutils will do it later, and then reset the path and clean -# out any namespace packages from site-packages that might have been -# loaded by .pth files. -clean_path = sys.path[:] -import site -sys.path[:] = clean_path -for k, v in sys.modules.items(): - if k in ('setuptools', 'pkg_resources') or ( - hasattr(v, '__path__') and - len(v.__path__)==1 and - not os.path.exists(os.path.join(v.__path__[0],'__init__.py'))): - # This is a namespace package. Remove it. - sys.modules.pop(k) - -is_jython = sys.platform.startswith('java') - -setuptools_source = 'http://peak.telecommunity.com/dist/ez_setup.py' -distribute_source = 'http://python-distribute.org/distribute_setup.py' - -# parsing arguments -def normalize_to_url(option, opt_str, value, parser): - if value: - if '://' not in value: # It doesn't smell like a URL. - value = 'file://%s' % ( - urllib.pathname2url( - os.path.abspath(os.path.expanduser(value))),) - if opt_str == '--download-base' and not value.endswith('/'): - # Download base needs a trailing slash to make the world happy. - value += '/' - else: - value = None - name = opt_str[2:].replace('-', '_') - setattr(parser.values, name, value) - -usage = '''\ -[DESIRED PYTHON FOR BUILDOUT] bootstrap.py [options] - -Bootstraps a buildout-based project. - -Simply run this script in a directory containing a buildout.cfg, using the -Python that you want bin/buildout to use. - -Note that by using --setup-source and --download-base to point to -local resources, you can keep this script from going over the network. -''' - -parser = OptionParser(usage=usage) -parser.add_option("-v", "--version", dest="version", - help="use a specific zc.buildout version") -parser.add_option("-d", "--distribute", - action="store_true", dest="use_distribute", default=False, - help="Use Distribute rather than Setuptools.") -parser.add_option("--setup-source", action="callback", dest="setup_source", - callback=normalize_to_url, nargs=1, type="string", - help=("Specify a URL or file location for the setup file. " - "If you use Setuptools, this will default to " + - setuptools_source + "; if you use Distribute, this " - "will default to " + distribute_source +".")) -parser.add_option("--download-base", action="callback", dest="download_base", - callback=normalize_to_url, nargs=1, type="string", - help=("Specify a URL or directory for downloading " - "zc.buildout and either Setuptools or Distribute. " - "Defaults to PyPI.")) -parser.add_option("--eggs", - help=("Specify a directory for storing eggs. Defaults to " - "a temporary directory that is deleted when the " - "bootstrap script completes.")) -parser.add_option("-t", "--accept-buildout-test-releases", - dest='accept_buildout_test_releases', - action="store_true", default=False, - help=("Normally, if you do not specify a --version, the " - "bootstrap script and buildout gets the newest " - "*final* versions of zc.buildout and its recipes and " - "extensions for you. If you use this flag, " - "bootstrap and buildout will get the newest releases " - "even if they are alphas or betas.")) -parser.add_option("-c", None, action="store", dest="config_file", - help=("Specify the path to the buildout configuration " - "file to be used.")) - -options, args = parser.parse_args() - -# if -c was provided, we push it back into args for buildout's main function -if options.config_file is not None: - args += ['-c', options.config_file] - -if options.eggs: - eggs_dir = os.path.abspath(os.path.expanduser(options.eggs)) -else: - eggs_dir = tempfile.mkdtemp() - -if options.setup_source is None: - if options.use_distribute: - options.setup_source = distribute_source - else: - options.setup_source = setuptools_source - -if options.accept_buildout_test_releases: - args.append('buildout:accept-buildout-test-releases=true') -args.append('bootstrap') - -try: - import pkg_resources - import setuptools # A flag. Sometimes pkg_resources is installed alone. - if not hasattr(pkg_resources, '_distribute'): - raise ImportError -except ImportError: - ez_code = urllib2.urlopen( - options.setup_source).read().replace('\r\n', '\n') - ez = {} - exec ez_code in ez - setup_args = dict(to_dir=eggs_dir, download_delay=0) - if options.download_base: - setup_args['download_base'] = options.download_base - if options.use_distribute: - setup_args['no_fake'] = True - ez['use_setuptools'](**setup_args) - if 'pkg_resources' in sys.modules: - reload(sys.modules['pkg_resources']) - import pkg_resources - # This does not (always?) update the default working set. We will - # do it. - for path in sys.path: - if path not in pkg_resources.working_set.entries: - pkg_resources.working_set.add_entry(path) - -cmd = [quote(sys.executable), - '-c', - quote('from setuptools.command.easy_install import main; main()'), - '-mqNxd', - quote(eggs_dir)] - -if not has_broken_dash_S: - cmd.insert(1, '-S') - -find_links = options.download_base -if not find_links: - find_links = os.environ.get('bootstrap-testing-find-links') -if find_links: - cmd.extend(['-f', quote(find_links)]) - -if options.use_distribute: - setup_requirement = 'distribute' -else: - setup_requirement = 'setuptools' -ws = pkg_resources.working_set -setup_requirement_path = ws.find( - pkg_resources.Requirement.parse(setup_requirement)).location -env = dict( - os.environ, - PYTHONPATH=setup_requirement_path) - -requirement = 'zc.buildout' -version = options.version -if version is None and not options.accept_buildout_test_releases: - # Figure out the most recent final version of zc.buildout. - import setuptools.package_index - _final_parts = '*final-', '*final' - def _final_version(parsed_version): - for part in parsed_version: - if (part[:1] == '*') and (part not in _final_parts): - return False - return True - index = setuptools.package_index.PackageIndex( - search_path=[setup_requirement_path]) - if find_links: - index.add_find_links((find_links,)) - req = pkg_resources.Requirement.parse(requirement) - if index.obtain(req) is not None: - best = [] - bestv = None - for dist in index[req.project_name]: - distv = dist.parsed_version - if _final_version(distv): - if bestv is None or distv > bestv: - best = [dist] - bestv = distv - elif distv == bestv: - best.append(dist) - if best: - best.sort() - version = best[-1].version -if version: - requirement = '=='.join((requirement, version)) -cmd.append(requirement) - -if is_jython: - import subprocess - exitcode = subprocess.Popen(cmd, env=env).wait() -else: # Windows prefers this, apparently; otherwise we would prefer subprocess - exitcode = os.spawnle(*([os.P_WAIT, sys.executable] + cmd + [env])) -if exitcode != 0: - sys.stdout.flush() - sys.stderr.flush() - print ("An error occurred when trying to install zc.buildout. " - "Look above this message for any errors that " - "were output by easy_install.") - sys.exit(exitcode) - -ws.add_entry(eggs_dir) -ws.require(requirement) -import zc.buildout.buildout -zc.buildout.buildout.main(args) -if not options.eggs: # clean up temporary egg directory - shutil.rmtree(eggs_dir) diff --git a/doc/groktut/the_rules_of_persistence2/setup.py b/doc/groktut/the_rules_of_persistence2/setup.py deleted file mode 100644 index 4f10c5b..0000000 --- a/doc/groktut/the_rules_of_persistence2/setup.py +++ /dev/null @@ -1,36 +0,0 @@ -from setuptools import setup, find_packages - -version = '0.0' - -setup(name='Sample', - version=version, - description="", - long_description="""\ -""", - # Get strings from http://www.python.org/pypi?%3Aaction=list_classifiers - classifiers=[], - keywords="", - author="", - author_email="", - url="", - license="", - package_dir={'': 'src'}, - packages=find_packages('src'), - include_package_data=True, - zip_safe=False, - install_requires=['setuptools', - 'grok', - 'grokui.admin', - 'z3c.testsetup', - 'grokcore.startup', - # Add extra requirements here - ], - entry_points = """ - [console_scripts] - sample-debug = grokcore.startup:interactive_debug_prompt - sample-ctl = grokcore.startup:zdaemon_controller - [paste.app_factory] - main = grokcore.startup:application_factory - debug = grokcore.startup:debug_application_factory - """, - ) diff --git a/doc/groktut/the_rules_of_persistence3/bootstrap.py b/doc/groktut/the_rules_of_persistence3/bootstrap.py deleted file mode 100644 index 5f2cb08..0000000 --- a/doc/groktut/the_rules_of_persistence3/bootstrap.py +++ /dev/null @@ -1,260 +0,0 @@ -############################################################################## -# -# Copyright (c) 2006 Zope Foundation 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. -""" - -import os, shutil, sys, tempfile, textwrap, urllib, urllib2, subprocess -from optparse import OptionParser - -if sys.platform == 'win32': - def quote(c): - if ' ' in c: - return '"%s"' % c # work around spawn lamosity on windows - else: - return c -else: - quote = str - -# See zc.buildout.easy_install._has_broken_dash_S for motivation and comments. -stdout, stderr = subprocess.Popen( - [sys.executable, '-Sc', - 'try:\n' - ' import ConfigParser\n' - 'except ImportError:\n' - ' print 1\n' - 'else:\n' - ' print 0\n'], - stdout=subprocess.PIPE, stderr=subprocess.PIPE).communicate() -has_broken_dash_S = bool(int(stdout.strip())) - -# In order to be more robust in the face of system Pythons, we want to -# run without site-packages loaded. This is somewhat tricky, in -# particular because Python 2.6's distutils imports site, so starting -# with the -S flag is not sufficient. However, we'll start with that: -if not has_broken_dash_S and 'site' in sys.modules: - # We will restart with python -S. - args = sys.argv[:] - args[0:0] = [sys.executable, '-S'] - args = map(quote, args) - os.execv(sys.executable, args) -# Now we are running with -S. We'll get the clean sys.path, import site -# because distutils will do it later, and then reset the path and clean -# out any namespace packages from site-packages that might have been -# loaded by .pth files. -clean_path = sys.path[:] -import site -sys.path[:] = clean_path -for k, v in sys.modules.items(): - if k in ('setuptools', 'pkg_resources') or ( - hasattr(v, '__path__') and - len(v.__path__)==1 and - not os.path.exists(os.path.join(v.__path__[0],'__init__.py'))): - # This is a namespace package. Remove it. - sys.modules.pop(k) - -is_jython = sys.platform.startswith('java') - -setuptools_source = 'http://peak.telecommunity.com/dist/ez_setup.py' -distribute_source = 'http://python-distribute.org/distribute_setup.py' - -# parsing arguments -def normalize_to_url(option, opt_str, value, parser): - if value: - if '://' not in value: # It doesn't smell like a URL. - value = 'file://%s' % ( - urllib.pathname2url( - os.path.abspath(os.path.expanduser(value))),) - if opt_str == '--download-base' and not value.endswith('/'): - # Download base needs a trailing slash to make the world happy. - value += '/' - else: - value = None - name = opt_str[2:].replace('-', '_') - setattr(parser.values, name, value) - -usage = '''\ -[DESIRED PYTHON FOR BUILDOUT] bootstrap.py [options] - -Bootstraps a buildout-based project. - -Simply run this script in a directory containing a buildout.cfg, using the -Python that you want bin/buildout to use. - -Note that by using --setup-source and --download-base to point to -local resources, you can keep this script from going over the network. -''' - -parser = OptionParser(usage=usage) -parser.add_option("-v", "--version", dest="version", - help="use a specific zc.buildout version") -parser.add_option("-d", "--distribute", - action="store_true", dest="use_distribute", default=False, - help="Use Distribute rather than Setuptools.") -parser.add_option("--setup-source", action="callback", dest="setup_source", - callback=normalize_to_url, nargs=1, type="string", - help=("Specify a URL or file location for the setup file. " - "If you use Setuptools, this will default to " + - setuptools_source + "; if you use Distribute, this " - "will default to " + distribute_source +".")) -parser.add_option("--download-base", action="callback", dest="download_base", - callback=normalize_to_url, nargs=1, type="string", - help=("Specify a URL or directory for downloading " - "zc.buildout and either Setuptools or Distribute. " - "Defaults to PyPI.")) -parser.add_option("--eggs", - help=("Specify a directory for storing eggs. Defaults to " - "a temporary directory that is deleted when the " - "bootstrap script completes.")) -parser.add_option("-t", "--accept-buildout-test-releases", - dest='accept_buildout_test_releases', - action="store_true", default=False, - help=("Normally, if you do not specify a --version, the " - "bootstrap script and buildout gets the newest " - "*final* versions of zc.buildout and its recipes and " - "extensions for you. If you use this flag, " - "bootstrap and buildout will get the newest releases " - "even if they are alphas or betas.")) -parser.add_option("-c", None, action="store", dest="config_file", - help=("Specify the path to the buildout configuration " - "file to be used.")) - -options, args = parser.parse_args() - -# if -c was provided, we push it back into args for buildout's main function -if options.config_file is not None: - args += ['-c', options.config_file] - -if options.eggs: - eggs_dir = os.path.abspath(os.path.expanduser(options.eggs)) -else: - eggs_dir = tempfile.mkdtemp() - -if options.setup_source is None: - if options.use_distribute: - options.setup_source = distribute_source - else: - options.setup_source = setuptools_source - -if options.accept_buildout_test_releases: - args.append('buildout:accept-buildout-test-releases=true') -args.append('bootstrap') - -try: - import pkg_resources - import setuptools # A flag. Sometimes pkg_resources is installed alone. - if not hasattr(pkg_resources, '_distribute'): - raise ImportError -except ImportError: - ez_code = urllib2.urlopen( - options.setup_source).read().replace('\r\n', '\n') - ez = {} - exec ez_code in ez - setup_args = dict(to_dir=eggs_dir, download_delay=0) - if options.download_base: - setup_args['download_base'] = options.download_base - if options.use_distribute: - setup_args['no_fake'] = True - ez['use_setuptools'](**setup_args) - if 'pkg_resources' in sys.modules: - reload(sys.modules['pkg_resources']) - import pkg_resources - # This does not (always?) update the default working set. We will - # do it. - for path in sys.path: - if path not in pkg_resources.working_set.entries: - pkg_resources.working_set.add_entry(path) - -cmd = [quote(sys.executable), - '-c', - quote('from setuptools.command.easy_install import main; main()'), - '-mqNxd', - quote(eggs_dir)] - -if not has_broken_dash_S: - cmd.insert(1, '-S') - -find_links = options.download_base -if not find_links: - find_links = os.environ.get('bootstrap-testing-find-links') -if find_links: - cmd.extend(['-f', quote(find_links)]) - -if options.use_distribute: - setup_requirement = 'distribute' -else: - setup_requirement = 'setuptools' -ws = pkg_resources.working_set -setup_requirement_path = ws.find( - pkg_resources.Requirement.parse(setup_requirement)).location -env = dict( - os.environ, - PYTHONPATH=setup_requirement_path) - -requirement = 'zc.buildout' -version = options.version -if version is None and not options.accept_buildout_test_releases: - # Figure out the most recent final version of zc.buildout. - import setuptools.package_index - _final_parts = '*final-', '*final' - def _final_version(parsed_version): - for part in parsed_version: - if (part[:1] == '*') and (part not in _final_parts): - return False - return True - index = setuptools.package_index.PackageIndex( - search_path=[setup_requirement_path]) - if find_links: - index.add_find_links((find_links,)) - req = pkg_resources.Requirement.parse(requirement) - if index.obtain(req) is not None: - best = [] - bestv = None - for dist in index[req.project_name]: - distv = dist.parsed_version - if _final_version(distv): - if bestv is None or distv > bestv: - best = [dist] - bestv = distv - elif distv == bestv: - best.append(dist) - if best: - best.sort() - version = best[-1].version -if version: - requirement = '=='.join((requirement, version)) -cmd.append(requirement) - -if is_jython: - import subprocess - exitcode = subprocess.Popen(cmd, env=env).wait() -else: # Windows prefers this, apparently; otherwise we would prefer subprocess - exitcode = os.spawnle(*([os.P_WAIT, sys.executable] + cmd + [env])) -if exitcode != 0: - sys.stdout.flush() - sys.stderr.flush() - print ("An error occurred when trying to install zc.buildout. " - "Look above this message for any errors that " - "were output by easy_install.") - sys.exit(exitcode) - -ws.add_entry(eggs_dir) -ws.require(requirement) -import zc.buildout.buildout -zc.buildout.buildout.main(args) -if not options.eggs: # clean up temporary egg directory - shutil.rmtree(eggs_dir) diff --git a/doc/groktut/the_rules_of_persistence3/setup.py b/doc/groktut/the_rules_of_persistence3/setup.py deleted file mode 100644 index 4f10c5b..0000000 --- a/doc/groktut/the_rules_of_persistence3/setup.py +++ /dev/null @@ -1,36 +0,0 @@ -from setuptools import setup, find_packages - -version = '0.0' - -setup(name='Sample', - version=version, - description="", - long_description="""\ -""", - # Get strings from http://www.python.org/pypi?%3Aaction=list_classifiers - classifiers=[], - keywords="", - author="", - author_email="", - url="", - license="", - package_dir={'': 'src'}, - packages=find_packages('src'), - include_package_data=True, - zip_safe=False, - install_requires=['setuptools', - 'grok', - 'grokui.admin', - 'z3c.testsetup', - 'grokcore.startup', - # Add extra requirements here - ], - entry_points = """ - [console_scripts] - sample-debug = grokcore.startup:interactive_debug_prompt - sample-ctl = grokcore.startup:zdaemon_controller - [paste.app_factory] - main = grokcore.startup:application_factory - debug = grokcore.startup:debug_application_factory - """, - ) diff --git a/doc/groktut/using_view_methods/bootstrap.py b/doc/groktut/using_view_methods/bootstrap.py deleted file mode 100644 index 5f2cb08..0000000 --- a/doc/groktut/using_view_methods/bootstrap.py +++ /dev/null @@ -1,260 +0,0 @@ -############################################################################## -# -# Copyright (c) 2006 Zope Foundation 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. -""" - -import os, shutil, sys, tempfile, textwrap, urllib, urllib2, subprocess -from optparse import OptionParser - -if sys.platform == 'win32': - def quote(c): - if ' ' in c: - return '"%s"' % c # work around spawn lamosity on windows - else: - return c -else: - quote = str - -# See zc.buildout.easy_install._has_broken_dash_S for motivation and comments. -stdout, stderr = subprocess.Popen( - [sys.executable, '-Sc', - 'try:\n' - ' import ConfigParser\n' - 'except ImportError:\n' - ' print 1\n' - 'else:\n' - ' print 0\n'], - stdout=subprocess.PIPE, stderr=subprocess.PIPE).communicate() -has_broken_dash_S = bool(int(stdout.strip())) - -# In order to be more robust in the face of system Pythons, we want to -# run without site-packages loaded. This is somewhat tricky, in -# particular because Python 2.6's distutils imports site, so starting -# with the -S flag is not sufficient. However, we'll start with that: -if not has_broken_dash_S and 'site' in sys.modules: - # We will restart with python -S. - args = sys.argv[:] - args[0:0] = [sys.executable, '-S'] - args = map(quote, args) - os.execv(sys.executable, args) -# Now we are running with -S. We'll get the clean sys.path, import site -# because distutils will do it later, and then reset the path and clean -# out any namespace packages from site-packages that might have been -# loaded by .pth files. -clean_path = sys.path[:] -import site -sys.path[:] = clean_path -for k, v in sys.modules.items(): - if k in ('setuptools', 'pkg_resources') or ( - hasattr(v, '__path__') and - len(v.__path__)==1 and - not os.path.exists(os.path.join(v.__path__[0],'__init__.py'))): - # This is a namespace package. Remove it. - sys.modules.pop(k) - -is_jython = sys.platform.startswith('java') - -setuptools_source = 'http://peak.telecommunity.com/dist/ez_setup.py' -distribute_source = 'http://python-distribute.org/distribute_setup.py' - -# parsing arguments -def normalize_to_url(option, opt_str, value, parser): - if value: - if '://' not in value: # It doesn't smell like a URL. - value = 'file://%s' % ( - urllib.pathname2url( - os.path.abspath(os.path.expanduser(value))),) - if opt_str == '--download-base' and not value.endswith('/'): - # Download base needs a trailing slash to make the world happy. - value += '/' - else: - value = None - name = opt_str[2:].replace('-', '_') - setattr(parser.values, name, value) - -usage = '''\ -[DESIRED PYTHON FOR BUILDOUT] bootstrap.py [options] - -Bootstraps a buildout-based project. - -Simply run this script in a directory containing a buildout.cfg, using the -Python that you want bin/buildout to use. - -Note that by using --setup-source and --download-base to point to -local resources, you can keep this script from going over the network. -''' - -parser = OptionParser(usage=usage) -parser.add_option("-v", "--version", dest="version", - help="use a specific zc.buildout version") -parser.add_option("-d", "--distribute", - action="store_true", dest="use_distribute", default=False, - help="Use Distribute rather than Setuptools.") -parser.add_option("--setup-source", action="callback", dest="setup_source", - callback=normalize_to_url, nargs=1, type="string", - help=("Specify a URL or file location for the setup file. " - "If you use Setuptools, this will default to " + - setuptools_source + "; if you use Distribute, this " - "will default to " + distribute_source +".")) -parser.add_option("--download-base", action="callback", dest="download_base", - callback=normalize_to_url, nargs=1, type="string", - help=("Specify a URL or directory for downloading " - "zc.buildout and either Setuptools or Distribute. " - "Defaults to PyPI.")) -parser.add_option("--eggs", - help=("Specify a directory for storing eggs. Defaults to " - "a temporary directory that is deleted when the " - "bootstrap script completes.")) -parser.add_option("-t", "--accept-buildout-test-releases", - dest='accept_buildout_test_releases', - action="store_true", default=False, - help=("Normally, if you do not specify a --version, the " - "bootstrap script and buildout gets the newest " - "*final* versions of zc.buildout and its recipes and " - "extensions for you. If you use this flag, " - "bootstrap and buildout will get the newest releases " - "even if they are alphas or betas.")) -parser.add_option("-c", None, action="store", dest="config_file", - help=("Specify the path to the buildout configuration " - "file to be used.")) - -options, args = parser.parse_args() - -# if -c was provided, we push it back into args for buildout's main function -if options.config_file is not None: - args += ['-c', options.config_file] - -if options.eggs: - eggs_dir = os.path.abspath(os.path.expanduser(options.eggs)) -else: - eggs_dir = tempfile.mkdtemp() - -if options.setup_source is None: - if options.use_distribute: - options.setup_source = distribute_source - else: - options.setup_source = setuptools_source - -if options.accept_buildout_test_releases: - args.append('buildout:accept-buildout-test-releases=true') -args.append('bootstrap') - -try: - import pkg_resources - import setuptools # A flag. Sometimes pkg_resources is installed alone. - if not hasattr(pkg_resources, '_distribute'): - raise ImportError -except ImportError: - ez_code = urllib2.urlopen( - options.setup_source).read().replace('\r\n', '\n') - ez = {} - exec ez_code in ez - setup_args = dict(to_dir=eggs_dir, download_delay=0) - if options.download_base: - setup_args['download_base'] = options.download_base - if options.use_distribute: - setup_args['no_fake'] = True - ez['use_setuptools'](**setup_args) - if 'pkg_resources' in sys.modules: - reload(sys.modules['pkg_resources']) - import pkg_resources - # This does not (always?) update the default working set. We will - # do it. - for path in sys.path: - if path not in pkg_resources.working_set.entries: - pkg_resources.working_set.add_entry(path) - -cmd = [quote(sys.executable), - '-c', - quote('from setuptools.command.easy_install import main; main()'), - '-mqNxd', - quote(eggs_dir)] - -if not has_broken_dash_S: - cmd.insert(1, '-S') - -find_links = options.download_base -if not find_links: - find_links = os.environ.get('bootstrap-testing-find-links') -if find_links: - cmd.extend(['-f', quote(find_links)]) - -if options.use_distribute: - setup_requirement = 'distribute' -else: - setup_requirement = 'setuptools' -ws = pkg_resources.working_set -setup_requirement_path = ws.find( - pkg_resources.Requirement.parse(setup_requirement)).location -env = dict( - os.environ, - PYTHONPATH=setup_requirement_path) - -requirement = 'zc.buildout' -version = options.version -if version is None and not options.accept_buildout_test_releases: - # Figure out the most recent final version of zc.buildout. - import setuptools.package_index - _final_parts = '*final-', '*final' - def _final_version(parsed_version): - for part in parsed_version: - if (part[:1] == '*') and (part not in _final_parts): - return False - return True - index = setuptools.package_index.PackageIndex( - search_path=[setup_requirement_path]) - if find_links: - index.add_find_links((find_links,)) - req = pkg_resources.Requirement.parse(requirement) - if index.obtain(req) is not None: - best = [] - bestv = None - for dist in index[req.project_name]: - distv = dist.parsed_version - if _final_version(distv): - if bestv is None or distv > bestv: - best = [dist] - bestv = distv - elif distv == bestv: - best.append(dist) - if best: - best.sort() - version = best[-1].version -if version: - requirement = '=='.join((requirement, version)) -cmd.append(requirement) - -if is_jython: - import subprocess - exitcode = subprocess.Popen(cmd, env=env).wait() -else: # Windows prefers this, apparently; otherwise we would prefer subprocess - exitcode = os.spawnle(*([os.P_WAIT, sys.executable] + cmd + [env])) -if exitcode != 0: - sys.stdout.flush() - sys.stderr.flush() - print ("An error occurred when trying to install zc.buildout. " - "Look above this message for any errors that " - "were output by easy_install.") - sys.exit(exitcode) - -ws.add_entry(eggs_dir) -ws.require(requirement) -import zc.buildout.buildout -zc.buildout.buildout.main(args) -if not options.eggs: # clean up temporary egg directory - shutil.rmtree(eggs_dir) diff --git a/doc/groktut/using_view_methods/setup.py b/doc/groktut/using_view_methods/setup.py deleted file mode 100644 index 4f10c5b..0000000 --- a/doc/groktut/using_view_methods/setup.py +++ /dev/null @@ -1,36 +0,0 @@ -from setuptools import setup, find_packages - -version = '0.0' - -setup(name='Sample', - version=version, - description="", - long_description="""\ -""", - # Get strings from http://www.python.org/pypi?%3Aaction=list_classifiers - classifiers=[], - keywords="", - author="", - author_email="", - url="", - license="", - package_dir={'': 'src'}, - packages=find_packages('src'), - include_package_data=True, - zip_safe=False, - install_requires=['setuptools', - 'grok', - 'grokui.admin', - 'z3c.testsetup', - 'grokcore.startup', - # Add extra requirements here - ], - entry_points = """ - [console_scripts] - sample-debug = grokcore.startup:interactive_debug_prompt - sample-ctl = grokcore.startup:zdaemon_controller - [paste.app_factory] - main = grokcore.startup:application_factory - debug = grokcore.startup:debug_application_factory - """, - ) diff --git a/doc/ACKS.txt b/docs/ACKS.txt similarity index 100% rename from doc/ACKS.txt rename to docs/ACKS.txt diff --git a/doc/Makefile b/docs/Makefile similarity index 100% rename from doc/Makefile rename to docs/Makefile diff --git a/doc/README.rst b/docs/README.rst similarity index 100% rename from doc/README.rst rename to docs/README.rst diff --git a/doc/_static/default.css b/docs/_static/default.css similarity index 100% rename from doc/_static/default.css rename to docs/_static/default.css diff --git a/doc/_static/grok.css b/docs/_static/grok.css similarity index 100% rename from doc/_static/grok.css rename to docs/_static/grok.css diff --git a/doc/_static/grok_club.gif b/docs/_static/grok_club.gif similarity index 100% rename from doc/_static/grok_club.gif rename to docs/_static/grok_club.gif diff --git a/doc/_static/logo.gif b/docs/_static/logo.gif similarity index 100% rename from doc/_static/logo.gif rename to docs/_static/logo.gif diff --git a/doc/_static/logo.png b/docs/_static/logo.png similarity index 100% rename from doc/_static/logo.png rename to docs/_static/logo.png diff --git a/doc/_static/top_bg.jpg b/docs/_static/top_bg.jpg similarity index 100% rename from doc/_static/top_bg.jpg rename to docs/_static/top_bg.jpg diff --git a/doc/bugs.rst b/docs/bugs.rst similarity index 100% rename from doc/bugs.rst rename to docs/bugs.rst diff --git a/docs/changes.rst b/docs/changes.rst new file mode 100644 index 0000000..8c85d51 --- /dev/null +++ b/docs/changes.rst @@ -0,0 +1,11 @@ +3.0.0a2 (unreleased) +-------------------- + +- Drop the following packages: + + - grokcore.rest (it is still just a dependency of some packages) + - z3c.autoinclude (it is still just a dependency of some packages) + + +3.0.0a1 (2018-01-22) +-------------------- diff --git a/doc/conf.py b/docs/conf.py similarity index 79% rename from doc/conf.py rename to docs/conf.py index 6a148f6..47c1d12 100644 --- a/doc/conf.py +++ b/docs/conf.py @@ -3,21 +3,21 @@ # Grok Reference documentation build configuration file, created by # sphinx-quickstart.py on Wed Feb 20 02:11:17 2008. # -# This file is execfile()d with the current directory set to its containing dir. +# This file is execfile()d with the current directory set to its containing +# dir. # # The contents of this file are pickled, so don't put values in the namespace -# that aren't pickleable (module imports are okay, they're removed automatically). +# that aren't pickleable (module imports are okay, they're removed +# automatically). # # All configuration values have a default value; values that are commented out # show the default value as assigned to them. -import sys -import pkg_resources +from os import path -from os import path, curdir # If your extensions are in another directory, add it here. -#sys.path.append('some/directory') +# sys.path.append('some/directory') # Note that not all possible configuration values are present in this # autogenerated file. @@ -25,20 +25,19 @@ # All configuration values have a default; values that are commented out # serve to show the default. -import sys, os # If extensions (or modules to document with autodoc) are in another directory, # add these directories to sys.path here. If the directory is relative to the # documentation root, use os.path.abspath to make it absolute, like shown here. -#sys.path.insert(0, os.path.abspath('.')) +# sys.path.insert(0, os.path.abspath('.')) -# -- General configuration ----------------------------------------------------- +# -- General configuration ---------------------------------------------------- # If your documentation needs a minimal Sphinx version, state it here. -#needs_sphinx = '1.0' +# needs_sphinx = '1.0' -# Add any Sphinx extension module names here, as strings. They can be extensions -# coming with Sphinx (named 'sphinx.ext.*') or your custom ones. +# Add any Sphinx extension module names here, as strings. They can be +# extensions coming with Sphinx (named 'sphinx.ext.*') or your custom ones. extensions = [ 'sphinx.ext.autodoc', 'sphinx.ext.coverage', @@ -62,39 +61,38 @@ # General substitutions. project = 'Official Grok' -copyright = '2006-2010, The Zope Foundation' +copyright = '2006-2023, The Zope Foundation' # The default replacements for |version| and |release|, also used in various # other places throughout the built documents. # # The short X.Y version. -version = pkg_resources.get_distribution('groktoolkit').version +version = '3.0' # The full version, including alpha/beta/rc tags. release = version -if release.endswith('dev'): - release = '%s (unreleased)' % release # There are two options for replacing |today|: either, you set today to some # non-false value, then it is used: -#today = '' +# today = '' # Else, today_fmt is used as the format for a strftime call. -#today_fmt = '%B %d, %Y' +# today_fmt = '%B %d, %Y' # List of patterns, relative to source directory, that match files and # directories to ignore when looking for source files. exclude_patterns = ['_build'] -# The reST default role (used for this markup: `text`) to use for all documents. -#default_role = None +# The reST default role (used for this markup: `text`) to use for all +# documents. +# default_role = None # If true, '()' will be appended to :func: etc. cross-reference text. -#add_function_parentheses = True +# add_function_parentheses = True # If true, the current module name will be prepended to all description # unit titles (such as .. function::). -#add_module_names = True +# add_module_names = True -# -- Options for HTML output --------------------------------------------------- +# -- Options for HTML output -------------------------------------------------- # Output file base name for HTML help builder. htmlhelp_basename = 'Grokdoc' @@ -114,64 +112,62 @@ # If not '', a 'Last updated on:' timestamp is inserted at every page bottom, # using the given strftime format. -#html_last_updated_fmt = '%b %d, %Y' +# html_last_updated_fmt = '%b %d, %Y' # If true, SmartyPants will be used to convert quotes and dashes to # typographically correct entities. -#html_use_smartypants = True +# html_use_smartypants = True # Custom sidebar templates, maps document names to template names. -#html_sidebars = {} +# html_sidebars = {} # Additional templates that should be rendered to pages, maps page names to # template names. -html_additional_pages = {'index':'docindex.template'} +html_additional_pages = {'index': 'docindex.template'} # If false, no module index is generated. -#html_domain_indices = True +# html_domain_indices = True # If false, no index is generated. -#html_use_index = True +# html_use_index = True # If true, the index is split into individual pages for each letter. -#html_split_index = False +# html_split_index = False # If true, links to the reST sources are added to the pages. -#html_show_sourcelink = True +# html_show_sourcelink = True # If true, the reST sources are included in the HTML build as _sources/. -#html_copy_source = True +# html_copy_source = True # If true, "Created using Sphinx" is shown in the HTML footer. Default is True. -#html_show_sphinx = True +# html_show_sphinx = True # If true, "(C) Copyright ..." is shown in the HTML footer. Default is True. -#html_show_copyright = True +# html_show_copyright = True # If true, an OpenSearch description file will be output, and all pages will # contain a tag referring to it. The value of this option must be the # base URL from which the finished HTML is served. -#html_use_opensearch = '' +# html_use_opensearch = '' # This is the file name suffix for HTML files (e.g. ".xhtml"). -#html_file_suffix = None +# html_file_suffix = None # Output file base name for HTML help builder. # htmlhelp_basename = 'grokdoc' -# -- Options for LaTeX output -------------------------------------------------- +# -- Options for LaTeX output ------------------------------------------------- # The paper size ('letter' or 'a4'). -#latex_paper_size = 'letter' +# latex_paper_size = 'letter' # The font size ('10pt', '11pt' or '12pt'). -#latex_font_size = '10pt' latex_font_size = '11pt' -# Grouping the document tree into LaTeX files. List of tuples -# (source start file, target name, title, author, document class [howto/manual]). -#latex_documents = [] +# Grouping the document tree into LaTeX files. List of tuples (source start +# file, target name, title, author, document class [howto/manual]). latex_documents = [ ('contents', 'grokdocs.tex', 'Grok Documentation', 'The Grok Team', 'manual'), @@ -182,20 +178,19 @@ ] # Additional stuff for the LaTeX preamble. -#latex_preamble = ' -latex_preamble = ''' +latex_preamble = r''' \usepackage{epsfig} ''' # Documents to append as an appendix to all manuals. -#latex_appendices = [] +# latex_appendices = [] # If false, no module index is generated. -#latex_domain_indices = True +# latex_domain_indices = True -# -- Options for manual page output -------------------------------------------- +# -- Options for manual page output ------------------------------------------- # One entry per manual page. List of tuples # (source start file, name, description, authors, manual section). @@ -206,4 +201,4 @@ # Example configuration for intersphinx: refer to the Python standard library. -intersphinx_mapping = {'http://docs.python.org/': None} +intersphinx_mapping = {'python': ('http://docs.python.org/', None)} diff --git a/doc/contents.rst b/docs/contents.rst similarity index 100% rename from doc/contents.rst rename to docs/contents.rst diff --git a/doc/copyright.rst b/docs/copyright.rst similarity index 100% rename from doc/copyright.rst rename to docs/copyright.rst diff --git a/doc/design/adapters.py b/docs/design/adapters.py similarity index 66% rename from doc/design/adapters.py rename to docs/design/adapters.py index 0e81fe2..11ac827 100644 --- a/doc/design/adapters.py +++ b/docs/design/adapters.py @@ -1,11 +1,20 @@ import grok -from zope.publisher.interfaces.browser import IBrowserRequest, IBrowserView -from zope.contentprovider.interfaces import IContentProvider from calc import Calculator +from zope.contentprovider.interfaces import IContentProvider +from zope.interface import Interface +from zope.publisher.interfaces.browser import IBrowserRequest +from zope.publisher.interfaces.browser import IBrowserView + + +class ISomething(Interface): + pass + class SingleAdapter(grok.Adapter): grok.context(Calculator) - grok.adapts(Calculator) # generally allowed, but not in this case, because there's already grok.context + # generally allowed, but not in this case, because there's already + # grok.context: + grok.adapts(Calculator) grok.implements(ISomething) # if this is not specified, app breaks grok.provides(ISomething) # if adapter implements more than one interface grok.name('') # this is actually the default @@ -14,7 +23,8 @@ def something(self): """self.context is automatically provided""" return self.context.foo -class CalculatorContentProvider(grok.MultiAdapter) + +class CalculatorContentProvider(grok.MultiAdapter): grok.adapts(Calculator, IBrowserRequest, IBrowserView) grok.implements(IContentProvider) diff --git a/doc/design/annotations.py b/docs/design/annotations.py similarity index 95% rename from doc/design/annotations.py rename to docs/design/annotations.py index f6b5eec..71cdaf4 100644 --- a/doc/design/annotations.py +++ b/docs/design/annotations.py @@ -1,10 +1,12 @@ import grok -from zope import interface from BTrees.OOBTree import OOTreeSet +from zope import interface + class Article(grok.Model): pass + class IComments(interface.Interface): def addComment(text): @@ -13,12 +15,13 @@ def addComment(text): def getComments(): pass + class Comments(grok.Annotation): grok.context(Article) # this is actually the default grok.implements(IComments) grok.name('annotations.Comments') # this is actually the default - def __init__(self): + def __init__(self): self.comments = OOTreeSet() def addComment(self, text): diff --git a/doc/design/container.py b/docs/design/container.py similarity index 99% rename from doc/design/container.py rename to docs/design/container.py index 766f631..a638808 100644 --- a/doc/design/container.py +++ b/docs/design/container.py @@ -1,8 +1,9 @@ import grok + class Contact(grok.Model): pass + class AddressBook(grok.App, grok.Container): pass - diff --git a/doc/design/grok_beginner.txt b/docs/design/grok_beginner.txt similarity index 100% rename from doc/design/grok_beginner.txt rename to docs/design/grok_beginner.txt diff --git a/doc/design/grok_dev.txt b/docs/design/grok_dev.txt similarity index 100% rename from doc/design/grok_dev.txt rename to docs/design/grok_dev.txt diff --git a/doc/design/menu.py b/docs/design/menu.py similarity index 82% rename from doc/design/menu.py rename to docs/design/menu.py index 518a393..948ab7c 100644 --- a/doc/design/menu.py +++ b/docs/design/menu.py @@ -34,7 +34,8 @@ Menu rendering process: - - create set of choices (apply filters in context, permissions, condition) + - create set of choices (apply filters in context, permissions, + condition) - apply (status) annotations @@ -52,7 +53,7 @@ - Is it the currently published view? - Generalisation: + Generalisation: Zope/Grok stuff: @@ -60,11 +61,11 @@ Questions: - - How to integrate with skin layers? + - How to integrate with skin layers? - Aren't menus just browser views? (context, request) - - Two variations: allow menu items to render their HTML, or not? + - Two variations: allow menu items to render their HTML, or not? Allow HTML: @@ -81,16 +82,21 @@ import grok from megrok import menu +from zope.interface import Attribute +from zope.interface import Interface + class AddressBook(grok.Model): pass + class Contact(grok.Model): pass + class EditContact(grok.EditForm): grok.context(Contact) - grok.annotation("title", _(u"Edit XY")) + grok.annotation("title", "Edit XY") layout = grok.PageTemplate("""\ @@ -110,8 +116,9 @@ class EditContact(grok.EditForm): - @@ -127,41 +134,42 @@ class EditContact(grok.EditForm): - """) + class IMenuItem(Interface): - action - title - submenu + action = Attribute() + title = Attribute() + submenu = Attribute() main = menu.Menu( - menu.View(EditContact), # Link to a view. Necessary information: context, name - # Link to a generic action/URL - menu.Action(_("External action"), "string:http://${context/"), + # Link to a view. Necessary information: context, name + menu.View(EditContact), + # Link to a generic action/URL + menu.Action("External action", "string:http://${context/"), menu.SubMenu( - menu.Item( + menu.Item())) -############ Implementation sketches +# ########### Implementation sketches class ViewMenuItem(object): def __init__(self, view): # View must be a view - + pass + class Action(object): - + def __init__(self, title, target): self.title = title self.target = target # TALES expression - def - class BaseMenuItem(object): @@ -171,8 +179,9 @@ def __init__(self, condition): def checkCondition(context, request): # - does this item apply in the given context? # - does the user have the necessary permissions - # - does the user supplied condition evalute to true? - + # - does the user supplied condition evalute to true? + pass + class Menu(object): @@ -187,6 +196,4 @@ def __call__(self, context, request): if not item.checkCondition(context, request): continue - relevant_item.append(item) - - + relevant_items.append(item) diff --git a/doc/design/model.py b/docs/design/model.py similarity index 87% rename from doc/design/model.py rename to docs/design/model.py index 8bd6648..e936bb4 100644 --- a/doc/design/model.py +++ b/docs/design/model.py @@ -2,9 +2,13 @@ Schema-driven development with grok """ import grok +import zope.schema +from zope.container.interfaces import IContainer + grok.directory('contact') + class Contact(grok.SchemaModel): """ This works now: @@ -21,8 +25,8 @@ class Contact(grok.SchemaModel): """ class fields: - name = schema.TextLine() - city = schema.TextLine() + name = zope.schema.TextLine() + city = zope.schema.TextLine() class Edit(grok.EditForm): @@ -30,15 +34,18 @@ class Edit(grok.EditForm): # this will automatically render an edit form, and use an # 'edit.html' template if available + class Index(grok.DisplayForm): pass # this will automatically render an display form, and use an # 'index.html' template if available + class Add(grok.AddForm): grok.context(Contact) # this is actually the default grok.container(IContainer) # this is actually the default + class FancyEdit(grok.EditForm): """ use cases: diff --git a/doc/design/permission.py b/docs/design/permission.py similarity index 80% rename from doc/design/permission.py rename to docs/design/permission.py index 920a6a7..705ebbe 100644 --- a/doc/design/permission.py +++ b/docs/design/permission.py @@ -1,7 +1,9 @@ import grok + grok.definepermission('grok.Complex') # define permission first + class Complex(grok.Model): # this sets the default for all methods grok.require('zope.Public') # this is actually the default @@ -13,9 +15,9 @@ class Complex(grok.Model): grok.writable('zope.Public') # this is actually the default # this overrides the above - grok.readable('grok.Complex', 'attr1') # override default - grok.readable('zope.ManageServices', 'attr2') # override default - grok.writable('zope.ManageContent', 'attr1', 'attr2') # override default + grok.readable('grok.Complex', 'attr1') # override default + grok.readable('zope.ManageServices', 'attr2') # override default + grok.writable('zope.ManageContent', 'attr1', 'attr2') # override default def __init__(self): self.attr1 = 1 @@ -29,8 +31,8 @@ def doSomethingVerySecret(self): def imPublic(self): pass + class SubClass(Complex): # it's all inherited grok.readable('zope.Public', 'attr1') - diff --git a/docs/design/skin-minimal.py b/docs/design/skin-minimal.py new file mode 100644 index 0000000..2e9e354 --- /dev/null +++ b/docs/design/skin-minimal.py @@ -0,0 +1,17 @@ +import grok + + +grok.definelayer('my') +grok.defineskin('my') # Picks up the layer 'my' if it exists + +# If there is only a single layer defined in a module, it will be the default +grok.layer('my') + + +class Painting(grok.View): + pass + + +fireplace = grok.PageTemplate("""\ + +""") diff --git a/doc/design/skin.py b/docs/design/skin.py similarity index 94% rename from doc/design/skin.py rename to docs/design/skin.py index 59459b3..e183478 100644 --- a/doc/design/skin.py +++ b/docs/design/skin.py @@ -1,5 +1,4 @@ import grok -from zope import interface grok.definelayer('my') diff --git a/doc/design/subscriber.py b/docs/design/subscriber.py similarity index 100% rename from doc/design/subscriber.py rename to docs/design/subscriber.py index 6edc126..a4de60d 100644 --- a/doc/design/subscriber.py +++ b/docs/design/subscriber.py @@ -1,6 +1,7 @@ -from zope.lifecycleevent.interfaces import IObjectModifiedEvent -from calc import Calculator import grok +from calc import Calculator +from zope.lifecycleevent.interfaces import IObjectModifiedEvent + @grok.subscriber(Calculator, IObjectModifiedEvent) def calculatorChanged(calc, event): @@ -8,4 +9,3 @@ def calculatorChanged(calc, event): # perhaps alias zope.event.notify to grok.notify??? - diff --git a/doc/design/traversal.py b/docs/design/traversal.py similarity index 67% rename from doc/design/traversal.py rename to docs/design/traversal.py index a9e4a8f..dac20d1 100644 --- a/doc/design/traversal.py +++ b/docs/design/traversal.py @@ -1,24 +1,27 @@ import grok + class Appointment(grok.Model): pass -class Day(grok.Model): + +class Year(grok.Model): def getAppointment(self, number): if number in self.appointments: return Appointment(number) - return None # try to look up views then + return None # try to look up views then def traverse(self, name): - return self.getAppointment(int(number)) - + return self.getAppointment(int(name)) + + class Calendar(grok.Model): def getYear(self, year): return Year(year) def traverse(self, name): - return self.getYear(int(number)) + return self.getYear(int(name)) # interpretation of traverse: @@ -27,7 +30,8 @@ def traverse(self, name): # * if this raises an error, propagate exception, do not swallow it (test) # * if this returns None, fall back on "normal" traversal for the - object (i.e. container traversal) +# object (i.e. container traversal) + """ http://.../calendar/2006/10/13/1/ @@ -35,7 +39,7 @@ def traverse(self, name): Cal. Year ... A. """ -#XXX routes (http://routes.groovie.org/) for advanced cases +# XXX routes (http://routes.groovie.org/) for advanced cases # instead of traverser on the model, you can also write a separate @@ -43,8 +47,8 @@ def traverse(self, name): class CalendarTraverser(grok.Traverser): grok.context(Calendar) # this is actually the default - grok.register(site=CalendarApp) #... + grok.register(site=CalendarApp) # noqa: F821 undefined name 'CalendarApp' def traverse(self, name): - now look up stuff on self.context with 'name'... - return that + # now look up stuff on self.context with 'name'... + return # that diff --git a/doc/design/utility.py b/docs/design/utility.py similarity index 65% rename from doc/design/utility.py rename to docs/design/utility.py index b68aa82..fe50e0f 100644 --- a/doc/design/utility.py +++ b/docs/design/utility.py @@ -1,31 +1,42 @@ import grok +import zope.interface + + +class ICalculator(zope.interface.Interface): + pass + class Calculator(grok.GlobalUtility): grok.implements(ICalculator) # if this is not specified, it breaks grok.name('') # this is actually the default - grok.provides(ICalculator) # this is actually the default + grok.provides(ICalculator) # this is actually the default + + +grok.global_utility(Calculator, provides=ICalculator, name=u'') -grok.global_utility(factory, provides=IFace, name=u'') -class Calculator(grok.LocalUtility): +class LocalCalculator(grok.LocalUtility): grok.utility_provides(ICalculator) + class Anything(grok.Model): pass + class NonPersistent(object): pass + class SpecialAnything(Anything): pass -class Foo(grok.Model, grok.Site): + +class Foo(grok.Model, grok.Site): grok.local_utility(Anything, hide=False, name_in_container='foo', persistent=None) grok.local_adapter() grok.local_view() + class Foo2(Foo): grok.local_utility(SpecialAnything) - - diff --git a/doc/design/views.py b/docs/design/views.py similarity index 91% rename from doc/design/views.py rename to docs/design/views.py index 84b8014..33d00cd 100644 --- a/doc/design/views.py +++ b/docs/design/views.py @@ -1,10 +1,15 @@ import grok +from zope import schema + + +# this is actually the default (from module name, calc.py) +grok.templatedir('calc_templates') -grok.templatedir('calc_templates') # this is actually the default (from module name, calc.py) class Calculator(grok.Model): pass + class Sum(grok.View): """Simple view for a model""" grok.context(Calculator) # this is actually the default (from module) @@ -15,7 +20,7 @@ class Sum(grok.View): def calculateSum(self): """you can pull this in the template through view/calculateSum""" - def update(self): + def update(self): """executed before the template is rendered""" self.sum = self.calculateSum() self.sendEmail() @@ -23,13 +28,15 @@ def update(self): def sendEmail(self): """send an email here""" + class PDFSum(grok.View): def update(self): pass def render(self): - return pdfdata + return # pdfdata + sum = grok.PageTemplate("""\

...

@@ -37,8 +44,6 @@ def render(self): """) -from zope import schema - class Index(grok.Form): """a form @@ -59,10 +64,11 @@ def calculate(self, operand, operator, operand2): # this will raise a helpful error message at startup time (encoded # strings) - @grok.action('Bääää') + @grok.action('B����') def whatever(self, **data): pass + index = grok.PageTemplate("""\

@@ -74,6 +80,7 @@ def whatever(self, **data):

""") + class CalculatorXMLRPC(grok.XMLRPC): @grok.require('zope.Public') # this is actually the default diff --git a/doc/docindex.template b/docs/docindex.template similarity index 100% rename from doc/docindex.template rename to docs/docindex.template diff --git a/doc/glossary.rst b/docs/glossary.rst similarity index 100% rename from doc/glossary.rst rename to docs/glossary.rst diff --git a/doc/grok_overview.rst b/docs/grok_overview.rst similarity index 100% rename from doc/grok_overview.rst rename to docs/grok_overview.rst diff --git a/doc/groktut/a_second_model/buildout.cfg b/docs/groktut/a_second_model/buildout.cfg similarity index 100% rename from doc/groktut/a_second_model/buildout.cfg rename to docs/groktut/a_second_model/buildout.cfg diff --git a/doc/groktut/a_second_model/etc/README.txt b/docs/groktut/a_second_model/etc/README.txt similarity index 100% rename from doc/groktut/a_second_model/etc/README.txt rename to docs/groktut/a_second_model/etc/README.txt diff --git a/doc/groktut/a_second_model/etc/debug.ini.in b/docs/groktut/a_second_model/etc/debug.ini.in similarity index 100% rename from doc/groktut/a_second_model/etc/debug.ini.in rename to docs/groktut/a_second_model/etc/debug.ini.in diff --git a/doc/groktut/a_second_model/etc/deploy.ini.in b/docs/groktut/a_second_model/etc/deploy.ini.in similarity index 100% rename from doc/groktut/a_second_model/etc/deploy.ini.in rename to docs/groktut/a_second_model/etc/deploy.ini.in diff --git a/doc/groktut/a_second_model/etc/site.zcml.in b/docs/groktut/a_second_model/etc/site.zcml.in similarity index 100% rename from doc/groktut/a_second_model/etc/site.zcml.in rename to docs/groktut/a_second_model/etc/site.zcml.in diff --git a/doc/groktut/a_second_model/etc/zope.conf.in b/docs/groktut/a_second_model/etc/zope.conf.in similarity index 100% rename from doc/groktut/a_second_model/etc/zope.conf.in rename to docs/groktut/a_second_model/etc/zope.conf.in diff --git a/doc/groktut/a_view_for_a_model/setup.py b/docs/groktut/a_second_model/setup.py similarity index 91% rename from doc/groktut/a_view_for_a_model/setup.py rename to docs/groktut/a_second_model/setup.py index 4f10c5b..3a60519 100644 --- a/doc/groktut/a_view_for_a_model/setup.py +++ b/docs/groktut/a_second_model/setup.py @@ -1,4 +1,6 @@ -from setuptools import setup, find_packages +from setuptools import find_packages +from setuptools import setup + version = '0.0' @@ -25,7 +27,7 @@ 'grokcore.startup', # Add extra requirements here ], - entry_points = """ + entry_points=""" [console_scripts] sample-debug = grokcore.startup:interactive_debug_prompt sample-ctl = grokcore.startup:zdaemon_controller diff --git a/doc/groktut/a_second_model/src/sample/__init__.py b/docs/groktut/a_second_model/src/sample/__init__.py similarity index 100% rename from doc/groktut/a_second_model/src/sample/__init__.py rename to docs/groktut/a_second_model/src/sample/__init__.py diff --git a/doc/groktut/a_second_model/src/sample/app.py b/docs/groktut/a_second_model/src/sample/app.py similarity index 97% rename from doc/groktut/a_second_model/src/sample/app.py rename to docs/groktut/a_second_model/src/sample/app.py index a52c172..18aa25f 100644 --- a/doc/groktut/a_second_model/src/sample/app.py +++ b/docs/groktut/a_second_model/src/sample/app.py @@ -1,15 +1,19 @@ import grok - + + class Sample(grok.Application, grok.Container): pass + class Another(grok.Application, grok.Model): pass + class SampleIndex(grok.View): grok.context(Sample) grok.name('index') - + + class AnotherIndex(grok.View): grok.context(Another) grok.name('index') diff --git a/doc/groktut/a_second_model/src/sample/app_templates/anotherindex.pt b/docs/groktut/a_second_model/src/sample/app_templates/anotherindex.pt similarity index 100% rename from doc/groktut/a_second_model/src/sample/app_templates/anotherindex.pt rename to docs/groktut/a_second_model/src/sample/app_templates/anotherindex.pt diff --git a/doc/groktut/a_second_model/src/sample/app_templates/sampleindex.pt b/docs/groktut/a_second_model/src/sample/app_templates/sampleindex.pt similarity index 100% rename from doc/groktut/a_second_model/src/sample/app_templates/sampleindex.pt rename to docs/groktut/a_second_model/src/sample/app_templates/sampleindex.pt diff --git a/doc/groktut/a_second_model/src/sample/configure.zcml b/docs/groktut/a_second_model/src/sample/configure.zcml similarity index 100% rename from doc/groktut/a_second_model/src/sample/configure.zcml rename to docs/groktut/a_second_model/src/sample/configure.zcml diff --git a/doc/groktut/a_second_view/buildout.cfg b/docs/groktut/a_second_view/buildout.cfg similarity index 100% rename from doc/groktut/a_second_view/buildout.cfg rename to docs/groktut/a_second_view/buildout.cfg diff --git a/doc/groktut/a_second_view/etc/README.txt b/docs/groktut/a_second_view/etc/README.txt similarity index 100% rename from doc/groktut/a_second_view/etc/README.txt rename to docs/groktut/a_second_view/etc/README.txt diff --git a/doc/groktut/a_second_view/etc/debug.ini.in b/docs/groktut/a_second_view/etc/debug.ini.in similarity index 100% rename from doc/groktut/a_second_view/etc/debug.ini.in rename to docs/groktut/a_second_view/etc/debug.ini.in diff --git a/doc/groktut/a_second_view/etc/deploy.ini.in b/docs/groktut/a_second_view/etc/deploy.ini.in similarity index 100% rename from doc/groktut/a_second_view/etc/deploy.ini.in rename to docs/groktut/a_second_view/etc/deploy.ini.in diff --git a/doc/groktut/a_second_view/etc/site.zcml.in b/docs/groktut/a_second_view/etc/site.zcml.in similarity index 100% rename from doc/groktut/a_second_view/etc/site.zcml.in rename to docs/groktut/a_second_view/etc/site.zcml.in diff --git a/doc/groktut/a_second_view/etc/zope.conf.in b/docs/groktut/a_second_view/etc/zope.conf.in similarity index 100% rename from doc/groktut/a_second_view/etc/zope.conf.in rename to docs/groktut/a_second_view/etc/zope.conf.in diff --git a/doc/groktut/a_second_view/setup.py b/docs/groktut/a_second_view/setup.py similarity index 91% rename from doc/groktut/a_second_view/setup.py rename to docs/groktut/a_second_view/setup.py index 4f10c5b..3a60519 100644 --- a/doc/groktut/a_second_view/setup.py +++ b/docs/groktut/a_second_view/setup.py @@ -1,4 +1,6 @@ -from setuptools import setup, find_packages +from setuptools import find_packages +from setuptools import setup + version = '0.0' @@ -25,7 +27,7 @@ 'grokcore.startup', # Add extra requirements here ], - entry_points = """ + entry_points=""" [console_scripts] sample-debug = grokcore.startup:interactive_debug_prompt sample-ctl = grokcore.startup:zdaemon_controller diff --git a/doc/groktut/a_second_view/src/sample/__init__.py b/docs/groktut/a_second_view/src/sample/__init__.py similarity index 100% rename from doc/groktut/a_second_view/src/sample/__init__.py rename to docs/groktut/a_second_view/src/sample/__init__.py diff --git a/doc/groktut/a_second_view/src/sample/app.py b/docs/groktut/a_second_view/src/sample/app.py similarity index 97% rename from doc/groktut/a_second_view/src/sample/app.py rename to docs/groktut/a_second_view/src/sample/app.py index 285c132..49d2cf8 100644 --- a/doc/groktut/a_second_view/src/sample/app.py +++ b/docs/groktut/a_second_view/src/sample/app.py @@ -1,11 +1,13 @@ import grok - + + class Sample(grok.Application, grok.Container): pass + class Index(grok.View): pass + class Bye(grok.View): pass - diff --git a/doc/groktut/a_second_view/src/sample/app_templates/bye.pt b/docs/groktut/a_second_view/src/sample/app_templates/bye.pt similarity index 100% rename from doc/groktut/a_second_view/src/sample/app_templates/bye.pt rename to docs/groktut/a_second_view/src/sample/app_templates/bye.pt diff --git a/doc/groktut/a_second_view/src/sample/app_templates/index.pt b/docs/groktut/a_second_view/src/sample/app_templates/index.pt similarity index 100% rename from doc/groktut/a_second_view/src/sample/app_templates/index.pt rename to docs/groktut/a_second_view/src/sample/app_templates/index.pt diff --git a/doc/groktut/a_second_view/src/sample/configure.zcml b/docs/groktut/a_second_view/src/sample/configure.zcml similarity index 100% rename from doc/groktut/a_second_view/src/sample/configure.zcml rename to docs/groktut/a_second_view/src/sample/configure.zcml diff --git a/doc/groktut/a_view_for_a_model/buildout.cfg b/docs/groktut/a_view_for_a_model/buildout.cfg similarity index 100% rename from doc/groktut/a_view_for_a_model/buildout.cfg rename to docs/groktut/a_view_for_a_model/buildout.cfg diff --git a/doc/groktut/a_view_for_a_model/etc/README.txt b/docs/groktut/a_view_for_a_model/etc/README.txt similarity index 100% rename from doc/groktut/a_view_for_a_model/etc/README.txt rename to docs/groktut/a_view_for_a_model/etc/README.txt diff --git a/doc/groktut/a_view_for_a_model/etc/debug.ini.in b/docs/groktut/a_view_for_a_model/etc/debug.ini.in similarity index 100% rename from doc/groktut/a_view_for_a_model/etc/debug.ini.in rename to docs/groktut/a_view_for_a_model/etc/debug.ini.in diff --git a/doc/groktut/a_view_for_a_model/etc/deploy.ini.in b/docs/groktut/a_view_for_a_model/etc/deploy.ini.in similarity index 100% rename from doc/groktut/a_view_for_a_model/etc/deploy.ini.in rename to docs/groktut/a_view_for_a_model/etc/deploy.ini.in diff --git a/doc/groktut/a_view_for_a_model/etc/site.zcml.in b/docs/groktut/a_view_for_a_model/etc/site.zcml.in similarity index 100% rename from doc/groktut/a_view_for_a_model/etc/site.zcml.in rename to docs/groktut/a_view_for_a_model/etc/site.zcml.in diff --git a/doc/groktut/a_view_for_a_model/etc/zope.conf.in b/docs/groktut/a_view_for_a_model/etc/zope.conf.in similarity index 100% rename from doc/groktut/a_view_for_a_model/etc/zope.conf.in rename to docs/groktut/a_view_for_a_model/etc/zope.conf.in diff --git a/doc/groktut/a_view_for_a_model2/setup.py b/docs/groktut/a_view_for_a_model/setup.py similarity index 91% rename from doc/groktut/a_view_for_a_model2/setup.py rename to docs/groktut/a_view_for_a_model/setup.py index 4f10c5b..3a60519 100644 --- a/doc/groktut/a_view_for_a_model2/setup.py +++ b/docs/groktut/a_view_for_a_model/setup.py @@ -1,4 +1,6 @@ -from setuptools import setup, find_packages +from setuptools import find_packages +from setuptools import setup + version = '0.0' @@ -25,7 +27,7 @@ 'grokcore.startup', # Add extra requirements here ], - entry_points = """ + entry_points=""" [console_scripts] sample-debug = grokcore.startup:interactive_debug_prompt sample-ctl = grokcore.startup:zdaemon_controller diff --git a/doc/groktut/a_view_for_a_model/src/sample/__init__.py b/docs/groktut/a_view_for_a_model/src/sample/__init__.py similarity index 100% rename from doc/groktut/a_view_for_a_model/src/sample/__init__.py rename to docs/groktut/a_view_for_a_model/src/sample/__init__.py diff --git a/doc/groktut/a_view_for_a_model/src/sample/app.py b/docs/groktut/a_view_for_a_model/src/sample/app.py similarity index 98% rename from doc/groktut/a_view_for_a_model/src/sample/app.py rename to docs/groktut/a_view_for_a_model/src/sample/app.py index 386f6da..4b8dff4 100644 --- a/doc/groktut/a_view_for_a_model/src/sample/app.py +++ b/docs/groktut/a_view_for_a_model/src/sample/app.py @@ -1,8 +1,10 @@ import grok + class Sample(grok.Application, grok.Container): def information(self): return "This is important information!" + class Index(grok.View): pass diff --git a/doc/groktut/a_view_for_a_model/src/sample/app_templates/index.pt b/docs/groktut/a_view_for_a_model/src/sample/app_templates/index.pt similarity index 100% rename from doc/groktut/a_view_for_a_model/src/sample/app_templates/index.pt rename to docs/groktut/a_view_for_a_model/src/sample/app_templates/index.pt diff --git a/doc/groktut/a_view_for_a_model/src/sample/configure.zcml b/docs/groktut/a_view_for_a_model/src/sample/configure.zcml similarity index 100% rename from doc/groktut/a_view_for_a_model/src/sample/configure.zcml rename to docs/groktut/a_view_for_a_model/src/sample/configure.zcml diff --git a/doc/groktut/a_view_for_a_model2/buildout.cfg b/docs/groktut/a_view_for_a_model2/buildout.cfg similarity index 100% rename from doc/groktut/a_view_for_a_model2/buildout.cfg rename to docs/groktut/a_view_for_a_model2/buildout.cfg diff --git a/doc/groktut/a_view_for_a_model2/etc/README.txt b/docs/groktut/a_view_for_a_model2/etc/README.txt similarity index 100% rename from doc/groktut/a_view_for_a_model2/etc/README.txt rename to docs/groktut/a_view_for_a_model2/etc/README.txt diff --git a/doc/groktut/a_view_for_a_model2/etc/debug.ini.in b/docs/groktut/a_view_for_a_model2/etc/debug.ini.in similarity index 100% rename from doc/groktut/a_view_for_a_model2/etc/debug.ini.in rename to docs/groktut/a_view_for_a_model2/etc/debug.ini.in diff --git a/doc/groktut/a_view_for_a_model2/etc/deploy.ini.in b/docs/groktut/a_view_for_a_model2/etc/deploy.ini.in similarity index 100% rename from doc/groktut/a_view_for_a_model2/etc/deploy.ini.in rename to docs/groktut/a_view_for_a_model2/etc/deploy.ini.in diff --git a/doc/groktut/a_view_for_a_model2/etc/site.zcml.in b/docs/groktut/a_view_for_a_model2/etc/site.zcml.in similarity index 100% rename from doc/groktut/a_view_for_a_model2/etc/site.zcml.in rename to docs/groktut/a_view_for_a_model2/etc/site.zcml.in diff --git a/doc/groktut/a_view_for_a_model2/etc/zope.conf.in b/docs/groktut/a_view_for_a_model2/etc/zope.conf.in similarity index 100% rename from doc/groktut/a_view_for_a_model2/etc/zope.conf.in rename to docs/groktut/a_view_for_a_model2/etc/zope.conf.in diff --git a/doc/groktut/a_second_model/setup.py b/docs/groktut/a_view_for_a_model2/setup.py similarity index 91% rename from doc/groktut/a_second_model/setup.py rename to docs/groktut/a_view_for_a_model2/setup.py index 4f10c5b..3a60519 100644 --- a/doc/groktut/a_second_model/setup.py +++ b/docs/groktut/a_view_for_a_model2/setup.py @@ -1,4 +1,6 @@ -from setuptools import setup, find_packages +from setuptools import find_packages +from setuptools import setup + version = '0.0' @@ -25,7 +27,7 @@ 'grokcore.startup', # Add extra requirements here ], - entry_points = """ + entry_points=""" [console_scripts] sample-debug = grokcore.startup:interactive_debug_prompt sample-ctl = grokcore.startup:zdaemon_controller diff --git a/doc/groktut/a_view_for_a_model2/src/sample/__init__.py b/docs/groktut/a_view_for_a_model2/src/sample/__init__.py similarity index 100% rename from doc/groktut/a_view_for_a_model2/src/sample/__init__.py rename to docs/groktut/a_view_for_a_model2/src/sample/__init__.py diff --git a/doc/groktut/a_view_for_a_model2/src/sample/app.py b/docs/groktut/a_view_for_a_model2/src/sample/app.py similarity index 99% rename from doc/groktut/a_view_for_a_model2/src/sample/app.py rename to docs/groktut/a_view_for_a_model2/src/sample/app.py index 794878b..1345e92 100644 --- a/doc/groktut/a_view_for_a_model2/src/sample/app.py +++ b/docs/groktut/a_view_for_a_model2/src/sample/app.py @@ -1,9 +1,11 @@ import grok + class Sample(grok.Application, grok.Container): def information(self): return "This is important information!" + class Index(grok.View): def reversed_information(self): return ''.join(reversed(self.context.information())) diff --git a/doc/groktut/a_view_for_a_model2/src/sample/app_templates/index.pt b/docs/groktut/a_view_for_a_model2/src/sample/app_templates/index.pt similarity index 100% rename from doc/groktut/a_view_for_a_model2/src/sample/app_templates/index.pt rename to docs/groktut/a_view_for_a_model2/src/sample/app_templates/index.pt diff --git a/doc/groktut/a_view_for_a_model2/src/sample/configure.zcml b/docs/groktut/a_view_for_a_model2/src/sample/configure.zcml similarity index 100% rename from doc/groktut/a_view_for_a_model2/src/sample/configure.zcml rename to docs/groktut/a_view_for_a_model2/src/sample/configure.zcml diff --git a/doc/groktut/an_empty_grok_project/buildout.cfg b/docs/groktut/an_empty_grok_project/buildout.cfg similarity index 100% rename from doc/groktut/an_empty_grok_project/buildout.cfg rename to docs/groktut/an_empty_grok_project/buildout.cfg diff --git a/doc/groktut/an_empty_grok_project/etc/README.txt b/docs/groktut/an_empty_grok_project/etc/README.txt similarity index 100% rename from doc/groktut/an_empty_grok_project/etc/README.txt rename to docs/groktut/an_empty_grok_project/etc/README.txt diff --git a/doc/groktut/an_empty_grok_project/etc/debug.ini.in b/docs/groktut/an_empty_grok_project/etc/debug.ini.in similarity index 100% rename from doc/groktut/an_empty_grok_project/etc/debug.ini.in rename to docs/groktut/an_empty_grok_project/etc/debug.ini.in diff --git a/doc/groktut/an_empty_grok_project/etc/deploy.ini.in b/docs/groktut/an_empty_grok_project/etc/deploy.ini.in similarity index 100% rename from doc/groktut/an_empty_grok_project/etc/deploy.ini.in rename to docs/groktut/an_empty_grok_project/etc/deploy.ini.in diff --git a/doc/groktut/an_empty_grok_project/etc/site.zcml.in b/docs/groktut/an_empty_grok_project/etc/site.zcml.in similarity index 100% rename from doc/groktut/an_empty_grok_project/etc/site.zcml.in rename to docs/groktut/an_empty_grok_project/etc/site.zcml.in diff --git a/doc/groktut/an_empty_grok_project/etc/zope.conf.in b/docs/groktut/an_empty_grok_project/etc/zope.conf.in similarity index 100% rename from doc/groktut/an_empty_grok_project/etc/zope.conf.in rename to docs/groktut/an_empty_grok_project/etc/zope.conf.in diff --git a/docs/groktut/an_empty_grok_project/setup.py b/docs/groktut/an_empty_grok_project/setup.py new file mode 100644 index 0000000..3a60519 --- /dev/null +++ b/docs/groktut/an_empty_grok_project/setup.py @@ -0,0 +1,38 @@ +from setuptools import find_packages +from setuptools import setup + + +version = '0.0' + +setup(name='Sample', + version=version, + description="", + long_description="""\ +""", + # Get strings from http://www.python.org/pypi?%3Aaction=list_classifiers + classifiers=[], + keywords="", + author="", + author_email="", + url="", + license="", + package_dir={'': 'src'}, + packages=find_packages('src'), + include_package_data=True, + zip_safe=False, + install_requires=['setuptools', + 'grok', + 'grokui.admin', + 'z3c.testsetup', + 'grokcore.startup', + # Add extra requirements here + ], + entry_points=""" + [console_scripts] + sample-debug = grokcore.startup:interactive_debug_prompt + sample-ctl = grokcore.startup:zdaemon_controller + [paste.app_factory] + main = grokcore.startup:application_factory + debug = grokcore.startup:debug_application_factory + """, + ) diff --git a/doc/groktut/an_empty_grok_project/src/sample/__init__.py b/docs/groktut/an_empty_grok_project/src/sample/__init__.py similarity index 100% rename from doc/groktut/an_empty_grok_project/src/sample/__init__.py rename to docs/groktut/an_empty_grok_project/src/sample/__init__.py diff --git a/doc/groktut/template/src/sample/app.py b/docs/groktut/an_empty_grok_project/src/sample/app.py similarity index 69% rename from doc/groktut/template/src/sample/app.py rename to docs/groktut/an_empty_grok_project/src/sample/app.py index 98a80d7..862265b 100644 --- a/doc/groktut/template/src/sample/app.py +++ b/docs/groktut/an_empty_grok_project/src/sample/app.py @@ -1,7 +1,9 @@ import grok + class Sample(grok.Application, grok.Container): pass + class Index(grok.View): - pass # see app_templates/index.pt + pass # see app_templates/index.pt diff --git a/doc/groktut/an_empty_grok_project/src/sample/app.txt b/docs/groktut/an_empty_grok_project/src/sample/app.txt similarity index 100% rename from doc/groktut/an_empty_grok_project/src/sample/app.txt rename to docs/groktut/an_empty_grok_project/src/sample/app.txt diff --git a/doc/groktut/an_empty_grok_project/src/sample/app_templates/index.pt b/docs/groktut/an_empty_grok_project/src/sample/app_templates/index.pt similarity index 100% rename from doc/groktut/an_empty_grok_project/src/sample/app_templates/index.pt rename to docs/groktut/an_empty_grok_project/src/sample/app_templates/index.pt diff --git a/doc/groktut/an_empty_grok_project/src/sample/configure.zcml b/docs/groktut/an_empty_grok_project/src/sample/configure.zcml similarity index 100% rename from doc/groktut/an_empty_grok_project/src/sample/configure.zcml rename to docs/groktut/an_empty_grok_project/src/sample/configure.zcml diff --git a/doc/groktut/an_empty_grok_project/src/sample/ftesting.zcml b/docs/groktut/an_empty_grok_project/src/sample/ftesting.zcml similarity index 100% rename from doc/groktut/an_empty_grok_project/src/sample/ftesting.zcml rename to docs/groktut/an_empty_grok_project/src/sample/ftesting.zcml diff --git a/doc/groktut/an_empty_grok_project/src/sample/static/README.txt b/docs/groktut/an_empty_grok_project/src/sample/static/README.txt similarity index 100% rename from doc/groktut/an_empty_grok_project/src/sample/static/README.txt rename to docs/groktut/an_empty_grok_project/src/sample/static/README.txt diff --git a/doc/groktut/publishing_a_simple_web_page/src/sample/tests.py b/docs/groktut/an_empty_grok_project/src/sample/tests.py similarity index 94% rename from doc/groktut/publishing_a_simple_web_page/src/sample/tests.py rename to docs/groktut/an_empty_grok_project/src/sample/tests.py index debea0c..00d7ba9 100644 --- a/doc/groktut/publishing_a_simple_web_page/src/sample/tests.py +++ b/docs/groktut/an_empty_grok_project/src/sample/tests.py @@ -1,8 +1,7 @@ -import os.path +import sample import z3c.testsetup from zope.app.wsgi.testlayer import BrowserLayer -import sample browser_layer = BrowserLayer(sample) diff --git a/doc/groktut/completely_python_driven_views/buildout.cfg b/docs/groktut/completely_python_driven_views/buildout.cfg similarity index 100% rename from doc/groktut/completely_python_driven_views/buildout.cfg rename to docs/groktut/completely_python_driven_views/buildout.cfg diff --git a/doc/groktut/completely_python_driven_views/etc/README.txt b/docs/groktut/completely_python_driven_views/etc/README.txt similarity index 100% rename from doc/groktut/completely_python_driven_views/etc/README.txt rename to docs/groktut/completely_python_driven_views/etc/README.txt diff --git a/doc/groktut/completely_python_driven_views/etc/debug.ini.in b/docs/groktut/completely_python_driven_views/etc/debug.ini.in similarity index 100% rename from doc/groktut/completely_python_driven_views/etc/debug.ini.in rename to docs/groktut/completely_python_driven_views/etc/debug.ini.in diff --git a/doc/groktut/completely_python_driven_views/etc/deploy.ini.in b/docs/groktut/completely_python_driven_views/etc/deploy.ini.in similarity index 100% rename from doc/groktut/completely_python_driven_views/etc/deploy.ini.in rename to docs/groktut/completely_python_driven_views/etc/deploy.ini.in diff --git a/doc/groktut/completely_python_driven_views/etc/site.zcml.in b/docs/groktut/completely_python_driven_views/etc/site.zcml.in similarity index 100% rename from doc/groktut/completely_python_driven_views/etc/site.zcml.in rename to docs/groktut/completely_python_driven_views/etc/site.zcml.in diff --git a/doc/groktut/completely_python_driven_views/etc/zope.conf.in b/docs/groktut/completely_python_driven_views/etc/zope.conf.in similarity index 100% rename from doc/groktut/completely_python_driven_views/etc/zope.conf.in rename to docs/groktut/completely_python_driven_views/etc/zope.conf.in diff --git a/docs/groktut/completely_python_driven_views/setup.py b/docs/groktut/completely_python_driven_views/setup.py new file mode 100644 index 0000000..3a60519 --- /dev/null +++ b/docs/groktut/completely_python_driven_views/setup.py @@ -0,0 +1,38 @@ +from setuptools import find_packages +from setuptools import setup + + +version = '0.0' + +setup(name='Sample', + version=version, + description="", + long_description="""\ +""", + # Get strings from http://www.python.org/pypi?%3Aaction=list_classifiers + classifiers=[], + keywords="", + author="", + author_email="", + url="", + license="", + package_dir={'': 'src'}, + packages=find_packages('src'), + include_package_data=True, + zip_safe=False, + install_requires=['setuptools', + 'grok', + 'grokui.admin', + 'z3c.testsetup', + 'grokcore.startup', + # Add extra requirements here + ], + entry_points=""" + [console_scripts] + sample-debug = grokcore.startup:interactive_debug_prompt + sample-ctl = grokcore.startup:zdaemon_controller + [paste.app_factory] + main = grokcore.startup:application_factory + debug = grokcore.startup:debug_application_factory + """, + ) diff --git a/doc/groktut/completely_python_driven_views/src/sample/__init__.py b/docs/groktut/completely_python_driven_views/src/sample/__init__.py similarity index 100% rename from doc/groktut/completely_python_driven_views/src/sample/__init__.py rename to docs/groktut/completely_python_driven_views/src/sample/__init__.py diff --git a/doc/groktut/completely_python_driven_views/src/sample/app.py b/docs/groktut/completely_python_driven_views/src/sample/app.py similarity index 98% rename from doc/groktut/completely_python_driven_views/src/sample/app.py rename to docs/groktut/completely_python_driven_views/src/sample/app.py index 8e0ffaa..bf51717 100644 --- a/doc/groktut/completely_python_driven_views/src/sample/app.py +++ b/docs/groktut/completely_python_driven_views/src/sample/app.py @@ -1,8 +1,10 @@ import grok - + + class Sample(grok.Application, grok.Container): pass + class Index(grok.View): def render(self): return "ME GROK NO TEMPLATE" diff --git a/doc/groktut/completely_python_driven_views/src/sample/configure.zcml b/docs/groktut/completely_python_driven_views/src/sample/configure.zcml similarity index 100% rename from doc/groktut/completely_python_driven_views/src/sample/configure.zcml rename to docs/groktut/completely_python_driven_views/src/sample/configure.zcml diff --git a/doc/groktut/containers/buildout.cfg b/docs/groktut/containers/buildout.cfg similarity index 100% rename from doc/groktut/containers/buildout.cfg rename to docs/groktut/containers/buildout.cfg diff --git a/doc/groktut/containers/etc/README.txt b/docs/groktut/containers/etc/README.txt similarity index 100% rename from doc/groktut/containers/etc/README.txt rename to docs/groktut/containers/etc/README.txt diff --git a/doc/groktut/containers/etc/debug.ini.in b/docs/groktut/containers/etc/debug.ini.in similarity index 100% rename from doc/groktut/containers/etc/debug.ini.in rename to docs/groktut/containers/etc/debug.ini.in diff --git a/doc/groktut/containers/etc/deploy.ini.in b/docs/groktut/containers/etc/deploy.ini.in similarity index 100% rename from doc/groktut/containers/etc/deploy.ini.in rename to docs/groktut/containers/etc/deploy.ini.in diff --git a/doc/groktut/containers/etc/site.zcml.in b/docs/groktut/containers/etc/site.zcml.in similarity index 100% rename from doc/groktut/containers/etc/site.zcml.in rename to docs/groktut/containers/etc/site.zcml.in diff --git a/doc/groktut/containers/etc/zope.conf.in b/docs/groktut/containers/etc/zope.conf.in similarity index 100% rename from doc/groktut/containers/etc/zope.conf.in rename to docs/groktut/containers/etc/zope.conf.in diff --git a/docs/groktut/containers/setup.py b/docs/groktut/containers/setup.py new file mode 100644 index 0000000..3a60519 --- /dev/null +++ b/docs/groktut/containers/setup.py @@ -0,0 +1,38 @@ +from setuptools import find_packages +from setuptools import setup + + +version = '0.0' + +setup(name='Sample', + version=version, + description="", + long_description="""\ +""", + # Get strings from http://www.python.org/pypi?%3Aaction=list_classifiers + classifiers=[], + keywords="", + author="", + author_email="", + url="", + license="", + package_dir={'': 'src'}, + packages=find_packages('src'), + include_package_data=True, + zip_safe=False, + install_requires=['setuptools', + 'grok', + 'grokui.admin', + 'z3c.testsetup', + 'grokcore.startup', + # Add extra requirements here + ], + entry_points=""" + [console_scripts] + sample-debug = grokcore.startup:interactive_debug_prompt + sample-ctl = grokcore.startup:zdaemon_controller + [paste.app_factory] + main = grokcore.startup:application_factory + debug = grokcore.startup:debug_application_factory + """, + ) diff --git a/doc/groktut/containers/src/sample/__init__.py b/docs/groktut/containers/src/sample/__init__.py similarity index 100% rename from doc/groktut/containers/src/sample/__init__.py rename to docs/groktut/containers/src/sample/__init__.py diff --git a/doc/groktut/containers/src/sample/app.py b/docs/groktut/containers/src/sample/app.py similarity index 99% rename from doc/groktut/containers/src/sample/app.py rename to docs/groktut/containers/src/sample/app.py index 44a56b2..73a90a3 100644 --- a/doc/groktut/containers/src/sample/app.py +++ b/docs/groktut/containers/src/sample/app.py @@ -1,12 +1,15 @@ import grok + class Sample(grok.Application, grok.Container): pass + class Entry(grok.Model): def __init__(self, text): self.text = text + class SampleIndex(grok.View): grok.context(Sample) grok.name('index') @@ -16,6 +19,7 @@ def update(self, name=None, text=None): return self.context[name] = Entry(text) + class EntryIndex(grok.View): grok.context(Entry) grok.name('index') diff --git a/doc/groktut/containers/src/sample/app_templates/entryindex.pt b/docs/groktut/containers/src/sample/app_templates/entryindex.pt similarity index 100% rename from doc/groktut/containers/src/sample/app_templates/entryindex.pt rename to docs/groktut/containers/src/sample/app_templates/entryindex.pt diff --git a/doc/groktut/containers/src/sample/app_templates/sampleindex.pt b/docs/groktut/containers/src/sample/app_templates/sampleindex.pt similarity index 100% rename from doc/groktut/containers/src/sample/app_templates/sampleindex.pt rename to docs/groktut/containers/src/sample/app_templates/sampleindex.pt diff --git a/doc/groktut/containers/src/sample/configure.zcml b/docs/groktut/containers/src/sample/configure.zcml similarity index 100% rename from doc/groktut/containers/src/sample/configure.zcml rename to docs/groktut/containers/src/sample/configure.zcml diff --git a/doc/groktut/doing_some_calculation_before_viewing_a_page/buildout.cfg b/docs/groktut/doing_some_calculation_before_viewing_a_page/buildout.cfg similarity index 100% rename from doc/groktut/doing_some_calculation_before_viewing_a_page/buildout.cfg rename to docs/groktut/doing_some_calculation_before_viewing_a_page/buildout.cfg diff --git a/doc/groktut/doing_some_calculation_before_viewing_a_page/etc/README.txt b/docs/groktut/doing_some_calculation_before_viewing_a_page/etc/README.txt similarity index 100% rename from doc/groktut/doing_some_calculation_before_viewing_a_page/etc/README.txt rename to docs/groktut/doing_some_calculation_before_viewing_a_page/etc/README.txt diff --git a/doc/groktut/doing_some_calculation_before_viewing_a_page/etc/debug.ini.in b/docs/groktut/doing_some_calculation_before_viewing_a_page/etc/debug.ini.in similarity index 100% rename from doc/groktut/doing_some_calculation_before_viewing_a_page/etc/debug.ini.in rename to docs/groktut/doing_some_calculation_before_viewing_a_page/etc/debug.ini.in diff --git a/doc/groktut/doing_some_calculation_before_viewing_a_page/etc/deploy.ini.in b/docs/groktut/doing_some_calculation_before_viewing_a_page/etc/deploy.ini.in similarity index 100% rename from doc/groktut/doing_some_calculation_before_viewing_a_page/etc/deploy.ini.in rename to docs/groktut/doing_some_calculation_before_viewing_a_page/etc/deploy.ini.in diff --git a/doc/groktut/doing_some_calculation_before_viewing_a_page/etc/site.zcml.in b/docs/groktut/doing_some_calculation_before_viewing_a_page/etc/site.zcml.in similarity index 100% rename from doc/groktut/doing_some_calculation_before_viewing_a_page/etc/site.zcml.in rename to docs/groktut/doing_some_calculation_before_viewing_a_page/etc/site.zcml.in diff --git a/doc/groktut/doing_some_calculation_before_viewing_a_page/etc/zope.conf.in b/docs/groktut/doing_some_calculation_before_viewing_a_page/etc/zope.conf.in similarity index 100% rename from doc/groktut/doing_some_calculation_before_viewing_a_page/etc/zope.conf.in rename to docs/groktut/doing_some_calculation_before_viewing_a_page/etc/zope.conf.in diff --git a/docs/groktut/doing_some_calculation_before_viewing_a_page/setup.py b/docs/groktut/doing_some_calculation_before_viewing_a_page/setup.py new file mode 100644 index 0000000..3a60519 --- /dev/null +++ b/docs/groktut/doing_some_calculation_before_viewing_a_page/setup.py @@ -0,0 +1,38 @@ +from setuptools import find_packages +from setuptools import setup + + +version = '0.0' + +setup(name='Sample', + version=version, + description="", + long_description="""\ +""", + # Get strings from http://www.python.org/pypi?%3Aaction=list_classifiers + classifiers=[], + keywords="", + author="", + author_email="", + url="", + license="", + package_dir={'': 'src'}, + packages=find_packages('src'), + include_package_data=True, + zip_safe=False, + install_requires=['setuptools', + 'grok', + 'grokui.admin', + 'z3c.testsetup', + 'grokcore.startup', + # Add extra requirements here + ], + entry_points=""" + [console_scripts] + sample-debug = grokcore.startup:interactive_debug_prompt + sample-ctl = grokcore.startup:zdaemon_controller + [paste.app_factory] + main = grokcore.startup:application_factory + debug = grokcore.startup:debug_application_factory + """, + ) diff --git a/doc/groktut/doing_some_calculation_before_viewing_a_page/src/sample/__init__.py b/docs/groktut/doing_some_calculation_before_viewing_a_page/src/sample/__init__.py similarity index 100% rename from doc/groktut/doing_some_calculation_before_viewing_a_page/src/sample/__init__.py rename to docs/groktut/doing_some_calculation_before_viewing_a_page/src/sample/__init__.py diff --git a/doc/groktut/doing_some_calculation_before_viewing_a_page/src/sample/app.py b/docs/groktut/doing_some_calculation_before_viewing_a_page/src/sample/app.py similarity index 99% rename from doc/groktut/doing_some_calculation_before_viewing_a_page/src/sample/app.py rename to docs/groktut/doing_some_calculation_before_viewing_a_page/src/sample/app.py index f3b40ec..cdb66f5 100644 --- a/doc/groktut/doing_some_calculation_before_viewing_a_page/src/sample/app.py +++ b/docs/groktut/doing_some_calculation_before_viewing_a_page/src/sample/app.py @@ -1,9 +1,10 @@ import grok + class Sample(grok.Application, grok.Container): pass + class Index(grok.View): def update(self): self.alpha = 2 ** 8 - diff --git a/doc/groktut/doing_some_calculation_before_viewing_a_page/src/sample/app_templates/index.pt b/docs/groktut/doing_some_calculation_before_viewing_a_page/src/sample/app_templates/index.pt similarity index 100% rename from doc/groktut/doing_some_calculation_before_viewing_a_page/src/sample/app_templates/index.pt rename to docs/groktut/doing_some_calculation_before_viewing_a_page/src/sample/app_templates/index.pt diff --git a/doc/groktut/doing_some_calculation_before_viewing_a_page/src/sample/configure.zcml b/docs/groktut/doing_some_calculation_before_viewing_a_page/src/sample/configure.zcml similarity index 100% rename from doc/groktut/doing_some_calculation_before_viewing_a_page/src/sample/configure.zcml rename to docs/groktut/doing_some_calculation_before_viewing_a_page/src/sample/configure.zcml diff --git a/doc/groktut/explicitly_associating_a_view_with_a_model/buildout.cfg b/docs/groktut/explicitly_associating_a_view_with_a_model/buildout.cfg similarity index 100% rename from doc/groktut/explicitly_associating_a_view_with_a_model/buildout.cfg rename to docs/groktut/explicitly_associating_a_view_with_a_model/buildout.cfg diff --git a/doc/groktut/explicitly_associating_a_view_with_a_model/etc/README.txt b/docs/groktut/explicitly_associating_a_view_with_a_model/etc/README.txt similarity index 100% rename from doc/groktut/explicitly_associating_a_view_with_a_model/etc/README.txt rename to docs/groktut/explicitly_associating_a_view_with_a_model/etc/README.txt diff --git a/doc/groktut/explicitly_associating_a_view_with_a_model/etc/debug.ini.in b/docs/groktut/explicitly_associating_a_view_with_a_model/etc/debug.ini.in similarity index 100% rename from doc/groktut/explicitly_associating_a_view_with_a_model/etc/debug.ini.in rename to docs/groktut/explicitly_associating_a_view_with_a_model/etc/debug.ini.in diff --git a/doc/groktut/explicitly_associating_a_view_with_a_model/etc/deploy.ini.in b/docs/groktut/explicitly_associating_a_view_with_a_model/etc/deploy.ini.in similarity index 100% rename from doc/groktut/explicitly_associating_a_view_with_a_model/etc/deploy.ini.in rename to docs/groktut/explicitly_associating_a_view_with_a_model/etc/deploy.ini.in diff --git a/doc/groktut/explicitly_associating_a_view_with_a_model/etc/site.zcml.in b/docs/groktut/explicitly_associating_a_view_with_a_model/etc/site.zcml.in similarity index 100% rename from doc/groktut/explicitly_associating_a_view_with_a_model/etc/site.zcml.in rename to docs/groktut/explicitly_associating_a_view_with_a_model/etc/site.zcml.in diff --git a/doc/groktut/explicitly_associating_a_view_with_a_model/etc/zope.conf.in b/docs/groktut/explicitly_associating_a_view_with_a_model/etc/zope.conf.in similarity index 100% rename from doc/groktut/explicitly_associating_a_view_with_a_model/etc/zope.conf.in rename to docs/groktut/explicitly_associating_a_view_with_a_model/etc/zope.conf.in diff --git a/docs/groktut/explicitly_associating_a_view_with_a_model/setup.py b/docs/groktut/explicitly_associating_a_view_with_a_model/setup.py new file mode 100644 index 0000000..3a60519 --- /dev/null +++ b/docs/groktut/explicitly_associating_a_view_with_a_model/setup.py @@ -0,0 +1,38 @@ +from setuptools import find_packages +from setuptools import setup + + +version = '0.0' + +setup(name='Sample', + version=version, + description="", + long_description="""\ +""", + # Get strings from http://www.python.org/pypi?%3Aaction=list_classifiers + classifiers=[], + keywords="", + author="", + author_email="", + url="", + license="", + package_dir={'': 'src'}, + packages=find_packages('src'), + include_package_data=True, + zip_safe=False, + install_requires=['setuptools', + 'grok', + 'grokui.admin', + 'z3c.testsetup', + 'grokcore.startup', + # Add extra requirements here + ], + entry_points=""" + [console_scripts] + sample-debug = grokcore.startup:interactive_debug_prompt + sample-ctl = grokcore.startup:zdaemon_controller + [paste.app_factory] + main = grokcore.startup:application_factory + debug = grokcore.startup:debug_application_factory + """, + ) diff --git a/doc/groktut/explicitly_associating_a_view_with_a_model/src/sample/__init__.py b/docs/groktut/explicitly_associating_a_view_with_a_model/src/sample/__init__.py similarity index 100% rename from doc/groktut/explicitly_associating_a_view_with_a_model/src/sample/__init__.py rename to docs/groktut/explicitly_associating_a_view_with_a_model/src/sample/__init__.py diff --git a/doc/groktut/explicitly_associating_a_view_with_a_model/src/sample/app.py b/docs/groktut/explicitly_associating_a_view_with_a_model/src/sample/app.py similarity index 95% rename from doc/groktut/explicitly_associating_a_view_with_a_model/src/sample/app.py rename to docs/groktut/explicitly_associating_a_view_with_a_model/src/sample/app.py index 19bee03..cce5788 100644 --- a/doc/groktut/explicitly_associating_a_view_with_a_model/src/sample/app.py +++ b/docs/groktut/explicitly_associating_a_view_with_a_model/src/sample/app.py @@ -1,12 +1,13 @@ import grok - + + class Sample(grok.Application, grok.Container): pass + class Index(grok.View): grok.context(Sample) + class Bye(grok.View): grok.context(Sample) - - diff --git a/doc/groktut/explicitly_associating_a_view_with_a_model/src/sample/app_templates/bye.pt b/docs/groktut/explicitly_associating_a_view_with_a_model/src/sample/app_templates/bye.pt similarity index 100% rename from doc/groktut/explicitly_associating_a_view_with_a_model/src/sample/app_templates/bye.pt rename to docs/groktut/explicitly_associating_a_view_with_a_model/src/sample/app_templates/bye.pt diff --git a/doc/groktut/explicitly_associating_a_view_with_a_model/src/sample/app_templates/index.pt b/docs/groktut/explicitly_associating_a_view_with_a_model/src/sample/app_templates/index.pt similarity index 100% rename from doc/groktut/explicitly_associating_a_view_with_a_model/src/sample/app_templates/index.pt rename to docs/groktut/explicitly_associating_a_view_with_a_model/src/sample/app_templates/index.pt diff --git a/doc/groktut/explicitly_associating_a_view_with_a_model/src/sample/configure.zcml b/docs/groktut/explicitly_associating_a_view_with_a_model/src/sample/configure.zcml similarity index 100% rename from doc/groktut/explicitly_associating_a_view_with_a_model/src/sample/configure.zcml rename to docs/groktut/explicitly_associating_a_view_with_a_model/src/sample/configure.zcml diff --git a/doc/groktut/generating_html_from_python/buildout.cfg b/docs/groktut/generating_html_from_python/buildout.cfg similarity index 100% rename from doc/groktut/generating_html_from_python/buildout.cfg rename to docs/groktut/generating_html_from_python/buildout.cfg diff --git a/doc/groktut/generating_html_from_python/etc/README.txt b/docs/groktut/generating_html_from_python/etc/README.txt similarity index 100% rename from doc/groktut/generating_html_from_python/etc/README.txt rename to docs/groktut/generating_html_from_python/etc/README.txt diff --git a/doc/groktut/generating_html_from_python/etc/debug.ini.in b/docs/groktut/generating_html_from_python/etc/debug.ini.in similarity index 100% rename from doc/groktut/generating_html_from_python/etc/debug.ini.in rename to docs/groktut/generating_html_from_python/etc/debug.ini.in diff --git a/doc/groktut/generating_html_from_python/etc/deploy.ini.in b/docs/groktut/generating_html_from_python/etc/deploy.ini.in similarity index 100% rename from doc/groktut/generating_html_from_python/etc/deploy.ini.in rename to docs/groktut/generating_html_from_python/etc/deploy.ini.in diff --git a/doc/groktut/generating_html_from_python/etc/site.zcml.in b/docs/groktut/generating_html_from_python/etc/site.zcml.in similarity index 100% rename from doc/groktut/generating_html_from_python/etc/site.zcml.in rename to docs/groktut/generating_html_from_python/etc/site.zcml.in diff --git a/doc/groktut/generating_html_from_python/etc/zope.conf.in b/docs/groktut/generating_html_from_python/etc/zope.conf.in similarity index 100% rename from doc/groktut/generating_html_from_python/etc/zope.conf.in rename to docs/groktut/generating_html_from_python/etc/zope.conf.in diff --git a/docs/groktut/generating_html_from_python/setup.py b/docs/groktut/generating_html_from_python/setup.py new file mode 100644 index 0000000..3a60519 --- /dev/null +++ b/docs/groktut/generating_html_from_python/setup.py @@ -0,0 +1,38 @@ +from setuptools import find_packages +from setuptools import setup + + +version = '0.0' + +setup(name='Sample', + version=version, + description="", + long_description="""\ +""", + # Get strings from http://www.python.org/pypi?%3Aaction=list_classifiers + classifiers=[], + keywords="", + author="", + author_email="", + url="", + license="", + package_dir={'': 'src'}, + packages=find_packages('src'), + include_package_data=True, + zip_safe=False, + install_requires=['setuptools', + 'grok', + 'grokui.admin', + 'z3c.testsetup', + 'grokcore.startup', + # Add extra requirements here + ], + entry_points=""" + [console_scripts] + sample-debug = grokcore.startup:interactive_debug_prompt + sample-ctl = grokcore.startup:zdaemon_controller + [paste.app_factory] + main = grokcore.startup:application_factory + debug = grokcore.startup:debug_application_factory + """, + ) diff --git a/doc/groktut/generating_html_from_python/src/sample/__init__.py b/docs/groktut/generating_html_from_python/src/sample/__init__.py similarity index 100% rename from doc/groktut/generating_html_from_python/src/sample/__init__.py rename to docs/groktut/generating_html_from_python/src/sample/__init__.py diff --git a/doc/groktut/generating_html_from_python/src/sample/app.py b/docs/groktut/generating_html_from_python/src/sample/app.py similarity index 98% rename from doc/groktut/generating_html_from_python/src/sample/app.py rename to docs/groktut/generating_html_from_python/src/sample/app.py index f013058..c6207b2 100644 --- a/doc/groktut/generating_html_from_python/src/sample/app.py +++ b/docs/groktut/generating_html_from_python/src/sample/app.py @@ -1,9 +1,10 @@ import grok - + + class Sample(grok.Application, grok.Container): pass + class Index(grok.View): def some_html(self): return "ME GROK BOLD" - diff --git a/doc/groktut/generating_html_from_python/src/sample/app_templates/index.pt b/docs/groktut/generating_html_from_python/src/sample/app_templates/index.pt similarity index 100% rename from doc/groktut/generating_html_from_python/src/sample/app_templates/index.pt rename to docs/groktut/generating_html_from_python/src/sample/app_templates/index.pt diff --git a/doc/groktut/generating_html_from_python/src/sample/configure.zcml b/docs/groktut/generating_html_from_python/src/sample/configure.zcml similarity index 100% rename from doc/groktut/generating_html_from_python/src/sample/configure.zcml rename to docs/groktut/generating_html_from_python/src/sample/configure.zcml diff --git a/doc/groktut/making_our_page_dynamic/buildout.cfg b/docs/groktut/making_our_page_dynamic/buildout.cfg similarity index 100% rename from doc/groktut/making_our_page_dynamic/buildout.cfg rename to docs/groktut/making_our_page_dynamic/buildout.cfg diff --git a/doc/groktut/making_our_page_dynamic/etc/README.txt b/docs/groktut/making_our_page_dynamic/etc/README.txt similarity index 100% rename from doc/groktut/making_our_page_dynamic/etc/README.txt rename to docs/groktut/making_our_page_dynamic/etc/README.txt diff --git a/doc/groktut/making_our_page_dynamic/etc/debug.ini.in b/docs/groktut/making_our_page_dynamic/etc/debug.ini.in similarity index 100% rename from doc/groktut/making_our_page_dynamic/etc/debug.ini.in rename to docs/groktut/making_our_page_dynamic/etc/debug.ini.in diff --git a/doc/groktut/making_our_page_dynamic/etc/deploy.ini.in b/docs/groktut/making_our_page_dynamic/etc/deploy.ini.in similarity index 100% rename from doc/groktut/making_our_page_dynamic/etc/deploy.ini.in rename to docs/groktut/making_our_page_dynamic/etc/deploy.ini.in diff --git a/doc/groktut/making_our_page_dynamic/etc/site.zcml.in b/docs/groktut/making_our_page_dynamic/etc/site.zcml.in similarity index 100% rename from doc/groktut/making_our_page_dynamic/etc/site.zcml.in rename to docs/groktut/making_our_page_dynamic/etc/site.zcml.in diff --git a/doc/groktut/making_our_page_dynamic/etc/zope.conf.in b/docs/groktut/making_our_page_dynamic/etc/zope.conf.in similarity index 100% rename from doc/groktut/making_our_page_dynamic/etc/zope.conf.in rename to docs/groktut/making_our_page_dynamic/etc/zope.conf.in diff --git a/docs/groktut/making_our_page_dynamic/setup.py b/docs/groktut/making_our_page_dynamic/setup.py new file mode 100644 index 0000000..3a60519 --- /dev/null +++ b/docs/groktut/making_our_page_dynamic/setup.py @@ -0,0 +1,38 @@ +from setuptools import find_packages +from setuptools import setup + + +version = '0.0' + +setup(name='Sample', + version=version, + description="", + long_description="""\ +""", + # Get strings from http://www.python.org/pypi?%3Aaction=list_classifiers + classifiers=[], + keywords="", + author="", + author_email="", + url="", + license="", + package_dir={'': 'src'}, + packages=find_packages('src'), + include_package_data=True, + zip_safe=False, + install_requires=['setuptools', + 'grok', + 'grokui.admin', + 'z3c.testsetup', + 'grokcore.startup', + # Add extra requirements here + ], + entry_points=""" + [console_scripts] + sample-debug = grokcore.startup:interactive_debug_prompt + sample-ctl = grokcore.startup:zdaemon_controller + [paste.app_factory] + main = grokcore.startup:application_factory + debug = grokcore.startup:debug_application_factory + """, + ) diff --git a/doc/groktut/making_our_page_dynamic/src/sample/__init__.py b/docs/groktut/making_our_page_dynamic/src/sample/__init__.py similarity index 100% rename from doc/groktut/making_our_page_dynamic/src/sample/__init__.py rename to docs/groktut/making_our_page_dynamic/src/sample/__init__.py diff --git a/doc/groktut/making_our_page_dynamic/src/sample/app.py b/docs/groktut/making_our_page_dynamic/src/sample/app.py similarity index 99% rename from doc/groktut/making_our_page_dynamic/src/sample/app.py rename to docs/groktut/making_our_page_dynamic/src/sample/app.py index 8c11342..bcc6e3e 100644 --- a/doc/groktut/making_our_page_dynamic/src/sample/app.py +++ b/docs/groktut/making_our_page_dynamic/src/sample/app.py @@ -1,8 +1,9 @@ import grok + class Sample(grok.Application, grok.Container): pass + class Index(grok.View): pass - diff --git a/doc/groktut/making_our_page_dynamic/src/sample/app_templates/index.pt b/docs/groktut/making_our_page_dynamic/src/sample/app_templates/index.pt similarity index 100% rename from doc/groktut/making_our_page_dynamic/src/sample/app_templates/index.pt rename to docs/groktut/making_our_page_dynamic/src/sample/app_templates/index.pt diff --git a/doc/groktut/making_our_page_dynamic/src/sample/configure.zcml b/docs/groktut/making_our_page_dynamic/src/sample/configure.zcml similarity index 100% rename from doc/groktut/making_our_page_dynamic/src/sample/configure.zcml rename to docs/groktut/making_our_page_dynamic/src/sample/configure.zcml diff --git a/doc/groktut/publishing_a_simple_web_page/buildout.cfg b/docs/groktut/publishing_a_simple_web_page/buildout.cfg similarity index 100% rename from doc/groktut/publishing_a_simple_web_page/buildout.cfg rename to docs/groktut/publishing_a_simple_web_page/buildout.cfg diff --git a/doc/groktut/publishing_a_simple_web_page/etc/README.txt b/docs/groktut/publishing_a_simple_web_page/etc/README.txt similarity index 100% rename from doc/groktut/publishing_a_simple_web_page/etc/README.txt rename to docs/groktut/publishing_a_simple_web_page/etc/README.txt diff --git a/doc/groktut/publishing_a_simple_web_page/etc/debug.ini.in b/docs/groktut/publishing_a_simple_web_page/etc/debug.ini.in similarity index 100% rename from doc/groktut/publishing_a_simple_web_page/etc/debug.ini.in rename to docs/groktut/publishing_a_simple_web_page/etc/debug.ini.in diff --git a/doc/groktut/publishing_a_simple_web_page/etc/deploy.ini.in b/docs/groktut/publishing_a_simple_web_page/etc/deploy.ini.in similarity index 100% rename from doc/groktut/publishing_a_simple_web_page/etc/deploy.ini.in rename to docs/groktut/publishing_a_simple_web_page/etc/deploy.ini.in diff --git a/doc/groktut/publishing_a_simple_web_page/etc/site.zcml.in b/docs/groktut/publishing_a_simple_web_page/etc/site.zcml.in similarity index 100% rename from doc/groktut/publishing_a_simple_web_page/etc/site.zcml.in rename to docs/groktut/publishing_a_simple_web_page/etc/site.zcml.in diff --git a/doc/groktut/publishing_a_simple_web_page/etc/zope.conf.in b/docs/groktut/publishing_a_simple_web_page/etc/zope.conf.in similarity index 100% rename from doc/groktut/publishing_a_simple_web_page/etc/zope.conf.in rename to docs/groktut/publishing_a_simple_web_page/etc/zope.conf.in diff --git a/docs/groktut/publishing_a_simple_web_page/setup.py b/docs/groktut/publishing_a_simple_web_page/setup.py new file mode 100644 index 0000000..3a60519 --- /dev/null +++ b/docs/groktut/publishing_a_simple_web_page/setup.py @@ -0,0 +1,38 @@ +from setuptools import find_packages +from setuptools import setup + + +version = '0.0' + +setup(name='Sample', + version=version, + description="", + long_description="""\ +""", + # Get strings from http://www.python.org/pypi?%3Aaction=list_classifiers + classifiers=[], + keywords="", + author="", + author_email="", + url="", + license="", + package_dir={'': 'src'}, + packages=find_packages('src'), + include_package_data=True, + zip_safe=False, + install_requires=['setuptools', + 'grok', + 'grokui.admin', + 'z3c.testsetup', + 'grokcore.startup', + # Add extra requirements here + ], + entry_points=""" + [console_scripts] + sample-debug = grokcore.startup:interactive_debug_prompt + sample-ctl = grokcore.startup:zdaemon_controller + [paste.app_factory] + main = grokcore.startup:application_factory + debug = grokcore.startup:debug_application_factory + """, + ) diff --git a/doc/groktut/publishing_a_simple_web_page/src/sample/__init__.py b/docs/groktut/publishing_a_simple_web_page/src/sample/__init__.py similarity index 100% rename from doc/groktut/publishing_a_simple_web_page/src/sample/__init__.py rename to docs/groktut/publishing_a_simple_web_page/src/sample/__init__.py diff --git a/doc/groktut/static_resources_for_our_web_page/src/sample/app.py b/docs/groktut/publishing_a_simple_web_page/src/sample/app.py similarity index 97% rename from doc/groktut/static_resources_for_our_web_page/src/sample/app.py rename to docs/groktut/publishing_a_simple_web_page/src/sample/app.py index 26082a7..bcc6e3e 100644 --- a/doc/groktut/static_resources_for_our_web_page/src/sample/app.py +++ b/docs/groktut/publishing_a_simple_web_page/src/sample/app.py @@ -1,7 +1,9 @@ import grok - + + class Sample(grok.Application, grok.Container): pass + class Index(grok.View): pass diff --git a/doc/groktut/publishing_a_simple_web_page/src/sample/app.txt b/docs/groktut/publishing_a_simple_web_page/src/sample/app.txt similarity index 100% rename from doc/groktut/publishing_a_simple_web_page/src/sample/app.txt rename to docs/groktut/publishing_a_simple_web_page/src/sample/app.txt diff --git a/doc/groktut/publishing_a_simple_web_page/src/sample/app_templates/index.pt b/docs/groktut/publishing_a_simple_web_page/src/sample/app_templates/index.pt similarity index 100% rename from doc/groktut/publishing_a_simple_web_page/src/sample/app_templates/index.pt rename to docs/groktut/publishing_a_simple_web_page/src/sample/app_templates/index.pt diff --git a/doc/groktut/publishing_a_simple_web_page/src/sample/configure.zcml b/docs/groktut/publishing_a_simple_web_page/src/sample/configure.zcml similarity index 100% rename from doc/groktut/publishing_a_simple_web_page/src/sample/configure.zcml rename to docs/groktut/publishing_a_simple_web_page/src/sample/configure.zcml diff --git a/doc/groktut/publishing_a_simple_web_page/src/sample/ftesting.zcml b/docs/groktut/publishing_a_simple_web_page/src/sample/ftesting.zcml similarity index 100% rename from doc/groktut/publishing_a_simple_web_page/src/sample/ftesting.zcml rename to docs/groktut/publishing_a_simple_web_page/src/sample/ftesting.zcml diff --git a/doc/groktut/publishing_a_simple_web_page/src/sample/static/README.txt b/docs/groktut/publishing_a_simple_web_page/src/sample/static/README.txt similarity index 100% rename from doc/groktut/publishing_a_simple_web_page/src/sample/static/README.txt rename to docs/groktut/publishing_a_simple_web_page/src/sample/static/README.txt diff --git a/doc/groktut/an_empty_grok_project/src/sample/tests.py b/docs/groktut/publishing_a_simple_web_page/src/sample/tests.py similarity index 94% rename from doc/groktut/an_empty_grok_project/src/sample/tests.py rename to docs/groktut/publishing_a_simple_web_page/src/sample/tests.py index debea0c..00d7ba9 100644 --- a/doc/groktut/an_empty_grok_project/src/sample/tests.py +++ b/docs/groktut/publishing_a_simple_web_page/src/sample/tests.py @@ -1,8 +1,7 @@ -import os.path +import sample import z3c.testsetup from zope.app.wsgi.testlayer import BrowserLayer -import sample browser_layer = BrowserLayer(sample) diff --git a/doc/groktut/reading_url_parameters/buildout.cfg b/docs/groktut/reading_url_parameters/buildout.cfg similarity index 100% rename from doc/groktut/reading_url_parameters/buildout.cfg rename to docs/groktut/reading_url_parameters/buildout.cfg diff --git a/doc/groktut/reading_url_parameters/etc/README.txt b/docs/groktut/reading_url_parameters/etc/README.txt similarity index 100% rename from doc/groktut/reading_url_parameters/etc/README.txt rename to docs/groktut/reading_url_parameters/etc/README.txt diff --git a/doc/groktut/reading_url_parameters/etc/debug.ini.in b/docs/groktut/reading_url_parameters/etc/debug.ini.in similarity index 100% rename from doc/groktut/reading_url_parameters/etc/debug.ini.in rename to docs/groktut/reading_url_parameters/etc/debug.ini.in diff --git a/doc/groktut/reading_url_parameters/etc/deploy.ini.in b/docs/groktut/reading_url_parameters/etc/deploy.ini.in similarity index 100% rename from doc/groktut/reading_url_parameters/etc/deploy.ini.in rename to docs/groktut/reading_url_parameters/etc/deploy.ini.in diff --git a/doc/groktut/reading_url_parameters/etc/site.zcml.in b/docs/groktut/reading_url_parameters/etc/site.zcml.in similarity index 100% rename from doc/groktut/reading_url_parameters/etc/site.zcml.in rename to docs/groktut/reading_url_parameters/etc/site.zcml.in diff --git a/doc/groktut/reading_url_parameters/etc/zope.conf.in b/docs/groktut/reading_url_parameters/etc/zope.conf.in similarity index 100% rename from doc/groktut/reading_url_parameters/etc/zope.conf.in rename to docs/groktut/reading_url_parameters/etc/zope.conf.in diff --git a/docs/groktut/reading_url_parameters/setup.py b/docs/groktut/reading_url_parameters/setup.py new file mode 100644 index 0000000..3a60519 --- /dev/null +++ b/docs/groktut/reading_url_parameters/setup.py @@ -0,0 +1,38 @@ +from setuptools import find_packages +from setuptools import setup + + +version = '0.0' + +setup(name='Sample', + version=version, + description="", + long_description="""\ +""", + # Get strings from http://www.python.org/pypi?%3Aaction=list_classifiers + classifiers=[], + keywords="", + author="", + author_email="", + url="", + license="", + package_dir={'': 'src'}, + packages=find_packages('src'), + include_package_data=True, + zip_safe=False, + install_requires=['setuptools', + 'grok', + 'grokui.admin', + 'z3c.testsetup', + 'grokcore.startup', + # Add extra requirements here + ], + entry_points=""" + [console_scripts] + sample-debug = grokcore.startup:interactive_debug_prompt + sample-ctl = grokcore.startup:zdaemon_controller + [paste.app_factory] + main = grokcore.startup:application_factory + debug = grokcore.startup:debug_application_factory + """, + ) diff --git a/doc/groktut/reading_url_parameters/src/sample/__init__.py b/docs/groktut/reading_url_parameters/src/sample/__init__.py similarity index 100% rename from doc/groktut/reading_url_parameters/src/sample/__init__.py rename to docs/groktut/reading_url_parameters/src/sample/__init__.py diff --git a/doc/groktut/reading_url_parameters/src/sample/app.py b/docs/groktut/reading_url_parameters/src/sample/app.py similarity index 98% rename from doc/groktut/reading_url_parameters/src/sample/app.py rename to docs/groktut/reading_url_parameters/src/sample/app.py index d37b771..7ee2b58 100644 --- a/doc/groktut/reading_url_parameters/src/sample/app.py +++ b/docs/groktut/reading_url_parameters/src/sample/app.py @@ -1,8 +1,10 @@ import grok + class Sample(grok.Application, grok.Container): pass + class Index(grok.View): def update(self, value1, value2): self.sum = int(value1) + int(value2) diff --git a/doc/groktut/reading_url_parameters/src/sample/app_templates/index.pt b/docs/groktut/reading_url_parameters/src/sample/app_templates/index.pt similarity index 100% rename from doc/groktut/reading_url_parameters/src/sample/app_templates/index.pt rename to docs/groktut/reading_url_parameters/src/sample/app_templates/index.pt diff --git a/doc/groktut/reading_url_parameters/src/sample/configure.zcml b/docs/groktut/reading_url_parameters/src/sample/configure.zcml similarity index 100% rename from doc/groktut/reading_url_parameters/src/sample/configure.zcml rename to docs/groktut/reading_url_parameters/src/sample/configure.zcml diff --git a/doc/groktut/reading_url_parameters2/buildout.cfg b/docs/groktut/reading_url_parameters2/buildout.cfg similarity index 100% rename from doc/groktut/reading_url_parameters2/buildout.cfg rename to docs/groktut/reading_url_parameters2/buildout.cfg diff --git a/doc/groktut/reading_url_parameters2/etc/README.txt b/docs/groktut/reading_url_parameters2/etc/README.txt similarity index 100% rename from doc/groktut/reading_url_parameters2/etc/README.txt rename to docs/groktut/reading_url_parameters2/etc/README.txt diff --git a/doc/groktut/reading_url_parameters2/etc/debug.ini.in b/docs/groktut/reading_url_parameters2/etc/debug.ini.in similarity index 100% rename from doc/groktut/reading_url_parameters2/etc/debug.ini.in rename to docs/groktut/reading_url_parameters2/etc/debug.ini.in diff --git a/doc/groktut/reading_url_parameters2/etc/deploy.ini.in b/docs/groktut/reading_url_parameters2/etc/deploy.ini.in similarity index 100% rename from doc/groktut/reading_url_parameters2/etc/deploy.ini.in rename to docs/groktut/reading_url_parameters2/etc/deploy.ini.in diff --git a/doc/groktut/reading_url_parameters2/etc/site.zcml.in b/docs/groktut/reading_url_parameters2/etc/site.zcml.in similarity index 100% rename from doc/groktut/reading_url_parameters2/etc/site.zcml.in rename to docs/groktut/reading_url_parameters2/etc/site.zcml.in diff --git a/doc/groktut/reading_url_parameters2/etc/zope.conf.in b/docs/groktut/reading_url_parameters2/etc/zope.conf.in similarity index 100% rename from doc/groktut/reading_url_parameters2/etc/zope.conf.in rename to docs/groktut/reading_url_parameters2/etc/zope.conf.in diff --git a/docs/groktut/reading_url_parameters2/setup.py b/docs/groktut/reading_url_parameters2/setup.py new file mode 100644 index 0000000..3a60519 --- /dev/null +++ b/docs/groktut/reading_url_parameters2/setup.py @@ -0,0 +1,38 @@ +from setuptools import find_packages +from setuptools import setup + + +version = '0.0' + +setup(name='Sample', + version=version, + description="", + long_description="""\ +""", + # Get strings from http://www.python.org/pypi?%3Aaction=list_classifiers + classifiers=[], + keywords="", + author="", + author_email="", + url="", + license="", + package_dir={'': 'src'}, + packages=find_packages('src'), + include_package_data=True, + zip_safe=False, + install_requires=['setuptools', + 'grok', + 'grokui.admin', + 'z3c.testsetup', + 'grokcore.startup', + # Add extra requirements here + ], + entry_points=""" + [console_scripts] + sample-debug = grokcore.startup:interactive_debug_prompt + sample-ctl = grokcore.startup:zdaemon_controller + [paste.app_factory] + main = grokcore.startup:application_factory + debug = grokcore.startup:debug_application_factory + """, + ) diff --git a/doc/groktut/reading_url_parameters2/src/sample/__init__.py b/docs/groktut/reading_url_parameters2/src/sample/__init__.py similarity index 100% rename from doc/groktut/reading_url_parameters2/src/sample/__init__.py rename to docs/groktut/reading_url_parameters2/src/sample/__init__.py diff --git a/doc/groktut/reading_url_parameters2/src/sample/app.py b/docs/groktut/reading_url_parameters2/src/sample/app.py similarity index 98% rename from doc/groktut/reading_url_parameters2/src/sample/app.py rename to docs/groktut/reading_url_parameters2/src/sample/app.py index 01c917e..dd5360b 100644 --- a/doc/groktut/reading_url_parameters2/src/sample/app.py +++ b/docs/groktut/reading_url_parameters2/src/sample/app.py @@ -1,8 +1,10 @@ import grok + class Sample(grok.Application, grok.Container): pass + class Index(grok.View): def update(self, value1=0, value2=0): self.sum = int(value1) + int(value2) diff --git a/doc/groktut/reading_url_parameters2/src/sample/app_templates/index.pt b/docs/groktut/reading_url_parameters2/src/sample/app_templates/index.pt similarity index 100% rename from doc/groktut/reading_url_parameters2/src/sample/app_templates/index.pt rename to docs/groktut/reading_url_parameters2/src/sample/app_templates/index.pt diff --git a/doc/groktut/reading_url_parameters2/src/sample/configure.zcml b/docs/groktut/reading_url_parameters2/src/sample/configure.zcml similarity index 100% rename from doc/groktut/reading_url_parameters2/src/sample/configure.zcml rename to docs/groktut/reading_url_parameters2/src/sample/configure.zcml diff --git a/doc/groktut/redirection/buildout.cfg b/docs/groktut/redirection/buildout.cfg similarity index 100% rename from doc/groktut/redirection/buildout.cfg rename to docs/groktut/redirection/buildout.cfg diff --git a/doc/groktut/redirection/etc/README.txt b/docs/groktut/redirection/etc/README.txt similarity index 100% rename from doc/groktut/redirection/etc/README.txt rename to docs/groktut/redirection/etc/README.txt diff --git a/doc/groktut/redirection/etc/debug.ini.in b/docs/groktut/redirection/etc/debug.ini.in similarity index 100% rename from doc/groktut/redirection/etc/debug.ini.in rename to docs/groktut/redirection/etc/debug.ini.in diff --git a/doc/groktut/redirection/etc/deploy.ini.in b/docs/groktut/redirection/etc/deploy.ini.in similarity index 100% rename from doc/groktut/redirection/etc/deploy.ini.in rename to docs/groktut/redirection/etc/deploy.ini.in diff --git a/doc/groktut/redirection/etc/site.zcml.in b/docs/groktut/redirection/etc/site.zcml.in similarity index 100% rename from doc/groktut/redirection/etc/site.zcml.in rename to docs/groktut/redirection/etc/site.zcml.in diff --git a/doc/groktut/redirection/etc/zope.conf.in b/docs/groktut/redirection/etc/zope.conf.in similarity index 100% rename from doc/groktut/redirection/etc/zope.conf.in rename to docs/groktut/redirection/etc/zope.conf.in diff --git a/docs/groktut/redirection/setup.py b/docs/groktut/redirection/setup.py new file mode 100644 index 0000000..3a60519 --- /dev/null +++ b/docs/groktut/redirection/setup.py @@ -0,0 +1,38 @@ +from setuptools import find_packages +from setuptools import setup + + +version = '0.0' + +setup(name='Sample', + version=version, + description="", + long_description="""\ +""", + # Get strings from http://www.python.org/pypi?%3Aaction=list_classifiers + classifiers=[], + keywords="", + author="", + author_email="", + url="", + license="", + package_dir={'': 'src'}, + packages=find_packages('src'), + include_package_data=True, + zip_safe=False, + install_requires=['setuptools', + 'grok', + 'grokui.admin', + 'z3c.testsetup', + 'grokcore.startup', + # Add extra requirements here + ], + entry_points=""" + [console_scripts] + sample-debug = grokcore.startup:interactive_debug_prompt + sample-ctl = grokcore.startup:zdaemon_controller + [paste.app_factory] + main = grokcore.startup:application_factory + debug = grokcore.startup:debug_application_factory + """, + ) diff --git a/doc/groktut/redirection/src/sample/__init__.py b/docs/groktut/redirection/src/sample/__init__.py similarity index 100% rename from doc/groktut/redirection/src/sample/__init__.py rename to docs/groktut/redirection/src/sample/__init__.py diff --git a/doc/groktut/redirection/src/sample/app.py b/docs/groktut/redirection/src/sample/app.py similarity index 98% rename from doc/groktut/redirection/src/sample/app.py rename to docs/groktut/redirection/src/sample/app.py index e63f79e..1bd9763 100644 --- a/doc/groktut/redirection/src/sample/app.py +++ b/docs/groktut/redirection/src/sample/app.py @@ -1,11 +1,14 @@ import grok + class Sample(grok.Application, grok.Container): text = 'default text' + class Index(grok.View): pass + class Edit(grok.View): def update(self, text=None): if text is None: diff --git a/doc/groktut/redirection/src/sample/app_templates/edit.pt b/docs/groktut/redirection/src/sample/app_templates/edit.pt similarity index 100% rename from doc/groktut/redirection/src/sample/app_templates/edit.pt rename to docs/groktut/redirection/src/sample/app_templates/edit.pt diff --git a/doc/groktut/redirection/src/sample/app_templates/index.pt b/docs/groktut/redirection/src/sample/app_templates/index.pt similarity index 100% rename from doc/groktut/redirection/src/sample/app_templates/index.pt rename to docs/groktut/redirection/src/sample/app_templates/index.pt diff --git a/doc/groktut/redirection/src/sample/configure.zcml b/docs/groktut/redirection/src/sample/configure.zcml similarity index 100% rename from doc/groktut/redirection/src/sample/configure.zcml rename to docs/groktut/redirection/src/sample/configure.zcml diff --git a/doc/groktut/setting_the_content_type/buildout.cfg b/docs/groktut/setting_the_content_type/buildout.cfg similarity index 100% rename from doc/groktut/setting_the_content_type/buildout.cfg rename to docs/groktut/setting_the_content_type/buildout.cfg diff --git a/doc/groktut/setting_the_content_type/etc/README.txt b/docs/groktut/setting_the_content_type/etc/README.txt similarity index 100% rename from doc/groktut/setting_the_content_type/etc/README.txt rename to docs/groktut/setting_the_content_type/etc/README.txt diff --git a/doc/groktut/setting_the_content_type/etc/debug.ini.in b/docs/groktut/setting_the_content_type/etc/debug.ini.in similarity index 100% rename from doc/groktut/setting_the_content_type/etc/debug.ini.in rename to docs/groktut/setting_the_content_type/etc/debug.ini.in diff --git a/doc/groktut/setting_the_content_type/etc/deploy.ini.in b/docs/groktut/setting_the_content_type/etc/deploy.ini.in similarity index 100% rename from doc/groktut/setting_the_content_type/etc/deploy.ini.in rename to docs/groktut/setting_the_content_type/etc/deploy.ini.in diff --git a/doc/groktut/setting_the_content_type/etc/site.zcml.in b/docs/groktut/setting_the_content_type/etc/site.zcml.in similarity index 100% rename from doc/groktut/setting_the_content_type/etc/site.zcml.in rename to docs/groktut/setting_the_content_type/etc/site.zcml.in diff --git a/doc/groktut/setting_the_content_type/etc/zope.conf.in b/docs/groktut/setting_the_content_type/etc/zope.conf.in similarity index 100% rename from doc/groktut/setting_the_content_type/etc/zope.conf.in rename to docs/groktut/setting_the_content_type/etc/zope.conf.in diff --git a/docs/groktut/setting_the_content_type/setup.py b/docs/groktut/setting_the_content_type/setup.py new file mode 100644 index 0000000..3a60519 --- /dev/null +++ b/docs/groktut/setting_the_content_type/setup.py @@ -0,0 +1,38 @@ +from setuptools import find_packages +from setuptools import setup + + +version = '0.0' + +setup(name='Sample', + version=version, + description="", + long_description="""\ +""", + # Get strings from http://www.python.org/pypi?%3Aaction=list_classifiers + classifiers=[], + keywords="", + author="", + author_email="", + url="", + license="", + package_dir={'': 'src'}, + packages=find_packages('src'), + include_package_data=True, + zip_safe=False, + install_requires=['setuptools', + 'grok', + 'grokui.admin', + 'z3c.testsetup', + 'grokcore.startup', + # Add extra requirements here + ], + entry_points=""" + [console_scripts] + sample-debug = grokcore.startup:interactive_debug_prompt + sample-ctl = grokcore.startup:zdaemon_controller + [paste.app_factory] + main = grokcore.startup:application_factory + debug = grokcore.startup:debug_application_factory + """, + ) diff --git a/doc/groktut/setting_the_content_type/src/sample/__init__.py b/docs/groktut/setting_the_content_type/src/sample/__init__.py similarity index 100% rename from doc/groktut/setting_the_content_type/src/sample/__init__.py rename to docs/groktut/setting_the_content_type/src/sample/__init__.py diff --git a/doc/groktut/setting_the_content_type/src/sample/app.py b/docs/groktut/setting_the_content_type/src/sample/app.py similarity index 98% rename from doc/groktut/setting_the_content_type/src/sample/app.py rename to docs/groktut/setting_the_content_type/src/sample/app.py index 703624f..e734d45 100644 --- a/doc/groktut/setting_the_content_type/src/sample/app.py +++ b/docs/groktut/setting_the_content_type/src/sample/app.py @@ -1,8 +1,10 @@ import grok - + + class Sample(grok.Application, grok.Container): pass + class Index(grok.View): def render(self): self.response.setHeader('Content-Type', diff --git a/doc/groktut/setting_the_content_type/src/sample/configure.zcml b/docs/groktut/setting_the_content_type/src/sample/configure.zcml similarity index 100% rename from doc/groktut/setting_the_content_type/src/sample/configure.zcml rename to docs/groktut/setting_the_content_type/src/sample/configure.zcml diff --git a/doc/groktut/showing_the_value_in_the_form/buildout.cfg b/docs/groktut/showing_the_value_in_the_form/buildout.cfg similarity index 100% rename from doc/groktut/showing_the_value_in_the_form/buildout.cfg rename to docs/groktut/showing_the_value_in_the_form/buildout.cfg diff --git a/doc/groktut/showing_the_value_in_the_form/etc/README.txt b/docs/groktut/showing_the_value_in_the_form/etc/README.txt similarity index 100% rename from doc/groktut/showing_the_value_in_the_form/etc/README.txt rename to docs/groktut/showing_the_value_in_the_form/etc/README.txt diff --git a/doc/groktut/showing_the_value_in_the_form/etc/debug.ini.in b/docs/groktut/showing_the_value_in_the_form/etc/debug.ini.in similarity index 100% rename from doc/groktut/showing_the_value_in_the_form/etc/debug.ini.in rename to docs/groktut/showing_the_value_in_the_form/etc/debug.ini.in diff --git a/doc/groktut/showing_the_value_in_the_form/etc/deploy.ini.in b/docs/groktut/showing_the_value_in_the_form/etc/deploy.ini.in similarity index 100% rename from doc/groktut/showing_the_value_in_the_form/etc/deploy.ini.in rename to docs/groktut/showing_the_value_in_the_form/etc/deploy.ini.in diff --git a/doc/groktut/showing_the_value_in_the_form/etc/site.zcml.in b/docs/groktut/showing_the_value_in_the_form/etc/site.zcml.in similarity index 100% rename from doc/groktut/showing_the_value_in_the_form/etc/site.zcml.in rename to docs/groktut/showing_the_value_in_the_form/etc/site.zcml.in diff --git a/doc/groktut/showing_the_value_in_the_form/etc/zope.conf.in b/docs/groktut/showing_the_value_in_the_form/etc/zope.conf.in similarity index 100% rename from doc/groktut/showing_the_value_in_the_form/etc/zope.conf.in rename to docs/groktut/showing_the_value_in_the_form/etc/zope.conf.in diff --git a/docs/groktut/showing_the_value_in_the_form/setup.py b/docs/groktut/showing_the_value_in_the_form/setup.py new file mode 100644 index 0000000..3a60519 --- /dev/null +++ b/docs/groktut/showing_the_value_in_the_form/setup.py @@ -0,0 +1,38 @@ +from setuptools import find_packages +from setuptools import setup + + +version = '0.0' + +setup(name='Sample', + version=version, + description="", + long_description="""\ +""", + # Get strings from http://www.python.org/pypi?%3Aaction=list_classifiers + classifiers=[], + keywords="", + author="", + author_email="", + url="", + license="", + package_dir={'': 'src'}, + packages=find_packages('src'), + include_package_data=True, + zip_safe=False, + install_requires=['setuptools', + 'grok', + 'grokui.admin', + 'z3c.testsetup', + 'grokcore.startup', + # Add extra requirements here + ], + entry_points=""" + [console_scripts] + sample-debug = grokcore.startup:interactive_debug_prompt + sample-ctl = grokcore.startup:zdaemon_controller + [paste.app_factory] + main = grokcore.startup:application_factory + debug = grokcore.startup:debug_application_factory + """, + ) diff --git a/doc/groktut/showing_the_value_in_the_form/src/sample/__init__.py b/docs/groktut/showing_the_value_in_the_form/src/sample/__init__.py similarity index 100% rename from doc/groktut/showing_the_value_in_the_form/src/sample/__init__.py rename to docs/groktut/showing_the_value_in_the_form/src/sample/__init__.py diff --git a/doc/groktut/showing_the_value_in_the_form/src/sample/app.py b/docs/groktut/showing_the_value_in_the_form/src/sample/app.py similarity index 98% rename from doc/groktut/showing_the_value_in_the_form/src/sample/app.py rename to docs/groktut/showing_the_value_in_the_form/src/sample/app.py index e63f79e..1bd9763 100644 --- a/doc/groktut/showing_the_value_in_the_form/src/sample/app.py +++ b/docs/groktut/showing_the_value_in_the_form/src/sample/app.py @@ -1,11 +1,14 @@ import grok + class Sample(grok.Application, grok.Container): text = 'default text' + class Index(grok.View): pass + class Edit(grok.View): def update(self, text=None): if text is None: diff --git a/doc/groktut/showing_the_value_in_the_form/src/sample/app_templates/edit.pt b/docs/groktut/showing_the_value_in_the_form/src/sample/app_templates/edit.pt similarity index 100% rename from doc/groktut/showing_the_value_in_the_form/src/sample/app_templates/edit.pt rename to docs/groktut/showing_the_value_in_the_form/src/sample/app_templates/edit.pt diff --git a/doc/groktut/showing_the_value_in_the_form/src/sample/app_templates/index.pt b/docs/groktut/showing_the_value_in_the_form/src/sample/app_templates/index.pt similarity index 100% rename from doc/groktut/showing_the_value_in_the_form/src/sample/app_templates/index.pt rename to docs/groktut/showing_the_value_in_the_form/src/sample/app_templates/index.pt diff --git a/doc/groktut/showing_the_value_in_the_form/src/sample/configure.zcml b/docs/groktut/showing_the_value_in_the_form/src/sample/configure.zcml similarity index 100% rename from doc/groktut/showing_the_value_in_the_form/src/sample/configure.zcml rename to docs/groktut/showing_the_value_in_the_form/src/sample/configure.zcml diff --git a/doc/groktut/simple_forms/buildout.cfg b/docs/groktut/simple_forms/buildout.cfg similarity index 100% rename from doc/groktut/simple_forms/buildout.cfg rename to docs/groktut/simple_forms/buildout.cfg diff --git a/doc/groktut/simple_forms/etc/README.txt b/docs/groktut/simple_forms/etc/README.txt similarity index 100% rename from doc/groktut/simple_forms/etc/README.txt rename to docs/groktut/simple_forms/etc/README.txt diff --git a/doc/groktut/simple_forms/etc/debug.ini.in b/docs/groktut/simple_forms/etc/debug.ini.in similarity index 100% rename from doc/groktut/simple_forms/etc/debug.ini.in rename to docs/groktut/simple_forms/etc/debug.ini.in diff --git a/doc/groktut/simple_forms/etc/deploy.ini.in b/docs/groktut/simple_forms/etc/deploy.ini.in similarity index 100% rename from doc/groktut/simple_forms/etc/deploy.ini.in rename to docs/groktut/simple_forms/etc/deploy.ini.in diff --git a/doc/groktut/simple_forms/etc/site.zcml.in b/docs/groktut/simple_forms/etc/site.zcml.in similarity index 100% rename from doc/groktut/simple_forms/etc/site.zcml.in rename to docs/groktut/simple_forms/etc/site.zcml.in diff --git a/doc/groktut/simple_forms/etc/zope.conf.in b/docs/groktut/simple_forms/etc/zope.conf.in similarity index 100% rename from doc/groktut/simple_forms/etc/zope.conf.in rename to docs/groktut/simple_forms/etc/zope.conf.in diff --git a/docs/groktut/simple_forms/setup.py b/docs/groktut/simple_forms/setup.py new file mode 100644 index 0000000..3a60519 --- /dev/null +++ b/docs/groktut/simple_forms/setup.py @@ -0,0 +1,38 @@ +from setuptools import find_packages +from setuptools import setup + + +version = '0.0' + +setup(name='Sample', + version=version, + description="", + long_description="""\ +""", + # Get strings from http://www.python.org/pypi?%3Aaction=list_classifiers + classifiers=[], + keywords="", + author="", + author_email="", + url="", + license="", + package_dir={'': 'src'}, + packages=find_packages('src'), + include_package_data=True, + zip_safe=False, + install_requires=['setuptools', + 'grok', + 'grokui.admin', + 'z3c.testsetup', + 'grokcore.startup', + # Add extra requirements here + ], + entry_points=""" + [console_scripts] + sample-debug = grokcore.startup:interactive_debug_prompt + sample-ctl = grokcore.startup:zdaemon_controller + [paste.app_factory] + main = grokcore.startup:application_factory + debug = grokcore.startup:debug_application_factory + """, + ) diff --git a/doc/groktut/simple_forms/src/sample/__init__.py b/docs/groktut/simple_forms/src/sample/__init__.py similarity index 100% rename from doc/groktut/simple_forms/src/sample/__init__.py rename to docs/groktut/simple_forms/src/sample/__init__.py diff --git a/doc/groktut/simple_forms/src/sample/app.py b/docs/groktut/simple_forms/src/sample/app.py similarity index 98% rename from doc/groktut/simple_forms/src/sample/app.py rename to docs/groktut/simple_forms/src/sample/app.py index 01c917e..dd5360b 100644 --- a/doc/groktut/simple_forms/src/sample/app.py +++ b/docs/groktut/simple_forms/src/sample/app.py @@ -1,8 +1,10 @@ import grok + class Sample(grok.Application, grok.Container): pass + class Index(grok.View): def update(self, value1=0, value2=0): self.sum = int(value1) + int(value2) diff --git a/doc/groktut/simple_forms/src/sample/app_templates/index.pt b/docs/groktut/simple_forms/src/sample/app_templates/index.pt similarity index 100% rename from doc/groktut/simple_forms/src/sample/app_templates/index.pt rename to docs/groktut/simple_forms/src/sample/app_templates/index.pt diff --git a/doc/groktut/simple_forms/src/sample/configure.zcml b/docs/groktut/simple_forms/src/sample/configure.zcml similarity index 100% rename from doc/groktut/simple_forms/src/sample/configure.zcml rename to docs/groktut/simple_forms/src/sample/configure.zcml diff --git a/doc/groktut/simple_forms2/buildout.cfg b/docs/groktut/simple_forms2/buildout.cfg similarity index 100% rename from doc/groktut/simple_forms2/buildout.cfg rename to docs/groktut/simple_forms2/buildout.cfg diff --git a/doc/groktut/simple_forms2/etc/README.txt b/docs/groktut/simple_forms2/etc/README.txt similarity index 100% rename from doc/groktut/simple_forms2/etc/README.txt rename to docs/groktut/simple_forms2/etc/README.txt diff --git a/doc/groktut/simple_forms2/etc/debug.ini.in b/docs/groktut/simple_forms2/etc/debug.ini.in similarity index 100% rename from doc/groktut/simple_forms2/etc/debug.ini.in rename to docs/groktut/simple_forms2/etc/debug.ini.in diff --git a/doc/groktut/simple_forms2/etc/deploy.ini.in b/docs/groktut/simple_forms2/etc/deploy.ini.in similarity index 100% rename from doc/groktut/simple_forms2/etc/deploy.ini.in rename to docs/groktut/simple_forms2/etc/deploy.ini.in diff --git a/doc/groktut/simple_forms2/etc/site.zcml.in b/docs/groktut/simple_forms2/etc/site.zcml.in similarity index 100% rename from doc/groktut/simple_forms2/etc/site.zcml.in rename to docs/groktut/simple_forms2/etc/site.zcml.in diff --git a/doc/groktut/simple_forms2/etc/zope.conf.in b/docs/groktut/simple_forms2/etc/zope.conf.in similarity index 100% rename from doc/groktut/simple_forms2/etc/zope.conf.in rename to docs/groktut/simple_forms2/etc/zope.conf.in diff --git a/docs/groktut/simple_forms2/setup.py b/docs/groktut/simple_forms2/setup.py new file mode 100644 index 0000000..3a60519 --- /dev/null +++ b/docs/groktut/simple_forms2/setup.py @@ -0,0 +1,38 @@ +from setuptools import find_packages +from setuptools import setup + + +version = '0.0' + +setup(name='Sample', + version=version, + description="", + long_description="""\ +""", + # Get strings from http://www.python.org/pypi?%3Aaction=list_classifiers + classifiers=[], + keywords="", + author="", + author_email="", + url="", + license="", + package_dir={'': 'src'}, + packages=find_packages('src'), + include_package_data=True, + zip_safe=False, + install_requires=['setuptools', + 'grok', + 'grokui.admin', + 'z3c.testsetup', + 'grokcore.startup', + # Add extra requirements here + ], + entry_points=""" + [console_scripts] + sample-debug = grokcore.startup:interactive_debug_prompt + sample-ctl = grokcore.startup:zdaemon_controller + [paste.app_factory] + main = grokcore.startup:application_factory + debug = grokcore.startup:debug_application_factory + """, + ) diff --git a/doc/groktut/simple_forms2/src/sample/__init__.py b/docs/groktut/simple_forms2/src/sample/__init__.py similarity index 100% rename from doc/groktut/simple_forms2/src/sample/__init__.py rename to docs/groktut/simple_forms2/src/sample/__init__.py diff --git a/doc/groktut/simple_forms2/src/sample/app.py b/docs/groktut/simple_forms2/src/sample/app.py similarity index 99% rename from doc/groktut/simple_forms2/src/sample/app.py rename to docs/groktut/simple_forms2/src/sample/app.py index 3fe8ff9..621ebb3 100644 --- a/doc/groktut/simple_forms2/src/sample/app.py +++ b/docs/groktut/simple_forms2/src/sample/app.py @@ -1,8 +1,10 @@ import grok + class Sample(grok.Application, grok.Container): pass + class Index(grok.View): def update(self, value1=None, value2=None): try: diff --git a/doc/groktut/simple_forms2/src/sample/app_templates/index.pt b/docs/groktut/simple_forms2/src/sample/app_templates/index.pt similarity index 100% rename from doc/groktut/simple_forms2/src/sample/app_templates/index.pt rename to docs/groktut/simple_forms2/src/sample/app_templates/index.pt diff --git a/doc/groktut/simple_forms2/src/sample/configure.zcml b/docs/groktut/simple_forms2/src/sample/configure.zcml similarity index 100% rename from doc/groktut/simple_forms2/src/sample/configure.zcml rename to docs/groktut/simple_forms2/src/sample/configure.zcml diff --git a/doc/groktut/static_resources_for_our_web_page/buildout.cfg b/docs/groktut/static_resources_for_our_web_page/buildout.cfg similarity index 100% rename from doc/groktut/static_resources_for_our_web_page/buildout.cfg rename to docs/groktut/static_resources_for_our_web_page/buildout.cfg diff --git a/doc/groktut/static_resources_for_our_web_page/etc/README.txt b/docs/groktut/static_resources_for_our_web_page/etc/README.txt similarity index 100% rename from doc/groktut/static_resources_for_our_web_page/etc/README.txt rename to docs/groktut/static_resources_for_our_web_page/etc/README.txt diff --git a/doc/groktut/static_resources_for_our_web_page/etc/debug.ini.in b/docs/groktut/static_resources_for_our_web_page/etc/debug.ini.in similarity index 100% rename from doc/groktut/static_resources_for_our_web_page/etc/debug.ini.in rename to docs/groktut/static_resources_for_our_web_page/etc/debug.ini.in diff --git a/doc/groktut/static_resources_for_our_web_page/etc/deploy.ini.in b/docs/groktut/static_resources_for_our_web_page/etc/deploy.ini.in similarity index 100% rename from doc/groktut/static_resources_for_our_web_page/etc/deploy.ini.in rename to docs/groktut/static_resources_for_our_web_page/etc/deploy.ini.in diff --git a/doc/groktut/static_resources_for_our_web_page/etc/site.zcml.in b/docs/groktut/static_resources_for_our_web_page/etc/site.zcml.in similarity index 100% rename from doc/groktut/static_resources_for_our_web_page/etc/site.zcml.in rename to docs/groktut/static_resources_for_our_web_page/etc/site.zcml.in diff --git a/doc/groktut/static_resources_for_our_web_page/etc/zope.conf.in b/docs/groktut/static_resources_for_our_web_page/etc/zope.conf.in similarity index 100% rename from doc/groktut/static_resources_for_our_web_page/etc/zope.conf.in rename to docs/groktut/static_resources_for_our_web_page/etc/zope.conf.in diff --git a/docs/groktut/static_resources_for_our_web_page/setup.py b/docs/groktut/static_resources_for_our_web_page/setup.py new file mode 100644 index 0000000..3a60519 --- /dev/null +++ b/docs/groktut/static_resources_for_our_web_page/setup.py @@ -0,0 +1,38 @@ +from setuptools import find_packages +from setuptools import setup + + +version = '0.0' + +setup(name='Sample', + version=version, + description="", + long_description="""\ +""", + # Get strings from http://www.python.org/pypi?%3Aaction=list_classifiers + classifiers=[], + keywords="", + author="", + author_email="", + url="", + license="", + package_dir={'': 'src'}, + packages=find_packages('src'), + include_package_data=True, + zip_safe=False, + install_requires=['setuptools', + 'grok', + 'grokui.admin', + 'z3c.testsetup', + 'grokcore.startup', + # Add extra requirements here + ], + entry_points=""" + [console_scripts] + sample-debug = grokcore.startup:interactive_debug_prompt + sample-ctl = grokcore.startup:zdaemon_controller + [paste.app_factory] + main = grokcore.startup:application_factory + debug = grokcore.startup:debug_application_factory + """, + ) diff --git a/doc/groktut/static_resources_for_our_web_page/src/sample/__init__.py b/docs/groktut/static_resources_for_our_web_page/src/sample/__init__.py similarity index 100% rename from doc/groktut/static_resources_for_our_web_page/src/sample/__init__.py rename to docs/groktut/static_resources_for_our_web_page/src/sample/__init__.py diff --git a/doc/groktut/publishing_a_simple_web_page/src/sample/app.py b/docs/groktut/static_resources_for_our_web_page/src/sample/app.py similarity index 97% rename from doc/groktut/publishing_a_simple_web_page/src/sample/app.py rename to docs/groktut/static_resources_for_our_web_page/src/sample/app.py index 26082a7..bcc6e3e 100644 --- a/doc/groktut/publishing_a_simple_web_page/src/sample/app.py +++ b/docs/groktut/static_resources_for_our_web_page/src/sample/app.py @@ -1,7 +1,9 @@ import grok - + + class Sample(grok.Application, grok.Container): pass + class Index(grok.View): pass diff --git a/doc/groktut/static_resources_for_our_web_page/src/sample/app_templates/index.pt b/docs/groktut/static_resources_for_our_web_page/src/sample/app_templates/index.pt similarity index 100% rename from doc/groktut/static_resources_for_our_web_page/src/sample/app_templates/index.pt rename to docs/groktut/static_resources_for_our_web_page/src/sample/app_templates/index.pt diff --git a/doc/groktut/static_resources_for_our_web_page/src/sample/configure.zcml b/docs/groktut/static_resources_for_our_web_page/src/sample/configure.zcml similarity index 100% rename from doc/groktut/static_resources_for_our_web_page/src/sample/configure.zcml rename to docs/groktut/static_resources_for_our_web_page/src/sample/configure.zcml diff --git a/doc/groktut/static_resources_for_our_web_page/src/sample/static/style.css b/docs/groktut/static_resources_for_our_web_page/src/sample/static/style.css similarity index 100% rename from doc/groktut/static_resources_for_our_web_page/src/sample/static/style.css rename to docs/groktut/static_resources_for_our_web_page/src/sample/static/style.css diff --git a/doc/groktut/storing_data/buildout.cfg b/docs/groktut/storing_data/buildout.cfg similarity index 100% rename from doc/groktut/storing_data/buildout.cfg rename to docs/groktut/storing_data/buildout.cfg diff --git a/doc/groktut/storing_data/etc/README.txt b/docs/groktut/storing_data/etc/README.txt similarity index 100% rename from doc/groktut/storing_data/etc/README.txt rename to docs/groktut/storing_data/etc/README.txt diff --git a/doc/groktut/storing_data/etc/debug.ini.in b/docs/groktut/storing_data/etc/debug.ini.in similarity index 100% rename from doc/groktut/storing_data/etc/debug.ini.in rename to docs/groktut/storing_data/etc/debug.ini.in diff --git a/doc/groktut/storing_data/etc/deploy.ini.in b/docs/groktut/storing_data/etc/deploy.ini.in similarity index 100% rename from doc/groktut/storing_data/etc/deploy.ini.in rename to docs/groktut/storing_data/etc/deploy.ini.in diff --git a/doc/groktut/storing_data/etc/site.zcml.in b/docs/groktut/storing_data/etc/site.zcml.in similarity index 100% rename from doc/groktut/storing_data/etc/site.zcml.in rename to docs/groktut/storing_data/etc/site.zcml.in diff --git a/doc/groktut/storing_data/etc/zope.conf.in b/docs/groktut/storing_data/etc/zope.conf.in similarity index 100% rename from doc/groktut/storing_data/etc/zope.conf.in rename to docs/groktut/storing_data/etc/zope.conf.in diff --git a/docs/groktut/storing_data/setup.py b/docs/groktut/storing_data/setup.py new file mode 100644 index 0000000..3a60519 --- /dev/null +++ b/docs/groktut/storing_data/setup.py @@ -0,0 +1,38 @@ +from setuptools import find_packages +from setuptools import setup + + +version = '0.0' + +setup(name='Sample', + version=version, + description="", + long_description="""\ +""", + # Get strings from http://www.python.org/pypi?%3Aaction=list_classifiers + classifiers=[], + keywords="", + author="", + author_email="", + url="", + license="", + package_dir={'': 'src'}, + packages=find_packages('src'), + include_package_data=True, + zip_safe=False, + install_requires=['setuptools', + 'grok', + 'grokui.admin', + 'z3c.testsetup', + 'grokcore.startup', + # Add extra requirements here + ], + entry_points=""" + [console_scripts] + sample-debug = grokcore.startup:interactive_debug_prompt + sample-ctl = grokcore.startup:zdaemon_controller + [paste.app_factory] + main = grokcore.startup:application_factory + debug = grokcore.startup:debug_application_factory + """, + ) diff --git a/doc/groktut/storing_data/src/sample/__init__.py b/docs/groktut/storing_data/src/sample/__init__.py similarity index 100% rename from doc/groktut/storing_data/src/sample/__init__.py rename to docs/groktut/storing_data/src/sample/__init__.py diff --git a/doc/groktut/storing_data/src/sample/app.py b/docs/groktut/storing_data/src/sample/app.py similarity index 98% rename from doc/groktut/storing_data/src/sample/app.py rename to docs/groktut/storing_data/src/sample/app.py index b3ac664..586b40a 100644 --- a/doc/groktut/storing_data/src/sample/app.py +++ b/docs/groktut/storing_data/src/sample/app.py @@ -1,11 +1,14 @@ import grok + class Sample(grok.Application, grok.Container): text = 'default text' + class Index(grok.View): pass + class Edit(grok.View): def update(self, text=None): if text is None: diff --git a/doc/groktut/storing_data/src/sample/app_templates/edit.pt b/docs/groktut/storing_data/src/sample/app_templates/edit.pt similarity index 100% rename from doc/groktut/storing_data/src/sample/app_templates/edit.pt rename to docs/groktut/storing_data/src/sample/app_templates/edit.pt diff --git a/doc/groktut/storing_data/src/sample/app_templates/index.pt b/docs/groktut/storing_data/src/sample/app_templates/index.pt similarity index 100% rename from doc/groktut/storing_data/src/sample/app_templates/index.pt rename to docs/groktut/storing_data/src/sample/app_templates/index.pt diff --git a/doc/groktut/storing_data/src/sample/configure.zcml b/docs/groktut/storing_data/src/sample/configure.zcml similarity index 100% rename from doc/groktut/storing_data/src/sample/configure.zcml rename to docs/groktut/storing_data/src/sample/configure.zcml diff --git a/doc/groktut/template/buildout.cfg b/docs/groktut/template/buildout.cfg similarity index 100% rename from doc/groktut/template/buildout.cfg rename to docs/groktut/template/buildout.cfg diff --git a/doc/groktut/template/etc/README.txt b/docs/groktut/template/etc/README.txt similarity index 100% rename from doc/groktut/template/etc/README.txt rename to docs/groktut/template/etc/README.txt diff --git a/doc/groktut/template/etc/debug.ini.in b/docs/groktut/template/etc/debug.ini.in similarity index 100% rename from doc/groktut/template/etc/debug.ini.in rename to docs/groktut/template/etc/debug.ini.in diff --git a/doc/groktut/template/etc/deploy.ini.in b/docs/groktut/template/etc/deploy.ini.in similarity index 100% rename from doc/groktut/template/etc/deploy.ini.in rename to docs/groktut/template/etc/deploy.ini.in diff --git a/doc/groktut/template/etc/site.zcml.in b/docs/groktut/template/etc/site.zcml.in similarity index 100% rename from doc/groktut/template/etc/site.zcml.in rename to docs/groktut/template/etc/site.zcml.in diff --git a/doc/groktut/template/etc/zope.conf.in b/docs/groktut/template/etc/zope.conf.in similarity index 100% rename from doc/groktut/template/etc/zope.conf.in rename to docs/groktut/template/etc/zope.conf.in diff --git a/docs/groktut/template/setup.py b/docs/groktut/template/setup.py new file mode 100644 index 0000000..3a60519 --- /dev/null +++ b/docs/groktut/template/setup.py @@ -0,0 +1,38 @@ +from setuptools import find_packages +from setuptools import setup + + +version = '0.0' + +setup(name='Sample', + version=version, + description="", + long_description="""\ +""", + # Get strings from http://www.python.org/pypi?%3Aaction=list_classifiers + classifiers=[], + keywords="", + author="", + author_email="", + url="", + license="", + package_dir={'': 'src'}, + packages=find_packages('src'), + include_package_data=True, + zip_safe=False, + install_requires=['setuptools', + 'grok', + 'grokui.admin', + 'z3c.testsetup', + 'grokcore.startup', + # Add extra requirements here + ], + entry_points=""" + [console_scripts] + sample-debug = grokcore.startup:interactive_debug_prompt + sample-ctl = grokcore.startup:zdaemon_controller + [paste.app_factory] + main = grokcore.startup:application_factory + debug = grokcore.startup:debug_application_factory + """, + ) diff --git a/doc/groktut/template/src/sample/__init__.py b/docs/groktut/template/src/sample/__init__.py similarity index 100% rename from doc/groktut/template/src/sample/__init__.py rename to docs/groktut/template/src/sample/__init__.py diff --git a/doc/groktut/an_empty_grok_project/src/sample/app.py b/docs/groktut/template/src/sample/app.py similarity index 69% rename from doc/groktut/an_empty_grok_project/src/sample/app.py rename to docs/groktut/template/src/sample/app.py index 98a80d7..862265b 100644 --- a/doc/groktut/an_empty_grok_project/src/sample/app.py +++ b/docs/groktut/template/src/sample/app.py @@ -1,7 +1,9 @@ import grok + class Sample(grok.Application, grok.Container): pass + class Index(grok.View): - pass # see app_templates/index.pt + pass # see app_templates/index.pt diff --git a/doc/groktut/template/src/sample/app_templates/index.pt b/docs/groktut/template/src/sample/app_templates/index.pt similarity index 100% rename from doc/groktut/template/src/sample/app_templates/index.pt rename to docs/groktut/template/src/sample/app_templates/index.pt diff --git a/doc/groktut/template/src/sample/configure.zcml b/docs/groktut/template/src/sample/configure.zcml similarity index 100% rename from doc/groktut/template/src/sample/configure.zcml rename to docs/groktut/template/src/sample/configure.zcml diff --git a/doc/groktut/the_rules_of_persistence/buildout.cfg b/docs/groktut/the_rules_of_persistence/buildout.cfg similarity index 100% rename from doc/groktut/the_rules_of_persistence/buildout.cfg rename to docs/groktut/the_rules_of_persistence/buildout.cfg diff --git a/doc/groktut/the_rules_of_persistence/etc/README.txt b/docs/groktut/the_rules_of_persistence/etc/README.txt similarity index 100% rename from doc/groktut/the_rules_of_persistence/etc/README.txt rename to docs/groktut/the_rules_of_persistence/etc/README.txt diff --git a/doc/groktut/the_rules_of_persistence/etc/debug.ini.in b/docs/groktut/the_rules_of_persistence/etc/debug.ini.in similarity index 100% rename from doc/groktut/the_rules_of_persistence/etc/debug.ini.in rename to docs/groktut/the_rules_of_persistence/etc/debug.ini.in diff --git a/doc/groktut/the_rules_of_persistence/etc/deploy.ini.in b/docs/groktut/the_rules_of_persistence/etc/deploy.ini.in similarity index 100% rename from doc/groktut/the_rules_of_persistence/etc/deploy.ini.in rename to docs/groktut/the_rules_of_persistence/etc/deploy.ini.in diff --git a/doc/groktut/the_rules_of_persistence/etc/site.zcml.in b/docs/groktut/the_rules_of_persistence/etc/site.zcml.in similarity index 100% rename from doc/groktut/the_rules_of_persistence/etc/site.zcml.in rename to docs/groktut/the_rules_of_persistence/etc/site.zcml.in diff --git a/doc/groktut/the_rules_of_persistence/etc/zope.conf.in b/docs/groktut/the_rules_of_persistence/etc/zope.conf.in similarity index 100% rename from doc/groktut/the_rules_of_persistence/etc/zope.conf.in rename to docs/groktut/the_rules_of_persistence/etc/zope.conf.in diff --git a/docs/groktut/the_rules_of_persistence/setup.py b/docs/groktut/the_rules_of_persistence/setup.py new file mode 100644 index 0000000..3a60519 --- /dev/null +++ b/docs/groktut/the_rules_of_persistence/setup.py @@ -0,0 +1,38 @@ +from setuptools import find_packages +from setuptools import setup + + +version = '0.0' + +setup(name='Sample', + version=version, + description="", + long_description="""\ +""", + # Get strings from http://www.python.org/pypi?%3Aaction=list_classifiers + classifiers=[], + keywords="", + author="", + author_email="", + url="", + license="", + package_dir={'': 'src'}, + packages=find_packages('src'), + include_package_data=True, + zip_safe=False, + install_requires=['setuptools', + 'grok', + 'grokui.admin', + 'z3c.testsetup', + 'grokcore.startup', + # Add extra requirements here + ], + entry_points=""" + [console_scripts] + sample-debug = grokcore.startup:interactive_debug_prompt + sample-ctl = grokcore.startup:zdaemon_controller + [paste.app_factory] + main = grokcore.startup:application_factory + debug = grokcore.startup:debug_application_factory + """, + ) diff --git a/doc/groktut/the_rules_of_persistence/src/sample/__init__.py b/docs/groktut/the_rules_of_persistence/src/sample/__init__.py similarity index 100% rename from doc/groktut/the_rules_of_persistence/src/sample/__init__.py rename to docs/groktut/the_rules_of_persistence/src/sample/__init__.py diff --git a/doc/groktut/the_rules_of_persistence/src/sample/app.py b/docs/groktut/the_rules_of_persistence/src/sample/app.py similarity index 98% rename from doc/groktut/the_rules_of_persistence/src/sample/app.py rename to docs/groktut/the_rules_of_persistence/src/sample/app.py index 3c49c7c..74cb339 100644 --- a/doc/groktut/the_rules_of_persistence/src/sample/app.py +++ b/docs/groktut/the_rules_of_persistence/src/sample/app.py @@ -1,13 +1,16 @@ import grok + class Sample(grok.Application, grok.Container): def __init__(self): super(Sample, self).__init__() self.list = [] - + + class Index(grok.View): pass + class Edit(grok.View): def update(self, text=None): if text is None: diff --git a/doc/groktut/the_rules_of_persistence/src/sample/app_templates/edit.pt b/docs/groktut/the_rules_of_persistence/src/sample/app_templates/edit.pt similarity index 100% rename from doc/groktut/the_rules_of_persistence/src/sample/app_templates/edit.pt rename to docs/groktut/the_rules_of_persistence/src/sample/app_templates/edit.pt diff --git a/doc/groktut/the_rules_of_persistence/src/sample/app_templates/index.pt b/docs/groktut/the_rules_of_persistence/src/sample/app_templates/index.pt similarity index 100% rename from doc/groktut/the_rules_of_persistence/src/sample/app_templates/index.pt rename to docs/groktut/the_rules_of_persistence/src/sample/app_templates/index.pt diff --git a/doc/groktut/the_rules_of_persistence/src/sample/configure.zcml b/docs/groktut/the_rules_of_persistence/src/sample/configure.zcml similarity index 100% rename from doc/groktut/the_rules_of_persistence/src/sample/configure.zcml rename to docs/groktut/the_rules_of_persistence/src/sample/configure.zcml diff --git a/doc/groktut/the_rules_of_persistence2/buildout.cfg b/docs/groktut/the_rules_of_persistence2/buildout.cfg similarity index 100% rename from doc/groktut/the_rules_of_persistence2/buildout.cfg rename to docs/groktut/the_rules_of_persistence2/buildout.cfg diff --git a/doc/groktut/the_rules_of_persistence2/etc/README.txt b/docs/groktut/the_rules_of_persistence2/etc/README.txt similarity index 100% rename from doc/groktut/the_rules_of_persistence2/etc/README.txt rename to docs/groktut/the_rules_of_persistence2/etc/README.txt diff --git a/doc/groktut/the_rules_of_persistence2/etc/debug.ini.in b/docs/groktut/the_rules_of_persistence2/etc/debug.ini.in similarity index 100% rename from doc/groktut/the_rules_of_persistence2/etc/debug.ini.in rename to docs/groktut/the_rules_of_persistence2/etc/debug.ini.in diff --git a/doc/groktut/the_rules_of_persistence2/etc/deploy.ini.in b/docs/groktut/the_rules_of_persistence2/etc/deploy.ini.in similarity index 100% rename from doc/groktut/the_rules_of_persistence2/etc/deploy.ini.in rename to docs/groktut/the_rules_of_persistence2/etc/deploy.ini.in diff --git a/doc/groktut/the_rules_of_persistence2/etc/site.zcml.in b/docs/groktut/the_rules_of_persistence2/etc/site.zcml.in similarity index 100% rename from doc/groktut/the_rules_of_persistence2/etc/site.zcml.in rename to docs/groktut/the_rules_of_persistence2/etc/site.zcml.in diff --git a/doc/groktut/the_rules_of_persistence2/etc/zope.conf.in b/docs/groktut/the_rules_of_persistence2/etc/zope.conf.in similarity index 100% rename from doc/groktut/the_rules_of_persistence2/etc/zope.conf.in rename to docs/groktut/the_rules_of_persistence2/etc/zope.conf.in diff --git a/docs/groktut/the_rules_of_persistence2/setup.py b/docs/groktut/the_rules_of_persistence2/setup.py new file mode 100644 index 0000000..3a60519 --- /dev/null +++ b/docs/groktut/the_rules_of_persistence2/setup.py @@ -0,0 +1,38 @@ +from setuptools import find_packages +from setuptools import setup + + +version = '0.0' + +setup(name='Sample', + version=version, + description="", + long_description="""\ +""", + # Get strings from http://www.python.org/pypi?%3Aaction=list_classifiers + classifiers=[], + keywords="", + author="", + author_email="", + url="", + license="", + package_dir={'': 'src'}, + packages=find_packages('src'), + include_package_data=True, + zip_safe=False, + install_requires=['setuptools', + 'grok', + 'grokui.admin', + 'z3c.testsetup', + 'grokcore.startup', + # Add extra requirements here + ], + entry_points=""" + [console_scripts] + sample-debug = grokcore.startup:interactive_debug_prompt + sample-ctl = grokcore.startup:zdaemon_controller + [paste.app_factory] + main = grokcore.startup:application_factory + debug = grokcore.startup:debug_application_factory + """, + ) diff --git a/doc/groktut/the_rules_of_persistence2/src/sample/__init__.py b/docs/groktut/the_rules_of_persistence2/src/sample/__init__.py similarity index 100% rename from doc/groktut/the_rules_of_persistence2/src/sample/__init__.py rename to docs/groktut/the_rules_of_persistence2/src/sample/__init__.py diff --git a/doc/groktut/the_rules_of_persistence2/src/sample/app.py b/docs/groktut/the_rules_of_persistence2/src/sample/app.py similarity index 98% rename from doc/groktut/the_rules_of_persistence2/src/sample/app.py rename to docs/groktut/the_rules_of_persistence2/src/sample/app.py index ffbf62d..230bca0 100644 --- a/doc/groktut/the_rules_of_persistence2/src/sample/app.py +++ b/docs/groktut/the_rules_of_persistence2/src/sample/app.py @@ -1,13 +1,16 @@ import grok + class Sample(grok.Application, grok.Container): def __init__(self): super(Sample, self).__init__() self.list = [] - + + class Index(grok.View): pass + class Edit(grok.View): def update(self, text=None): if text is None: diff --git a/doc/groktut/the_rules_of_persistence2/src/sample/app_templates/edit.pt b/docs/groktut/the_rules_of_persistence2/src/sample/app_templates/edit.pt similarity index 100% rename from doc/groktut/the_rules_of_persistence2/src/sample/app_templates/edit.pt rename to docs/groktut/the_rules_of_persistence2/src/sample/app_templates/edit.pt diff --git a/doc/groktut/the_rules_of_persistence2/src/sample/app_templates/index.pt b/docs/groktut/the_rules_of_persistence2/src/sample/app_templates/index.pt similarity index 100% rename from doc/groktut/the_rules_of_persistence2/src/sample/app_templates/index.pt rename to docs/groktut/the_rules_of_persistence2/src/sample/app_templates/index.pt diff --git a/doc/groktut/the_rules_of_persistence2/src/sample/configure.zcml b/docs/groktut/the_rules_of_persistence2/src/sample/configure.zcml similarity index 100% rename from doc/groktut/the_rules_of_persistence2/src/sample/configure.zcml rename to docs/groktut/the_rules_of_persistence2/src/sample/configure.zcml diff --git a/doc/groktut/the_rules_of_persistence3/buildout.cfg b/docs/groktut/the_rules_of_persistence3/buildout.cfg similarity index 100% rename from doc/groktut/the_rules_of_persistence3/buildout.cfg rename to docs/groktut/the_rules_of_persistence3/buildout.cfg diff --git a/doc/groktut/the_rules_of_persistence3/etc/README.txt b/docs/groktut/the_rules_of_persistence3/etc/README.txt similarity index 100% rename from doc/groktut/the_rules_of_persistence3/etc/README.txt rename to docs/groktut/the_rules_of_persistence3/etc/README.txt diff --git a/doc/groktut/the_rules_of_persistence3/etc/debug.ini.in b/docs/groktut/the_rules_of_persistence3/etc/debug.ini.in similarity index 100% rename from doc/groktut/the_rules_of_persistence3/etc/debug.ini.in rename to docs/groktut/the_rules_of_persistence3/etc/debug.ini.in diff --git a/doc/groktut/the_rules_of_persistence3/etc/deploy.ini.in b/docs/groktut/the_rules_of_persistence3/etc/deploy.ini.in similarity index 100% rename from doc/groktut/the_rules_of_persistence3/etc/deploy.ini.in rename to docs/groktut/the_rules_of_persistence3/etc/deploy.ini.in diff --git a/doc/groktut/the_rules_of_persistence3/etc/site.zcml.in b/docs/groktut/the_rules_of_persistence3/etc/site.zcml.in similarity index 100% rename from doc/groktut/the_rules_of_persistence3/etc/site.zcml.in rename to docs/groktut/the_rules_of_persistence3/etc/site.zcml.in diff --git a/doc/groktut/the_rules_of_persistence3/etc/zope.conf.in b/docs/groktut/the_rules_of_persistence3/etc/zope.conf.in similarity index 100% rename from doc/groktut/the_rules_of_persistence3/etc/zope.conf.in rename to docs/groktut/the_rules_of_persistence3/etc/zope.conf.in diff --git a/docs/groktut/the_rules_of_persistence3/setup.py b/docs/groktut/the_rules_of_persistence3/setup.py new file mode 100644 index 0000000..3a60519 --- /dev/null +++ b/docs/groktut/the_rules_of_persistence3/setup.py @@ -0,0 +1,38 @@ +from setuptools import find_packages +from setuptools import setup + + +version = '0.0' + +setup(name='Sample', + version=version, + description="", + long_description="""\ +""", + # Get strings from http://www.python.org/pypi?%3Aaction=list_classifiers + classifiers=[], + keywords="", + author="", + author_email="", + url="", + license="", + package_dir={'': 'src'}, + packages=find_packages('src'), + include_package_data=True, + zip_safe=False, + install_requires=['setuptools', + 'grok', + 'grokui.admin', + 'z3c.testsetup', + 'grokcore.startup', + # Add extra requirements here + ], + entry_points=""" + [console_scripts] + sample-debug = grokcore.startup:interactive_debug_prompt + sample-ctl = grokcore.startup:zdaemon_controller + [paste.app_factory] + main = grokcore.startup:application_factory + debug = grokcore.startup:debug_application_factory + """, + ) diff --git a/doc/groktut/the_rules_of_persistence3/src/sample/__init__.py b/docs/groktut/the_rules_of_persistence3/src/sample/__init__.py similarity index 100% rename from doc/groktut/the_rules_of_persistence3/src/sample/__init__.py rename to docs/groktut/the_rules_of_persistence3/src/sample/__init__.py diff --git a/doc/groktut/the_rules_of_persistence3/src/sample/app.py b/docs/groktut/the_rules_of_persistence3/src/sample/app.py similarity index 98% rename from doc/groktut/the_rules_of_persistence3/src/sample/app.py rename to docs/groktut/the_rules_of_persistence3/src/sample/app.py index 645d26d..81d320c 100644 --- a/doc/groktut/the_rules_of_persistence3/src/sample/app.py +++ b/docs/groktut/the_rules_of_persistence3/src/sample/app.py @@ -1,5 +1,6 @@ import grok + class Sample(grok.Application, grok.Container): def __init__(self): super(Sample, self).__init__() @@ -8,10 +9,12 @@ def __init__(self): def addText(self, text): self.list.append(text) self._p_changed = True - + + class Index(grok.View): pass + class Edit(grok.View): def update(self, text=None): if text is None: diff --git a/doc/groktut/the_rules_of_persistence3/src/sample/app_templates/edit.pt b/docs/groktut/the_rules_of_persistence3/src/sample/app_templates/edit.pt similarity index 100% rename from doc/groktut/the_rules_of_persistence3/src/sample/app_templates/edit.pt rename to docs/groktut/the_rules_of_persistence3/src/sample/app_templates/edit.pt diff --git a/doc/groktut/the_rules_of_persistence3/src/sample/app_templates/index.pt b/docs/groktut/the_rules_of_persistence3/src/sample/app_templates/index.pt similarity index 100% rename from doc/groktut/the_rules_of_persistence3/src/sample/app_templates/index.pt rename to docs/groktut/the_rules_of_persistence3/src/sample/app_templates/index.pt diff --git a/doc/groktut/the_rules_of_persistence3/src/sample/configure.zcml b/docs/groktut/the_rules_of_persistence3/src/sample/configure.zcml similarity index 100% rename from doc/groktut/the_rules_of_persistence3/src/sample/configure.zcml rename to docs/groktut/the_rules_of_persistence3/src/sample/configure.zcml diff --git a/doc/groktut/using_view_methods/buildout.cfg b/docs/groktut/using_view_methods/buildout.cfg similarity index 100% rename from doc/groktut/using_view_methods/buildout.cfg rename to docs/groktut/using_view_methods/buildout.cfg diff --git a/doc/groktut/using_view_methods/etc/README.txt b/docs/groktut/using_view_methods/etc/README.txt similarity index 100% rename from doc/groktut/using_view_methods/etc/README.txt rename to docs/groktut/using_view_methods/etc/README.txt diff --git a/doc/groktut/using_view_methods/etc/debug.ini.in b/docs/groktut/using_view_methods/etc/debug.ini.in similarity index 100% rename from doc/groktut/using_view_methods/etc/debug.ini.in rename to docs/groktut/using_view_methods/etc/debug.ini.in diff --git a/doc/groktut/using_view_methods/etc/deploy.ini.in b/docs/groktut/using_view_methods/etc/deploy.ini.in similarity index 100% rename from doc/groktut/using_view_methods/etc/deploy.ini.in rename to docs/groktut/using_view_methods/etc/deploy.ini.in diff --git a/doc/groktut/using_view_methods/etc/site.zcml.in b/docs/groktut/using_view_methods/etc/site.zcml.in similarity index 100% rename from doc/groktut/using_view_methods/etc/site.zcml.in rename to docs/groktut/using_view_methods/etc/site.zcml.in diff --git a/doc/groktut/using_view_methods/etc/zope.conf.in b/docs/groktut/using_view_methods/etc/zope.conf.in similarity index 100% rename from doc/groktut/using_view_methods/etc/zope.conf.in rename to docs/groktut/using_view_methods/etc/zope.conf.in diff --git a/docs/groktut/using_view_methods/setup.py b/docs/groktut/using_view_methods/setup.py new file mode 100644 index 0000000..3a60519 --- /dev/null +++ b/docs/groktut/using_view_methods/setup.py @@ -0,0 +1,38 @@ +from setuptools import find_packages +from setuptools import setup + + +version = '0.0' + +setup(name='Sample', + version=version, + description="", + long_description="""\ +""", + # Get strings from http://www.python.org/pypi?%3Aaction=list_classifiers + classifiers=[], + keywords="", + author="", + author_email="", + url="", + license="", + package_dir={'': 'src'}, + packages=find_packages('src'), + include_package_data=True, + zip_safe=False, + install_requires=['setuptools', + 'grok', + 'grokui.admin', + 'z3c.testsetup', + 'grokcore.startup', + # Add extra requirements here + ], + entry_points=""" + [console_scripts] + sample-debug = grokcore.startup:interactive_debug_prompt + sample-ctl = grokcore.startup:zdaemon_controller + [paste.app_factory] + main = grokcore.startup:application_factory + debug = grokcore.startup:debug_application_factory + """, + ) diff --git a/doc/groktut/using_view_methods/src/sample/__init__.py b/docs/groktut/using_view_methods/src/sample/__init__.py similarity index 100% rename from doc/groktut/using_view_methods/src/sample/__init__.py rename to docs/groktut/using_view_methods/src/sample/__init__.py diff --git a/doc/groktut/using_view_methods/src/sample/app.py b/docs/groktut/using_view_methods/src/sample/app.py similarity index 88% rename from doc/groktut/using_view_methods/src/sample/app.py rename to docs/groktut/using_view_methods/src/sample/app.py index 91f4460..c036446 100644 --- a/doc/groktut/using_view_methods/src/sample/app.py +++ b/docs/groktut/using_view_methods/src/sample/app.py @@ -1,10 +1,13 @@ -import grok from datetime import datetime +import grok + + class Sample(grok.Application, grok.Container): pass -class Index(grok.View): + +class Index(grok.View): def current_datetime(self): now = datetime.now() return now.strftime('%Y-%m-%d %H:%M') diff --git a/doc/groktut/using_view_methods/src/sample/app_templates/index.pt b/docs/groktut/using_view_methods/src/sample/app_templates/index.pt similarity index 100% rename from doc/groktut/using_view_methods/src/sample/app_templates/index.pt rename to docs/groktut/using_view_methods/src/sample/app_templates/index.pt diff --git a/doc/groktut/using_view_methods/src/sample/configure.zcml b/docs/groktut/using_view_methods/src/sample/configure.zcml similarity index 100% rename from doc/groktut/using_view_methods/src/sample/configure.zcml rename to docs/groktut/using_view_methods/src/sample/configure.zcml diff --git a/doc/index.rst b/docs/index.rst similarity index 100% rename from doc/index.rst rename to docs/index.rst diff --git a/doc/layout.html b/docs/layout.html similarity index 85% rename from doc/layout.html rename to docs/layout.html index 37ed5fa..d47e1d3 100644 --- a/doc/layout.html +++ b/docs/layout.html @@ -16,7 +16,7 @@

Navigation

  • Developer's Notes
  • Reference
  • Index
  • -
  • Grok Community Documentation
  • +
  • Grok Community Documentation
  • {%- block relbaritems %}{% endblock %} @@ -26,7 +26,7 @@

    Navigation

    {%- block sidebarlogo %} - diff --git a/doc/license.rst b/docs/license.rst similarity index 100% rename from doc/license.rst rename to docs/license.rst diff --git a/doc/make.bat b/docs/make.bat similarity index 100% rename from doc/make.bat rename to docs/make.bat diff --git a/doc/naming_conventions.rst b/docs/naming_conventions.rst similarity index 100% rename from doc/naming_conventions.rst rename to docs/naming_conventions.rst diff --git a/doc/reference/components.rst b/docs/reference/components.rst similarity index 99% rename from doc/reference/components.rst rename to docs/reference/components.rst index 5a6d4e3..4df9847 100644 --- a/doc/reference/components.rst +++ b/docs/reference/components.rst @@ -149,14 +149,6 @@ reasonable performance for large collections of objects. Return an iterator for the keys of the mapping object. - .. method:: values() - - Return the values of the mapping object. - - .. method:: items() - - Return the items of the mapping object. - .. method:: __len__() Return the number of items. @@ -397,7 +389,7 @@ The source code for the `grok.Adapter` base class is simply: Base class to define an adapter. Adapters are automatically registered when a module is "grokked". - .. attribute:: context + .. attribute:::no-index: context The adapted object. @@ -1480,7 +1472,6 @@ are not bound to any existing content or model object. .. autoclass:: grok.AddForm :members: - :undoc-members: Inherits from :class:`grok.Form`. @@ -1493,7 +1484,6 @@ are bound to the object set in the `context` attribute. .. autoclass:: grok.EditForm :members: - :undoc-members: Inherits from :class:`grok.Form`. @@ -1506,7 +1496,6 @@ form are bound to the object set in the `context` attribute. .. autoclass:: grok.DisplayForm :members: - :undoc-members: Inherits from :class:`grok.Form`. diff --git a/doc/reference/conf.py b/docs/reference/conf.py similarity index 82% rename from doc/reference/conf.py rename to docs/reference/conf.py index 25173ae..a3a90b1 100644 --- a/doc/reference/conf.py +++ b/docs/reference/conf.py @@ -3,45 +3,43 @@ # Grok Reference documentation build configuration file, created by # sphinx-quickstart.py on Wed Feb 20 02:11:17 2008. # -# This file is execfile()d with the current directory set to its containing dir. +# This file is execfile()d with the current directory set to its containing +# dir. # # The contents of this file are pickled, so don't put values in the namespace -# that aren't pickleable (module imports are okay, they're removed automatically). +# that aren't pickleable (module imports are okay, they're removed +# automatically). # # All configuration values have a default value; values that are commented out # show the default value as assigned to them. -import sys - -#import os -from os import path, curdir import re +from os import curdir +from os import path version = 'Unknown' setupfilepath = path.join(path.dirname( path.dirname(path.abspath(curdir))), 'setup.py') -reg = re.compile("^\s*version=.(.+).,.*") +reg = re.compile(r"^\s*version=.(.+).,.*") for line in open(setupfilepath, 'r').read().split(): m = reg.match(line) if m: version = m.groups()[0] - - # If your extensions are in another directory, add it here. -#sys.path.append('some/directory') +# sys.path.append('some/directory') # General configuration # --------------------- -# Add any Sphinx extension module names here, as strings. They can be extensions -# coming with Sphinx (named 'sphinx.addons.*') or your custom ones. -#extensions = [] +# Add any Sphinx extension module names here, as strings. They can be +# extensions coming with Sphinx (named 'sphinx.addons.*') or your custom ones. +# extensions = [] # Add any paths that contain templates here, relative to this directory. -#templates_path = [] +# templates_path = [] # The suffix of source filenames. source_suffix = '.rst' @@ -51,7 +49,7 @@ # General substitutions. project = 'Grok Reference' -copyright = '2006-2008, The Zope Foundation' +copyright = '2006-2023, The Zope Foundation' # The default replacements for |version| and |release|, also used in various # other places throughout the built documents. @@ -63,19 +61,19 @@ # There are two options for replacing |today|: either, you set today to some # non-false value, then it is used: -#today = '' +# today = '' # Else, today_fmt is used as the format for a strftime call. today_fmt = '%B %d, %Y' # List of documents that shouldn't be included in the build. -#unused_docs = [] +# unused_docs = [] # If true, '()' will be appended to :func: etc. cross-reference text. -#add_function_parentheses = True +# add_function_parentheses = True # If true, the current module name will be prepended to all description # unit titles (such as .. function::). -#add_module_names = True +# add_module_names = True # Options for HTML output @@ -90,17 +88,17 @@ html_use_smartypants = True # Content template for the index page, filename relative to this file. -#html_index = '' +# html_index = '' # Custom sidebar templates, maps page names to filenames relative to this file. -#html_sidebars = {} +# html_sidebars = {} # Additional templates that should be rendered to pages, maps page names to # filenames relative to this file. -#html_additional_pages = {} +# html_additional_pages = {} # If true, the reST sources are included in the HTML build as _sources/. -#html_copy_source = True +# html_copy_source = True # Output file base name for HTML help builder. htmlhelp_basename = 'Grok Referencedoc' @@ -113,27 +111,28 @@ # Add any paths that contain custom static files (such as style sheets) here, # relative to this directory. They are copied after the builtin static files, # so a file named "default.css" will overwrite the builtin "default.css". -#html_static_path = [path.join(path.abspath(curdir), '.static')] +# html_static_path = [path.join(path.abspath(curdir), '.static')] # Options for LaTeX output # ------------------------ # The paper size ('letter' or 'a4'). -#latex_paper_size = 'letter' +# latex_paper_size = 'letter' # The font size ('10pt', '11pt' or '12pt'). -#latex_font_size = '10pt' +# latex_font_size = '10pt' # Grouping the document tree into LaTeX files. List of tuples -# (source start file, target name, title, author, document class [howto/manual]). -#latex_documents = [] +# (source start file, target name, title, author, document class +# [howto/manual]). +# latex_documents = [] latex_documents = [ ('reference.tex', 'Grok Reference', 'The Grok Team', 'manual') ] # Additional stuff for the LaTeX preamble. -#latex_preamble = ' +# latex_preamble = ' # Documents to append as an appendix to all manuals. -#latex_appendices = [] +# latex_appendices = [] diff --git a/doc/reference/decorators.rst b/docs/reference/decorators.rst similarity index 100% rename from doc/reference/decorators.rst rename to docs/reference/decorators.rst diff --git a/doc/reference/directives.rst b/docs/reference/directives.rst similarity index 100% rename from doc/reference/directives.rst rename to docs/reference/directives.rst diff --git a/doc/reference/events.rst b/docs/reference/events.rst similarity index 100% rename from doc/reference/events.rst rename to docs/reference/events.rst diff --git a/doc/reference/exceptions.rst b/docs/reference/exceptions.rst similarity index 100% rename from doc/reference/exceptions.rst rename to docs/reference/exceptions.rst diff --git a/doc/reference/functions.rst b/docs/reference/functions.rst similarity index 97% rename from doc/reference/functions.rst rename to docs/reference/functions.rst index f0d60fd..f03a2fa 100644 --- a/doc/reference/functions.rst +++ b/docs/reference/functions.rst @@ -156,3 +156,9 @@ will appear as input fields in that order. View classes derived from :class:`grok.View` have a similar :meth:`url` method for constructing URLs. + +:func:`grok.create_application` +=============================== + +.. autofunction:: grok.create_application + diff --git a/doc/reference/index.rst b/docs/reference/index.rst similarity index 100% rename from doc/reference/index.rst rename to docs/reference/index.rst diff --git a/doc/reference/testing.rst b/docs/reference/testing.rst similarity index 99% rename from doc/reference/testing.rst rename to docs/reference/testing.rst index 94fce4f..76cc3b6 100644 --- a/doc/reference/testing.rst +++ b/docs/reference/testing.rst @@ -7,7 +7,7 @@ Installing the testing tool Every Grok-based project will install a test runner that can find and run all test cases for your project. This test runner is installed -using Buildout with the +using Buildout with the `zc.recipe.testrunner `_ recipe. The default configuration is:: @@ -294,7 +294,7 @@ helpers located in the :mod:`grok.testing` module. :undoc-members: :inherited-members: - .. autofunction:: grok.testing.grok_component + .. autofunction:: grokcore.component.testing.grok_component Grok a single component. @@ -332,7 +332,7 @@ helpers located in the :mod:`grok.testing` module. >>> grok('grokcore.component.meta') >>> grok_component('MyAdapter', MyAdapter) True - + The adapter should now be available: >>> adapted = IFoo(Bar()) @@ -341,4 +341,4 @@ helpers located in the :mod:`grok.testing` module. .. deprecated:: 1.0 - Use :func:`grokcore.component.testing.grok_component` instead. \ No newline at end of file + Use :func:`grokcore.component.testing.grok_component` instead. diff --git a/doc/reference/utils.rst b/docs/reference/utils.rst similarity index 87% rename from doc/reference/utils.rst rename to docs/reference/utils.rst index 32f61d6..433502b 100644 --- a/doc/reference/utils.rst +++ b/docs/reference/utils.rst @@ -21,12 +21,6 @@ This function is also available as a method on the :class:`grok.View` class. .. autofunction:: grok.util.applySkin -:func:`grok.util.create_application` -==================================== - -.. autofunction:: grok.util.create_application - - :func:`grok.util.getApplication` ================================ diff --git a/doc/release.rst b/docs/release.rst similarity index 100% rename from doc/release.rst rename to docs/release.rst diff --git a/doc/releases.rst b/docs/releases.rst similarity index 100% rename from doc/releases.rst rename to docs/releases.rst diff --git a/docs/requirements.txt b/docs/requirements.txt new file mode 100644 index 0000000..ebbc7ab --- /dev/null +++ b/docs/requirements.txt @@ -0,0 +1,2 @@ +Sphinx +grok diff --git a/doc/resources/evencaveman.jpg b/docs/resources/evencaveman.jpg similarity index 100% rename from doc/resources/evencaveman.jpg rename to docs/resources/evencaveman.jpg diff --git a/doc/resources/grok-standing.jpg b/docs/resources/grok-standing.jpg similarity index 100% rename from doc/resources/grok-standing.jpg rename to docs/resources/grok-standing.jpg diff --git a/doc/scripts/update-releaseinfo.py b/docs/scripts/update-releaseinfo.py similarity index 74% rename from doc/scripts/update-releaseinfo.py rename to docs/scripts/update-releaseinfo.py index cddcc23..96a4dcc 100644 --- a/doc/scripts/update-releaseinfo.py +++ b/docs/scripts/update-releaseinfo.py @@ -2,17 +2,19 @@ # This script has been shamelessly copied from the Zope Toolkit documentation # and heavily modified. -import ConfigParser import os import os.path -import py.path import socket -import StringIO -import sys -import urllib2 import xml.etree.ElementTree + import pkg_resources +import ConfigParser +import py.path +import StringIO +import urllib2 + + socket.setdefaulttimeout(10) TABLE_HEADER = """\ @@ -41,9 +43,10 @@ DOAP_NS = 'http://usefulinc.com/ns/doap#' GROKTOOLKIT_ROOT = py.path.svnurl('http://svn.zope.org/repos/main/groktoolkit') + def package_list( packages, config, out, line=PACKAGE_LINE): - print >>out, TABLE_HEADER + print(TABLE_HEADER, file=out) for package in sorted(packages): version = config.get('versions', package) if package == 'IPython': @@ -58,25 +61,27 @@ def package_list( description = ' '.join( doap.find('//{%s}shortdesc' % DOAP_NS).text.splitlines()) homepage = 'http://pypi.python.org/pypi/%s/%s' % (package, version) - print >>out, line % dict( + print(line % dict( name=package, homepage=homepage, - description=description, version=version) - print >>out + description=description, version=version), file=out) + print(file=out) + def packages(config, key): if not config.has_option('grok', key): - print 'Key "%s" not found in section [grok]' % key + print('Key "%s" not found in section [grok]' % key) return [] result = config.get('grok', key).splitlines() result = filter(None, map(str.strip, result)) return result + def write_package_list(path, version, use_trunk=False): location = GROKTOOLKIT_ROOT / ('tags/%s' % version) if use_trunk: location = GROKTOOLKIT_ROOT / 'trunk' - print 'Writing package list for Grok Toolkit "%s"' % version, location + print('Writing package list for Grok Toolkit "%s"' % version, location) config = ConfigParser.RawConfigParser() config.optionxform = str @@ -84,45 +89,45 @@ def write_package_list(path, version, use_trunk=False): config.readfp(fp) output = open(path, 'w') - print >>output, GENERATED_WARNING + print(GENERATED_WARNING, file=output) heading = 'Grok %s packages' % version - print >>output, '=' * len(heading) - print >>output, heading - print >>output, '=' * len(heading) + print('=' * len(heading), file=output) + print(heading, file=output) + print('=' * len(heading), file=output) - print >>output, """ -""" + print("\n", file=output) ztk_version = '1.1.4' - print >>output, 'Zope Toolkit %s' % ztk_version - print >>output, '------------------------------' - print >>output, """ + print('Zope Toolkit %s' % ztk_version, file=output) + print('------------------------------', file=output) + print(""" This Grok released is based on Zope Toolkit %s. `Overview `_ of the ZTK. List of the ZTK `packages `_ -""" % (ztk_version, ztk_version, ztk_version) +""" % (ztk_version, ztk_version, ztk_version), file=output) - print >>output, 'Packages' - print >>output, '--------' + print('Packages', file=output) + print('--------', file=output) included = packages(config, 'included') package_list(included, config, output) deprecating = packages(config, 'deprecating') if deprecating: - print >>output, 'Deprecating' - print >>output, '-----------' - package_list(deprecating, versions, output) + print('Deprecating', file=output) + print('-----------', file=output) + package_list(deprecating, config.options('versions'), output) - print >>output, 'Other dependencies' - print >>output, '------------------' + print('Other dependencies', file=output) + print('------------------', file=output) all = config.options('versions') - dependencies = (set(all) - set(included)) #- set(deprecating) + dependencies = (set(all) - set(included)) # - set(deprecating) package_list(dependencies, config, output) output.close() + if __name__ == '__main__': path = os.path.abspath(os.path.join('packages.rst')) dist = pkg_resources.get_distribution('groktoolkit') diff --git a/doc/style.tex b/docs/style.tex similarity index 100% rename from doc/style.tex rename to docs/style.tex diff --git a/doc/template.pt b/docs/template.pt similarity index 100% rename from doc/template.pt rename to docs/template.pt diff --git a/doc/tutorial.rst b/docs/tutorial.rst similarity index 100% rename from doc/tutorial.rst rename to docs/tutorial.rst diff --git a/doc/tutorial_outline.txt b/docs/tutorial_outline.txt similarity index 100% rename from doc/tutorial_outline.txt rename to docs/tutorial_outline.txt diff --git a/doc/upgrade.rst b/docs/upgrade.rst similarity index 100% rename from doc/upgrade.rst rename to docs/upgrade.rst diff --git a/doc/upgrade.txt b/docs/upgrade.txt similarity index 99% rename from doc/upgrade.txt rename to docs/upgrade.txt index 85e8c9a..86f86cf 100644 --- a/doc/upgrade.txt +++ b/docs/upgrade.txt @@ -96,8 +96,8 @@ Extra notes: 2) Include the following code in ``resource.py``:: - from fanstatic import Library - library = Library(PACKAGENAME, 'static') + from fanstatic import Library + library = Library(PACKAGENAME, 'static') 3) In the ``setup.py`` of your project, add the following entry point (again, for each 'static' directory your project may have) :: diff --git a/documentation.cfg b/documentation.cfg index 7779f9a..cbc8cc4 100644 --- a/documentation.cfg +++ b/documentation.cfg @@ -15,7 +15,6 @@ eggs = grokcore.formlib grokcore.json grokcore.message - grokcore.rest grokcore.security grokcore.site grokcore.traverser diff --git a/grok.cfg b/grok.cfg index e10326f..870910a 100644 --- a/grok.cfg +++ b/grok.cfg @@ -1,11 +1,11 @@ [buildout] extends = ztk-versions.cfg -versions = versions +extensions = mr.developer sources = sources -sources-dir = dev -github = git://github.com/zopefoundation +github = https://github.com/zopefoundation github_push = git@github.com:zopefoundation +auto-checkout = [grok] packages = @@ -20,7 +20,6 @@ packages = grokcore.json grokcore.layout grokcore.message - grokcore.rest grokcore.security grokcore.site grokcore.startup @@ -29,7 +28,6 @@ packages = grokcore.viewlet grokcore.xmlrpc martian - z3c.autoinclude z3c.evalexception z3c.flashmessage zc.catalog @@ -37,9 +35,9 @@ packages = zope.fanstatic [versions] -Chameleon = 4.1.0 +Chameleon = 4.4.1 fanstatic = 1.3 -grok = 3.3 +grok = 4.0 grokcore.annotation = 4.0 grokcore.catalog = 4.0 grokcore.chameleon = 4.0 @@ -50,7 +48,6 @@ grokcore.formlib = 4.0 grokcore.json = 4.1 grokcore.layout = 4.0 grokcore.message = 4.0 -grokcore.rest = 4.1 grokcore.security = 4.0 grokcore.site = 4.0 grokcore.startup = 4.0 @@ -62,8 +59,7 @@ grokui.admin = 1.0 grokui.base = 0.8.2 ipython = 8.15.0 martian = 2.0.post1 -z3c.autoinclude = 1.0 -z3c.evalexception = 3.0 +z3c.evalexception = 4.0 z3c.flashmessage = 3.0 z3c.pt = 4.0 z3c.recipe.i18n = 2.0 @@ -83,6 +79,7 @@ collective.recipe.omelette = 1.1.0 collective.recipe.template = 2.2 decorator = 5.1.1 gnureadline = 8.1.2 +grokcore.rest = 4.1 ipython-genutils = 0.2.0 Paste = 3.5.3 pexpect = 4.8.0 @@ -92,22 +89,35 @@ ptyprocess = 0.7.0 requests-toolbelt = 1.0.0 shutilwhich = 1.1.0 simplegeneric = 0.8.1 -traitlets = 5.9.0 +soupsieve = 2.5 tqdm = 4.66.1 +traitlets = 5.9.0 twine = 4.0.2 waitress = 2.1.2 WebOb = 1.8.7 WebTest = 3.0.0 +WSGIProxy2 = 0.5.1 +z3c.autoinclude = 1.0 +zdaemon = 5.0 zest.releaser = 9.0.0 -WSGIProxy2=0.5.1 -# For Python 2 -enum34=1.1.10 -futures = 3.2.0 -mock = 5.1.0 -pathlib2=2.3.7.post1 -scandir = 1.10.0 -trollius = 2.1.post2 +[versions:python37] +# newer Chameleon versions are either yanked or require Python 3.8+ +Chameleon = 4.2.0 +importlib-metadata = 7.0.0 +importlib-resources = 5.12.0 +# Newer versions require Python 3.8+ +typing-extensions = 4.7.1 +zipp = 3.15.0 + +[versions:python38] +importlib-metadata = 7.0.0 +importlib-resources = 6.1.1 +zipp = 3.17.0 + +[versions:python39] +importlib-metadata = 7.0.0 +zipp = 3.17.0 [sources] # While working on the python 3 branches, make use of this sources list. @@ -122,7 +132,6 @@ grokcore.formlib = git ${buildout:github}/grokcore.formlib pushurl=${buildout:gi grokcore.json = git ${buildout:github}/grokcore.json pushurl=${buildout:github_push}/grokcore.json grokcore.layout = git ${buildout:github}/grokcore.layout pushurl=${buildout:github_push}/grokcore.layout grokcore.message = git ${buildout:github}/grokcore.message pushurl=${buildout:github_push}/grokcore.message -grokcore.rest = git ${buildout:github}/grokcore.rest pushurl=${buildout:github_push}/grokcore.rest grokcore.security = git ${buildout:github}/grokcore.security pushurl=${buildout:github_push}/grokcore.security grokcore.site = git ${buildout:github}/grokcore.site pushurl=${buildout:github_push}/grokcore.site grokcore.startup = git ${buildout:github}/grokcore.startup pushurl=${buildout:github_push}/grokcore.startup @@ -131,7 +140,6 @@ grokcore.view = git ${buildout:github}/grokcore.view pushurl=${buildout:github_p grokcore.viewlet = git ${buildout:github}/grokcore.viewlet pushurl=${buildout:github_push}/grokcore.viewlet grokcore.xmlrpc = git ${buildout:github}/grokcore.xmlrpc pushurl=${buildout:github_push}/grokcore.xmlrpc martian = git ${buildout:github}/martian pushurl=${buildout:github_push}/martian -z3c.autoinclude = git ${buildout:github}/z3c.autoinclude pushurl=${buildout:github_push}/z3c.autoinclude z3c.evalexception = git ${buildout:github}/z3c.evalexception pushurl=${buildout:github_push}/z3c.evalexception z3c.flashmessage = git ${buildout:github}/z3c.flashmessage pushurl=${buildout:github_push}/z3c.flashmessage z3c.recipe.i18n = git ${buildout:github}/z3c.recipe.i18n pushurl=${buildout:github_push}/z3c.recipe.i18n diff --git a/setup.cfg b/setup.cfg new file mode 100644 index 0000000..ffa3a24 --- /dev/null +++ b/setup.cfg @@ -0,0 +1,28 @@ +# Generated from: +# https://github.com/zopefoundation/meta/tree/master/config/toolkit +[bdist_wheel] +universal = 0 + +[flake8] +doctests = 1 + +[check-manifest] +ignore = + .editorconfig + .meta.toml + docs/_build/html/_sources/* + docs/_build/html/* + docs/_build/html/*/* + docs/_build/html/*/*/* + docs/_build/html/*/*/*/* + +[isort] +force_single_line = True +combine_as_imports = True +sections = FUTURE,STDLIB,THIRDPARTY,ZOPE,FIRSTPARTY,LOCALFOLDER +known_third_party = docutils, pkg_resources, pytz +known_zope = +known_first_party = +default_section = ZOPE +line_length = 79 +lines_after_imports = 2 diff --git a/setup.py b/setup.py index 706eaae..b375759 100644 --- a/setup.py +++ b/setup.py @@ -1,27 +1,32 @@ -from setuptools import setup, find_packages +from setuptools import setup version = '3.0.0a2.dev0' +with open('README.rst') as f: + README = f.read() + setup( name='groktoolkit', version=version, description='Grok: Now even cavemen can use Zope 3!', author='Grok Team', - author_email='grok-dev@zope.org', - url='http://grok.zope.org', + author_email='zope-dev@zope.dev', license='ZPL', - package_dir={'': 'src'}, - packages=find_packages('src'), - include_package_data=True, + long_description_content_type='text/x-rst', + long_description=README, + classifiers=[ + "Development Status :: 5 - Production/Stable", + "License :: OSI Approved :: Zope Public License", + "Programming Language :: Python :: 3.7", + "Programming Language :: Python :: 3.8", + "Programming Language :: Python :: 3.9", + "Programming Language :: Python :: 3.10", + "Programming Language :: Python :: 3.11", + "Programming Language :: Python :: 3.12", + "Programming Language :: Python :: Implementation :: PyPy", + "Programming Language :: Python :: Implementation :: CPython", + ], zip_safe=False, - install_requires=[ - 'setuptools', - 'zc.buildout', - 'zest.releaser', - ], - entry_points={ - 'zest.releaser.releaser.after': [ - 'upload_ztk_versions=groktoolkit:upload_entrypoint', - ], - } + install_requires=[], + entry_points={} ) diff --git a/src/groktoolkit/__init__.py b/src/groktoolkit/__init__.py deleted file mode 100644 index 147880e..0000000 --- a/src/groktoolkit/__init__.py +++ /dev/null @@ -1,33 +0,0 @@ -import sys -import re -import os -import commands - -HOST = 'grok.zope.org' -RELEASEINFOPATH = '/var/www/html/grok/releaseinfo' - -def _upload_gtk_versions(packageroot, version): - # Create the releaseinfo directory for this version. - cmd = 'ssh %s "mkdir %s/%s"' % (HOST, RELEASEINFOPATH, version) - print(cmd + '\n') - print(commands.getoutput(cmd)) - # ``scp`` the file to the given destination. - versions_filename = os.path.join(packageroot, 'grok.cfg') - cmd = 'scp %s %s:%s/%s/versions.cfg' % ( - versions_filename, HOST, RELEASEINFOPATH, version) - print(cmd + '\n') - print(commands.getoutput(cmd)) - -def upload_entrypoint(data): - if data['name'] != 'groktoolkit': - # We're dealing with another package that somehow depends on - # groktoolkit. Skip the step in that case. - return - packageroot = data['workingdir'] - version = data['version'] - _upload_gtk_versions(packageroot, version) - -def upload_gtk_versions(): - packageroot = os.getcwd() # Ugh. - version = sys.argv[1] # Ugh. - _upload_gtk_versions(packageroot, version) diff --git a/tox.ini b/tox.ini index 5a5ac9b..4167fec 100644 --- a/tox.ini +++ b/tox.ini @@ -1,21 +1,75 @@ +# Generated from: +# https://github.com/zopefoundation/meta/tree/master/config/toolkit [tox] +minversion = 3.18 envlist = - py27, - py34, - py35, - py36, - pypy, + release-check + lint + py37 + py38 + py39 + py310 + py311 + py312 pypy3 + docs [testenv] -deps = -rrequirements.txt -# z3c.recipe.compattest is not tox-enabled, remove ~/.zope.teststats to avoid -# ValueError: unsupported pickle protocol -whitelist-externals = /bin/rm +skip_install = true +deps = + zc.buildout >= 3.0.1 + wheel > 0.37 setenv = - HOME={toxinidir} + zope_i18n_compile_mo_files=True + py312: VIRTUALENV_PIP=23.1.2 + py312: PIP_REQUIRE_VIRTUALENV=0 +commands_pre = + {envbindir}/buildout -nc {toxinidir}/buildout.cfg buildout:directory={envdir} commands = - /bin/rm -f {toxinidir}/.zope.teststats - {envbindir}/buildout bin-directory={envbindir} - {envbindir}/test-grok - /bin/rm -f {toxinidir}/.zope.teststats + {envdir}/bin/test-grok {posargs:-cv} + +[testenv:lint] +basepython = python3 +commands_pre = + mkdir -p {toxinidir}/parts/flake8 +allowlist_externals = + mkdir +commands = + isort --check-only --diff {toxinidir}/docs + flake8 {toxinidir}/docs +deps = + flake8 + isort +[testenv:release-check] +description = ensure that the distribution is ready to release +basepython = python3 +skip_install = true +deps = + twine + build + check-manifest + check-python-versions >= 0.20.0 + wheel +commands_pre = +commands = + check-manifest + check-python-versions + python -m build --sdist --no-isolation + twine check dist/* + +[testenv:isort-apply] +basepython = python3 +skip_install = true +commands_pre = +deps = + isort +commands = + isort {toxinidir}/docs [] + +[testenv:docs] +basepython = python3 +deps = + -r docs/requirements.txt +commands_pre = +commands = + sphinx-build -b html -d docs/_build/doctrees docs docs/_build/html From ddf905ea2baa352b928cfa9715805a7af7976271 Mon Sep 17 00:00:00 2001 From: Michael Howitz Date: Wed, 20 Dec 2023 14:17:21 +0100 Subject: [PATCH 08/10] Add missing version pin. --- grok.cfg | 1 + 1 file changed, 1 insertion(+) diff --git a/grok.cfg b/grok.cfg index 870910a..64d6751 100644 --- a/grok.cfg +++ b/grok.cfg @@ -107,6 +107,7 @@ Chameleon = 4.2.0 importlib-metadata = 7.0.0 importlib-resources = 5.12.0 # Newer versions require Python 3.8+ +soupsieve = 2.4.1 typing-extensions = 4.7.1 zipp = 3.15.0 From d2f0b3604f709c9030ff75917f342b10cdfa21f4 Mon Sep 17 00:00:00 2001 From: Michael Howitz Date: Wed, 20 Dec 2023 14:17:53 +0100 Subject: [PATCH 09/10] Fix syntax. --- setup.py | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/setup.py b/setup.py index c070da8..d14e21b 100644 --- a/setup.py +++ b/setup.py @@ -27,7 +27,7 @@ "Programming Language :: Python :: Implementation :: CPython", ], zip_safe=False, - install_requires=[], - entry_points={} python_requires='>=3.7', + install_requires=[], + entry_points={}, ) From 6ee033021b8da50e10c0b4a11094079a8f462aa0 Mon Sep 17 00:00:00 2001 From: Michael Howitz Date: Wed, 20 Dec 2023 14:23:33 +0100 Subject: [PATCH 10/10] Add support for Python 3.12. --- docs/changes.rst | 2 ++ 1 file changed, 2 insertions(+) diff --git a/docs/changes.rst b/docs/changes.rst index 8c85d51..65e5a8b 100644 --- a/docs/changes.rst +++ b/docs/changes.rst @@ -1,6 +1,8 @@ 3.0.0a2 (unreleased) -------------------- + - Add support for Python 3.12. + - Drop the following packages: - grokcore.rest (it is still just a dependency of some packages)