Last active
December 23, 2015 00:59
-
-
Save davisagli/6557270 to your computer and use it in GitHub Desktop.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
from .models import appmaker | |
from OFS.Application import install_products | |
from pyramid.config import Configurator | |
from pyramid_zodbconn import get_connection | |
from zope.configuration import xmlconfig | |
from zope.configuration.config import ConfigurationMachine | |
import os | |
def root_factory(request): | |
conn = get_connection(request) | |
return appmaker(conn.root()) | |
def main(global_config, **settings): | |
""" This function returns a Pyramid WSGI application. | |
""" | |
config = Configurator(root_factory=root_factory, settings=settings) | |
config.add_static_view('static', 'static', cache_max_age=3600) | |
config.scan() | |
# configure Plone | |
zopeconfig = ConfigurationMachine() | |
xmlconfig.registerCommonDirectives(zopeconfig) | |
site_zcml = os.path.join(os.path.dirname(__file__), 'site.zcml') | |
xmlconfig.file(site_zcml, context=zopeconfig) | |
install_products(None) | |
return config.make_wsgi_app() |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
from Products.CMFPlone.Portal import PloneSite | |
from Products.GenericSetup.tool import SetupTool | |
from five.localsitemanager import update_sitemanager_bases | |
from zope.component.hooks import setSite | |
class RootPloneSite(PloneSite): | |
"""Plone site that implements some things which used to be acquired.""" | |
def getPhysicalRoot(self): | |
return self | |
def _getProducts(self): | |
# There is no persistent product registry anymore | |
return None | |
@property | |
def aq_base(self): | |
return self | |
def appmaker(zodb_root): | |
if not 'Plone' in zodb_root: | |
site = RootPloneSite('Plone') | |
zodb_root['Plone'] = site | |
site['portal_setup'] = SetupTool('portal_setup') | |
setup_tool = site['portal_setup'] | |
update_sitemanager_bases(site) | |
setSite(site) | |
setup_tool.setBaselineContext('profile-Products.CMFPlone:plone') | |
setup_tool.runAllImportStepsFromProfile('profile-Products.CMFPlone:plone') | |
import transaction | |
transaction.commit() | |
return zodb_root['Plone'] |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
AccessControl==3.0.6 | |
Acquisition==2.13.8 | |
Chameleon==2.12 | |
DateTime==3.0.3 | |
DocumentTemplate==2.13.2 | |
ExtensionClass==2.13.2 | |
Mako==0.9.0 | |
Markdown==2.0.3 | |
MarkupSafe==0.18 | |
Missing==2.13.1 | |
MultiMapping==2.13.0 | |
PasteDeploy==1.5.0 | |
Persistence==2.13.2 | |
Pillow==1.7.8 | |
Products.ATContentTypes==2.1.13 | |
Products.ATReferenceBrowserWidget==3.0 | |
Products.Archetypes==1.9.4 | |
Products.BTreeFolder2==2.13.3 | |
Products.CMFActionIcons==2.1.3 | |
Products.CMFCalendar==2.2.2 | |
Products.CMFCore==2.2.7 | |
Products.CMFDefault==2.2.3 | |
Products.CMFDiffTool==2.1 | |
Products.CMFDynamicViewFTI==4.0.5 | |
Products.CMFEditions==2.2.8 | |
Products.CMFFormController==3.0.3 | |
Products.CMFPlacefulWorkflow==1.5.9 | |
Products.CMFPlone==4.3.2 | |
Products.CMFQuickInstallerTool==3.0.6 | |
Products.CMFUid==2.2.1 | |
Products.DCWorkflow==2.2.4 | |
Products.ExtendedPathIndex==3.1 | |
Products.ExternalEditor==1.1.0 | |
Products.ExternalMethod==2.13.0 | |
Products.GenericSetup==1.7.4 | |
Products.MIMETools==2.13.0 | |
Products.MailHost==2.13.1 | |
Products.Marshall==2.1.2 | |
Products.MimetypesRegistry==2.0.5 | |
Products.OFSP==2.13.2 | |
Products.PasswordResetTool==2.0.14 | |
Products.PlacelessTranslationService==2.0.4 | |
Products.PloneLanguageTool==3.2.7 | |
Products.PlonePAS==4.1.1 | |
Products.PloneTestCase==0.9.17 | |
Products.PluggableAuthService==1.10.0 | |
Products.PluginRegistry==1.3 | |
Products.PortalTransforms==2.1.2 | |
Products.PythonScripts==2.13.2 | |
Products.ResourceRegistries==2.2.9 | |
Products.SecureMailHost==1.1.2 | |
Products.StandardCacheManagers==2.13.0 | |
Products.TinyMCE==1.3.5 | |
Products.ZCTextIndex==2.13.4 | |
Products.ZCatalog==2.13.23 | |
Products.ZSQLMethods==2.13.4 | |
Products.ZopeVersionControl==1.1.3 | |
Products.contentmigration==2.1.5 | |
Products.statusmessages==4.0 | |
Products.validation==2.0 | |
Pygments==1.6 | |
Record==2.13.0 | |
RestrictedPython==3.6.0 | |
Unidecode==0.04.1 | |
WebOb==1.2.3 | |
ZConfig==2.9.1 | |
ZODB3==3.10.5 | |
Zope2==2.13.5 | |
ZopeUndo==2.12.0 | |
archetypes.kss==1.7.3 | |
archetypes.querywidget==1.0.8 | |
archetypes.referencebrowserwidget==2.4.18 | |
archetypes.schemaextender==2.1.2 | |
borg.localrole==3.0.2 | |
collective.monkeypatcher==1.0.1 | |
collective.z3cform.datetimewidget==1.2.5 | |
diazo==1.0.3 | |
docutils==0.9.1 | |
experimental.cssselect==0.3 | |
feedparser==5.0.1 | |
five.customerize==1.1 | |
five.formlib==1.0.4 | |
five.globalrequest==1.0 | |
five.localsitemanager==2.0.5 | |
initgroups==2.13.0 | |
kss.core==1.6.5 | |
lxml==2.3.6 | |
mechanize==0.2.5 | |
mock==1.0.1 | |
plone.alterego==1.0 | |
plone.app.blob==1.5.8 | |
plone.app.caching==1.1.4 | |
plone.app.collection==1.0.10 | |
plone.app.content==2.1.3 | |
plone.app.contentlisting==1.0.4 | |
plone.app.contentmenu==2.0.8 | |
plone.app.contentrules==3.0.4 | |
plone.app.controlpanel==2.2.12 | |
plone.app.customerize==1.2.2 | |
plone.app.discussion==2.2.7 | |
plone.app.folder==1.0.5 | |
plone.app.form==2.2.3 | |
plone.app.i18n==2.0.2 | |
plone.app.imaging==1.0.9 | |
plone.app.iterate==2.1.10 | |
plone.app.jquery==1.7.2 | |
plone.app.jquerytools==1.5.5 | |
plone.app.kss==1.8.0 | |
plone.app.layout==2.3.5 | |
plone.app.linkintegrity==1.5.3 | |
plone.app.locales==4.3.2 | |
plone.app.openid==2.0.2 | |
plone.app.portlets==2.3.9 | |
plone.app.querystring==1.0.8 | |
plone.app.redirector==1.2 | |
plone.app.registry==1.2.3 | |
plone.app.search==1.1.5 | |
plone.app.textfield==1.2.2 | |
plone.app.theming==1.1.1 | |
plone.app.upgrade==1.2.6 | |
plone.app.users==1.1.5 | |
plone.app.uuid==1.0 | |
plone.app.viewletmanager==2.0.3 | |
plone.app.vocabularies==2.1.10 | |
plone.app.workflow==2.1.6 | |
plone.app.z3cform==0.7.3 | |
plone.autoform==1.4 | |
plone.batching==1.0 | |
plone.behavior==1.0.2 | |
plone.browserlayer==2.1.2 | |
plone.cachepurging==1.0.4 | |
plone.caching==1.0 | |
plone.contentrules==2.0.3 | |
plone.dexterity==2.1.3 | |
plone.fieldsets==2.0.2 | |
plone.folder==1.0.4 | |
plone.formwidget.namedfile==1.0.6 | |
plone.i18n==2.0.8 | |
plone.indexer==1.0.2 | |
plone.intelligenttext==2.0.2 | |
plone.keyring==2.0.1 | |
plone.locking==2.0.4 | |
plone.memoize==1.1.1 | |
plone.namedfile==2.0.2 | |
plone.openid==2.0.1 | |
plone.outputfilters==1.10 | |
plone.portlet.collection==2.1.5 | |
plone.portlet.static==2.0.2 | |
plone.portlets==2.2 | |
plone.protect==2.0.2 | |
plone.registry==1.0.1 | |
plone.resource==1.0.2 | |
plone.resourceeditor==1.0 | |
plone.rfc822==1.0.1 | |
plone.scale==1.3.2 | |
plone.schemaeditor==1.3.2 | |
plone.session==3.5.3 | |
plone.stringinterp==1.0.10 | |
plone.subrequest==1.6.7 | |
plone.supermodel==1.2.2 | |
plone.synchronize==1.0.1 | |
plone.theme==2.1 | |
plone.transformchain==1.0.3 | |
plone.uuid==1.0.3 | |
plone.z3cform==0.8.0 | |
plonetheme.classic==1.3.2 | |
plonetheme.sunburst==1.4.5 | |
pyramid==1.5a1 | |
pyramid-debugtoolbar==1.0.8 | |
pyramid-mako==0.2 | |
pyramid-tm==0.7 | |
pyramid-zodbconn==0.4 | |
python-dateutil==1.5 | |
python-gettext==1.2 | |
python-openid==2.2.5 | |
pytz==2013b | |
repoze.debug==1.0.2 | |
repoze.lru==0.6 | |
repoze.xmliter==0.5 | |
roman==1.4.0 | |
six==1.2.0 | |
tempstorage==2.12.2 | |
transaction==1.1.1 | |
translationstring==1.1 | |
unittest2==0.5.1 | |
venusian==1.0a8 | |
waitress==0.8.7 | |
wsgiref==0.1.2 | |
z3c.autoinclude==0.3.4 | |
z3c.caching==2.0a1 | |
z3c.form==3.0 | |
z3c.formwidget.query==0.9 | |
z3c.zcmlhook==1.0b1 | |
zExceptions==2.13.0 | |
zLOG==2.11.1 | |
zc.buildout==2.2.1 | |
zc.lockfile==1.0.2 | |
zc.recipe.egg==1.3.2 | |
zdaemon==2.0.7 | |
zodburi==2.0b1 | |
zope.annotation==3.5.0 | |
zope.app.cache==3.7.0 | |
zope.app.content==3.5.1 | |
zope.app.form==4.0.2 | |
zope.app.locales==3.6.2 | |
zope.app.pagetemplate==3.11.2 | |
zope.app.publication==3.12.0 | |
zope.authentication==3.7.1 | |
zope.broken==3.6.0 | |
zope.browser==1.3 | |
zope.browsermenu==3.9.1 | |
zope.browserpage==3.12.2 | |
zope.browserresource==3.10.3 | |
zope.cachedescriptors==3.5.1 | |
zope.component==3.9.5 | |
zope.componentvocabulary==1.0.1 | |
zope.configuration==3.7.4 | |
zope.container==3.11.2 | |
zope.contentprovider==3.7.2 | |
zope.contenttype==3.5.5 | |
zope.copy==3.5.0 | |
zope.datetime==3.4.1 | |
zope.deferredimport==3.5.3 | |
zope.deprecation==4.0.2 | |
zope.dottedname==3.4.6 | |
zope.dublincore==4.0.0 | |
zope.error==3.7.4 | |
zope.event==3.5.2 | |
zope.exceptions==3.6.2 | |
zope.filerepresentation==3.6.1 | |
zope.formlib==4.0.6 | |
zope.globalrequest==1.0 | |
zope.hookable==4.0.1 | |
zope.i18n==3.7.4 | |
zope.i18nmessageid==3.5.3 | |
zope.interface==4.0.5 | |
zope.lifecycleevent==3.6.2 | |
zope.location==3.9.1 | |
zope.pagetemplate==3.6.3 | |
zope.processlifetime==1.0 | |
zope.proxy==3.6.1 | |
zope.ptresource==3.9.0 | |
zope.publisher==3.12.6 | |
zope.ramcache==1.0 | |
zope.schema==4.2.2 | |
zope.security==3.8.5 | |
zope.sendmail==3.7.5 | |
zope.sequencesort==3.4.0 | |
zope.site==3.9.2 | |
zope.size==3.4.1 | |
zope.structuredtext==3.5.1 | |
zope.tal==3.5.2 | |
zope.tales==3.5.3 | |
zope.testbrowser==3.11.1 | |
zope.testing==3.9.7 | |
zope.traversing==3.13.2 | |
zope.untrustedpython==4.0.0 | |
zope.viewlet==3.7.2 | |
-e . |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment