From ltucker at codespeak.net Tue Jul 3 21:42:43 2007 From: ltucker at codespeak.net (ltucker at codespeak.net) Date: Tue, 3 Jul 2007 21:42:43 +0200 (CEST) Subject: [z3-checkins] r44707 - z3/deliverance/trunk/deliverance Message-ID: <20070703194243.56F0C80AA@code0.codespeak.net> Author: ltucker Date: Tue Jul 3 21:42:41 2007 New Revision: 44707 Modified: z3/deliverance/trunk/deliverance/resource_fetcher.py z3/deliverance/trunk/deliverance/wsgimiddleware.py Log: allow slightly broader definition of what an internal resource is Modified: z3/deliverance/trunk/deliverance/resource_fetcher.py ============================================================================== --- z3/deliverance/trunk/deliverance/resource_fetcher.py (original) +++ z3/deliverance/trunk/deliverance/resource_fetcher.py Tue Jul 3 21:42:41 2007 @@ -21,23 +21,29 @@ else: self.environ = in_environ.copy() - if not self.uri.startswith('/'): - self.uri = '/' + self.uri - + base_url = in_environ['deliverance.base-url'] + if not base_url.endswith('/'): + base_url += '/' + uri = urlparse.urljoin(base_url, uri) uri_parts = urlparse.urlparse(uri) - self.environ['PATH_INFO'] = urllib.unquote(uri_parts[2]) + if uri.startswith(base_url): + script_name = urlparse.urlparse(base_url)[2] + path_info = uri_parts[2][len(script_name):] + if not path_info.startswith('/'): + path_info = '/%s' % path_info + + self.environ['SCRIPT_NAME'] = urllib.unquote(script_name) + self.environ['PATH_INFO'] = urllib.unquote(path_info) + else: + self.environ['SCRIPT_NAME'] = '' + self.environ['PATH_INFO'] = urllib.unquote(uri_parts[2]) + if len(uri_parts[4]) > 0: self.environ['QUERY_STRING'] = uri_parts[4] + '¬heme' else: self.environ['QUERY_STRING'] = 'notheme' - base_url = in_environ['deliverance.base-url'] - if base_url is not None: - self.environ['SCRIPT_NAME'] = urllib.unquote(urlparse.urlparse(base_url)[2]) - else: - self.environ['SCRIPT_NAME'] = '' - if headers_only: self.environ['REQUEST_METHOD'] = 'HEAD' else: @@ -130,7 +136,6 @@ def __init__(self, in_environ, uri, headers_only=False): self.uri = uri - url_chunks = urlparse.urlsplit(uri) loc = urlparse.urlsplit(uri) self.environ = in_environ.copy() Modified: z3/deliverance/trunk/deliverance/wsgimiddleware.py ============================================================================== --- z3/deliverance/trunk/deliverance/wsgimiddleware.py (original) +++ z3/deliverance/trunk/deliverance/wsgimiddleware.py Tue Jul 3 21:42:41 2007 @@ -39,7 +39,9 @@ tranformation as a WSGI middleware component. """ - def __init__(self, app, theme_uri, rule_uri, renderer='py', merge_cache_control=False): + def __init__(self, app, theme_uri, rule_uri, + renderer='py', merge_cache_control=False, + is_internal_uri=None): """ initializer @@ -50,9 +52,14 @@ performing transformations, may be 'py' or 'xslt' or a Renderer class merge_cache_control: if set to True, the cache-control header will - be calculated from the cache-control headers of all component pages - during rendering. If set to False, the requested content's - cache-control headers will be used. (does not affect etag merging) + be calculated from the cache-control headers of all component pages + during rendering. If set to False, the requested content's + cache-control headers will be used. (does not affect etag merging) + is_internal_uri: an optional predicate accepting a uri and + a wsgi environment. This should return true if the uri + should be considered 'internal'(passed to the + subapplication) and false if the requestshould be send + over the network. """ self.app = app self.theme_uri = theme_uri @@ -70,6 +77,8 @@ else: self._rendererType = renderer + self._is_internal_uri = is_internal_uri + def get_renderer(self, environ): return self.create_renderer(environ) @@ -322,6 +331,7 @@ uses cache if possible. throws exception if response is not 200 """ + if uri in environ[DELIVERANCE_CACHE]: response = environ[DELIVERANCE_CACHE][uri] if response[0].startswith('200'): @@ -355,21 +365,39 @@ environ[DELIVERANCE_CACHE][uri] = (status, headers, body) return body + + + def is_internal_uri(self, uri, environ): + if self._is_internal_uri: + # specified in constructor + return self._is_internal_uri(uri, environ) + else: + # default + internalBaseURL = environ.get(DELIVERANCE_BASE_URL) + test_uri = urlparse.urljoin(internalBaseURL, uri) + + if test_uri.startswith(internalBaseURL): + return True + else: + return False def get_fetcher(self, environ, uri): """ retrieve an object which is appropriate for fetching the uri specified. """ - internalBaseURL = environ.get(DELIVERANCE_BASE_URL,None) - uri = urlparse.urljoin(internalBaseURL, uri) - + if urlparse.urlparse(uri)[0] == 'file': return FileResourceFetcher(environ, uri) - elif internalBaseURL and uri.startswith(internalBaseURL): - return InternalResourceFetcher(environ, uri[len(internalBaseURL):], + elif self.is_internal_uri(uri, environ): + # make it absolute + internalBaseURL = environ.get(DELIVERANCE_BASE_URL) + uri = urlparse.urljoin(internalBaseURL, uri) + + return InternalResourceFetcher(environ, + uri, self.app) else: out_environ = self.cleaned_environ(environ) From ltucker at codespeak.net Tue Jul 3 21:44:29 2007 From: ltucker at codespeak.net (ltucker at codespeak.net) Date: Tue, 3 Jul 2007 21:44:29 +0200 (CEST) Subject: [z3-checkins] r44708 - z3/deliverance/DeliveranceVHoster/trunk/dvhoster Message-ID: <20070703194429.C464180AA@code0.codespeak.net> Author: ltucker Date: Tue Jul 3 21:44:29 2007 New Revision: 44708 Added: z3/deliverance/DeliveranceVHoster/trunk/dvhoster/scrubber.py Modified: z3/deliverance/DeliveranceVHoster/trunk/dvhoster/dispatcher.py z3/deliverance/DeliveranceVHoster/trunk/dvhoster/wsgiapp.py Log: make deliverance requests back to domain internal requests, do not scrub recursive requests Modified: z3/deliverance/DeliveranceVHoster/trunk/dvhoster/dispatcher.py ============================================================================== --- z3/deliverance/DeliveranceVHoster/trunk/dvhoster/dispatcher.py (original) +++ z3/deliverance/DeliveranceVHoster/trunk/dvhoster/dispatcher.py Tue Jul 3 21:44:29 2007 @@ -1,4 +1,3 @@ -import re import posixpath import os import urlparse @@ -55,14 +54,7 @@ self.app_conf = app_conf self.provider = DomainInfoSet(data_dir) self.rewrite_links = asbool(app_conf.get('rewrite_links', False)) - if app_conf.get('clean_environ_headers_regex'): - self.clean_environ_headers_regex = re.compile(app_conf['clean_environ_headers_regex']) - else: - self.clean_environ_headers_regex = None - if app_conf.get('safe_header_ips'): - self.safe_header_ips = app_conf.get('safe_header_ips').strip().split() - else: - self.safe_header_ips = None + logger = make_logger(app_conf.get('logger'), 'dvhoster') self.logger = logger @@ -93,9 +85,10 @@ """ WSGI interface """ + if 'paste.registry' in environ: environ['paste.registry'].register(current_environ, environ) - self.clean_environ_headers(environ) + domain_info = self.get_domain_info(environ) environ['dvhoster.domain_info'] = domain_info environ['dvhoster.base_url'] = construct_url( @@ -143,11 +136,24 @@ for r in domain_info.remote_uris]))) return exc(environ, start_response) + scheme = environ['wsgi.url_scheme'] + host_parts = environ['HTTP_HOST'].split(':',1) + host = host_parts[0] + if len(host_parts) > 1: + port = host_parts[1] + else: + if scheme == 'http': + port = '80' + elif scheme == 'https': + port = '443' + else: + port = '' + vars = { - 'host': environ['HTTP_HOST'], + 'host': host, 'domain': environ['HTTP_HOST'].split(':', 1)[0], - 'scheme': environ['wsgi.url_scheme'], - 'port': environ['HTTP_HOST'].split(':', 1)[1], + 'scheme': scheme, + 'port': port, 'path': environ['SCRIPT_NAME'] + environ['PATH_INFO'], 'script_name': environ['SCRIPT_NAME'], 'path_info': environ['PATH_INFO'], @@ -178,15 +184,34 @@ app = relocateresponse.RelocateMiddleware( app, old_href=remote_uri) - rule_uri = construct_url( - environ, with_query_string=False, - path_info='/_rules/rule.xml') + internal_prefix = construct_url( + environ, with_query_string=False, + script_name='', path_info='/') + + rule_uri = urlparse.urljoin(internal_prefix, + '/_rules/rule.xml') + + theme_uri = domain_info.theme_uri.strip() + theme_uri = urlparse.urljoin(internal_prefix, + theme_uri) + + # set up deliverance so all subrequests + # to this domain come back through the + # recursive middleware as trusted requests + # (unscrubbed) + def is_internal_uri(uri, environ): + test_uri = urlparse.urljoin(internal_prefix, uri) + if test_uri.startswith(internal_prefix): + return True + return False + app = DeliveranceMiddleware( app, - theme_uri=domain_info.theme_uri, + theme_uri=theme_uri, rule_uri=rule_uri, - renderer=Renderer) + renderer=Renderer, + is_internal_uri=is_internal_uri) return app(environ, start_response) def find_static_file(self, domain_info, path_info): @@ -203,30 +228,6 @@ return FileApp(static_path) return None - def clean_environ_headers(self, environ): - """ - Remove any request headers that overlap with internal request - headers (as configured with ``clean_environ_headers_regex``). - """ - host = environ.get('HTTP_HOST') - if host is None: - host = environ['SERVER_NAME'] + ':' + environ['SERVER_PORT'] - elif ':' not in host: - if environ['wsgi.url_scheme'] == 'https': - host += ':443' - else: - host += ':80' - environ['HTTP_HOST'] = host - if not self.clean_environ_headers_regex: - return - remote_addr = environ.get('REMOTE_ADDR') - if (remote_addr and self.safe_header_ips - and remote_addr in self.safe_header_ips): - return - for key in environ.keys(): - if self.clean_environ_headers_regex.search(key): - # @@: Should log this - del environ[key] def get_domain_info(self, environ): """ Added: z3/deliverance/DeliveranceVHoster/trunk/dvhoster/scrubber.py ============================================================================== --- (empty file) +++ z3/deliverance/DeliveranceVHoster/trunk/dvhoster/scrubber.py Tue Jul 3 21:44:29 2007 @@ -0,0 +1,55 @@ +import re + + +class EnvironScrubber: + """ + Cleans up environment generated by + user request. This can be configured + to scrub out specific headers using + the 'clean_environ_headers_regex' + option specified in app_conf + """ + + def __init__(self, subapp, app_conf): + self.app = subapp + + if app_conf.get('clean_environ_headers_regex'): + self.clean_environ_headers_regex = re.compile(app_conf['clean_environ_headers_regex']) + else: + self.clean_environ_headers_regex = None + + if app_conf.get('safe_header_ips'): + self.safe_header_ips = app_conf.get('safe_header_ips').strip().split() + else: + self.safe_header_ips = None + + + def __call__(self, environ, start_response): + self.clean_environ_headers(environ) + return self.app(environ, start_response) + + + def clean_environ_headers(self, environ): + """ + Remove any request headers that overlap with internal request + headers (as configured with ``clean_environ_headers_regex``). + """ + host = environ.get('HTTP_HOST') + if host is None: + host = environ['SERVER_NAME'] + ':' + environ['SERVER_PORT'] + elif ':' not in host: + if environ['wsgi.url_scheme'] == 'https': + host += ':443' + else: + host += ':80' + environ['HTTP_HOST'] = host + if not self.clean_environ_headers_regex: + return + remote_addr = environ.get('REMOTE_ADDR') + if (remote_addr and self.safe_header_ips + and remote_addr in self.safe_header_ips): + return + for key in environ.keys(): + if self.clean_environ_headers_regex.search(key): + # @@: Should log this + del environ[key] Modified: z3/deliverance/DeliveranceVHoster/trunk/dvhoster/wsgiapp.py ============================================================================== --- z3/deliverance/DeliveranceVHoster/trunk/dvhoster/wsgiapp.py (original) +++ z3/deliverance/DeliveranceVHoster/trunk/dvhoster/wsgiapp.py Tue Jul 3 21:44:29 2007 @@ -7,12 +7,14 @@ from paste.exceptions.errormiddleware import ErrorMiddleware from paste.httpexceptions import HTTPExceptionHandler from dvhoster.dispatcher import DeliveranceDispatcher +from dvhoster.scrubber import EnvironScrubber def make_app(global_conf, **app_conf): """Create a WSGI application and return it""" app = DeliveranceDispatcher(app_conf) app = HTTPExceptionHandler(app) app = RecursiveMiddleware(app) + app = EnvironScrubber(app, app_conf) app = RegistryManager(app) debug = app_conf['debug'] = asbool(app_conf.get('debug', global_conf.get('debug'))) if asbool(app_conf.get('debug_headers')): From ltucker at codespeak.net Tue Jul 3 21:56:33 2007 From: ltucker at codespeak.net (ltucker at codespeak.net) Date: Tue, 3 Jul 2007 21:56:33 +0200 (CEST) Subject: [z3-checkins] r44709 - z3/deliverance/DeliveranceVHoster/trunk/dvhoster Message-ID: <20070703195633.75DB380B3@code0.codespeak.net> Author: ltucker Date: Tue Jul 3 21:56:32 2007 New Revision: 44709 Modified: z3/deliverance/DeliveranceVHoster/trunk/dvhoster/dispatcher.py z3/deliverance/DeliveranceVHoster/trunk/dvhoster/scrubber.py Log: consolidate some logic Modified: z3/deliverance/DeliveranceVHoster/trunk/dvhoster/dispatcher.py ============================================================================== --- z3/deliverance/DeliveranceVHoster/trunk/dvhoster/dispatcher.py (original) +++ z3/deliverance/DeliveranceVHoster/trunk/dvhoster/dispatcher.py Tue Jul 3 21:56:32 2007 @@ -15,6 +15,7 @@ from dvhoster.util import load_func from dvhoster.logcreate import make_logger from dvhoster import uritemplate +from dvhoster.scrubber import scrub_environ_host import transcluder from transcluder.middleware import TranscluderMiddleware @@ -136,24 +137,13 @@ for r in domain_info.remote_uris]))) return exc(environ, start_response) - scheme = environ['wsgi.url_scheme'] + scrub_environ_host(environ) host_parts = environ['HTTP_HOST'].split(':',1) - host = host_parts[0] - if len(host_parts) > 1: - port = host_parts[1] - else: - if scheme == 'http': - port = '80' - elif scheme == 'https': - port = '443' - else: - port = '' - vars = { - 'host': host, + 'host': host_parts[0], 'domain': environ['HTTP_HOST'].split(':', 1)[0], - 'scheme': scheme, - 'port': port, + 'scheme': environ['wsgi.url_scheme'], + 'port': host_parts[1], 'path': environ['SCRIPT_NAME'] + environ['PATH_INFO'], 'script_name': environ['SCRIPT_NAME'], 'path_info': environ['PATH_INFO'], Modified: z3/deliverance/DeliveranceVHoster/trunk/dvhoster/scrubber.py ============================================================================== --- z3/deliverance/DeliveranceVHoster/trunk/dvhoster/scrubber.py (original) +++ z3/deliverance/DeliveranceVHoster/trunk/dvhoster/scrubber.py Tue Jul 3 21:56:32 2007 @@ -34,15 +34,8 @@ Remove any request headers that overlap with internal request headers (as configured with ``clean_environ_headers_regex``). """ - host = environ.get('HTTP_HOST') - if host is None: - host = environ['SERVER_NAME'] + ':' + environ['SERVER_PORT'] - elif ':' not in host: - if environ['wsgi.url_scheme'] == 'https': - host += ':443' - else: - host += ':80' - environ['HTTP_HOST'] = host + scrub_environ_host(environ) + if not self.clean_environ_headers_regex: return remote_addr = environ.get('REMOTE_ADDR') @@ -53,3 +46,15 @@ if self.clean_environ_headers_regex.search(key): # @@: Should log this del environ[key] + + +def scrub_environ_host(environ): + host = environ.get('HTTP_HOST') + if host is None: + host = environ['SERVER_NAME'] + ':' + environ['SERVER_PORT'] + elif ':' not in host: + if environ['wsgi.url_scheme'] == 'https': + host += ':443' + else: + host += ':80' + environ['HTTP_HOST'] = host From ltucker at codespeak.net Tue Jul 3 23:31:23 2007 From: ltucker at codespeak.net (ltucker at codespeak.net) Date: Tue, 3 Jul 2007 23:31:23 +0200 (CEST) Subject: [z3-checkins] r44713 - z3/deliverance/trunk/deliverance Message-ID: <20070703213123.E1A7B80C4@code0.codespeak.net> Author: ltucker Date: Tue Jul 3 23:31:23 2007 New Revision: 44713 Modified: z3/deliverance/trunk/deliverance/utils.py Log: make links in external references relative to their requested location Modified: z3/deliverance/trunk/deliverance/utils.py ============================================================================== --- z3/deliverance/trunk/deliverance/utils.py (original) +++ z3/deliverance/trunk/deliverance/utils.py Tue Jul 3 23:31:23 2007 @@ -439,6 +439,8 @@ if doc is None: continue + self.fixup_links(doc, href) + doc_node = etree.SubElement(root,"document") doc_node.set("content",href) doc_node.append(doc) From philikon at codespeak.net Mon Jul 9 09:02:00 2007 From: philikon at codespeak.net (philikon at codespeak.net) Date: Mon, 9 Jul 2007 09:02:00 +0200 (CEST) Subject: [z3-checkins] r44858 - in z3/NudgeNudge/branches/zope-on-a-paste-demos: . src/nudgenudge Message-ID: <20070709070200.EDB00820E@code0.codespeak.net> Author: philikon Date: Mon Jul 9 09:02:00 2007 New Revision: 44858 Added: z3/NudgeNudge/branches/zope-on-a-paste-demos/src/nudgenudge/develop.ini z3/NudgeNudge/branches/zope-on-a-paste-demos/src/nudgenudge/main.py (contents, props changed) Modified: z3/NudgeNudge/branches/zope-on-a-paste-demos/setup.py Log: Add a script that starts up NudgeNudge (shortcut to paster serve) Modified: z3/NudgeNudge/branches/zope-on-a-paste-demos/setup.py ============================================================================== --- z3/NudgeNudge/branches/zope-on-a-paste-demos/setup.py (original) +++ z3/NudgeNudge/branches/zope-on-a-paste-demos/setup.py Mon Jul 9 09:02:00 2007 @@ -27,5 +27,15 @@ 'zope.app.security', 'zope.app.securitypolicy', 'zope.app.zcmlfiles', + + # these are needed for PasteDeploy-based deployment + 'PasteScript', + 'PasteDeploy', + 'zope.paste', + 'WSGIUtils', # contains standard HTTP server ], + entry_points = """ + [console_scripts] + startNudgeNudge = nudgenudge.main:main + """ ) Added: z3/NudgeNudge/branches/zope-on-a-paste-demos/src/nudgenudge/develop.ini ============================================================================== --- (empty file) +++ z3/NudgeNudge/branches/zope-on-a-paste-demos/src/nudgenudge/develop.ini Mon Jul 9 09:02:00 2007 @@ -0,0 +1,20 @@ +[composite:main] +use = egg:Paste#urlmap +/ = themed +/notheme = zope + +[filter-app:themed] +use = egg:Deliverance +theme_uri = /@@/nudgenudge/www.python.org/pypi/index.html +rule_uri = /@@/nudgenudge/rules.xml +next = zope + +[app:zope] +use = egg:zope.paste +site_definition = site.zcml +file_storage = var/Data.fs + +[server:main] +use = egg:PasteScript#wsgiutils +host = 127.0.0.1 +port = 8080 Added: z3/NudgeNudge/branches/zope-on-a-paste-demos/src/nudgenudge/main.py ============================================================================== --- (empty file) +++ z3/NudgeNudge/branches/zope-on-a-paste-demos/src/nudgenudge/main.py Mon Jul 9 09:02:00 2007 @@ -0,0 +1,8 @@ +import os.path +import nudgenudge +import paste.script.command + +def main(): + conf_file = os.path.join(os.path.dirname(nudgenudge.__file__), + 'develop.ini') + paste.script.command.run(['serve', conf_file]) From philikon at codespeak.net Mon Jul 9 09:03:41 2007 From: philikon at codespeak.net (philikon at codespeak.net) Date: Mon, 9 Jul 2007 09:03:41 +0200 (CEST) Subject: [z3-checkins] r44859 - z3/NudgeNudge/branches/zope-on-a-paste-demos Message-ID: <20070709070341.A52E98210@code0.codespeak.net> Author: philikon Date: Mon Jul 9 09:03:41 2007 New Revision: 44859 Modified: z3/NudgeNudge/branches/zope-on-a-paste-demos/buildout.cfg Log: can shorten eggs list in buildout now Modified: z3/NudgeNudge/branches/zope-on-a-paste-demos/buildout.cfg ============================================================================== --- z3/NudgeNudge/branches/zope-on-a-paste-demos/buildout.cfg (original) +++ z3/NudgeNudge/branches/zope-on-a-paste-demos/buildout.cfg Mon Jul 9 09:03:41 2007 @@ -10,15 +10,10 @@ [server] recipe = zc.recipe.egg eggs = ${app:eggs} - zope.paste - PasteDeploy z3c.evalexception capitalizer Deliverance - PasteScript - WSGIUtils tgdemo -extra-paths = ${zope3:location}/lib/python [app] database = data From philikon at codespeak.net Mon Jul 9 09:05:43 2007 From: philikon at codespeak.net (philikon at codespeak.net) Date: Mon, 9 Jul 2007 09:05:43 +0200 (CEST) Subject: [z3-checkins] r44860 - z3/NudgeNudge/branches/zope-on-a-paste-demos/src/nudgenudge Message-ID: <20070709070543.C81DC8210@code0.codespeak.net> Author: philikon Date: Mon Jul 9 09:05:43 2007 New Revision: 44860 Modified: z3/NudgeNudge/branches/zope-on-a-paste-demos/src/nudgenudge/site.zcml Log: Add an i18n domain to avoid warning Modified: z3/NudgeNudge/branches/zope-on-a-paste-demos/src/nudgenudge/site.zcml ============================================================================== --- z3/NudgeNudge/branches/zope-on-a-paste-demos/src/nudgenudge/site.zcml (original) +++ z3/NudgeNudge/branches/zope-on-a-paste-demos/src/nudgenudge/site.zcml Mon Jul 9 09:05:43 2007 @@ -1,4 +1,5 @@ - + From philikon at codespeak.net Mon Jul 9 11:01:57 2007 From: philikon at codespeak.net (philikon at codespeak.net) Date: Mon, 9 Jul 2007 11:01:57 +0200 (CEST) Subject: [z3-checkins] r44863 - in z3/NudgeNudge/branches/zope-on-a-paste-demos: . tgdemo turbopaste turbopaste/ez_setup turbopaste/turbopaste turbopaste/turbopaste/config turbopaste/turbopaste/controllers turbopaste/turbopaste/docs turbopaste/turbopaste/i18n turbopaste/turbopaste/lib turbopaste/turbopaste/models turbopaste/turbopaste/public turbopaste/turbopaste/public/css turbopaste/turbopaste/public/images turbopaste/turbopaste/public/javascript turbopaste/turbopaste/templates turbopaste/turbopaste/tests turbopaste/turbopaste/tests/functional Message-ID: <20070709090157.9310381FD@code0.codespeak.net> Author: philikon Date: Mon Jul 9 11:01:55 2007 New Revision: 44863 Added: z3/NudgeNudge/branches/zope-on-a-paste-demos/turbopaste/ z3/NudgeNudge/branches/zope-on-a-paste-demos/turbopaste/README.txt (contents, props changed) z3/NudgeNudge/branches/zope-on-a-paste-demos/turbopaste/development.ini z3/NudgeNudge/branches/zope-on-a-paste-demos/turbopaste/ez_setup/ z3/NudgeNudge/branches/zope-on-a-paste-demos/turbopaste/ez_setup/README.txt (contents, props changed) z3/NudgeNudge/branches/zope-on-a-paste-demos/turbopaste/ez_setup/__init__.py (contents, props changed) z3/NudgeNudge/branches/zope-on-a-paste-demos/turbopaste/setup.cfg z3/NudgeNudge/branches/zope-on-a-paste-demos/turbopaste/setup.py (contents, props changed) z3/NudgeNudge/branches/zope-on-a-paste-demos/turbopaste/test.ini z3/NudgeNudge/branches/zope-on-a-paste-demos/turbopaste/turbopaste/ z3/NudgeNudge/branches/zope-on-a-paste-demos/turbopaste/turbopaste/__init__.py (contents, props changed) z3/NudgeNudge/branches/zope-on-a-paste-demos/turbopaste/turbopaste/config/ z3/NudgeNudge/branches/zope-on-a-paste-demos/turbopaste/turbopaste/config/__init__.py (contents, props changed) z3/NudgeNudge/branches/zope-on-a-paste-demos/turbopaste/turbopaste/config/environment.py (contents, props changed) z3/NudgeNudge/branches/zope-on-a-paste-demos/turbopaste/turbopaste/config/middleware.py (contents, props changed) z3/NudgeNudge/branches/zope-on-a-paste-demos/turbopaste/turbopaste/config/routing.py (contents, props changed) z3/NudgeNudge/branches/zope-on-a-paste-demos/turbopaste/turbopaste/controllers/ z3/NudgeNudge/branches/zope-on-a-paste-demos/turbopaste/turbopaste/controllers/__init__.py (contents, props changed) z3/NudgeNudge/branches/zope-on-a-paste-demos/turbopaste/turbopaste/controllers/error.py (contents, props changed) z3/NudgeNudge/branches/zope-on-a-paste-demos/turbopaste/turbopaste/controllers/root.py (contents, props changed) z3/NudgeNudge/branches/zope-on-a-paste-demos/turbopaste/turbopaste/controllers/template.py (contents, props changed) z3/NudgeNudge/branches/zope-on-a-paste-demos/turbopaste/turbopaste/docs/ z3/NudgeNudge/branches/zope-on-a-paste-demos/turbopaste/turbopaste/docs/index.txt (contents, props changed) z3/NudgeNudge/branches/zope-on-a-paste-demos/turbopaste/turbopaste/i18n/ z3/NudgeNudge/branches/zope-on-a-paste-demos/turbopaste/turbopaste/i18n/__init__.py (contents, props changed) z3/NudgeNudge/branches/zope-on-a-paste-demos/turbopaste/turbopaste/lib/ z3/NudgeNudge/branches/zope-on-a-paste-demos/turbopaste/turbopaste/lib/__init__.py (contents, props changed) z3/NudgeNudge/branches/zope-on-a-paste-demos/turbopaste/turbopaste/lib/app_globals.py (contents, props changed) z3/NudgeNudge/branches/zope-on-a-paste-demos/turbopaste/turbopaste/lib/base.py (contents, props changed) z3/NudgeNudge/branches/zope-on-a-paste-demos/turbopaste/turbopaste/lib/database.py (contents, props changed) z3/NudgeNudge/branches/zope-on-a-paste-demos/turbopaste/turbopaste/lib/helpers.py (contents, props changed) z3/NudgeNudge/branches/zope-on-a-paste-demos/turbopaste/turbopaste/models/ z3/NudgeNudge/branches/zope-on-a-paste-demos/turbopaste/turbopaste/models/__init__.py (contents, props changed) z3/NudgeNudge/branches/zope-on-a-paste-demos/turbopaste/turbopaste/public/ z3/NudgeNudge/branches/zope-on-a-paste-demos/turbopaste/turbopaste/public/css/ z3/NudgeNudge/branches/zope-on-a-paste-demos/turbopaste/turbopaste/public/css/style.css (contents, props changed) z3/NudgeNudge/branches/zope-on-a-paste-demos/turbopaste/turbopaste/public/favicon.ico (contents, props changed) z3/NudgeNudge/branches/zope-on-a-paste-demos/turbopaste/turbopaste/public/images/ z3/NudgeNudge/branches/zope-on-a-paste-demos/turbopaste/turbopaste/public/images/header_inner.png (contents, props changed) z3/NudgeNudge/branches/zope-on-a-paste-demos/turbopaste/turbopaste/public/images/info.png (contents, props changed) z3/NudgeNudge/branches/zope-on-a-paste-demos/turbopaste/turbopaste/public/images/ok.png (contents, props changed) z3/NudgeNudge/branches/zope-on-a-paste-demos/turbopaste/turbopaste/public/images/tg_under_the_hood.png (contents, props changed) z3/NudgeNudge/branches/zope-on-a-paste-demos/turbopaste/turbopaste/public/images/under_the_hood_blue.png (contents, props changed) z3/NudgeNudge/branches/zope-on-a-paste-demos/turbopaste/turbopaste/public/javascript/ z3/NudgeNudge/branches/zope-on-a-paste-demos/turbopaste/turbopaste/templates/ z3/NudgeNudge/branches/zope-on-a-paste-demos/turbopaste/turbopaste/templates/__init__.py (contents, props changed) z3/NudgeNudge/branches/zope-on-a-paste-demos/turbopaste/turbopaste/templates/index.html (contents, props changed) z3/NudgeNudge/branches/zope-on-a-paste-demos/turbopaste/turbopaste/templates/master.html (contents, props changed) z3/NudgeNudge/branches/zope-on-a-paste-demos/turbopaste/turbopaste/tests/ z3/NudgeNudge/branches/zope-on-a-paste-demos/turbopaste/turbopaste/tests/__init__.py (contents, props changed) z3/NudgeNudge/branches/zope-on-a-paste-demos/turbopaste/turbopaste/tests/functional/ z3/NudgeNudge/branches/zope-on-a-paste-demos/turbopaste/turbopaste/tests/functional/__init__.py (contents, props changed) z3/NudgeNudge/branches/zope-on-a-paste-demos/turbopaste/turbopaste/tests/test_models.py (contents, props changed) z3/NudgeNudge/branches/zope-on-a-paste-demos/turbopaste/turbopaste/websetup.py (contents, props changed) Removed: z3/NudgeNudge/branches/zope-on-a-paste-demos/tgdemo/ Modified: z3/NudgeNudge/branches/zope-on-a-paste-demos/ (props changed) z3/NudgeNudge/branches/zope-on-a-paste-demos/buildout.cfg z3/NudgeNudge/branches/zope-on-a-paste-demos/combined.ini Log: Switch to TurboGears2 (which runs on Pylons). Modified: z3/NudgeNudge/branches/zope-on-a-paste-demos/buildout.cfg ============================================================================== --- z3/NudgeNudge/branches/zope-on-a-paste-demos/buildout.cfg (original) +++ z3/NudgeNudge/branches/zope-on-a-paste-demos/buildout.cfg Mon Jul 9 11:01:55 2007 @@ -1,6 +1,6 @@ [buildout] parts = app data instance server test -develop = . deliverance capitalizer turbogears tgdemo +develop = . deliverance capitalizer TurboGears Pylons turbopaste find-links = http://download.zope.org/distribution/ [zope3] @@ -13,7 +13,9 @@ z3c.evalexception capitalizer Deliverance - tgdemo + PasteScript + TurboGears2 + turbopaste [app] database = data Modified: z3/NudgeNudge/branches/zope-on-a-paste-demos/combined.ini ============================================================================== --- z3/NudgeNudge/branches/zope-on-a-paste-demos/combined.ini (original) +++ z3/NudgeNudge/branches/zope-on-a-paste-demos/combined.ini Mon Jul 9 11:01:55 2007 @@ -1,10 +1,10 @@ [composite:main] use = egg:Paste#urlmap /zope = zope -/tg = tgdemo +/ = turbopaste -[app:tgdemo] -use = egg:tgdemo +[app:turbopaste] +use = egg:turbopaste [app:zope] use = egg:zope.paste Added: z3/NudgeNudge/branches/zope-on-a-paste-demos/turbopaste/README.txt ============================================================================== --- (empty file) +++ z3/NudgeNudge/branches/zope-on-a-paste-demos/turbopaste/README.txt Mon Jul 9 11:01:55 2007 @@ -0,0 +1,19 @@ +This file is for you to describe the turbopaste application. Typically +you would include information such as the information below: + +Installation and Setup +====================== + +Install ``turbopaste`` using easy_install:: + + easy_install turbopaste + +Make a config file as follows:: + + paster make-config turbopaste config.ini + +Tweak the config file as appropriate and then setup the application:: + + paster setup-app config.ini + +Then you are ready to go. Added: z3/NudgeNudge/branches/zope-on-a-paste-demos/turbopaste/development.ini ============================================================================== --- (empty file) +++ z3/NudgeNudge/branches/zope-on-a-paste-demos/turbopaste/development.ini Mon Jul 9 11:01:55 2007 @@ -0,0 +1,41 @@ +# +# turbopaste - Pylons development environment configuration +# +# The %(here)s variable will be replaced with the parent directory of this file +# +[DEFAULT] +debug = true +email_to = you at yourdomain.com +smtp_server = localhost +error_email_from = paste at localhost + +[server:main] +use = egg:Paste#http +host = 0.0.0.0 +port = 8080 + +[app:main] +use = egg:turbopaste +cache_dir = %(here)s/data +beaker.session.key = turbopaste +beaker.session.secret = somesecret + +# If you'd like to fine-tune the individual locations of the cache data dirs +# for the Cache data, or the Session saves, un-comment the desired +# settings here: +#beaker.cache.data_dir = %(here)s/data/cache +#beaker.session.data_dir = %(here)s/data/sessions + +# Specify the database for SQLAlchemy to use via +# pylons.database.session_context. +# %(here) may include a ':' character on Windows environments; this can +# invalidate the URI when specifying a SQLite db via path name +#sqlalchemy.dburi = sqlite:///%(here)s/somedb.db + +# Specify the database for SQLObject to use via pylons.database.PackageHub. +#sqlobject.dburi = sqlite://%(here)s/somedb.db + +# WARNING: *THE LINE BELOW MUST BE UNCOMMENTED ON A PRODUCTION ENVIRONMENT* +# Debug mode will enable the interactive debugging tool, allowing ANYONE to +# execute malicious code after an exception is raised. +#set debug = false Added: z3/NudgeNudge/branches/zope-on-a-paste-demos/turbopaste/ez_setup/README.txt ============================================================================== --- (empty file) +++ z3/NudgeNudge/branches/zope-on-a-paste-demos/turbopaste/ez_setup/README.txt Mon Jul 9 11:01:55 2007 @@ -0,0 +1,15 @@ +This directory exists so that Subversion-based projects can share a single +copy of the ``ez_setup`` bootstrap module for ``setuptools``, and have it +automatically updated in their projects when ``setuptools`` is updated. + +For your convenience, you may use the following svn:externals definition:: + + ez_setup svn://svn.eby-sarna.com/svnroot/ez_setup + +You can set this by executing this command in your project directory:: + + svn propedit svn:externals . + +And then adding the line shown above to the file that comes up for editing. +Then, whenever you update your project, ``ez_setup`` will be updated as well. + Added: z3/NudgeNudge/branches/zope-on-a-paste-demos/turbopaste/ez_setup/__init__.py ============================================================================== --- (empty file) +++ z3/NudgeNudge/branches/zope-on-a-paste-demos/turbopaste/ez_setup/__init__.py Mon Jul 9 11:01:55 2007 @@ -0,0 +1,231 @@ +#!python +"""Bootstrap setuptools installation + +If you want to use setuptools in your package's setup.py, just include this +file in the same directory with it, and add this to the top of your setup.py:: + + from ez_setup import use_setuptools + use_setuptools() + +If you want to require a specific version of setuptools, set a download +mirror, or use an alternate download directory, you can do so by supplying +the appropriate options to ``use_setuptools()``. + +This file can also be run as a script to install or upgrade setuptools. +""" +import sys +DEFAULT_VERSION = "0.6c6" +DEFAULT_URL = "http://cheeseshop.python.org/packages/%s/s/setuptools/" % sys.version[:3] + +md5_data = { + 'setuptools-0.6b1-py2.3.egg': '8822caf901250d848b996b7f25c6e6ca', + 'setuptools-0.6b1-py2.4.egg': 'b79a8a403e4502fbb85ee3f1941735cb', + 'setuptools-0.6b2-py2.3.egg': '5657759d8a6d8fc44070a9d07272d99b', + 'setuptools-0.6b2-py2.4.egg': '4996a8d169d2be661fa32a6e52e4f82a', + 'setuptools-0.6b3-py2.3.egg': 'bb31c0fc7399a63579975cad9f5a0618', + 'setuptools-0.6b3-py2.4.egg': '38a8c6b3d6ecd22247f179f7da669fac', + 'setuptools-0.6b4-py2.3.egg': '62045a24ed4e1ebc77fe039aa4e6f7e5', + 'setuptools-0.6b4-py2.4.egg': '4cb2a185d228dacffb2d17f103b3b1c4', + 'setuptools-0.6c1-py2.3.egg': 'b3f2b5539d65cb7f74ad79127f1a908c', + 'setuptools-0.6c1-py2.4.egg': 'b45adeda0667d2d2ffe14009364f2a4b', + 'setuptools-0.6c2-py2.3.egg': 'f0064bf6aa2b7d0f3ba0b43f20817c27', + 'setuptools-0.6c2-py2.4.egg': '616192eec35f47e8ea16cd6a122b7277', + 'setuptools-0.6c3-py2.3.egg': 'f181fa125dfe85a259c9cd6f1d7b78fa', + 'setuptools-0.6c3-py2.4.egg': 'e0ed74682c998bfb73bf803a50e7b71e', + 'setuptools-0.6c3-py2.5.egg': 'abef16fdd61955514841c7c6bd98965e', + 'setuptools-0.6c4-py2.3.egg': 'b0b9131acab32022bfac7f44c5d7971f', + 'setuptools-0.6c4-py2.4.egg': '2a1f9656d4fbf3c97bf946c0a124e6e2', + 'setuptools-0.6c4-py2.5.egg': '8f5a052e32cdb9c72bcf4b5526f28afc', + 'setuptools-0.6c5-py2.3.egg': 'ee9fd80965da04f2f3e6b3576e9d8167', + 'setuptools-0.6c5-py2.4.egg': 'afe2adf1c01701ee841761f5bcd8aa64', + 'setuptools-0.6c5-py2.5.egg': 'a8d3f61494ccaa8714dfed37bccd3d5d', + 'setuptools-0.6c6-py2.3.egg': '35686b78116a668847237b69d549ec20', + 'setuptools-0.6c6-py2.4.egg': '3c56af57be3225019260a644430065ab', + 'setuptools-0.6c6-py2.5.egg': 'b2f8a7520709a5b34f80946de5f02f53', +} + +import sys, os + +def _validate_md5(egg_name, data): + if egg_name in md5_data: + from md5 import md5 + digest = md5(data).hexdigest() + if digest != md5_data[egg_name]: + print >>sys.stderr, ( + "md5 validation of %s failed! (Possible download problem?)" + % egg_name + ) + sys.exit(2) + return data + + +def use_setuptools( + version=DEFAULT_VERSION, download_base=DEFAULT_URL, to_dir=os.curdir, + download_delay=15 +): + """Automatically find/download setuptools and make it available on sys.path + + `version` should be a valid setuptools version number that is available + as an egg for download under the `download_base` URL (which should end with + a '/'). `to_dir` is the directory where setuptools will be downloaded, if + it is not already available. If `download_delay` is specified, it should + be the number of seconds that will be paused before initiating a download, + should one be required. If an older version of setuptools is installed, + this routine will print a message to ``sys.stderr`` and raise SystemExit in + an attempt to abort the calling script. + """ + try: + import setuptools + if setuptools.__version__ == '0.0.1': + print >>sys.stderr, ( + "You have an obsolete version of setuptools installed. Please\n" + "remove it from your system entirely before rerunning this script." + ) + sys.exit(2) + except ImportError: + egg = download_setuptools(version, download_base, to_dir, download_delay) + sys.path.insert(0, egg) + import setuptools; setuptools.bootstrap_install_from = egg + + import pkg_resources + try: + pkg_resources.require("setuptools>="+version) + + except pkg_resources.VersionConflict, e: + # XXX could we install in a subprocess here? + print >>sys.stderr, ( + "The required version of setuptools (>=%s) is not available, and\n" + "can't be installed while this script is running. Please install\n" + " a more recent version first.\n\n(Currently using %r)" + ) % (version, e.args[0]) + sys.exit(2) + +def download_setuptools( + version=DEFAULT_VERSION, download_base=DEFAULT_URL, to_dir=os.curdir, + delay = 15 +): + """Download setuptools from a specified location and return its filename + + `version` should be a valid setuptools version number that is available + as an egg for download under the `download_base` URL (which should end + with a '/'). `to_dir` is the directory where the egg will be downloaded. + `delay` is the number of seconds to pause before an actual download attempt. + """ + import urllib2, shutil + egg_name = "setuptools-%s-py%s.egg" % (version,sys.version[:3]) + url = download_base + egg_name + saveto = os.path.join(to_dir, egg_name) + src = dst = None + if not os.path.exists(saveto): # Avoid repeated downloads + try: + from distutils import log + if delay: + log.warn(""" +--------------------------------------------------------------------------- +This script requires setuptools version %s to run (even to display +help). I will attempt to download it for you (from +%s), but +you may need to enable firewall access for this script first. +I will start the download in %d seconds. + +(Note: if this machine does not have network access, please obtain the file + + %s + +and place it in this directory before rerunning this script.) +---------------------------------------------------------------------------""", + version, download_base, delay, url + ); from time import sleep; sleep(delay) + log.warn("Downloading %s", url) + src = urllib2.urlopen(url) + # Read/write all in one block, so we don't create a corrupt file + # if the download is interrupted. + data = _validate_md5(egg_name, src.read()) + dst = open(saveto,"wb"); dst.write(data) + finally: + if src: src.close() + if dst: dst.close() + return os.path.realpath(saveto) + +def main(argv, version=DEFAULT_VERSION): + """Install or upgrade setuptools and EasyInstall""" + + try: + import setuptools + except ImportError: + egg = None + try: + egg = download_setuptools(version, delay=0) + sys.path.insert(0,egg) + from setuptools.command.easy_install import main + return main(list(argv)+[egg]) # we're done here + finally: + if egg and os.path.exists(egg): + os.unlink(egg) + else: + if setuptools.__version__ == '0.0.1': + # tell the user to uninstall obsolete version + use_setuptools(version) + + req = "setuptools>="+version + import pkg_resources + try: + pkg_resources.require(req) + except pkg_resources.VersionConflict: + try: + from setuptools.command.easy_install import main + except ImportError: + from easy_install import main + main(list(argv)+[download_setuptools(delay=0)]) + sys.exit(0) # try to force an exit + else: + if argv: + from setuptools.command.easy_install import main + main(argv) + else: + print "Setuptools version",version,"or greater has been installed." + print '(Run "ez_setup.py -U setuptools" to reinstall or upgrade.)' + + + +def update_md5(filenames): + """Update our built-in md5 registry""" + + import re + from md5 import md5 + + for name in filenames: + base = os.path.basename(name) + f = open(name,'rb') + md5_data[base] = md5(f.read()).hexdigest() + f.close() + + data = [" %r: %r,\n" % it for it in md5_data.items()] + data.sort() + repl = "".join(data) + + import inspect + srcfile = inspect.getsourcefile(sys.modules[__name__]) + f = open(srcfile, 'rb'); src = f.read(); f.close() + + match = re.search("\nmd5_data = {\n([^}]+)}", src) + if not match: + print >>sys.stderr, "Internal error!" + sys.exit(2) + + src = src[:match.start(1)] + repl + src[match.end(1):] + f = open(srcfile,'w') + f.write(src) + f.close() + + +if __name__=='__main__': + if len(sys.argv)>2 and sys.argv[1]=='--md5update': + update_md5(sys.argv[2:]) + else: + main(sys.argv[1:]) + + + + + Added: z3/NudgeNudge/branches/zope-on-a-paste-demos/turbopaste/setup.cfg ============================================================================== --- (empty file) +++ z3/NudgeNudge/branches/zope-on-a-paste-demos/turbopaste/setup.cfg Mon Jul 9 11:01:55 2007 @@ -0,0 +1,34 @@ +[egg_info] +tag_build = dev +tag_svn_revision = true + +[easy_install] +find_links = http://www.pylonshq.com/download/ + +[pudge] +theme = pythonpaste.org + +# Add extra doc files here with spaces between them +docs = turbopaste/docs/index.txt + +# Doc Settings +doc_base = turbopaste/docs/ +dest = turbopaste/docs/html + +# Add extra modules here separated with commas +modules = turbopaste +title = Turbopaste +organization = Pylons + +# Optionally add extra links +#organization_url = http://pylonshq.com/ +#trac_url = http://pylonshq.com/project +settings = no_about=true + +# Optionally add extra settings +# link1=/community/ Community +# link2=/download/ Download + +[publish] +doc-dir=turbopaste/docs/html +make-dirs=1 Added: z3/NudgeNudge/branches/zope-on-a-paste-demos/turbopaste/setup.py ============================================================================== --- (empty file) +++ z3/NudgeNudge/branches/zope-on-a-paste-demos/turbopaste/setup.py Mon Jul 9 11:01:55 2007 @@ -0,0 +1,21 @@ +from setuptools import setup, find_packages + +setup( + name='turbopaste', + version="", + #description="", + #author="", + #author_email="", + #url="", + install_requires=["TurboGears2>=2.0a1dev-r3239"], + packages=find_packages(exclude=['ez_setup']), + include_package_data=True, + test_suite = 'nose.collector', + package_data={'turbopaste': ['i18n/*/LC_MESSAGES/*.mo']}, + entry_points=""" + [paste.app_factory] + main=turbopaste:make_app + [paste.app_install] + main=pylons.util:PylonsInstaller + """, +) Added: z3/NudgeNudge/branches/zope-on-a-paste-demos/turbopaste/test.ini ============================================================================== --- (empty file) +++ z3/NudgeNudge/branches/zope-on-a-paste-demos/turbopaste/test.ini Mon Jul 9 11:01:55 2007 @@ -0,0 +1,20 @@ +# +# turbopaste - Pylons testing environment configuration +# +# The %(here)s variable will be replaced with the parent directory of this file +# +[DEFAULT] +debug = true +email_to = you at yourdomain.com +smtp_server = localhost +error_email_from = paste at localhost + +[server:main] +use = egg:Paste#http +host = 0.0.0.0 +port = 5000 + +[app:main] +use = config:development.ini + +# Add additional test specific configuration options as necessary. Added: z3/NudgeNudge/branches/zope-on-a-paste-demos/turbopaste/turbopaste/__init__.py ============================================================================== --- (empty file) +++ z3/NudgeNudge/branches/zope-on-a-paste-demos/turbopaste/turbopaste/__init__.py Mon Jul 9 11:01:55 2007 @@ -0,0 +1,8 @@ +""" +turbopaste + +This file loads the finished app from turbopaste.config.middleware. + +""" + +from turbopaste.config.middleware import make_app Added: z3/NudgeNudge/branches/zope-on-a-paste-demos/turbopaste/turbopaste/config/__init__.py ============================================================================== --- (empty file) +++ z3/NudgeNudge/branches/zope-on-a-paste-demos/turbopaste/turbopaste/config/__init__.py Mon Jul 9 11:01:55 2007 @@ -0,0 +1 @@ +# Added: z3/NudgeNudge/branches/zope-on-a-paste-demos/turbopaste/turbopaste/config/environment.py ============================================================================== --- (empty file) +++ z3/NudgeNudge/branches/zope-on-a-paste-demos/turbopaste/turbopaste/config/environment.py Mon Jul 9 11:01:55 2007 @@ -0,0 +1,39 @@ +import os + +from paste.deploy.config import CONFIG + +from pylons import config +import webhelpers + +from turbopaste.config.routing import make_map + +def load_environment(global_conf, app_conf): + # Create our paths + root_path = os.path.dirname(os.path.dirname(os.path.abspath(__file__))) + paths = {'root_path': root_path, + 'controllers': os.path.join(root_path, 'controllers'), + 'templates': [os.path.join(root_path, path) for path in \ + ('components', 'templates')], + 'static_files': os.path.join(root_path, 'public') + } + + # Initialize the other basic options + config.init_app(global_conf, app_conf, package='turbopaste', + template_engine='genshi', paths=paths) + + map = make_map(config) + config['pylons.map'] = map + + + # Add your own template options config options here, note that all config options will override + # any Pylons config options + + # The following template options are passed to your template engines + tmpl_options = {} + + # Load-up the template options + config['buffet.template_options'] = tmpl_options + + # Setup the Paste CONFIG object for legacy code + CONFIG.push_process_config(config._current_obj()) + \ No newline at end of file Added: z3/NudgeNudge/branches/zope-on-a-paste-demos/turbopaste/turbopaste/config/middleware.py ============================================================================== --- (empty file) +++ z3/NudgeNudge/branches/zope-on-a-paste-demos/turbopaste/turbopaste/config/middleware.py Mon Jul 9 11:01:55 2007 @@ -0,0 +1,53 @@ +from paste.cascade import Cascade +from paste.urlparser import StaticURLParser +from paste.registry import RegistryManager +from paste.deploy.config import ConfigMiddleware +from paste.deploy.converters import asbool + +from pylons.error import error_template +from pylons import config +from pylons.middleware import ErrorHandler, ErrorDocuments, StaticJavascripts, error_mapper +import pylons.wsgiapp + +from turbopaste.config.environment import load_environment +import turbopaste.lib.helpers +import turbopaste.lib.app_globals as app_globals + +def make_app(global_conf, full_stack=True, **app_conf): + """Create a WSGI application and return it + + global_conf is a dict representing the Paste configuration options, the + paste.deploy.converters should be used when parsing Paste config options + to ensure they're treated properly. + """ + # Load our Pylons configuration defaults + load_environment(global_conf, app_conf) + + # Load our default Pylons WSGI app and make g available + app = pylons.wsgiapp.PylonsApp(helpers=turbopaste.lib.helpers, + g=app_globals.Globals) + + app = ConfigMiddleware(app, config._current_obj()) + + # YOUR MIDDLEWARE + # Put your own middleware here, so that any problems are caught by the error + # handling middleware underneath + + # If errror handling will be handled by middleware for multiple apps, you + # will want to set full_stack = False in your config file so that it can + # catch the problems. + if asbool(full_stack): + # Error Handling + app = ErrorHandler(app, global_conf, error_template=error_template, **config['pylons.errorware']) + + # Display error documents for 401, 403, 404 status codes (if debug is disabled also + # intercepts 500) + app = ErrorDocuments(app, global_conf, mapper=error_mapper, **app_conf) + + # Establish the Registry for this application + app = RegistryManager(app) + + static_app = StaticURLParser(config['pylons.paths']['static_files']) + javascripts_app = StaticJavascripts() + app = Cascade([static_app, javascripts_app, app]) + return app Added: z3/NudgeNudge/branches/zope-on-a-paste-demos/turbopaste/turbopaste/config/routing.py ============================================================================== --- (empty file) +++ z3/NudgeNudge/branches/zope-on-a-paste-demos/turbopaste/turbopaste/config/routing.py Mon Jul 9 11:01:55 2007 @@ -0,0 +1,28 @@ +"""Setup your Routes options here""" + +import os + +from routes import Mapper + + +def make_map(conf={}): + + root_path = os.path.dirname(os.path.dirname(os.path.abspath(__file__))) + map = Mapper(directory=os.path.join(root_path, 'controllers')) + + # This route connects your root controller + map.connect('*url', controller='root', action='route') + + # This route handles displaying the error page and graphics used in the 404/500 + # error pages. It should likely stay at the top to ensure that the error page is + # displayed properly. + + map.connect('error/:action/:id', controller='error') + + # Define your routes. The more specific and detailed routes should be defined first, + # so they may take precedent over the more generic routes. For more information, refer + # to the routes manual @ http://routes.groovie.org/docs/ + + map.connect('*url', controller='template', action='view', _encoding=None) + + return map Added: z3/NudgeNudge/branches/zope-on-a-paste-demos/turbopaste/turbopaste/controllers/__init__.py ============================================================================== Added: z3/NudgeNudge/branches/zope-on-a-paste-demos/turbopaste/turbopaste/controllers/error.py ============================================================================== --- (empty file) +++ z3/NudgeNudge/branches/zope-on-a-paste-demos/turbopaste/turbopaste/controllers/error.py Mon Jul 9 11:01:55 2007 @@ -0,0 +1,32 @@ +import os.path +from paste import fileapp +from pylons.middleware import media_path, error_document_template +from turbopaste.lib.base import * + +class ErrorController(BaseController): + """ + Class to generate error documents as and when they are required. This behaviour of this + class can be altered by changing the parameters to the ErrorDocuments middleware in + your config/middleware.py file. + """ + + def document(self): + """ + Change this method to change how error documents are displayed + """ + page = error_document_template % { + 'prefix': request.environ.get('SCRIPT_NAME', ''), + 'code': request.params.get('code', ''), + 'message': request.params.get('message', ''), + } + return Response(page) + + def img(self, id): + return self._serve_file(os.path.join(media_path, 'img', id)) + + def style(self, id): + return self._serve_file(os.path.join(media_path, 'style', id)) + + def _serve_file(self, path): + fapp = fileapp.FileApp(path) + return fapp(request.environ, self.start_response) Added: z3/NudgeNudge/branches/zope-on-a-paste-demos/turbopaste/turbopaste/controllers/root.py ============================================================================== --- (empty file) +++ z3/NudgeNudge/branches/zope-on-a-paste-demos/turbopaste/turbopaste/controllers/root.py Mon Jul 9 11:01:55 2007 @@ -0,0 +1,9 @@ +from tg import expose, validate, TurboGearsController +from pylons.helpers import redirect_to + +class RootController(TurboGearsController): + + @expose('turbopaste.templates.index') + def index(self): + from datetime import datetime + return dict(now=datetime.now()) \ No newline at end of file Added: z3/NudgeNudge/branches/zope-on-a-paste-demos/turbopaste/turbopaste/controllers/template.py ============================================================================== --- (empty file) +++ z3/NudgeNudge/branches/zope-on-a-paste-demos/turbopaste/turbopaste/controllers/template.py Mon Jul 9 11:01:55 2007 @@ -0,0 +1,28 @@ +from turbopaste.lib.base import * + +class TemplateController(BaseController): + def view(self, url): + """ + This is the last place which is tried during a request to try to find a + file to serve. It could be used for example to display a template:: + + def view(self, url): + return render_response(url) + + Or, if you're using Myghty and would like to catch the component not + found error which will occur when the template doesn't exist; you + can use the following version which will provide a 404 if the template + doesn't exist:: + + import myghty.exception + + def view(self, url): + try: + return render_response('/'+url) + except myghty.exception.ComponentNotFound: + return Response(code=404) + + The default is just to abort the request with a 404 File not found + status message. + """ + abort(404) Added: z3/NudgeNudge/branches/zope-on-a-paste-demos/turbopaste/turbopaste/docs/index.txt ============================================================================== --- (empty file) +++ z3/NudgeNudge/branches/zope-on-a-paste-demos/turbopaste/turbopaste/docs/index.txt Mon Jul 9 11:01:55 2007 @@ -0,0 +1,11 @@ +turbopaste +++++++++++ + +This is the main index page of your documentation. It should be written in reStructuredText format. + +You can generate your documentation in HTML format by running this command:: + + setup.py pudge + +For this to work you will need to download and install ``buildutils`` and ``pudge``. + Added: z3/NudgeNudge/branches/zope-on-a-paste-demos/turbopaste/turbopaste/i18n/__init__.py ============================================================================== Added: z3/NudgeNudge/branches/zope-on-a-paste-demos/turbopaste/turbopaste/lib/__init__.py ============================================================================== Added: z3/NudgeNudge/branches/zope-on-a-paste-demos/turbopaste/turbopaste/lib/app_globals.py ============================================================================== --- (empty file) +++ z3/NudgeNudge/branches/zope-on-a-paste-demos/turbopaste/turbopaste/lib/app_globals.py Mon Jul 9 11:01:55 2007 @@ -0,0 +1,35 @@ +class Globals(object): + + def __init__(self, global_conf, app_conf, **extra): + """ + Globals acts as a container for objects available throughout + the life of the application. + + One instance of Globals is created by Pylons during + application initialization and is available during requests + via the 'g' variable. + + ``global_conf`` + The same variable used throughout ``config/middleware.py`` + namely, the variables from the ``[DEFAULT]`` section of the + configuration file. + + ``app_conf`` + The same ``kw`` dictionary used throughout + ``config/middleware.py`` namely, the variables from the + section in the config file for your application. + + ``extra`` + The configuration returned from ``load_config`` in + ``config/middleware.py`` which may be of use in the setup of + your global variables. + + """ + pass + + def __del__(self): + """ + Put any cleanup code to be run when the application finally exits + here. + """ + pass Added: z3/NudgeNudge/branches/zope-on-a-paste-demos/turbopaste/turbopaste/lib/base.py ============================================================================== --- (empty file) +++ z3/NudgeNudge/branches/zope-on-a-paste-demos/turbopaste/turbopaste/lib/base.py Mon Jul 9 11:01:55 2007 @@ -0,0 +1,19 @@ +from pylons import Response, c, g, cache, request, session +from pylons.controllers import WSGIController +from pylons.decorators import jsonify, validate +from pylons.templating import render, render_response +from pylons.helpers import abort, redirect_to, etag_cache +from pylons.i18n import N_, _, ungettext +import turbopaste.models as model +import turbopaste.lib.helpers as h + +class BaseController(WSGIController): + def __call__(self, environ, start_response): + # Insert any code to be run per request here. The Routes match + # is under environ['pylons.routes_dict'] should you want to check + # the action or route vars here + return WSGIController.__call__(self, environ, start_response) + +# Include the '_' function in the public names +__all__ = [__name for __name in locals().keys() if not __name.startswith('_') \ + or __name == '_'] Added: z3/NudgeNudge/branches/zope-on-a-paste-demos/turbopaste/turbopaste/lib/database.py ============================================================================== --- (empty file) +++ z3/NudgeNudge/branches/zope-on-a-paste-demos/turbopaste/turbopaste/lib/database.py Mon Jul 9 11:01:55 2007 @@ -0,0 +1,35 @@ +from pylons.database import create_engine + +import elixir + +metadata = elixir.metadata +objectstore = elixir.objectstore +session_context = objectstore.context +engine = None + +def connect(dburi=None, echo = None): + """ + Connects engine to metadata + """ + global engine + engine = create_engine(dburi, echo) + metadata.connect(engine) + elixir.setup_all() + +def resync(): + """ + Renews SQLAlchemy session with current thread + """ + del session_context.current + +def flush_all(): + """ + Flushes all changes to database + """ + objectstore.flush() + +# Uncomment these lines if you want to use the "autoload" option with your Elixir models +# if not metadata.is_bound(): +# elixir.delay_setup = True + +__all__ = ['metadata', 'objectstore', 'session_context', 'engine', 'connect', 'resync', 'flush_all'] \ No newline at end of file Added: z3/NudgeNudge/branches/zope-on-a-paste-demos/turbopaste/turbopaste/lib/helpers.py ============================================================================== --- (empty file) +++ z3/NudgeNudge/branches/zope-on-a-paste-demos/turbopaste/turbopaste/lib/helpers.py Mon Jul 9 11:01:55 2007 @@ -0,0 +1,8 @@ +""" +Helper functions + +All names available in this module will be available under the Pylons h object. +""" +from webhelpers import * +from pylons.helpers import log +from pylons.i18n import get_lang, set_lang Added: z3/NudgeNudge/branches/zope-on-a-paste-demos/turbopaste/turbopaste/models/__init__.py ============================================================================== --- (empty file) +++ z3/NudgeNudge/branches/zope-on-a-paste-demos/turbopaste/turbopaste/models/__init__.py Mon Jul 9 11:01:55 2007 @@ -0,0 +1,4 @@ +from turbopaste.lib.database import * + +# Import or define your Elixir classes here +# from elixir import * Added: z3/NudgeNudge/branches/zope-on-a-paste-demos/turbopaste/turbopaste/public/css/style.css ============================================================================== --- (empty file) +++ z3/NudgeNudge/branches/zope-on-a-paste-demos/turbopaste/turbopaste/public/css/style.css Mon Jul 9 11:01:55 2007 @@ -0,0 +1,134 @@ +/* + * Quick mash-up of CSS for the TG quick start page. + */ + +html, body { + color: black; + background-color: #ddd; + font: x-small "Lucida Grande", "Lucida Sans Unicode", geneva, verdana, sans-serif; + margin: 0; + padding: 0; +} + +td, th {padding:3px;border:none;} +tr th {text-align:left;background-color:#f0f0f0;color:#333;} +tr.odd td {background-color:#edf3fe;} +tr.even td {background-color:#fff;} + +#header { + height: 80px; + width: 777px; + background: blue URL('../images/header_inner.png') no-repeat; + border-left: 1px solid #aaa; + border-right: 1px solid #aaa; + margin: 0 auto 0 auto; +} + +a.link, a, a.active { + color: #369; +} + + +#main_content { + color: black; + font-size: 127%; + background-color: white; + width: 757px; + margin: 0 auto 0 auto; + border-left: 1px solid #aaa; + border-right: 1px solid #aaa; + padding: 10px; +} + +#sidebar { + border: 1px solid #aaa; + background-color: #eee; + margin: 0.5em; + padding: 1em; + float: right; + width: 200px; + font-size: 88%; +} + +#sidebar h2 { + margin-top: 0; +} + +#sidebar ul { + margin-left: 1.5em; + padding-left: 0; +} + +h1,h2,h3,h4,h5,h6,#getting_started_steps { + font-family: "Century Schoolbook L", Georgia, serif; + font-weight: bold; +} + +h2 { + font-size: 150%; +} + +#getting_started_steps a { + text-decoration: none; +} + +#getting_started_steps a:hover { + text-decoration: underline; +} + +#getting_started_steps li { + font-size: 80%; + margin-bottom: 0.5em; +} + +#getting_started_steps h2 { + font-size: 120%; +} + +#getting_started_steps p { + font: 100% "Lucida Grande", "Lucida Sans Unicode", geneva, verdana, sans-serif; +} + +#footer { + border: 1px solid #aaa; + border-top: 0px none; + color: #999; + background-color: white; + padding: 10px; + font-size: 80%; + text-align: center; + width: 757px; + margin: 0 auto 1em auto; +} + +.code { + font-family: monospace; +} + +span.code { + font-weight: bold; + background: #eee; +} + +#status_block { + margin: 0 auto 0.5em auto; + padding: 15px 10px 15px 55px; + background: #cec URL('../images/ok.png') left center no-repeat; + border: 1px solid #9c9; + width: 450px; + font-size: 120%; + font-weight: bolder; +} + +.notice { + margin: 0.5em auto 0.5em auto; + padding: 15px 10px 15px 55px; + width: 450px; + background: #eef URL('../images/info.png') left center no-repeat; + border: 1px solid #cce; +} + +.fielderror { + color: red; + font-weight: bold; +} \ No newline at end of file Added: z3/NudgeNudge/branches/zope-on-a-paste-demos/turbopaste/turbopaste/public/favicon.ico ============================================================================== Binary file. No diff available. Added: z3/NudgeNudge/branches/zope-on-a-paste-demos/turbopaste/turbopaste/public/images/header_inner.png ============================================================================== Binary file. No diff available. Added: z3/NudgeNudge/branches/zope-on-a-paste-demos/turbopaste/turbopaste/public/images/info.png ============================================================================== Binary file. No diff available. Added: z3/NudgeNudge/branches/zope-on-a-paste-demos/turbopaste/turbopaste/public/images/ok.png ============================================================================== Binary file. No diff available. Added: z3/NudgeNudge/branches/zope-on-a-paste-demos/turbopaste/turbopaste/public/images/tg_under_the_hood.png ============================================================================== Binary file. No diff available. Added: z3/NudgeNudge/branches/zope-on-a-paste-demos/turbopaste/turbopaste/public/images/under_the_hood_blue.png ============================================================================== Binary file. No diff available. Added: z3/NudgeNudge/branches/zope-on-a-paste-demos/turbopaste/turbopaste/templates/__init__.py ============================================================================== Added: z3/NudgeNudge/branches/zope-on-a-paste-demos/turbopaste/turbopaste/templates/index.html ============================================================================== --- (empty file) +++ z3/NudgeNudge/branches/zope-on-a-paste-demos/turbopaste/turbopaste/templates/index.html Mon Jul 9 11:01:55 2007 @@ -0,0 +1,48 @@ + + + + + + + + Welcome to TurboGears 2.0, standing on the + shoulders of giants, since 2007 + + + +
Your application is now running
+ +
+
    +
  1. +

    Code your data model

    +

    Code your data model, Create the database, and Add some bootstrap data.

    +
  2. +
  3. +

    Design your URLs

    +

    Design your URLs, Write your controller methods, Write your + templates, and Add some static files (CSS and/or JavaScript).

    +
  4. +
  5. +

    Build an distribution

    +

    Build an distribution.

    +
  6. +
+
TurboGears is an opensource project, help yourself to + make turbogears better and make your life easier.
+
+ + \ No newline at end of file Added: z3/NudgeNudge/branches/zope-on-a-paste-demos/turbopaste/turbopaste/templates/master.html ============================================================================== --- (empty file) +++ z3/NudgeNudge/branches/zope-on-a-paste-demos/turbopaste/turbopaste/templates/master.html Mon Jul 9 11:01:55 2007 @@ -0,0 +1,28 @@ + + + + + + Your title goes here + + + + + + +
+
+
+ + + + \ No newline at end of file Added: z3/NudgeNudge/branches/zope-on-a-paste-demos/turbopaste/turbopaste/tests/__init__.py ============================================================================== --- (empty file) +++ z3/NudgeNudge/branches/zope-on-a-paste-demos/turbopaste/turbopaste/tests/__init__.py Mon Jul 9 11:01:55 2007 @@ -0,0 +1,34 @@ +import os +import sys +from unittest import TestCase + +here_dir = os.path.dirname(os.path.abspath(__file__)) +conf_dir = os.path.dirname(os.path.dirname(here_dir)) + +sys.path.insert(0, conf_dir) + +import pkg_resources + +pkg_resources.working_set.add_entry(conf_dir) + +pkg_resources.require('Paste') +pkg_resources.require('PasteScript') + +from paste.deploy import loadapp +import paste.fixture +import paste.script.appinstall + +from turbopaste.config.routing import * +from routes import request_config, url_for + +test_file = os.path.join(conf_dir, 'test.ini') +cmd = paste.script.appinstall.SetupCommand('setup-app') +cmd.run([test_file]) + +class TestController(TestCase): + def __init__(self, *args): + wsgiapp = loadapp('config:test.ini', relative_to=conf_dir) + self.app = paste.fixture.TestApp(wsgiapp) + TestCase.__init__(self, *args) + +__all__ = ['url_for', 'TestController'] Added: z3/NudgeNudge/branches/zope-on-a-paste-demos/turbopaste/turbopaste/tests/functional/__init__.py ============================================================================== Added: z3/NudgeNudge/branches/zope-on-a-paste-demos/turbopaste/turbopaste/tests/test_models.py ============================================================================== Added: z3/NudgeNudge/branches/zope-on-a-paste-demos/turbopaste/turbopaste/websetup.py ============================================================================== --- (empty file) +++ z3/NudgeNudge/branches/zope-on-a-paste-demos/turbopaste/turbopaste/websetup.py Mon Jul 9 11:01:55 2007 @@ -0,0 +1,10 @@ +import paste.deploy + +def setup_config(command, filename, section, vars): + """ + Place any commands to setup turbopaste here. + """ + conf = paste.deploy.appconfig('config:' + filename) + conf.update(dict(app_conf=conf.local_conf, global_conf=conf.global_conf)) + paste.deploy.CONFIG.push_process_config(conf) + From philikon at codespeak.net Mon Jul 9 11:08:40 2007 From: philikon at codespeak.net (philikon at codespeak.net) Date: Mon, 9 Jul 2007 11:08:40 +0200 (CEST) Subject: [z3-checkins] r44864 - z3/NudgeNudge/branches/zope-on-a-paste-demos Message-ID: <20070709090840.1FBF981FD@code0.codespeak.net> Author: philikon Date: Mon Jul 9 11:08:39 2007 New Revision: 44864 Modified: z3/NudgeNudge/branches/zope-on-a-paste-demos/mod_python.conf z3/NudgeNudge/branches/zope-on-a-paste-demos/nudge.wsgi Log: update pythonpath with newest eggs Modified: z3/NudgeNudge/branches/zope-on-a-paste-demos/mod_python.conf ============================================================================== --- z3/NudgeNudge/branches/zope-on-a-paste-demos/mod_python.conf (original) +++ z3/NudgeNudge/branches/zope-on-a-paste-demos/mod_python.conf Mon Jul 9 11:08:39 2007 @@ -2,91 +2,118 @@ SetHandler python-program PythonHandler paste.modpython PythonPath "[ '/Users/philipp/shared-eggs/setuptools-0.6c6-py2.4.egg', \ - '/Users/philipp/shared-eggs/grok-0.9dev_r75634-py2.4.egg', \ + '/Users/philipp/shared-eggs/grok-0.9dev_r77371-py2.4.egg', \ '/Users/philipp/dev/zope-on-a-paste-demos/src', \ - '/Users/philipp/shared-eggs/zope.paste-0.3-py2.4.egg', \ - '/Users/philipp/shared-eggs/PasteDeploy-1.3-py2.4.egg', \ + '/Users/philipp/shared-eggs/z3c.evalexception-1.0-py2.4.egg', \ + '/Users/philipp/dev/zope-on-a-paste-demos/capitalizer', \ '/Users/philipp/dev/zope-on-a-paste-demos/deliverance', \ - '/Users/philipp/shared-eggs/PasteScript-1.3.4-py2.4.egg', \ - '/Users/philipp/shared-eggs/WSGIUtils-0.7-py2.4.egg', \ - '/Users/philipp/shared-eggs/Paste-1.3-py2.4.egg', \ + '/Users/philipp/shared-eggs/PasteScript-1.3.5-py2.4.egg', \ + '/Users/philipp/dev/zope-on-a-paste-demos/TurboGears', \ + '/Users/philipp/dev/zope-on-a-paste-demos/turbopaste', \ + '/Users/philipp/shared-eggs/SQLAlchemy-0.3.8-py2.4.egg', \ + '/Users/philipp/shared-eggs/Genshi-0.4.2-py2.4.egg', \ + '/Users/philipp/dev/zope-on-a-paste-demos/Pylons', \ + '/Users/philipp/shared-eggs/PasteDeploy-1.3.1-py2.4.egg', \ + '/Users/philipp/shared-eggs/Paste-1.4-py2.4.egg', \ '/Users/philipp/shared-eggs/WSGIFilter-0.1dev-py2.4.egg', \ - '/Users/philipp/shared-eggs/nose-0.9.3-py2.4.egg', \ + '/Users/philipp/shared-eggs/nose-0.10.0a1-py2.4.egg', \ '/Users/philipp/shared-eggs/elementtree-1.2.6_20050316-py2.4.egg', \ '/Users/philipp/shared-eggs/FormEncode-0.7.1-py2.4.egg', \ - '/Users/philipp/shared-eggs/lxml-1.3beta-py2.4-macosx-10.4-i386.egg', \ - '/Users/philipp/shared-eggs/zope.app.server-3.4.0b1dev_r75388-py2.4.egg', \ - '/Users/philipp/shared-eggs/zope.app.twisted-3.4.0a1-py2.4.egg', \ - '/Users/philipp/shared-eggs/zope.app.wsgi-3.4.0b1dev_r75415-py2.4.egg', \ - '/Users/philipp/shared-eggs/zope.app.appsetup-3.4.0a1-py2.4.egg', \ - '/Users/philipp/shared-eggs/zope.interface-3.4.0b1-py2.4-macosx-10.4-i386.egg', \ + '/Users/philipp/shared-eggs/lxml-1.3.2-py2.4-macosx-10.4-i386.egg', \ + '/Users/philipp/shared-eggs/WSGIUtils-0.7-py2.4.egg', \ + '/Users/philipp/shared-eggs/zope.paste-0.3-py2.4.egg', \ + '/Users/philipp/shared-eggs/zope.app.zcmlfiles-3.4.0a1-py2.4.egg', \ '/Users/philipp/shared-eggs/zope.app.securitypolicy-3.4.0a1-py2.4.egg', \ '/Users/philipp/shared-eggs/zope.app.security-3.4.0a1_1-py2.4.egg', \ '/Users/philipp/shared-eggs/zope.app.authentication-3.4.0a1-py2.4.egg', \ - '/Users/philipp/shared-eggs/zope.app.catalog-3.4.0a2-py2.4.egg', \ + '/Users/philipp/shared-eggs/zope.app.catalog-3.5.0a1-py2.4.egg', \ '/Users/philipp/shared-eggs/zope.component-3.4.0a1-py2.4.egg', \ '/Users/philipp/shared-eggs/zope.schema-3.4.0a1-py2.4.egg', \ - '/Users/philipp/shared-eggs/ZODB3-3.8.0a1-py2.4-macosx-10.4-i386.egg', \ + '/Users/philipp/shared-eggs/zope.interface-3.4.0b1-py2.4-macosx-10.4-i386.egg', \ + '/Users/philipp/shared-eggs/ZODB3-3.9.0_dev_r77011-py2.4-macosx-10.4-i386.egg', \ + '/Users/philipp/shared-eggs/zc.catalog-1.1.1-py2.4.egg', \ '/Users/philipp/shared-eggs/simplejson-1.7.1-py2.4.egg', \ + '/Users/philipp/shared-eggs/martian-0.8-py2.4.egg', \ + '/Users/philipp/shared-eggs/Mako-0.1.8-py2.4.egg', \ + '/Users/philipp/shared-eggs/decorator-2.1.0-py2.4.egg', \ + '/Users/philipp/shared-eggs/Beaker-0.7.3-py2.4.egg', \ + '/Users/philipp/shared-eggs/WebHelpers-0.3.1dev_r2064-py2.4.egg', \ + '/Users/philipp/shared-eggs/Routes-1.7-py2.4.egg', \ '/Users/philipp/shared-eggs/HTTPEncode-0.1dev_r6484-py2.4.egg', \ - '/Users/philipp/shared-eggs/ZConfig-2.4a2-py2.4.egg', \ - '/Users/philipp/shared-eggs/zdaemon-2.0a6-py2.4.egg', \ - '/Users/philipp/shared-eggs/zope.server-3.5.0a2-py2.4.egg', \ - '/Users/philipp/shared-eggs/zope.publisher-3.4.0a1_1-py2.4.egg', \ - '/Users/philipp/shared-eggs/zope.event-3.4.0b1.dev_r75122-py2.4.egg', \ - '/Users/philipp/shared-eggs/zope.configuration-3.4.0a1-py2.4.egg', \ - '/Users/philipp/shared-eggs/zope.app.publication-3.4.0a1_2-py2.4.egg', \ - '/Users/philipp/shared-eggs/zope.app.applicationcontrol-3.4_dev_r73715-py2.4.egg', \ - '/Users/philipp/shared-eggs/zope.app.zapi-3.4.0a1-py2.4.egg', \ - '/Users/philipp/shared-eggs/zope.security-3.4.0a1-py2.4-macosx-10.4-i386.egg', \ - '/Users/philipp/shared-eggs/zope.exceptions-3.4dev_r73107-py2.4.egg', \ - '/Users/philipp/shared-eggs/zope.copypastemove-3.4.0a1-py2.4.egg', \ - '/Users/philipp/shared-eggs/zope.app.container-3.4.0a1-py2.4-macosx-10.4-i386.egg', \ - '/Users/philipp/shared-eggs/zope.traversing-3.4.0a1-py2.4.egg', \ - '/Users/philipp/shared-eggs/zope.app.folder-3.4.0a1-py2.4.egg', \ + '/Users/philipp/shared-eggs/zope.app.server-3.4.0b1dev_r75388-py2.4.egg', \ + '/Users/philipp/shared-eggs/zope.app.twisted-3.4.0b1_r76119-py2.4.egg', \ + '/Users/philipp/shared-eggs/zope.app.wsgi-3.4.0b1dev_r75415-py2.4.egg', \ + '/Users/philipp/shared-eggs/zope.app.appsetup-3.4.0a1-py2.4.egg', \ + '/Users/philipp/shared-eggs/zope.app.container-3.5.0a1-py2.4-macosx-10.4-i386.egg', \ + '/Users/philipp/shared-eggs/zope.app.schema-3.4.0a1-py2.4.egg', \ + '/Users/philipp/shared-eggs/zope.app.pagetemplate-3.4.0b1dev_r75616-py2.4.egg', \ + '/Users/philipp/shared-eggs/zope.i18n-3.4.0b3-py2.4.egg', \ + '/Users/philipp/shared-eggs/zope.formlib-3.4.0a1-py2.4.egg', \ + '/Users/philipp/shared-eggs/zope.app.rotterdam-3.4.0a1-py2.4.egg', \ + '/Users/philipp/shared-eggs/zope.app.basicskin-3.4.0a1-py2.4.egg', \ + '/Users/philipp/shared-eggs/zope.app.principalannotation-3.4.0a1-py2.4.egg', \ + '/Users/philipp/shared-eggs/zope.app.zopeappgenerations-3.4.0a1-py2.4.egg', \ + '/Users/philipp/shared-eggs/zope.app.locales-3.4.0b1.dev_r77033-py2.4.egg', \ + '/Users/philipp/shared-eggs/zope.app.form-3.4.0b2.dev_r76975-py2.4.egg', \ + '/Users/philipp/shared-eggs/zope.app.publisher-0.1dev_r73800-py2.4.egg', \ + '/Users/philipp/shared-eggs/zope.app.interface-3.4.0a1-py2.4.egg', \ + '/Users/philipp/shared-eggs/zope.app.generations-3.4.0a1-py2.4.egg', \ '/Users/philipp/shared-eggs/zope.app.component-0.1dev_r74310-py2.4.egg', \ + '/Users/philipp/shared-eggs/zope.publisher-3.4.0b2-py2.4.egg', \ + '/Users/philipp/shared-eggs/zope.app.content-3.4.0a1-py2.4.egg', \ + '/Users/philipp/shared-eggs/zope.app.dependable-3.4.0a1-py2.4.egg', \ + '/Users/philipp/shared-eggs/zope.annotation-3.4.0b1.dev_r75758-py2.4.egg', \ + '/Users/philipp/shared-eggs/zope.modulealias-3.4.0a1-py2.4.egg', \ + '/Users/philipp/shared-eggs/zope.security-3.4.0b2-py2.4-macosx-10.4-i386.egg', \ '/Users/philipp/shared-eggs/zope.location-3.4.0b1.dev_r75152-py2.4.egg', \ '/Users/philipp/shared-eggs/zope.i18nmessageid-3.4.0a1-py2.4-macosx-10.4-i386.egg', \ - '/Users/philipp/shared-eggs/zope.i18n-3.4.0a1-py2.4.egg', \ - '/Users/philipp/shared-eggs/zope.app.form-0.1.dev_r74902-py2.4.egg', \ - '/Users/philipp/shared-eggs/zope.annotation-3.4.0b1.dev_r75758-py2.4.egg', \ + '/Users/philipp/shared-eggs/zope.exceptions-3.4.0b1-py2.4.egg', \ + '/Users/philipp/shared-eggs/zope.configuration-3.4.0a1-py2.4.egg', \ '/Users/philipp/shared-eggs/zope.deprecation-3.4.0a1-py2.4.egg', \ - '/Users/philipp/shared-eggs/zope.deferredimport-3.4dev-py2.4.egg', \ - '/Users/philipp/shared-eggs/zope.app.publisher-0.1dev_r73800-py2.4.egg', \ - '/Users/philipp/shared-eggs/zope.app.pagetemplate-3.4.0b1dev_r75616-py2.4.egg', \ + '/Users/philipp/shared-eggs/zope.deferredimport-3.4.0b1-py2.4.egg', \ '/Users/philipp/shared-eggs/zope.app.i18n-3.4.0a1-py2.4.egg', \ + '/Users/philipp/shared-eggs/zope.traversing-3.4.0a1-py2.4.egg', \ + '/Users/philipp/shared-eggs/zope.event-3.4.0b1.dev_r75122-py2.4.egg', \ '/Users/philipp/shared-eggs/zope.dublincore-3.4.0a1-py2.4.egg', \ - '/Users/philipp/shared-eggs/zope.app.session-3.4.0a1-py2.4.egg', \ + '/Users/philipp/shared-eggs/zope.app.zapi-3.4.0a1-py2.4.egg', \ + '/Users/philipp/shared-eggs/zope.app.session-3.5.0dev_r77333-py2.4.egg', \ '/Users/philipp/shared-eggs/zope.testing-3.4_r75911-py2.4.egg', \ '/Users/philipp/shared-eggs/zope.lifecycleevent-3.4.0a1-py2.4.egg', \ '/Users/philipp/shared-eggs/zope.index-3.4.0a2-py2.4.egg', \ - '/Users/philipp/shared-eggs/zope.app.testing-3.4.0b1_r75826-py2.4.egg', \ + '/Users/philipp/shared-eggs/zope.app.testing-3.4.0b1_r76117-py2.4.egg', \ '/Users/philipp/shared-eggs/zope.app.intid-3.4.0a2-py2.4.egg', \ + '/Users/philipp/shared-eggs/zdaemon-2.0a6-py2.4.egg', \ + '/Users/philipp/shared-eggs/ZConfig-2.4a6-py2.4.egg', \ '/Users/philipp/shared-eggs/zope.proxy-3.4.0a1-py2.4-macosx-10.4-i386.egg', \ '/Users/philipp/shared-eggs/httplib2-0.3.0-py2.4.egg', \ - '/Users/philipp/shared-eggs/zope.app.exception-3.4.0a1-py2.4.egg', \ - '/Users/philipp/shared-eggs/zope.app.error-3.4.0a1-py2.4.egg', \ - '/Users/philipp/shared-eggs/zope.app.http-3.4.0a1-py2.4.egg', \ - '/Users/philipp/shared-eggs/zope.size-3.4.0a1-py2.4.egg', \ - '/Users/philipp/shared-eggs/zope.app.interface-3.4.0a1-py2.4.egg', \ - '/Users/philipp/shared-eggs/zope.thread-3.4dev_r73086-py2.4-macosx-10.4-i386.egg', \ - '/Users/philipp/shared-eggs/pytz-2007d-py2.4.egg', \ + '/Users/philipp/shared-eggs/zope.server-3.5.0a2-py2.4.egg', \ + '/Users/philipp/shared-eggs/zope.app.publication-3.4.0a1_2-py2.4.egg', \ + '/Users/philipp/shared-eggs/zope.app.applicationcontrol-3.4_dev_r73715-py2.4.egg', \ + '/Users/philipp/shared-eggs/zope.copypastemove-3.4.0a1-py2.4.egg', \ + '/Users/philipp/shared-eggs/zope.app.folder-3.4.0a1-py2.4.egg', \ '/Users/philipp/shared-eggs/zope.app.broken-3.4.0a1-py2.4.egg', \ + '/Users/philipp/shared-eggs/zope.size-3.4.0a1-py2.4.egg', \ '/Users/philipp/shared-eggs/zope.filerepresentation-3.4.0a1-py2.4.egg', \ '/Users/philipp/shared-eggs/zope.dottedname-3.4dev_r73113-py2.4.egg', \ '/Users/philipp/shared-eggs/zope.cachedescriptors-3.4.0b1_r75830-py2.4.egg', \ - '/Users/philipp/shared-eggs/zope.datetime-3.4.0a1-py2.4.egg', \ - '/Users/philipp/shared-eggs/zope.formlib-3.4.0a1-py2.4.egg', \ - '/Users/philipp/shared-eggs/zope.hookable-3.4.0a1-py2.4-macosx-10.4-i386.egg', \ - '/Users/philipp/shared-eggs/zope.app.basicskin-3.4.0a1-py2.4.egg', \ + '/Users/philipp/shared-eggs/zope.tales-3.4.0a1-py2.4.egg', \ '/Users/philipp/shared-eggs/zope.pagetemplate-3.4.0a1-py2.4.egg', \ + '/Users/philipp/shared-eggs/pytz-2007f-py2.4.egg', \ + '/Users/philipp/shared-eggs/zope.tal-3.4.0b1-py2.4.egg', \ + '/Users/philipp/shared-eggs/zope.datetime-3.4.0a1-py2.4.egg', \ '/Users/philipp/shared-eggs/zope.contenttype-3.4.0a1-py2.4.egg', \ - '/Users/philipp/shared-eggs/zope.tales-3.4.0a1-py2.4.egg', \ - '/Users/philipp/shared-eggs/zope.app.dependable-3.4.0a1-py2.4.egg', \ - '/Users/philipp/shared-eggs/zope.app.debug-3.4.0a1-py2.4.egg', \ - '/Users/philipp/shared-eggs/zope.app.keyreference-3.4.0a1-py2.4.egg', \ '/Users/philipp/shared-eggs/zodbcode-3.4.0b1dev_r75670-py2.4.egg', \ - '/Users/philipp/shared-eggs/zope.tal-3.4.0a1-py2.4.egg', \ - '/Users/philipp/shared-eggs/RestrictedPython-3.4dev_r73257-py2.4.egg'] + sys.path" + '/Users/philipp/shared-eggs/zope.app.renderer-3.4.0a1-py2.4.egg', \ + '/Users/philipp/shared-eggs/zope.thread-3.4.0b1-py2.4-macosx-10.4-i386.egg', \ + '/Users/philipp/shared-eggs/zope.hookable-3.4.0a1-py2.4-macosx-10.4-i386.egg', \ + '/Users/philipp/shared-eggs/zope.minmax-1.0b1-py2.4.egg', \ + '/Users/philipp/shared-eggs/zope.app.http-3.4.0a1-py2.4.egg', \ + '/Users/philipp/shared-eggs/zope.app.debug-3.4.0a1-py2.4.egg', \ + '/Users/philipp/shared-eggs/zope.app.keyreference-3.5.0_dev_r77018-py2.4.egg', \ + '/Users/philipp/shared-eggs/zope.app.exception-3.4.0a1-py2.4.egg', \ + '/Users/philipp/shared-eggs/zope.app.error-3.4.0a1-py2.4.egg', \ + '/Users/philipp/shared-eggs/RestrictedPython-3.4.1-py2.4.egg', \ + '/Users/philipp/shared-eggs/zope.structuredtext-3.4.0a1-py2.4.egg', \ + '/Users/philipp/shared-eggs/docutils-0.4-py2.4.egg', ] + sys.path" PythonOption paste.ini /Users/philipp/dev/zope-on-a-paste-demos/simple.ini Modified: z3/NudgeNudge/branches/zope-on-a-paste-demos/nudge.wsgi ============================================================================== --- z3/NudgeNudge/branches/zope-on-a-paste-demos/nudge.wsgi (original) +++ z3/NudgeNudge/branches/zope-on-a-paste-demos/nudge.wsgi Mon Jul 9 11:08:39 2007 @@ -1,92 +1,119 @@ import sys sys.path[0:0] = [ '/Users/philipp/shared-eggs/setuptools-0.6c6-py2.4.egg', - '/Users/philipp/shared-eggs/grok-0.9dev_r75634-py2.4.egg', + '/Users/philipp/shared-eggs/grok-0.9dev_r77371-py2.4.egg', '/Users/philipp/dev/zope-on-a-paste-demos/src', - '/Users/philipp/shared-eggs/zope.paste-0.3-py2.4.egg', - '/Users/philipp/shared-eggs/PasteDeploy-1.3-py2.4.egg', + '/Users/philipp/shared-eggs/z3c.evalexception-1.0-py2.4.egg', + '/Users/philipp/dev/zope-on-a-paste-demos/capitalizer', '/Users/philipp/dev/zope-on-a-paste-demos/deliverance', - '/Users/philipp/shared-eggs/PasteScript-1.3.4-py2.4.egg', - '/Users/philipp/shared-eggs/WSGIUtils-0.7-py2.4.egg', - '/Users/philipp/shared-eggs/Paste-1.3-py2.4.egg', + '/Users/philipp/shared-eggs/PasteScript-1.3.5-py2.4.egg', + '/Users/philipp/dev/zope-on-a-paste-demos/TurboGears', + '/Users/philipp/dev/zope-on-a-paste-demos/turbopaste', + '/Users/philipp/shared-eggs/SQLAlchemy-0.3.8-py2.4.egg', + '/Users/philipp/shared-eggs/Genshi-0.4.2-py2.4.egg', + '/Users/philipp/dev/zope-on-a-paste-demos/Pylons', + '/Users/philipp/shared-eggs/PasteDeploy-1.3.1-py2.4.egg', + '/Users/philipp/shared-eggs/Paste-1.4-py2.4.egg', '/Users/philipp/shared-eggs/WSGIFilter-0.1dev-py2.4.egg', - '/Users/philipp/shared-eggs/nose-0.9.3-py2.4.egg', + '/Users/philipp/shared-eggs/nose-0.10.0a1-py2.4.egg', '/Users/philipp/shared-eggs/elementtree-1.2.6_20050316-py2.4.egg', '/Users/philipp/shared-eggs/FormEncode-0.7.1-py2.4.egg', - '/Users/philipp/shared-eggs/lxml-1.3beta-py2.4-macosx-10.4-i386.egg', - '/Users/philipp/shared-eggs/zope.app.server-3.4.0b1dev_r75388-py2.4.egg', - '/Users/philipp/shared-eggs/zope.app.twisted-3.4.0a1-py2.4.egg', - '/Users/philipp/shared-eggs/zope.app.wsgi-3.4.0b1dev_r75415-py2.4.egg', - '/Users/philipp/shared-eggs/zope.app.appsetup-3.4.0a1-py2.4.egg', - '/Users/philipp/shared-eggs/zope.interface-3.4.0b1-py2.4-macosx-10.4-i386.egg', + '/Users/philipp/shared-eggs/lxml-1.3.2-py2.4-macosx-10.4-i386.egg', + '/Users/philipp/shared-eggs/WSGIUtils-0.7-py2.4.egg', + '/Users/philipp/shared-eggs/zope.paste-0.3-py2.4.egg', + '/Users/philipp/shared-eggs/zope.app.zcmlfiles-3.4.0a1-py2.4.egg', '/Users/philipp/shared-eggs/zope.app.securitypolicy-3.4.0a1-py2.4.egg', '/Users/philipp/shared-eggs/zope.app.security-3.4.0a1_1-py2.4.egg', '/Users/philipp/shared-eggs/zope.app.authentication-3.4.0a1-py2.4.egg', - '/Users/philipp/shared-eggs/zope.app.catalog-3.4.0a2-py2.4.egg', + '/Users/philipp/shared-eggs/zope.app.catalog-3.5.0a1-py2.4.egg', '/Users/philipp/shared-eggs/zope.component-3.4.0a1-py2.4.egg', '/Users/philipp/shared-eggs/zope.schema-3.4.0a1-py2.4.egg', - '/Users/philipp/shared-eggs/ZODB3-3.8.0a1-py2.4-macosx-10.4-i386.egg', + '/Users/philipp/shared-eggs/zope.interface-3.4.0b1-py2.4-macosx-10.4-i386.egg', + '/Users/philipp/shared-eggs/ZODB3-3.9.0_dev_r77011-py2.4-macosx-10.4-i386.egg', + '/Users/philipp/shared-eggs/zc.catalog-1.1.1-py2.4.egg', '/Users/philipp/shared-eggs/simplejson-1.7.1-py2.4.egg', + '/Users/philipp/shared-eggs/martian-0.8-py2.4.egg', + '/Users/philipp/shared-eggs/Mako-0.1.8-py2.4.egg', + '/Users/philipp/shared-eggs/decorator-2.1.0-py2.4.egg', + '/Users/philipp/shared-eggs/Beaker-0.7.3-py2.4.egg', + '/Users/philipp/shared-eggs/WebHelpers-0.3.1dev_r2064-py2.4.egg', + '/Users/philipp/shared-eggs/Routes-1.7-py2.4.egg', '/Users/philipp/shared-eggs/HTTPEncode-0.1dev_r6484-py2.4.egg', - '/Users/philipp/shared-eggs/ZConfig-2.4a2-py2.4.egg', - '/Users/philipp/shared-eggs/zdaemon-2.0a6-py2.4.egg', - '/Users/philipp/shared-eggs/zope.server-3.5.0a2-py2.4.egg', - '/Users/philipp/shared-eggs/zope.publisher-3.4.0a1_1-py2.4.egg', - '/Users/philipp/shared-eggs/zope.event-3.4.0b1.dev_r75122-py2.4.egg', - '/Users/philipp/shared-eggs/zope.configuration-3.4.0a1-py2.4.egg', - '/Users/philipp/shared-eggs/zope.app.publication-3.4.0a1_2-py2.4.egg', - '/Users/philipp/shared-eggs/zope.app.applicationcontrol-3.4_dev_r73715-py2.4.egg', - '/Users/philipp/shared-eggs/zope.app.zapi-3.4.0a1-py2.4.egg', - '/Users/philipp/shared-eggs/zope.security-3.4.0a1-py2.4-macosx-10.4-i386.egg', - '/Users/philipp/shared-eggs/zope.exceptions-3.4dev_r73107-py2.4.egg', - '/Users/philipp/shared-eggs/zope.copypastemove-3.4.0a1-py2.4.egg', - '/Users/philipp/shared-eggs/zope.app.container-3.4.0a1-py2.4-macosx-10.4-i386.egg', - '/Users/philipp/shared-eggs/zope.traversing-3.4.0a1-py2.4.egg', - '/Users/philipp/shared-eggs/zope.app.folder-3.4.0a1-py2.4.egg', + '/Users/philipp/shared-eggs/zope.app.server-3.4.0b1dev_r75388-py2.4.egg', + '/Users/philipp/shared-eggs/zope.app.twisted-3.4.0b1_r76119-py2.4.egg', + '/Users/philipp/shared-eggs/zope.app.wsgi-3.4.0b1dev_r75415-py2.4.egg', + '/Users/philipp/shared-eggs/zope.app.appsetup-3.4.0a1-py2.4.egg', + '/Users/philipp/shared-eggs/zope.app.container-3.5.0a1-py2.4-macosx-10.4-i386.egg', + '/Users/philipp/shared-eggs/zope.app.schema-3.4.0a1-py2.4.egg', + '/Users/philipp/shared-eggs/zope.app.pagetemplate-3.4.0b1dev_r75616-py2.4.egg', + '/Users/philipp/shared-eggs/zope.i18n-3.4.0b3-py2.4.egg', + '/Users/philipp/shared-eggs/zope.formlib-3.4.0a1-py2.4.egg', + '/Users/philipp/shared-eggs/zope.app.rotterdam-3.4.0a1-py2.4.egg', + '/Users/philipp/shared-eggs/zope.app.basicskin-3.4.0a1-py2.4.egg', + '/Users/philipp/shared-eggs/zope.app.principalannotation-3.4.0a1-py2.4.egg', + '/Users/philipp/shared-eggs/zope.app.zopeappgenerations-3.4.0a1-py2.4.egg', + '/Users/philipp/shared-eggs/zope.app.locales-3.4.0b1.dev_r77033-py2.4.egg', + '/Users/philipp/shared-eggs/zope.app.form-3.4.0b2.dev_r76975-py2.4.egg', + '/Users/philipp/shared-eggs/zope.app.publisher-0.1dev_r73800-py2.4.egg', + '/Users/philipp/shared-eggs/zope.app.interface-3.4.0a1-py2.4.egg', + '/Users/philipp/shared-eggs/zope.app.generations-3.4.0a1-py2.4.egg', '/Users/philipp/shared-eggs/zope.app.component-0.1dev_r74310-py2.4.egg', + '/Users/philipp/shared-eggs/zope.publisher-3.4.0b2-py2.4.egg', + '/Users/philipp/shared-eggs/zope.app.content-3.4.0a1-py2.4.egg', + '/Users/philipp/shared-eggs/zope.app.dependable-3.4.0a1-py2.4.egg', + '/Users/philipp/shared-eggs/zope.annotation-3.4.0b1.dev_r75758-py2.4.egg', + '/Users/philipp/shared-eggs/zope.modulealias-3.4.0a1-py2.4.egg', + '/Users/philipp/shared-eggs/zope.security-3.4.0b2-py2.4-macosx-10.4-i386.egg', '/Users/philipp/shared-eggs/zope.location-3.4.0b1.dev_r75152-py2.4.egg', '/Users/philipp/shared-eggs/zope.i18nmessageid-3.4.0a1-py2.4-macosx-10.4-i386.egg', - '/Users/philipp/shared-eggs/zope.i18n-3.4.0a1-py2.4.egg', - '/Users/philipp/shared-eggs/zope.app.form-0.1.dev_r74902-py2.4.egg', - '/Users/philipp/shared-eggs/zope.annotation-3.4.0b1.dev_r75758-py2.4.egg', + '/Users/philipp/shared-eggs/zope.exceptions-3.4.0b1-py2.4.egg', + '/Users/philipp/shared-eggs/zope.configuration-3.4.0a1-py2.4.egg', '/Users/philipp/shared-eggs/zope.deprecation-3.4.0a1-py2.4.egg', - '/Users/philipp/shared-eggs/zope.deferredimport-3.4dev-py2.4.egg', - '/Users/philipp/shared-eggs/zope.app.publisher-0.1dev_r73800-py2.4.egg', - '/Users/philipp/shared-eggs/zope.app.pagetemplate-3.4.0b1dev_r75616-py2.4.egg', + '/Users/philipp/shared-eggs/zope.deferredimport-3.4.0b1-py2.4.egg', '/Users/philipp/shared-eggs/zope.app.i18n-3.4.0a1-py2.4.egg', + '/Users/philipp/shared-eggs/zope.traversing-3.4.0a1-py2.4.egg', + '/Users/philipp/shared-eggs/zope.event-3.4.0b1.dev_r75122-py2.4.egg', '/Users/philipp/shared-eggs/zope.dublincore-3.4.0a1-py2.4.egg', - '/Users/philipp/shared-eggs/zope.app.session-3.4.0a1-py2.4.egg', + '/Users/philipp/shared-eggs/zope.app.zapi-3.4.0a1-py2.4.egg', + '/Users/philipp/shared-eggs/zope.app.session-3.5.0dev_r77333-py2.4.egg', '/Users/philipp/shared-eggs/zope.testing-3.4_r75911-py2.4.egg', '/Users/philipp/shared-eggs/zope.lifecycleevent-3.4.0a1-py2.4.egg', '/Users/philipp/shared-eggs/zope.index-3.4.0a2-py2.4.egg', - '/Users/philipp/shared-eggs/zope.app.testing-3.4.0b1_r75826-py2.4.egg', + '/Users/philipp/shared-eggs/zope.app.testing-3.4.0b1_r76117-py2.4.egg', '/Users/philipp/shared-eggs/zope.app.intid-3.4.0a2-py2.4.egg', + '/Users/philipp/shared-eggs/zdaemon-2.0a6-py2.4.egg', + '/Users/philipp/shared-eggs/ZConfig-2.4a6-py2.4.egg', '/Users/philipp/shared-eggs/zope.proxy-3.4.0a1-py2.4-macosx-10.4-i386.egg', '/Users/philipp/shared-eggs/httplib2-0.3.0-py2.4.egg', - '/Users/philipp/shared-eggs/zope.app.exception-3.4.0a1-py2.4.egg', - '/Users/philipp/shared-eggs/zope.app.error-3.4.0a1-py2.4.egg', - '/Users/philipp/shared-eggs/zope.app.http-3.4.0a1-py2.4.egg', - '/Users/philipp/shared-eggs/zope.size-3.4.0a1-py2.4.egg', - '/Users/philipp/shared-eggs/zope.app.interface-3.4.0a1-py2.4.egg', - '/Users/philipp/shared-eggs/zope.thread-3.4dev_r73086-py2.4-macosx-10.4-i386.egg', - '/Users/philipp/shared-eggs/pytz-2007d-py2.4.egg', + '/Users/philipp/shared-eggs/zope.server-3.5.0a2-py2.4.egg', + '/Users/philipp/shared-eggs/zope.app.publication-3.4.0a1_2-py2.4.egg', + '/Users/philipp/shared-eggs/zope.app.applicationcontrol-3.4_dev_r73715-py2.4.egg', + '/Users/philipp/shared-eggs/zope.copypastemove-3.4.0a1-py2.4.egg', + '/Users/philipp/shared-eggs/zope.app.folder-3.4.0a1-py2.4.egg', '/Users/philipp/shared-eggs/zope.app.broken-3.4.0a1-py2.4.egg', + '/Users/philipp/shared-eggs/zope.size-3.4.0a1-py2.4.egg', '/Users/philipp/shared-eggs/zope.filerepresentation-3.4.0a1-py2.4.egg', '/Users/philipp/shared-eggs/zope.dottedname-3.4dev_r73113-py2.4.egg', '/Users/philipp/shared-eggs/zope.cachedescriptors-3.4.0b1_r75830-py2.4.egg', - '/Users/philipp/shared-eggs/zope.datetime-3.4.0a1-py2.4.egg', - '/Users/philipp/shared-eggs/zope.formlib-3.4.0a1-py2.4.egg', - '/Users/philipp/shared-eggs/zope.hookable-3.4.0a1-py2.4-macosx-10.4-i386.egg', - '/Users/philipp/shared-eggs/zope.app.basicskin-3.4.0a1-py2.4.egg', + '/Users/philipp/shared-eggs/zope.tales-3.4.0a1-py2.4.egg', '/Users/philipp/shared-eggs/zope.pagetemplate-3.4.0a1-py2.4.egg', + '/Users/philipp/shared-eggs/pytz-2007f-py2.4.egg', + '/Users/philipp/shared-eggs/zope.tal-3.4.0b1-py2.4.egg', + '/Users/philipp/shared-eggs/zope.datetime-3.4.0a1-py2.4.egg', '/Users/philipp/shared-eggs/zope.contenttype-3.4.0a1-py2.4.egg', - '/Users/philipp/shared-eggs/zope.tales-3.4.0a1-py2.4.egg', - '/Users/philipp/shared-eggs/zope.app.dependable-3.4.0a1-py2.4.egg', - '/Users/philipp/shared-eggs/zope.app.debug-3.4.0a1-py2.4.egg', - '/Users/philipp/shared-eggs/zope.app.keyreference-3.4.0a1-py2.4.egg', '/Users/philipp/shared-eggs/zodbcode-3.4.0b1dev_r75670-py2.4.egg', - '/Users/philipp/shared-eggs/zope.tal-3.4.0a1-py2.4.egg', - '/Users/philipp/shared-eggs/RestrictedPython-3.4dev_r73257-py2.4.egg', + '/Users/philipp/shared-eggs/zope.app.renderer-3.4.0a1-py2.4.egg', + '/Users/philipp/shared-eggs/zope.thread-3.4.0b1-py2.4-macosx-10.4-i386.egg', + '/Users/philipp/shared-eggs/zope.hookable-3.4.0a1-py2.4-macosx-10.4-i386.egg', + '/Users/philipp/shared-eggs/zope.minmax-1.0b1-py2.4.egg', + '/Users/philipp/shared-eggs/zope.app.http-3.4.0a1-py2.4.egg', + '/Users/philipp/shared-eggs/zope.app.debug-3.4.0a1-py2.4.egg', + '/Users/philipp/shared-eggs/zope.app.keyreference-3.5.0_dev_r77018-py2.4.egg', + '/Users/philipp/shared-eggs/zope.app.exception-3.4.0a1-py2.4.egg', + '/Users/philipp/shared-eggs/zope.app.error-3.4.0a1-py2.4.egg', + '/Users/philipp/shared-eggs/RestrictedPython-3.4.1-py2.4.egg', + '/Users/philipp/shared-eggs/zope.structuredtext-3.4.0a1-py2.4.egg', + '/Users/philipp/shared-eggs/docutils-0.4-py2.4.egg', '/lib/python', ] From philikon at codespeak.net Mon Jul 9 11:15:14 2007 From: philikon at codespeak.net (philikon at codespeak.net) Date: Mon, 9 Jul 2007 11:15:14 +0200 (CEST) Subject: [z3-checkins] r44866 - z3/NudgeNudge/branches/zope-on-a-paste-demos Message-ID: <20070709091514.3606C8211@code0.codespeak.net> Author: philikon Date: Mon Jul 9 11:15:13 2007 New Revision: 44866 Modified: z3/NudgeNudge/branches/zope-on-a-paste-demos/capitalize.ini z3/NudgeNudge/branches/zope-on-a-paste-demos/combined.ini z3/NudgeNudge/branches/zope-on-a-paste-demos/debug.ini z3/NudgeNudge/branches/zope-on-a-paste-demos/logging.ini z3/NudgeNudge/branches/zope-on-a-paste-demos/nudge.ini z3/NudgeNudge/branches/zope-on-a-paste-demos/simple.ini Log: Cosmetics: refer to nudgenudge/site.zcml instead of parts/... Modified: z3/NudgeNudge/branches/zope-on-a-paste-demos/capitalize.ini ============================================================================== --- z3/NudgeNudge/branches/zope-on-a-paste-demos/capitalize.ini (original) +++ z3/NudgeNudge/branches/zope-on-a-paste-demos/capitalize.ini Mon Jul 9 11:15:13 2007 @@ -4,7 +4,7 @@ [app:zope] use = egg:zope.paste -site_definition = parts/app/site.zcml +site_definition = src/nudgenudge/site.zcml file_storage = parts/data/Data.fs [server:main] Modified: z3/NudgeNudge/branches/zope-on-a-paste-demos/combined.ini ============================================================================== --- z3/NudgeNudge/branches/zope-on-a-paste-demos/combined.ini (original) +++ z3/NudgeNudge/branches/zope-on-a-paste-demos/combined.ini Mon Jul 9 11:15:13 2007 @@ -8,7 +8,7 @@ [app:zope] use = egg:zope.paste -site_definition = parts/app/site.zcml +site_definition = src/nudgenudge/site.zcml file_storage = parts/data/Data.fs [server:main] Modified: z3/NudgeNudge/branches/zope-on-a-paste-demos/debug.ini ============================================================================== --- z3/NudgeNudge/branches/zope-on-a-paste-demos/debug.ini (original) +++ z3/NudgeNudge/branches/zope-on-a-paste-demos/debug.ini Mon Jul 9 11:15:13 2007 @@ -8,7 +8,7 @@ [app:zope] use = egg:zope.paste -site_definition = parts/app/site.zcml +site_definition = src/nudgenudge/site.zcml file_storage = parts/data/Data.fs [server:main] Modified: z3/NudgeNudge/branches/zope-on-a-paste-demos/logging.ini ============================================================================== --- z3/NudgeNudge/branches/zope-on-a-paste-demos/logging.ini (original) +++ z3/NudgeNudge/branches/zope-on-a-paste-demos/logging.ini Mon Jul 9 11:15:13 2007 @@ -4,7 +4,7 @@ [app:zope] use = egg:zope.paste -site_definition = parts/app/site.zcml +site_definition = src/nudgenudge/site.zcml file_storage = parts/data/Data.fs [server:main] Modified: z3/NudgeNudge/branches/zope-on-a-paste-demos/nudge.ini ============================================================================== --- z3/NudgeNudge/branches/zope-on-a-paste-demos/nudge.ini (original) +++ z3/NudgeNudge/branches/zope-on-a-paste-demos/nudge.ini Mon Jul 9 11:15:13 2007 @@ -11,7 +11,7 @@ [app:zope] use = egg:zope.paste -site_definition = parts/app/site.zcml +site_definition = src/nudgenudge/site.zcml file_storage = parts/data/Data.fs [server:main] Modified: z3/NudgeNudge/branches/zope-on-a-paste-demos/simple.ini ============================================================================== --- z3/NudgeNudge/branches/zope-on-a-paste-demos/simple.ini (original) +++ z3/NudgeNudge/branches/zope-on-a-paste-demos/simple.ini Mon Jul 9 11:15:13 2007 @@ -1,6 +1,6 @@ [app:main] use = egg:zope.paste -site_definition = parts/app/site.zcml +site_definition = src/nudgenudge/site.zcml file_storage = parts/data/Data.fs [server:main] From ltucker at codespeak.net Thu Jul 12 17:19:16 2007 From: ltucker at codespeak.net (ltucker at codespeak.net) Date: Thu, 12 Jul 2007 17:19:16 +0200 (CEST) Subject: [z3-checkins] r44975 - in z3/deliverance/DeliveranceVHoster/trunk: docs dvhoster Message-ID: <20070712151916.B400C818C@code0.codespeak.net> Author: ltucker Date: Thu Jul 12 17:19:13 2007 New Revision: 44975 Modified: z3/deliverance/DeliveranceVHoster/trunk/docs/example_init_domain.py z3/deliverance/DeliveranceVHoster/trunk/docs/hooks.txt z3/deliverance/DeliveranceVHoster/trunk/docs/openplans_hooks.py z3/deliverance/DeliveranceVHoster/trunk/dvhoster/dispatcher.py Log: make find_remote_uri take domain_info Modified: z3/deliverance/DeliveranceVHoster/trunk/docs/example_init_domain.py ============================================================================== --- z3/deliverance/DeliveranceVHoster/trunk/docs/example_init_domain.py (original) +++ z3/deliverance/DeliveranceVHoster/trunk/docs/example_init_domain.py Thu Jul 12 17:19:13 2007 @@ -35,7 +35,7 @@ ('X-Openplans-Project', project), ] -def find_remote_uri(remote_uri, remote_uri_info, environ, +def find_remote_uri(remote_uri, remote_uri_info, domain_info, environ, app_conf): from paste.request import path_info_pop if remote_uri is not None: Modified: z3/deliverance/DeliveranceVHoster/trunk/docs/hooks.txt ============================================================================== --- z3/deliverance/DeliveranceVHoster/trunk/docs/hooks.txt (original) +++ z3/deliverance/DeliveranceVHoster/trunk/docs/hooks.txt Thu Jul 12 17:19:13 2007 @@ -41,7 +41,7 @@ and a match found (or potentially no match found). It returns the remote_uri that should be used. It should look like:: - def find_remote_uri(remote_uri, remote_uri_info, environ, + def find_remote_uri(remote_uri, remote_uri_info, domain_info, environ, app_conf): if remote_uri is not None: # It was set explicitly in the remote_uris setting Modified: z3/deliverance/DeliveranceVHoster/trunk/docs/openplans_hooks.py ============================================================================== --- z3/deliverance/DeliveranceVHoster/trunk/docs/openplans_hooks.py (original) +++ z3/deliverance/DeliveranceVHoster/trunk/docs/openplans_hooks.py Thu Jul 12 17:19:13 2007 @@ -48,7 +48,7 @@ domain_info.set_rule_file( 'rule.xml', rule_data) -def find_remote_uri(remote_uri, remote_uri_info, environ, +def find_remote_uri(remote_uri, remote_uri_info, domain_info, environ, app_conf): """ Maps request to a remote_uri (when none has been explicitly set). Modified: z3/deliverance/DeliveranceVHoster/trunk/dvhoster/dispatcher.py ============================================================================== --- z3/deliverance/DeliveranceVHoster/trunk/dvhoster/dispatcher.py (original) +++ z3/deliverance/DeliveranceVHoster/trunk/dvhoster/dispatcher.py Thu Jul 12 17:19:13 2007 @@ -322,9 +322,9 @@ header_name = 'HTTP_' + header_name environ[str(header_name)] = str(header_value) if self.find_remote_uri: - remote_uri = self.find_remote_uri(remote_uri, remote_uri_info, environ, self.app_conf) + remote_uri = self.find_remote_uri(remote_uri, remote_uri_info, domain_info, environ, self.app_conf) return remote_uri if self.find_remote_uri: # Last change for find_remote_uri to do something - remote_uri = self.find_remote_uri(remote_uri, None, environ, self.app_conf) + remote_uri = self.find_remote_uri(remote_uri, None, domain_info, environ, self.app_conf) return remote_uri From ianb at codespeak.net Thu Jul 12 22:49:00 2007 From: ianb at codespeak.net (ianb at codespeak.net) Date: Thu, 12 Jul 2007 22:49:00 +0200 (CEST) Subject: [z3-checkins] r44983 - z3/deliverance/trunk/deliverance/test-data Message-ID: <20070712204900.5F8E9818E@code0.codespeak.net> Author: ianb Date: Thu Jul 12 22:48:58 2007 New Revision: 44983 Added: z3/deliverance/trunk/deliverance/test-data/test_xpath_rules.xml Log: Added a test that I think should show the problem in #429, that | picks up elements outside of the document Added: z3/deliverance/trunk/deliverance/test-data/test_xpath_rules.xml ============================================================================== --- (empty file) +++ z3/deliverance/trunk/deliverance/test-data/test_xpath_rules.xml Thu Jul 12 22:48:58 2007 @@ -0,0 +1,46 @@ + + + + + + + + + + + + Blah + +
+
Dummy Content
+
More Dummy
+ +
+ + + +
Real Content
+ 1 + 2 +

zzz

+
3
+
4
+ +
+ + + Blah +
+
+ 1 +
3
+
+
More Dummy
+ +
+
+ + +
From ianb at codespeak.net Thu Jul 12 23:05:08 2007 From: ianb at codespeak.net (ianb at codespeak.net) Date: Thu, 12 Jul 2007 23:05:08 +0200 (CEST) Subject: [z3-checkins] r44984 - in z3/deliverance/trunk/deliverance: . test-data Message-ID: <20070712210508.3F1F781A6@code0.codespeak.net> Author: ianb Date: Thu Jul 12 23:05:07 2007 New Revision: 44984 Modified: z3/deliverance/trunk/deliverance/test-data/test_xpath_rules.xml z3/deliverance/trunk/deliverance/utils.py Log: Fix for #429, problem with | (union) in xpath expressions when there's an external reference. Also add support for ||, which selects the first xpath expression that returns something Modified: z3/deliverance/trunk/deliverance/test-data/test_xpath_rules.xml ============================================================================== --- z3/deliverance/trunk/deliverance/test-data/test_xpath_rules.xml (original) +++ z3/deliverance/trunk/deliverance/test-data/test_xpath_rules.xml Thu Jul 12 23:05:07 2007 @@ -42,5 +42,54 @@ + + + + + + +
+
+ + + +
some content
+ more content + +
+ + +
+
some content
+
+
+ + + + + + + + +
+
+ + + + some content + more content + + + + +
+ some content + more content +
+
+
+ Modified: z3/deliverance/trunk/deliverance/utils.py ============================================================================== --- z3/deliverance/trunk/deliverance/utils.py (original) +++ z3/deliverance/trunk/deliverance/utils.py Thu Jul 12 23:05:07 2007 @@ -404,7 +404,7 @@ ... - + ... @@ -456,6 +456,57 @@ if content_xpath is None: return None + + content_doc = rule.get(self.RULE_HREF_KEY, self.REQUEST_CONTENT) + ored_parts = content_xpath.split('||') + ored_parts = [self._translate_content_xpath(part, content_doc) + for part in ored_parts] + if len(ored_parts) == 1: + # Simplest/commonest case, we'll just skip the rest: + return ored_parts[0] + prev_parts = [] + new_parts = [] + for part in ored_parts: + for prev_part in prev_parts: + part = self._add_xpath_condition( + part, 'count(%s) = 0' % (prev_part)) + new_parts.append(part) + prev_parts.append(part) + content_xpath = ' | '.join(new_parts) + return content_xpath + + def _translate_content_xpath(self, xpath, content_doc): + paths = xpath.split('|') + new_paths = [] + for path in paths: + path = path.strip() + if not path.startswith('/'): + path = '/' + path + new_paths.append( + "/content/document[@content='%s']%s" + % (content_doc, path)) + return ' | '.join(new_paths) + + def _add_xpath_condition(self, xpath, cond, operator='and'): + if xpath.endswith(']'): + return '%s %s (%s)]' % ( + xpath[:-1], operator, cond) + else: + return '%s[%s]' % (xpath, cond) + + + + + + def x_get_content_xpath(self, rule): + """ + gets the xpath to lookup the content referred to by rule + in the aggregated content document + """ + content_xpath = rule.get(self.RULE_CONTENT_KEY) + + if content_xpath is None: + return None if not content_xpath.startswith('/'): content_xpath = '/%s' % content_xpath @@ -466,5 +517,3 @@ return new_xpath - - From jinty at codespeak.net Sat Jul 14 12:44:27 2007 From: jinty at codespeak.net (jinty at codespeak.net) Date: Sat, 14 Jul 2007 12:44:27 +0200 (CEST) Subject: [z3-checkins] r45064 - z3/hurry.query/trunk/src/hurry/query Message-ID: <20070714104427.4195481B2@code0.codespeak.net> Author: jinty Date: Sat Jul 14 12:44:26 2007 New Revision: 45064 Modified: z3/hurry.query/trunk/src/hurry/query/__init__.py z3/hurry.query/trunk/src/hurry/query/interfaces.py z3/hurry.query/trunk/src/hurry/query/query.py z3/hurry.query/trunk/src/hurry/query/set.py z3/hurry.query/trunk/src/hurry/query/tests.py z3/hurry.query/trunk/src/hurry/query/value.py Log: add license headers. Modified: z3/hurry.query/trunk/src/hurry/query/__init__.py ============================================================================== --- z3/hurry.query/trunk/src/hurry/query/__init__.py (original) +++ z3/hurry.query/trunk/src/hurry/query/__init__.py Sat Jul 14 12:44:26 2007 @@ -1 +1,3 @@ +# Copyright (c) 2007 Infrae. All rights reserved. +# See also LICENSE.txt from query import And, Or, Eq, NotEq, Between, In, Ge, Le, Text Modified: z3/hurry.query/trunk/src/hurry/query/interfaces.py ============================================================================== --- z3/hurry.query/trunk/src/hurry/query/interfaces.py (original) +++ z3/hurry.query/trunk/src/hurry/query/interfaces.py Sat Jul 14 12:44:26 2007 @@ -1,3 +1,5 @@ +# Copyright (c) 2007 Infrae. All rights reserved. +# See also LICENSE.txt from zope.interface import Interface class IQuery(Interface): Modified: z3/hurry.query/trunk/src/hurry/query/query.py ============================================================================== --- z3/hurry.query/trunk/src/hurry/query/query.py (original) +++ z3/hurry.query/trunk/src/hurry/query/query.py Sat Jul 14 12:44:26 2007 @@ -1,3 +1,5 @@ +# Copyright (c) 2007 Infrae. All rights reserved. +# See also LICENSE.txt from zope.interface import implements from zope.app import zapi Modified: z3/hurry.query/trunk/src/hurry/query/set.py ============================================================================== --- z3/hurry.query/trunk/src/hurry/query/set.py (original) +++ z3/hurry.query/trunk/src/hurry/query/set.py Sat Jul 14 12:44:26 2007 @@ -1,3 +1,5 @@ +# Copyright (c) 2007 Infrae. All rights reserved. +# See also LICENSE.txt from zc.catalog.interfaces import ISetIndex from hurry.query import query Modified: z3/hurry.query/trunk/src/hurry/query/tests.py ============================================================================== --- z3/hurry.query/trunk/src/hurry/query/tests.py (original) +++ z3/hurry.query/trunk/src/hurry/query/tests.py Sat Jul 14 12:44:26 2007 @@ -1,3 +1,5 @@ +# Copyright (c) 2007 Infrae. All rights reserved. +# See also LICENSE.txt import unittest from zope.testing import doctest Modified: z3/hurry.query/trunk/src/hurry/query/value.py ============================================================================== --- z3/hurry.query/trunk/src/hurry/query/value.py (original) +++ z3/hurry.query/trunk/src/hurry/query/value.py Sat Jul 14 12:44:26 2007 @@ -1,3 +1,5 @@ +# Copyright (c) 2007 Infrae. All rights reserved. +# See also LICENSE.txt from zc.catalog.interfaces import IValueIndex from hurry.query import query From jinty at codespeak.net Sat Jul 14 12:45:54 2007 From: jinty at codespeak.net (jinty at codespeak.net) Date: Sat, 14 Jul 2007 12:45:54 +0200 (CEST) Subject: [z3-checkins] r45065 - z3/hurry.query/trunk Message-ID: <20070714104554.1DFAE8176@code0.codespeak.net> Author: jinty Date: Sat Jul 14 12:45:53 2007 New Revision: 45065 Modified: z3/hurry.query/trunk/setup.py Log: Bump revision number. Modified: z3/hurry.query/trunk/setup.py ============================================================================== --- z3/hurry.query/trunk/setup.py (original) +++ z3/hurry.query/trunk/setup.py Sat Jul 14 12:45:53 2007 @@ -2,7 +2,7 @@ setup( name="hurry.query", - version="0.9.2", + version="0.9.3", packages=find_packages('src'), package_dir= {'':'src'}, From jinty at codespeak.net Sat Jul 14 12:46:37 2007 From: jinty at codespeak.net (jinty at codespeak.net) Date: Sat, 14 Jul 2007 12:46:37 +0200 (CEST) Subject: [z3-checkins] r45066 - z3/hurry.query/tag/hurry.query-0.9.3 Message-ID: <20070714104637.7E0B581B1@code0.codespeak.net> Author: jinty Date: Sat Jul 14 12:46:37 2007 New Revision: 45066 Added: z3/hurry.query/tag/hurry.query-0.9.3/ - copied from r45064, z3/hurry.query/trunk/ z3/hurry.query/tag/hurry.query-0.9.3/setup.py - copied unchanged from r45065, z3/hurry.query/trunk/setup.py Log: tag release From kobold at codespeak.net Mon Jul 16 23:54:20 2007 From: kobold at codespeak.net (kobold at codespeak.net) Date: Mon, 16 Jul 2007 23:54:20 +0200 (CEST) Subject: [z3-checkins] r45141 - z3/sqlos/trunk/src/sqlos/file Message-ID: <20070716215420.98CF4812D@code0.codespeak.net> Author: kobold Date: Mon Jul 16 23:54:20 2007 New Revision: 45141 Modified: z3/sqlos/trunk/src/sqlos/file/fsutility.py Log: Copy files instead of using links (otherwise, zope will freeze on NFS filesystems). Modified: z3/sqlos/trunk/src/sqlos/file/fsutility.py ============================================================================== --- z3/sqlos/trunk/src/sqlos/file/fsutility.py (original) +++ z3/sqlos/trunk/src/sqlos/file/fsutility.py Mon Jul 16 23:54:20 2007 @@ -270,7 +270,7 @@ fullfilename = os.path.join(self._calcFilePath(id), filename) # NOTE: Filesystem operation is thread safe as the thread id is a # component of the filename - os.link(fullfilename, tmpfile) + shutil.copyfile(fullfilename, tmpfile) def _getTmpFile(self, id): assert id in self._state @@ -312,7 +312,7 @@ if os.path.exists(filedir): shutil.rmtree(filedir) os.makedirs(filedir) - os.link(tmpfile, fullfilename) + shutil.copyfile(tmpfile, fullfilename) FS_USE_LOCK.release() self._delTmpFile(id) self._state = {} From z3-checkins at codespeak.net Wed Jul 18 13:43:18 2007 From: z3-checkins at codespeak.net (z3-checkins at codespeak.net) Date: Wed, 18 Jul 2007 13:43:18 +0200 (CEST) Subject: [z3-checkins] New in Clearance - Save on hundreds of Products 57761276964022 Message-ID: <20070718044412.9285.qmail@bzq-88-155-17-246.red.bezeqint.net> An HTML attachment was scrubbed... URL: http://codespeak.net/pipermail/z3-checkins/attachments/20070718/111c6e4d/attachment.htm From ianb at codespeak.net Mon Jul 23 19:56:56 2007 From: ianb at codespeak.net (ianb at codespeak.net) Date: Mon, 23 Jul 2007 19:56:56 +0200 (CEST) Subject: [z3-checkins] r45282 - z3/deliverance/trunk/deliverance Message-ID: <20070723175656.0B98281B0@code0.codespeak.net> Author: ianb Date: Mon Jul 23 19:56:54 2007 New Revision: 45282 Modified: z3/deliverance/trunk/deliverance/wsgimiddleware.py Log: Style everything by 3xx, 204, and 401 responses Modified: z3/deliverance/trunk/deliverance/wsgimiddleware.py ============================================================================== --- z3/deliverance/trunk/deliverance/wsgimiddleware.py (original) +++ z3/deliverance/trunk/deliverance/wsgimiddleware.py Mon Jul 23 19:56:54 2007 @@ -188,8 +188,14 @@ if status is None: # non-html responses, or rebuild is not necessary: bail out return body - if not status.startswith('200'): - # any non-200 response shouldn't be themed... + theme = True + status_code = status.split()[0] + if (status_code.startswith('3') + or status_code == '204' + or status_code == '401'): + # Redirects, not-modified, etc don't get themed (3xx) + # No Content doesn't get themed (204) + # Unauthorized isn't themed (401) start_response(status, headers) return body From ianb at codespeak.net Tue Jul 24 00:17:22 2007 From: ianb at codespeak.net (ianb at codespeak.net) Date: Tue, 24 Jul 2007 00:17:22 +0200 (CEST) Subject: [z3-checkins] r45286 - in z3/deliverance/DeliveranceVHoster/trunk: docs dvhoster tests Message-ID: <20070723221722.9C2D8812D@code0.codespeak.net> Author: ianb Date: Tue Jul 24 00:17:21 2007 New Revision: 45286 Modified: z3/deliverance/DeliveranceVHoster/trunk/docs/rest-api.txt z3/deliverance/DeliveranceVHoster/trunk/dvhoster/model.py z3/deliverance/DeliveranceVHoster/trunk/tests/test_functional_api.py Log: Added an API to delete domains Modified: z3/deliverance/DeliveranceVHoster/trunk/docs/rest-api.txt ============================================================================== --- z3/deliverance/DeliveranceVHoster/trunk/docs/rest-api.txt (original) +++ z3/deliverance/DeliveranceVHoster/trunk/docs/rest-api.txt Tue Jul 24 00:17:21 2007 @@ -151,6 +151,12 @@ Like ``remote_uris`` you can POST to these locations to add and remove redirects, without reseting all redirects. +``/.deliverance/delete`` + + POST to this resource (no body required) to delete the domain. The + actual data is moved into a directory ``TRASH``, but is no longer + visible. You have to clean up these trash directories manually. + Python Usage ------------ Modified: z3/deliverance/DeliveranceVHoster/trunk/dvhoster/model.py ============================================================================== --- z3/deliverance/DeliveranceVHoster/trunk/dvhoster/model.py (original) +++ z3/deliverance/DeliveranceVHoster/trunk/dvhoster/model.py Tue Jul 24 00:17:21 2007 @@ -1,5 +1,6 @@ import re import os +import shutil from ohm import persist from ohm import server from ohm import descriptors @@ -44,6 +45,16 @@ ''' +def unique_filename(dir, base_filename): + n = 0 + suffix = '' + while 1: + new = os.path.join(dir, base_filename) + suffix + if not os.path.exists(new): + return new + n += 1 + suffix = '-%s' + n + class DomainInfoSet(object): """ Represents a set of DomainInfo objects. @@ -55,6 +66,8 @@ This also handles aliases -- domains that point to other domains. """ + trash_dir = 'TRASH' + def __init__(self, dir): self.dir = dir if not os.path.exists(self.dir): @@ -157,6 +170,18 @@ os.rename(old_dir, new_dir) return self.domain(new_domain_name) + def delete_domain(self, domain): + if hasattr(domain, 'domain'): + # DomainInfo object; get its domain: + domain = domain.domain + domain = self.normalize(domain) + cur_dir = os.path.join(self.dir, domain) + trash_dir = os.path.join(self.dir, self.trash_dir) + if not os.path.exists(trash_dir): + os.makedirs(trash_dir) + new_dir = unique_filename(trash_dir, domain) + shutil.move(cur_dir, new_dir) + class DomainInfo(object): """ Represents the information about a single domain. @@ -249,6 +274,9 @@ domain = property(domain__get, domain__set) + def delete_domain(self): + self.domain_set.delete_domain(self) + class DomainValidator(validators.Regex): regex = r'^[a-z0-9\-]+|[a-z0-9][a-z0-9\-\.\_]*\.[a-z]+$' @@ -428,6 +456,12 @@ additional_request_headers = server.JSONSetter( validator=HeaderValidator()) + def delete_domain(self, body): + self.delete_domain() + + delete = server.Setter( + POST=(None, delete_domain)) + @server.appfactory() def rules(self): if not os.path.exists(self.rule_dir): Modified: z3/deliverance/DeliveranceVHoster/trunk/tests/test_functional_api.py ============================================================================== --- z3/deliverance/DeliveranceVHoster/trunk/tests/test_functional_api.py (original) +++ z3/deliverance/DeliveranceVHoster/trunk/tests/test_functional_api.py Tue Jul 24 00:17:21 2007 @@ -39,6 +39,7 @@ yield (use_api, 'localhost') yield (rename_site,) yield (use_api, 'localhost2') + yield (delete_site,) def reset_env(): if os.path.exists(data_filename): @@ -183,6 +184,15 @@ assert app.get('/.deliverance/domain').body == 'localhost2' print 'site renamed to localhost2' +def delete_site(): + app.extra_environ['HTTP_HOST'] = 'localhost2' + res = app.get('/.deliverance/domain') + res = app.get('/foo.html', status=404) + put('/.deliverance/static/foo.html', 'text') + res = app.get('/foo.html') + assert res.body == 'text' + res = app.post('/.deliverance/delete', '', status=204) + res = app.get('/foo.html', status=404) def setup_module(module): from paste.script import testapp From faassen at codespeak.net Wed Aug 15 19:48:39 2007 From: faassen at codespeak.net (faassen at codespeak.net) Date: Wed, 15 Aug 2007 19:48:39 +0200 (CEST) Subject: [z3-checkins] r45687 - z3/hurry.workflow/trunk Message-ID: <20070815174839.A5E758102@code0.codespeak.net> Author: faassen Date: Wed Aug 15 19:48:38 2007 New Revision: 45687 Modified: z3/hurry.workflow/trunk/CHANGES.txt z3/hurry.workflow/trunk/CREDITS.txt z3/hurry.workflow/trunk/README.txt z3/hurry.workflow/trunk/setup.py Log: Work to register documentation with the cheese shop. Modified: z3/hurry.workflow/trunk/CHANGES.txt ============================================================================== --- z3/hurry.workflow/trunk/CHANGES.txt (original) +++ z3/hurry.workflow/trunk/CHANGES.txt Wed Aug 15 19:48:38 2007 @@ -1,13 +1,29 @@ hurry.workflow changes -====================== +********************** + +0.9.2 (2007-08-15) +================== + +Bug fixes +--------- + +* zope.security changes broke imports in hurry.workflow. + +* localUtility directive is now deprecated, so don't use it anymore. 0.9.1 (2006-09-22) ------------------- +================== + +Feature changes +--------------- * first cheesehop release. 0.9 (2006-06-15) ----------------- +================ + +Feature changes +--------------- * separate out from hurry package into hurry.workflow @@ -16,6 +32,9 @@ * Zope 3.3 compatibility work 0.8 (2006-05-01) ----------------- +================ + +Feature changes +--------------- Initial public release. Modified: z3/hurry.workflow/trunk/CREDITS.txt ============================================================================== --- z3/hurry.workflow/trunk/CREDITS.txt (original) +++ z3/hurry.workflow/trunk/CREDITS.txt Wed Aug 15 19:48:38 2007 @@ -1,8 +1,11 @@ Credits ------- -Martijn Faassen - initial and main developer -Jan-Wijbrand Kolman - suggestions and feedback +* Martijn Faassen - initial and main developer + +* Jan-Wijbrand Kolman - suggestions and feedback + +* Tobias Rod?bel - compatibility fixes The hurry.workflow library for Zope 3 was originally developed at Infrae (http://www.infrae.com). Modified: z3/hurry.workflow/trunk/README.txt ============================================================================== --- z3/hurry.workflow/trunk/README.txt (original) +++ z3/hurry.workflow/trunk/README.txt Wed Aug 15 19:48:38 2007 @@ -1,2 +1,5 @@ -hurry.workflow - a simple but quite nifty workflow system. See - src/hurry/workflow/workflow.txt for documentation. +************** +hurry.workflow +************** + +A simple but quite nifty workflow system for Zope 3. Modified: z3/hurry.workflow/trunk/setup.py ============================================================================== --- z3/hurry.workflow/trunk/setup.py (original) +++ z3/hurry.workflow/trunk/setup.py Wed Aug 15 19:48:38 2007 @@ -1,8 +1,28 @@ +import os from setuptools import setup, find_packages +def read(*rnames): + return open(os.path.join(os.path.dirname(__file__), *rnames)).read() + +long_description = ( + read('README.txt') + + '\n' + + read('CHANGES.txt') + + '\n' + + 'Detailed Documentation\n' + '**********************\n' + + '\n' + + read('src', 'hurry', 'workflow', 'workflow.txt') + + '\n' + + 'Download\n' + '********\n' + ) + +open('doc.txt', 'w').write(long_description) + setup( name="hurry.workflow", - version="0.9.1", + version="0.9.2", packages=find_packages('src'), package_dir= {'':'src'}, @@ -19,6 +39,7 @@ hurry.workflow is a simple workflow system. It can be used to implement stateful multi-version workflows for Zope 3 applications. """, + long_description=long_description, license='BSD', keywords="zope zope3", classifiers = ['Framework :: Zope3'], From faassen at codespeak.net Wed Aug 15 19:50:10 2007 From: faassen at codespeak.net (faassen at codespeak.net) Date: Wed, 15 Aug 2007 19:50:10 +0200 (CEST) Subject: [z3-checkins] r45688 - z3/hurry.workflow/tag/hurry.workflow-0.9.2 Message-ID: <20070815175010.E7A898126@code0.codespeak.net> Author: faassen Date: Wed Aug 15 19:50:10 2007 New Revision: 45688 Added: z3/hurry.workflow/tag/hurry.workflow-0.9.2/ - copied from r45687, z3/hurry.workflow/trunk/ Log: Tag release. From faassen at codespeak.net Wed Aug 15 21:11:56 2007 From: faassen at codespeak.net (faassen at codespeak.net) Date: Wed, 15 Aug 2007 21:11:56 +0200 (CEST) Subject: [z3-checkins] r45689 - in z3/hurry.workflow/trunk: . src/hurry/workflow Message-ID: <20070815191156.0C2118132@code0.codespeak.net> Author: faassen Date: Wed Aug 15 21:11:55 2007 New Revision: 45689 Modified: z3/h