package
stringlengths
1
122
pacakge-description
stringlengths
0
1.3M
zope.server
This package contains generic base classes for channel-based servers, the servers themselves and helper objects, such as tasks and requests.WSGI Supportzope.server’s HTTP server comes withWSGIsupport.zope.server.http.wsgihttpserver.WSGIHTTPServercan act as a WSGI gateway. There’s also an entry point forPasteDeploythat lets you use zope.server’s WSGI gateway from a configuration file, e.g.:[server:main] use = egg:zope.server host = 127.0.0.1 port = 8080CHANGES4.0.2 (2019-07-11)Fix pipetrigger.close() to close the right file descriptor. (This could’ve been causing EBADF errors in unrelated places!)Add Python 3.7 support.4.0.1 (2017-10-31)Fix Windows compatibility regression introduced in 4.0.0. Seeissue 9.4.0.0 (2017-10-30)Drop Python 2.6 support.Add Python 3.4, 3.5, and 3.6 support.Add PyPy support.Made the HTTPTask not havecommandorurivalues of"None"when the first request line cannot be parsed. Now they are empty strings.Reimplementbuffers.OverflowableBufferin terms of the standard library’stempfile.SpooledTemporaryFile. This is much simpler. Seeissue 5.Achieve and maintain 100% test coverage.Remove all the custom logging implementations inzope.server.loggingand change theCommonAccessLoggerandCommonFTPActivityLoggerto only work with Python standard library loggers. The standard library supports all the logging functions this package previously provided. It can be easily configured with ZConfig. Seeissue 4.3.9.0 (2013-03-13)Better adherence to WSGI:Call close method if present on iterables returned bystart_response.Don’t include non-string values in the CGI environment (CHANNEL_CREATION_TIME).Always includeQUERY_STRINGto avoid the cgi module falling back tosys.argv.Add tests based onpaste.lintmiddleware.Replaced deprecatedzope.interface.implementsusage with equivalentzope.interface.implementerdecorator.Dropped support for Python 2.4 and 2.5.Exceptions that happen in the handler thread main loop are logged so that the unexpected death of a handler thread does not happen in silence.3.8.6 (2012-01-07)On startup, HTTPServer prints a clickable URL after the hostname/port.3.8.5 (2011-09-13)fixed bug: requests lasting over 15 minutes were sometimes closed prematurely.3.8.4 (2011-06-07)Fix syntax error in tests on Python < 2.6.3.8.3 (2011-05-18)Madestart_responsemethod of WSGI server implementation more compliant with spec:http://www.python.org/dev/peps/pep-0333/#the-start-response-callable3.8.2 (2010-12-04)Corrected license version inzope/server/http/tests/test_wsgiserver.py.3.8.1 (2010-08-24)When the result of a WSGI application was received,task.write()was only called once to transmit the data. This prohibited the transmission of partial results. Now the WSGI server iterates through the result itself making multipletask.write()calls, which will cause partial data to be transmitted.Created a second test case instance for the post-mortem WSGI server, so it is tested as well.Using python’sdoctestmodule instead of deprecatedzope.testing.doctest.3.8.0 (2010-08-05)Implemented correct server proxy behavior. The HTTP server would always add a “Server” and “Date” response header to the list of response headers regardless whether one had been set already. The HTTP 1.1 spec specifies that a proxy server must not modify the “Server” and “Date” header but add a “Via” header instead.3.7.0 (2010-08-01)Implemented proxy support. Proxy requests contain a full URIs and the request parser used to throw that information away. Usingurlparse.urlsplit(), all pieces of the URL are recorded.The proxy scheme and netloc/hostname are exposed in the WSGI environment aszserver.proxy.schemeandzserver.proxy.host.Made tests runnable via buildout again.3.6.2 (2010-06-11)The log message “Exception during task” is no longer logged to the root logger but to zope.server.taskthreads.3.6.1 (2009-10-07)Made tests pass with current zope.publisher which restricts redirects to the current host by default.3.6.0 (2009-05-27)Moved some imports from test modules to their setUp to prevent failures when ZEO tests are run by the same testrunnerRemoved unused dependency on zope.deprecation.Remove old zpkg-related DEPENDENCIES.cfg file.3.5.0 (2008-03-01)Improve package meta-data.Fix of 599 error on conflict error in request see:http://mail.zope.org/pipermail/zope-dev/2008-January/030844.htmlRemoved dependency on ZODB.3.5.0a2 (2007-06-02)Made WSGI server really WSGI-compliant by adding variables to the environment that are required by the spec.3.5.0a1 (2007-06-02)Added a factory and entry point for PasteDeploy.3.4.3 (2008-08-18)Moved some imports from test modules to their setUp to prevent failures when ZEO tests are run by the same testrunner3.4.2 (2008-02-02)Fix of 599 error on conflict error in request see:http://mail.zope.org/pipermail/zope-dev/2008-January/030844.html3.4.1 (2007-06-02)Made WSGI server really WSGI-compliant by adding variables to the environment that are required by the spec.3.4.0 (2007-06-02)Removed an unused import. Unchanged otherwise.3.4.0a1 (2007-04-22)Initial release as a separate project, corresponds to zope.server from Zope 3.4.0a1Made WSGI server really WSGI-compliant by adding variables to the environment that are required by the spec.
zope.session
zope.sessionThis package provides interfaces for client identification and session support and their implementations for the request objects ofzope.publisher.Documentation is hosted athttps://zopesession.readthedocs.io/CHANGES5.1 (2023-08-28)Declarezope.traversingas install dependency.5.0 (2023-03-02)Drop support for Python 2.7, 3.5, 3.6.Add support for Python 3.11.4.5 (2022-08-30)Add support for Python 3.5, 3.9, 3.10.4.4.0 (2020-10-16)Fix inconsistent resolution order with zope.interface v5.Add support for Python 3.8.Drop support for Python 3.4 and 3.5.4.3.0 (2018-10-19)Add support for Python 3.7.Host documentation athttps://zopesession.readthedocs.io4.2.0 (2017-09-22)Add support for Python 3.5 and 3.6.Drop support for Python 2.6 and 3.3Reach 100% code coverage and maintain it via tox.ini and Travis CI.4.1.0 (2015-06-02)Add support for PyPy and PyPy3.4.0.0 (2014-12-24)Add support for Python 3.4.Add support for testing on Travis.4.0.0a2 (2013-08-27)Fix test that fails on any timezone east of GMT4.0.0a1 (2013-02-21)Add support for Python 3.3Replace deprecatedzope.component.adaptsusage with equivalentzope.component.adapterdecorator.Replace deprecatedzope.interface.implementsusage with equivalentzope.interface.implementerdecorator.Drop support for Python 2.4 and 2.5.3.9.5 (2011-08-11)LP #824355: enable support for HttpOnly cookies.Fix a bug inzope.session.session.Sessionthat would trigger an infinite loop if either iteration or a containment test were attempted on an instance.3.9.4 (2011-03-07)Add an explicitprovidesto the IClientId adapter declaration in adapter.zcml.Add option to disable implicit sweeps in PersistentSessionDataContainer.3.9.3 (2010-09-25)Add test extra to declare test dependency onzope.testing.Use Python’sdoctestmodule instead of depreactedzope.testing.doctest.3.9.2 (2009-11-23)Fix Python 2.4 hmac compatibility issue by only using hashlib in Python versions 2.5 and above.Use the CookieClientIdManager’s secret as the hmac key instead of the message when constructing and verifying client ids.Make it possible to construct CookieClientIdManager passing cookie namespace and/or secret as constructor’s arguments.Use zope.schema.fieldproperty.FieldProperty for “namespace” attribute of CookieClientIdManager, just like for other attributes in its interface. Also, make ICookieClientIdManager’s “namespace” field an ASCIILine, so it accepts only non-unicode strings for cookie names.3.9.1 (2009-04-20)Restore compatibility with Python 2.4.3.9.0 (2009-03-19)Don’t raise deprecation warnings on Python 2.6.Drop dependency onzope.annotation. Instead, we make classes implementIAttributeAnnotatablein ZCML configuration, only ifzope.annotationis available. If your code relies on annotatableCookieClientIdManagerandPersistentSessionDataContainerand you don’t include the zcml classes configuration of this package, you’ll need to useclassImplementsfunction fromzope.interfaceto make those classes implementIAttributeAnnotatableagain.Drop dependency on zope.app.http, use standard date formatting function from theemail.utilsmodule.Zope 3 application bootstrapping code for session utilities was moved into zope.app.appsetup package, thus drop dependency on zope.app.appsetup in this package.Drop testing dependencies, as we don’t need anything behind zope.testing and previous dependencies was simply migrated from zope.app.session before.Remove zpkg files and zcml slugs.Update package’s description a bit.3.8.1 (2009-02-23)Add an ability to set cookie effective domain for CookieClientIdManager. This is useful for simple cases when you have your application set up on one domain and you want your identification cookie be active for subdomains.Python 2.6 compatibility change. Encode strings before calling hmac.new() as the function no longer accepts the unicode() type.3.8.0 (2008-12-31)Add missing test dependency onzope.siteandzope.app.publication.3.7.1 (2008-12-30)Specify i18n_domain for titles in apidoc.zcmlZODB 3.9 no longer contains ZODB.utils.ConflictResolvingMappingStorage, fixed tests, so they work both with ZODB 3.8 and 3.9.3.7.0 (2008-10-03)New features:Added a ‘postOnly’ option on CookieClientIdManagers to only allow setting the client id cookie on POST requests. This is to further reduce risk from broken caches handing the same client id out to multiple users. (Of course, it doesn’t help if caches are broken enough to cache POSTs.)3.6.0 (2008-08-12)New features:Added a ‘secure’ option on CookieClientIdManagers to cause the secure set-cookie option to be used, which tells the browser not to send the cookie over http.This provides enhanced security for ssl-only applications.Only set the client-id cookie if it isn’t already set and try to prevent the header from being cached. This is to minimize risk from broken caches handing the same client id out to multiple users.3.5.2 (2008-06-12)Remove ConflictErrors caused on SessionData caused by settinglastAccessTime.3.5.1 (2008-04-30)Split up the ZCML to make it possible to re-use more reasonably.3.5.0 (2008-03-11)Change the default session “resolution” to a sane value and document/test it.3.4.1 (2007-09-25)Fixed some meta data and switch to tgz release.3.4.0 (2007-09-25)Initial releaseMoved parts fromzope.app.sessionto this packages
zope.site
zope.siteThis package provides a local and persistent site manager implementation, so that one can register local utilities and adapters. It uses local adapter registries for its adapter and utility registry. The module also provides some facilities to organize the local software and ensures the correct behavior inside the ZODB.Documentation is hosted athttps://zopesite.readthedocs.ioSites and Local Site ManagersThis is an introduction of location-based component architecture.Creating and Accessing SitesSitesare used to provide custom component setups for parts of your application or web site. Every folder:>>> from zope.site import folder >>> myfolder = folder.rootFolder()has the potential to become a site:>>> from zope.component.interfaces import ISite, IPossibleSite >>> IPossibleSite.providedBy(myfolder) Truebut is not yet one:>>> ISite.providedBy(myfolder) FalseIf you would like your custom content component to be able to become a site, you can use theSiteManagerContainermix-in class:>>> from zope import site >>> class MyContentComponent(site.SiteManagerContainer): ... pass>>> myContent = MyContentComponent() >>> IPossibleSite.providedBy(myContent) True >>> ISite.providedBy(myContent) FalseTo convert a possible site to a real site, we have to provide a site manager:>>> sm = site.LocalSiteManager(myfolder) >>> myfolder.setSiteManager(sm) >>> ISite.providedBy(myfolder) True >>> myfolder.getSiteManager() is sm TrueNote that an event is generated when a local site manager is created:>>> from zope.component.eventtesting import getEvents >>> from zope.site.interfaces import INewLocalSite >>> [event] = getEvents(INewLocalSite) >>> event.manager is sm TrueIf one tries to set a bogus site manager, aValueErrorwill be raised:>>> myfolder2 = folder.Folder() >>> myfolder2.setSiteManager(object) Traceback (most recent call last): ... ValueError: setSiteManager requires an IComponentLookupIf the possible site has been changed to a site already, aTypeErroris raised when one attempts to add a new site manager:>>> myfolder.setSiteManager(site.LocalSiteManager(myfolder)) Traceback (most recent call last): ... TypeError: Already a siteThere is also an adapter you can use to get the next site manager from any location:>>> myfolder['mysubfolder'] = folder.Folder() >>> import zope.interface.interfaces >>> zope.interface.interfaces.IComponentLookup(myfolder['mysubfolder']) is sm TrueIf the location passed is a site, the site manager of that site is returned:>>> zope.interface.interfaces.IComponentLookup(myfolder) is sm TrueUsing the Site ManagerA site manager contains severalsite management folders, which are used to logically organize the software. When a site manager is initialized, a default site management folder is created:>>> sm = myfolder.getSiteManager() >>> default = sm['default'] >>> default.__class__ <class 'zope.site.site.SiteManagementFolder'>However, you can tell not to create the default site manager folder on LocalSiteManager creation:>>> nodefault = site.LocalSiteManager(myfolder, default_folder=False) >>> 'default' in nodefault FalseAlso, note that when creating LocalSiteManager, its __parent__ is set to site that was passed to constructor and the __name__ is set to ++etc++site.>>> nodefault.__parent__ is myfolder True >>> nodefault.__name__ == '++etc++site' TrueYou can easily create a new site management folder:>>> sm['mySMF'] = site.SiteManagementFolder() >>> sm['mySMF'].__class__ <class 'zope.site.site.SiteManagementFolder'>Once you have your site management folder – let’s use the default one – we can register some components. Let’s start with a utility (we define it in a__module__that can be pickled):>>> import zope.interface >>> __name__ = 'zope.site.tests' >>> class IMyUtility(zope.interface.Interface): ... pass>>> import persistent >>> from zope.container.contained import Contained >>> @zope.interface.implementer(IMyUtility) ... class MyUtility(persistent.Persistent, Contained): ... def __init__(self, title): ... self.title = title ... def __repr__(self): ... return "%s('%s')" %(self.__class__.__name__, self.title)Now we can create an instance of our utility and put it in the site management folder and register it:>>> myutil = MyUtility('My custom utility') >>> default['myutil'] = myutil >>> sm.registerUtility(myutil, IMyUtility, 'u1')Now we can ask the site manager for the utility:>>> sm.queryUtility(IMyUtility, 'u1') MyUtility('My custom utility')Of course, the local site manager has also access to the global component registrations:>>> gutil = MyUtility('Global Utility') >>> from zope.component import getGlobalSiteManager >>> gsm = getGlobalSiteManager() >>> gsm.registerUtility(gutil, IMyUtility, 'gutil')>>> sm.queryUtility(IMyUtility, 'gutil') MyUtility('Global Utility')Next let’s see whether we can also successfully register an adapter as well. Here the adapter will provide the size of a file:>>> class IFile(zope.interface.Interface): ... pass>>> class ISized(zope.interface.Interface): ... pass>>> @zope.interface.implementer(IFile) ... class File(object): ... pass>>> @zope.interface.implementer(ISized) ... class FileSize(object): ... def __init__(self, context): ... self.context = contextNow that we have the adapter we need to register it:>>> sm.registerAdapter(FileSize, [IFile])Finally, we can get the adapter for a file:>>> file = File() >>> size = sm.queryAdapter(file, ISized, name='') >>> isinstance(size, FileSize) True >>> size.context is file TrueBy the way, once you set a site>>> from zope.component import hooks >>> hooks.setSite(myfolder)you can simply use the zope.component’sgetSiteManager()method to get the nearest site manager:>>> from zope.component import getSiteManager >>> getSiteManager() is sm TrueThis also means that you can simply use zope.component to look up your utility>>> from zope.component import getUtility >>> getUtility(IMyUtility, 'gutil') MyUtility('Global Utility')or the adapter via the interface’s__call__method:>>> size = ISized(file) >>> isinstance(size, FileSize) True >>> size.context is file TrueMultiple SitesUntil now we have only dealt with one local and the global site. But things really become interesting, once we have multiple sites. We can override other local configuration.This behaviour uses the notion of location, therefore we need to configure the zope.location package first:>>> import zope.configuration.xmlconfig >>> _ = zope.configuration.xmlconfig.string(""" ... <configure xmlns="http://namespaces.zope.org/zope"> ... <include package="zope.component" file="meta.zcml"/> ... <include package="zope.location" /> ... </configure> ... """)Let’s now create a new folder calledfolder11, add it tomyfolderand make it a site:>>> myfolder11 = folder.Folder() >>> myfolder['myfolder11'] = myfolder11 >>> myfolder11.setSiteManager(site.LocalSiteManager(myfolder11)) >>> sm11 = myfolder11.getSiteManager()If we ask the second site manager for its next, we get>>> sm11.__bases__ == (sm, ) Trueand the first site manager should have the folling sub manager:>>> sm.subs == (sm11,) TrueIf we now register a second utility with the same name and interface with the new site manager folder,>>> default11 = sm11['default'] >>> myutil11 = MyUtility('Utility, uno & uno') >>> default11['myutil'] = myutil11>>> sm11.registerUtility(myutil11, IMyUtility, 'u1')then it will will be available in the second site manager>>> sm11.queryUtility(IMyUtility, 'u1') MyUtility('Utility, uno & uno')but not in the first one:>>> sm.queryUtility(IMyUtility, 'u1') MyUtility('My custom utility')It is also interesting to look at the use cases of moving and copying a site. To do that we create a second root folder and make it a site, so that site hierarchy is as follows:_____ global site _____ / \ myfolder myfolder2 | myfolder11 >>> myfolder2 = folder.rootFolder() >>> myfolder2.setSiteManager(site.LocalSiteManager(myfolder2))Before we can move or copy sites, we need to register two event subscribers that manage the wiring of site managers after moving or copying:>>> import zope.lifecycleevent.interfaces >>> gsm.registerHandler( ... site.changeSiteConfigurationAfterMove, ... (ISite, zope.lifecycleevent.interfaces.IObjectMovedEvent), ... )We only have to register one event listener, since the copy action causes anIObjectAddedEventto be created, which is just a special type ofIObjectMovedEvent.First, make sure that everything is setup correctly in the first place:>>> myfolder11.getSiteManager().__bases__ == (myfolder.getSiteManager(), ) True >>> myfolder.getSiteManager().subs[0] is myfolder11.getSiteManager() True >>> myfolder2.getSiteManager().subs ()Let’s now movemyfolder11frommyfoldertomyfolder2:>>> myfolder2['myfolder21'] = myfolder11 >>> del myfolder['myfolder11']Now the next site manager formyfolder11’s site manager should have changed:>>> myfolder21 = myfolder11 >>> myfolder21.getSiteManager().__bases__ == (myfolder2.getSiteManager(), ) True >>> myfolder2.getSiteManager().subs[0] is myfolder21.getSiteManager() True >>> myfolder.getSiteManager().subs ()Make sure that our interfaces and classes are picklable:>>> import sys >>> sys.modules['zope.site.tests'].IMyUtility = IMyUtility >>> sys.modules['zope.site.tests'].MyUtility = MyUtility>>> from pickle import dumps, loads >>> data = dumps(myfolder2['myfolder21']) >>> myfolder['myfolder11'] = loads(data)>>> myfolder11 = myfolder['myfolder11'] >>> myfolder11.getSiteManager().__bases__ == (myfolder.getSiteManager(), ) True >>> myfolder.getSiteManager().subs[0] is myfolder11.getSiteManager() True >>> myfolder2.getSiteManager().subs[0] is myfolder21.getSiteManager() TrueFinally, let’s check that everything works fine when our folder is moved to the folder that doesn’t contain any site manager. Our folder’s sitemanager’s bases should be set to global site manager.>>> myfolder11.getSiteManager().__bases__ == (myfolder.getSiteManager(), ) True>>> nosm = folder.Folder() >>> nosm['root'] = myfolder11 >>> myfolder11.getSiteManager().__bases__ == (gsm, ) TrueDeleting a site unregisters its site manger from its parent site manager:>>> del myfolder2['myfolder21'] >>> myfolder2.getSiteManager().subs ()The removed site manager now has no bases:>>> myfolder21.getSiteManager().__bases__ ()Changes5.0 (2023-06-30)Drop support for Python 2.7, 3.5, 3.6.Add support for Python 3.11.4.6.1 (2022-09-02)Fix more deprecation warnings.4.6 (2022-08-23)Add support for Python 3.9, 3.10.Fix deprecation warning.4.5.0 (2021-03-04)Fix the interface definition ofIRootFolderto giveIRoothigher priority than the folder and container interfaces. This is what is usually expected, but not what the code defined. Commonly, in the past, this problem was hidden because the factory functionrootFolder()re-arranged the interfaces to putIRootat the front. Under zope.interface 5’s C3 resolution order, however, this rearrangement was not taking place; thus, looking up adapters for arootFolder()object was likely to find adapters forIItemContainerinstead of adapters forIRootas intended.With this change, users ofrootFolder()should notice no changes compared with zope.interface 4. Code that has classes defined to implementIRootFolderdirectly, though, may notice a different resolution order on those objects (consistent with whatrootFolder()generates).Seeissue 17.4.4.0 (2020-09-10)On removal of a site, clear the bases of its site manager. This fixes a reference leak from a parent site manager. Seeissue 1.4.3.0 (2020-04-01)Add support for Python 3.8.Drop support for Python 3.4.Drop support for the deprecatedpython setup.py testcommand.Fix tests with zope.interface 5.0. Seeissue 12.4.2.2 (2018-10-19)Fix moreDeprecationWarnings. Seeissue 10.4.2.1 (2018-10-11)Use current import location forUtilityRegistrationandIUtilityRegistrationclasses to avoidDeprecationWarning.4.2.0 (2018-10-09)Add support for Python 3.7.4.1.0 (2017-08-08)Add support for Python 3.5 and 3.6.Drop support for Python 2.6 and 3.3.Deprecatezope.site.hooks.*,zope.site.site.setSite,zope.site.next.getNextUtilityandzope.site.next.queryNextUtilitywithzope.deprecation. These will be removed in version 5.0. They all have replacements inzope.component.Added implementation for _p_repr in LocalSiteManager. For further information seeissue 8.Reach 100% test coverage and ensure we remain there.4.0.0 (2014-12-24)Add support for PyPy.Add support for Python 3.4.Add support for testing on Travis.4.0.0a1 (2013-02-20)Added support for Python 3.3.Replaced deprecatedzope.interface.implementsusage with equivalentzope.interface.implementerdecorator.Dropped support for Python 2.4 and 2.5.Include zcml dependencies in configure.zcml, added tests for zcml.3.9.2 (2010-09-25)Added not declared, but needed test dependency onzope.testing.3.9.1 (2010-04-30)Removed use of ‘zope.testing.doctest’ in favor of stdlib’s ‘doctest.Removed use of ‘zope.testing.doctestunit’ in favor of stdlib’s ‘doctest.3.9.0 (2009-12-29)Avoid a test dependency on zope.copypastemove by testing the correct persistent behavior of a site manager using the normal pickle module.3.8.0 (2009-12-15)Removed functional testing setup and dependency on zope.app.testing.3.7.1 (2009-11-18)Moved the zope.site.hooks functionality to zope.component.hooks as it isn’t actually dealing with zope.site’s concept of a site.Import ISite and IPossibleSite from zope.component after they were moved there from zope.location.3.7.0 (2009-09-29)Cleaned up the undeclared dependency on zope.app.publication by moving the two relevant subscriber registrations and their tests to that package.Dropped the dependency on zope.traversing which was only used to access zope.location functionality. Configure zope.location for some tests.Demoted zope.configuration to a testing dependency.3.6.4 (2009-09-01)Set __parent__ and __name__ in the LocalSiteManager’s constructor after calling constructor of its superclasses, so __name__ doesn’t get overwritten with empty string by the Components constructor.Don’t set __parent__ and __name__ attributes of site manager in SiteManagerContainer’ssetSiteManagermethod, as they’re already set for LocalSiteManager. Other site manager implementations are not required to have those attributes at all, so we’re not adding them anymore.3.6.3 (2009-07-27)Propagate an ObjectRemovedEvent to the SiteManager upon removal of a SiteManagerContainer.3.6.2 (2009-07-24)Fixed tests to pass with latest packages.Removed failing test of persistent interfaces, since it did not test anything in this package and used the deprecatedzodbcodemodule.Fix NameError when callingzope.site.testing.siteSetUp(site=True).ThegetNextUtilityandqueryNextUtilityfunctions was moved tozope.component. While backward-compatibility imports are provided, it’s strongly recommended to update your imports.3.6.1 (2009-02-28)Import symbols moved from zope.traversing to zope.location from the new location.Don’t fail when changing component registry bases while moving ISite object to non-ISite object.Allow specify whether to create ‘default’ SiteManagementFolder on initializing LocalSiteManager. Use thedefault_folderargument.Add a containment constraint to the SiteManagementFolder that makes it only available to be contained in ILocalSiteManagers and other ISiteManagementFolders.Change package’s mailing list address to zope-dev at zope.org, as zope3-dev at zope.org is now retired.Remove old unused code. Update package description.3.6.0 (2009-01-31)Use zope.container instead of zope.app.container.3.5.1 (2009-01-27)Extracted from zope.app.component (trunk, 3.5.1 under development) as part of an effort to clean up dependencies between Zope packages.
zope.size
This package provides a definition of simple interface that allows applications to retrieve the size of the object for displaying and for sorting.The default adapter is also provided. It expects objects to have thegetSizemethod that returns size in bytes. However, the adapter won’t crash if an object doesn’t have one and will show size as “not available” instead.Development is hosted athttps://github.com/zopefoundation/zope.sizeDocumentation is hosted athttps://zopesize.readthedocs.ioChanges5.0 (2023-06-30)Drop support for Python 2.7, 3.5, 3.6.Add support for Python 3.11.4.4 (2022-08-30)Drop support for Python 3.4.Add support for Python 3.8, 3.9, 3.10.4.3 (2018-10-05)Add support for Python 3.7.4.2.0 (2017-07-27)Add support for Python 3.5 and 3.6.Drop support for Python 2.6, 3.2 and 3.3.4.1.0 (2014-12-29)Add support for PyPy3.Add support for Python 3.4.Add support for testing on Travis.4.0.1 (2013-03-08)Add Trove classifiers indicating CPython and PyPy support.4.0.0 (2013-02-13)Replace deprecatedzope.interface.implementsusage with equivalentzope.interface.implementerdecorator.Drop support for Python 2.4 and 2.5.Add support for Python 3.2 and 3.3.Conditionally disable tests that requirezope.configurationandzope.security.3.5.0 (2011-11-29)Include zcml dependencies in configure.zcml, require the necessary packages via a zcml extra, added tests for zcml.3.4.1 (2009-09-10)Add support for bootstrapping on Jython.Add docstrings.Beautify package’s README and include CHANGES into the description.Change package’s url to PyPI instead of Subversion.3.4.0 (2006-09-29)First release as a separate egg
zopeskel.browserlayer
IntroductionThis is a ZopeSkel template package for creating a skeleton Plone add-on package. The skeleton package installs a plone.app.browserlayer browserlayer and associated css and js resources.Use this package when you want to build an add-on that adds css or js functionality without a theme. The advantage of this is that you may use the functionality with different themes.This is a development tool. You should be familiar with Plone and buildout to use it.InstallationAdd these lines into buildout:[buildout] parts = zopeskel [zopeskel] recipe = zc.recipe.egg eggs = ZopeSkel Paste PasteDeploy PasteScript zopeskel.browserlayer ${buildout:eggs}And run the buildoutUsageCreating a dexterity content package, typically done in your buildout’s src directory:../bin/zopeskel browserlayerNotesEgg DirectoriesIn order to support local commands, ZopeSkel/Paster will create Paste, PasteDeploy and PasteScript eggs inside your product. These are only needed for development. You can and should remove them from your add-on distribution.ErrorsIf you hit and error like this:pkg_resources.DistributionNotFound: plone.app.relationfield: Not Found for: my.product (did you run python setup.py develop?)when attempting to runpaster addcontent, then you need to ensure that Paster knows about all the relevant eggs from your buildout.Add${instance:eggs}to yourpastersection in your buildout, thusly:[zopeskel] recipe = zc.recipe.egg eggs = ... ${instance:eggs} entry-points = paster=paste.script.command:runwhereinstanceis the name of yourplone.recipe.zope2instancesection. Re-run the buildout and the issue should be resolved.Changelog1.0 ~ 2011-10-24Initial release
zopeskel.dexterity
IntroductionDexterity is a content-type development tool for Plone. It supports Through-The-Web and filesystem development of new content types for Plone.zopeskel.dexterity provides a mechanism to quickly create Dexterity add on skeletons. It also makes it easy to add new content types to an existing skeleton. New content types built with this tool will support round-trip elaboration with Dexterity’s TTW schema editor.This is a development tool. You should be familiar with Plone and buildout to use it. You should have already installed Dexterity in your Plone development instance and be ready to start learning to use it.Installationzopeskel.dexterity is meant for use with the ZopeSkel 2.x series. It is not compatible with ZopeSkel > 3.0dev (aka Templer). For Dexterity templates for use with Templer, use templer.dexterity.zopeskel.dexterity 1.5+ is meant for use with Plone 4.3+. If you’re using an earlier version of Plone, pick the latest zopeskel.dexterity 1.4.x.Add these lines into buildout:[buildout] parts = zopeskel [zopeskel] recipe = zc.recipe.egg eggs = ZopeSkel < 3.0dev Paste PasteDeploy PasteScript zopeskel.dexterity ${buildout:eggs}And run the buildoutUsageCreating a dexterity content package, typically done in your buildout’s src directory:../bin/zopeskel dexterityAdding a content-type skeleton to an existing package:cd yourbuildout/src/your-product ../../bin/paster addcontent dexterity_contentAdding a behavior skeleton:cd yourbuildout/src/your-product ../../bin/paster addcontent dexterity_behaviorNotesEgg DirectoriesIn order to support local commands, ZopeSkel/Paster will create Paste, PasteDeploy and PasteScript eggs inside your product. These are only needed for development. You can and should remove them from your add-on distribution.ErrorsIf you hit and error like this:pkg_resources.DistributionNotFound: plone.app.relationfield: Not Found for: my.product (did you run python setup.py develop?)when attempting to runpaster addcontent, then you need to ensure that Paster knows about all the relevant eggs from your buildout.Add${instance:eggs}to yourpastersection in your buildout, thusly:[zopeskel] recipe = zc.recipe.egg eggs = ... ${instance:eggs} entry-points = paster=paste.script.command:runwhereinstanceis the name of yourplone.recipe.zope2instancesection. Re-run the buildout and the issue should be resolved.Changelog1.5.4 (2013-12-11)fixed improper code template for Python content classbase class of generated content class code was always Container (without taking the ‘folderish’ value of the configuration into account). [ajung]1.5.3 (2013-07-28)Restore relations support as an option. [smcmahon]1.5.2 ~ (2013-06-02)Use plone.directives.form.model.schema for grok’d Schema. [smcmahon]1.5.1 ~ (2013-05-29)Offer no-grok option in initial product creation questions. [smcmahon]Remove deprecated relations extra. [smcmahon]1.5.0 ~ (2013-04-09)Backport rudimentary content type tests from templer.dexterity. [smcmahon]Dexterity 2 is deemphasizing the Item type in favor of containers which may or may not allow contents. Adjusted question and actions to match. [smcmahon]grok no longer has automatic “static” resource directory. Wire in a new one with zcml. Name it “resources” to distinguish it from the old grok magic. Document in its own readme. [smcmahon]Cover Plone 4.3 dependencies. Add “[grok, relations]” to plone.app.dexterity dependencies. [smcmahon]1.4.1 ~ 2012-12-29Fixed issue with ZopeSkel 3.x series, for moment, it is pinning version ‘ZopeSkel<=2.21.2’ as a dependency requirement for install. [macagua]1.4 ~ 2011-10-29Minor revisions to bring into closer accord with PP4 and current Dexterity Developers’ Manual. [smcmahon]Add blob support [smcmahon]1.3 ~ 2011-05-22Added README.txt to static folder in dexterity template. [smcmahon]Changed metadata.xml template to start with an integer of 1 rather than the package version number. [davidjb]1.3b3 ~ 2011-05-13Add a working sample integration doctest. [smcmahon]1.3b2 ~ 2011-05-13Restore dotted filenames for new content types. Content types in file system addons need to be robustly installable in systems that may already have simple add-on names. [smcmahon]1.3b1 ~ 2011-05-07Removed content field and view local command templates. My rationale for removing the field template is that most novice developers should be using TTW models and taking advantage of supermodel round-tripping. Those who are comfortable with schema fields are probably not likely to be using a tool like ZopeSkel to add them. The rationale for removing the view template is simpler: it’s main functionality is now in the content-type template. [smcmahon]Add sample view definition with addition of a content type. [smcmahon]Revise to use filenames that will match those created by dexterity’s export buttons. This means removing the dotted filename style. [smcmahon]Revise to use grok-style directory structures that will more closely correspond with the dexterity docs. [smcmahon]1.2.2 ~ 2011-04-18Fixed issues when locales folder was lost in the packaging and thus was not able to start Plone 4.1 with the generated product present. Packaging probably prunes empty folders, included a dummy README.txt file there. [mikko ohtamaa]1.2.1 ~ 2011-04-08Release 1.2 of zopeskel.dexterity is not installable with python2.4 due to a bug in the tarfile module. Added setup.cfg that forces using the –formats=zip option when creating an sdist; this solves the problem on python2.4. [maurits]1.2 ~ 2011-01-13dexterity_behavior_field localcommand now also adds the relevant setter/getter/deleter in the adapter. [kagesenshi]1.2.1 ~ unreleasedRelease 1.2 of zopeskel.dexterity is not installable with python2.4 due to a bug in the tarfile module. Added setup.cfg that forces using the –formats=zip option when creating an sdist; this solves the problem on python2.4. [maurits]1.2 ~ 2011-01-13dexterity_behavior_field localcommand now also adds the relevant setter/getter/deleter in the adapter. [kagesenshi]1.1b2 ~ 2010-11-23Fixed indentation in the module generated by dexterity_behavior local command. It was using 3 spaces instead of 4 spaces. [esartor]Added import for the i18n message factory to the dexterity_behavior local command. [esartor]1.1b1 ~ 2010-06-21Correcting date type fields to use schema.Date rather than schema.Datetime. Using Datetime caused an incorrect widget being used, leading to issues in KSS validation and not being able to save content. [davidjb]Updating collective.z3cform.datetimewidget widgets locations. The old locations are now deprecated. [davidjb]Wrapped Dexterity content title/description fields in MessageFactory call [davidjb]Added note about Paster and potentially missing eggs to readme [davidjb]1.1a1added ability to add fields to the content type and behavior schema [vangheem]moved to zopeskel.dexterity package from collective.dexteritypaste [vangheem]1.0a1devInitial release
zopeskel.diazochildtheme
Introduction============This is a ZopeSkel template package for creating a skeleton Plone add-onpackage. The skeleton package creates a Bootstrap Diazo (diaxotheme.framworks) childtheme packageand associated css and js resources for use with plone.app.theming inPlone 4.2+.Use this package when you want to package a Diazo childtheme as a Plone add on,particularly if you need to override viewlet or skin templates in the process.This is a development tool. You should be familiar with Plone and buildout touse it... ATTENTION::This package is compatible with ZopeSkel<3.0 only.Installation============Add these lines into buildout::[buildout]parts =zopeskel[zopeskel]recipe = zc.recipe.eggeggs =ZopeSkelPastePasteDeployPasteScriptzopeskel.diazochildthemeAnd run the buildoutUsage======Add ons under development are typically created in your buildout's srcdirectory. Command line for creating a package named diazochildtheme.mychildtheme would be::../bin/zopeskel diazochildtheme diazochildtheme.mychildthemeThis will create a Python package with a directory structure like this::diazochildtheme.mychildtheme/|-- diazochildtheme| +-- mychildtheme| |-- diazo_resources| | +-- static| |-- locales| |-- profiles| | +-- default| +-- template_overrides|-- diazochildtheme.mychildtheme.egg-info+-- docsThe typically customized parts are in the diazochildtheme.mychildtheme/diazochildtheme/mychildtheme subdirectory.diazo_resources---------------This is where you'll put your Diazo resources including a rules XML file andone or more template HTML files. You may wish to interactively develop thesechildtheme elements in the theming editor (for Plone 4.3+), then export theresources and add them here.A sample childtheme is included to use as a starting point. Just replace it if youdon't need it. The sample childtheme's key feature is that it makes use of all ofPlone's CSS and JavaScript as a starting point.Everything you put in this directory and its subdirectories is publiclyavailable at ++childtheme++namespace.package/resourcename.ext.NOTE: The Diazo childtheme will be available in Plone even if you have notinstalled the package. It will not be applied, though, until enabled in theChildTheme configlet of site setup.diazo_resources/static----------------------This is the conventional place to put static resources like CSS, JS and image files.There's nothing magic about "static". Remove or replace it if it fits your needs.Everything you put in this directory and its subdirectories is publiclyavailable at ++childtheme++namespace.package/static/resourcename.ext.locales-------If your templates include translatable messages, you may provide translationfiles in this directory. Ignore it if you don't need translations.profiles, profiles/default--------------------------This is the Generic Setup profile for the add on. The is applied when you usethe "add ons" configlet in site setup to install the package.This profile has a couple of important features:* It sets up a BrowserLayer, which insures tha template overrides and registrysettings do not affect other Plone installations unless this childtheme isinstalled.* It has sample resource registrations for CSS and JavaScript resourceregistries. These allow you to incorporate static resources which are partof the childtheme into the Plone resource registries for efficient merging withother CSS and JS resources. The samples are commented out. If you remove thecomment markers and install/reinstall the childtheme, the main.css and main.jsfiles from your diazo_resources/static directory will be incorporated into theCSS and JS delivered by Plone -- even if the Diazo childtheme is not active.The alternative to adding your resources to the registries is to load themdirectly in your childtheme's index.html. This is a better approach if you don'tintend to use Plone's own CSS and JS resources. If you do, registering yourown resources will allow them to be merged for more efficient delivery.template_overrides------------------You may use this directory to override any Plone viewlet, portlet or skin template.To override a template, copy or create a template in this directory using thefull dotted name of the template you wish to override.For example, if you wish to override the standard Plone footer, you would find the original at::plone.app.layout/plone/app/layout/viewlets/footer.ptThe full, dotted name for this resource is::plone.app.layout.viewlets.footer.ptTemplate overrides are only applied when the BrowserLayer is installed byinstalling your package. So, they won't affect Plone installations where thispackage is not installed.For details on template overrides, see the documentation for `z3c.jbot<https://pypi.python.org/pypi/z3c.jbot>`_.Changelog=========1.0 (2015-03-25)----------------* Initial release.
zopeskel.diazotheme
Introduction============This is a ZopeSkel template package for creating a skeleton Plone add-onpackage. The skeleton package creates a Diazo (plone.app.theming) theme packageand associated css and js resources for use with plone.app.theming inPlone 4.2+.Use this package when you want to package a Diazo theme as a Plone add on,particularly if you need to override viewlet or skin templates in the process.This is a development tool. You should be familiar with Plone and buildout touse it.Installation============Add these lines into buildout::[buildout]parts =zopeskel[zopeskel]recipe = zc.recipe.eggeggs =ZopeSkelPastePasteDeployPasteScriptzopeskel.diazothemeAnd run the buildoutUsage======Add ons under development are typically created in your buildout's srcdirectory. Command line for creating a package named diazotheme.mytheme would be::../bin/zopeskel diazotheme diazotheme.mythemeThis will create a Python package with a directory structure like this::diazotheme.mytheme/|-- diazotheme| +-- mytheme| |-- diazo_resources| | +-- static| |-- locales| |-- profiles| | +-- default| +-- template_overrides|-- diazotheme.mytheme.egg-info+-- docsThe typically customized parts are in the diazotheme.mytheme/diazotheme/mytheme subdirectory.diazo_resources---------------This is where you'll put your Diazo resources including a rules XML file andone or more template HTML files. You may wish to interactively develop thesetheme elements in the theming editor (for Plone 4.3+), then export theresources and add them here.A sample theme is included to use as a starting point. Just replace it if youdon't need it. The sample theme's key feature is that it makes use of all ofPlone's CSS and JavaScript as a starting point.Everything you put in this directory and its subdirectories is publiclyavailable at ++theme++namespace.package/resourcename.ext.NOTE: The Diazo theme will be available in Plone even if you have notinstalled the package. It will not be applied, though, until enabled in theTheme configlet of site setup.diazo_resources/static----------------------This is the conventional place to put static resources like CSS, JS and image files.There's nothing magic about "static". Remove or replace it if it fits your needs.Everything you put in this directory and its subdirectories is publiclyavailable at ++theme++namespace.package/static/resourcename.ext.locales-------If your templates include translatable messages, you may provide translationfiles in this directory. Ignore it if you don't need translations.profiles, profiles/default--------------------------This is the Generic Setup profile for the add on. The is applied when you usethe "add ons" configlet in site setup to install the package.This profile has a couple of important features:* It sets up a BrowserLayer, which insures tha template overrides and registrysettings do not affect other Plone installations unless this theme isinstalled.* It has sample resource registrations for CSS and JavaScript resourceregistries. These allow you to incorporate static resources which are partof the theme into the Plone resource registries for efficient merging withother CSS and JS resources. The samples are commented out. If you remove thecomment markers and install/reinstall the theme, the main.css and main.jsfiles from your diazo_resources/static directory will be incorporated into theCSS and JS delivered by Plone -- even if the Diazo theme is not active.The alternative to adding your resources to the registries is to load themdirectly in your theme's index.html. This is a better approach if you don'tintend to use Plone's own CSS and JS resources. If you do, registering yourown resources will allow them to be merged for more efficient delivery.template_overrides------------------You may use this directory to override any Plone viewlet, portlet or skin template.To override a template, copy or create a template in this directory using thefull dotted name of the template you wish to override.For example, if you wish to override the standard Plone footer, you would find the original at::plone.app.layout/plone/app/layout/viewlets/footer.ptThe full, dotted name for this resource is::plone.app.layout.viewlets.footer.ptTemplate overrides are only applied when the BrowserLayer is installed byinstalling your package. So, they won't affect Plone installations where thispackage is not installed.A sample override for the Plone footer is included. Delete it if you don't need it.For details on template overrides, see the documentation for `z3c.jbot<https://pypi.python.org/pypi/z3c.jbot>`_.Changelog=========1.1 (2013-04-21)----------------- Added z3c.jbot to setup.py requires for created theme.- Changed ++resource++ to ++theme++ in profile/defaults.- Tuned up documentation.1.0 (2013-04-10)----------------* Initial release.
zopeskel.doctools
Introductionzopeskel.doctools provides two tools for assisting in the creation of ZopeSKel documentation:pastegraphpastedocpastegraphpastegraph outputs Graphviz source code representing a dependency tree for all available ZopeSkel entry points.pastedocpastedoc output an HTML outline of all fields and local commands for all available ZopeSkel entry points.ChangelogVersion 1.0First two tools: pastegraph and pastedoc. [cbc]
zopeskel.niteoweb
Starting, deploying and maintaining Plone 4 projects made easyzopeskel.niteoweb is collection of ZopeSkel templates to help you standardize and automate the task of starting, deploying and maintaining a new Plone project. Its particularly helpful for less experienced Plone developers as they can get a properly structured and deployed Plone 4 project in no time. A complete tutorial on how to use these templates for your own projects is athttp://ploneboutique.com.It will help you to automate and standardize:Starting a new Plone 4 project that includes old- and new-style python, zope page template and css overrides, collective.xdv, etc.Adding your own functionalities and look to Plone 4.Staging and deploying your Plone 4 project on Rackspace Cloud server instance running CentOS, with Nginx in front and secured with iptables firewall (only $11 per month per instance!)Maintaining and upgrading your Plone 4 project on the production server.By default the Plone 4 project you create with these templates is equiped with:latest collective.xdv with sample rules.xml and template.html,.svnignore files to ignore files/folders that should not be stored inside your code repository,base.cfg that holds global configuration for your buildout,versions.cfg that pins all your eggs to specific versions to ensure repeatability,development.cfg that builds a development environment,production.cfg that builds a production environment with ZEO,sphinx.cfg that is used to generate documentation for your code,test_setup.py that shows you how to write tests for your project,fabfile.py with Fabric commands to automatically deploy your code and data to a Rackspace Cloud server instance running CentOS,Sphinx documentation for your project,nginx.conf template to setup the Nginx web-proxy in front of your Zope,basic iptables configuration to deny access on all ports but the ones you actually use,munin-node.conf template to setup Munin system monitor node on your production server,and many more smaller goodies.InstallationInstallation is simple, just run ‘sudo easy_install zopeskel.niteoweb’ and you’re good to go. Go where? Tohttp://ploneboutique.com.AssumptionsOut-of-the-box, this package is intended for NiteoWeb’s internal projects. However, athttp://ploneboutique.comyou’ll find a comprehensive guide on how to use these templates for your own projects.To dopatch iostat munin pluginmunin plugins for Zopeaudit iptablesaudit sudoersaudit sshd_configbash_logoutyum-security email notificationinvestigate and fix fabric errors ‘err: /bin/bash: /home/zupo/.bash_profile: Permission denied’ContributorsNejc ‘zupo’ Zupan, NiteoWeb Ltd.Domen ‘iElectric’ Kožar, NiteoWeb Ltd.Changelog0.1 (2010-08-30)Went through the whole procedure and tested that it works. [zupo]0.1a6 (2010-08-29)Fix supervisord runtime error. [zupo]Debugging and cleanup. [zupo]0.1a5 (2010-08-29)Refactored maintenance_hostname to headquarters_hostname. [zupo]Added sendmail installation with Fabric. [zupo]Hidden some ZopeSkel questions. [zupo]Added ‘maintenance_ip’ question. [zupo]Ask for maintenance username when starting Fabric commands. [zupo]0.1a4 (2010-08-28)Many fixes to templates. [zupo]Pin down a specific version of Fabric. [zupo]Moved global config, Fabric and zest.releaser to production.cfg. [zupo]Changed comment banner styling. [zupo]Moved actual code into ./src. [zupo]Changed default IP. [zupo]Added Quick-start information. [zupo]0.1a3 (2010-08-27)Fixed sintax errors in production.cfg_tmpl [zupo]Added documentation structure. [zupo]Added zc.buildout and Sphinx. [zupo]0.1a2 (2010-08-26)Added zest.releaser to buildout [zupo]Added initial documentation. [zupo]0.1a1 (2010-08-26)Initial release. [zupo]
zopeskel.unis
IntroductionThis egg contains some paste templates to help to build a Plone architecture with as little knowledge as possible about Python and Plone. The first target is Debian Lenny up-to-date with the lenny-backports repository enabled. In a second time Debian Squeeze and Ubuntu LTS should be added. No ReadHat, Suse, Mandriva, or any RPM-based linux is on the roadmap.The docs directory contains all necessary steps about server configuration before installing this egg. These documents can be distributed separately under the specified license in each of them.These templates was initiated by the UNIS Team of the ENS de Lyon <[email protected]> and by Quadra Informatique <[email protected]>.The CECILL-B license is a BSD like license. The english and the french version are available in this directory. If you want to make patch or to send us a success story you can use the mail addresses above.UNIS Skels UsageSkels allows you to quickly configure a new project following its need. For the next steps you only need a normal account user. The only steps you need to to as superuser are reconfiguring and restarting the proxy (apache or nginx) that runs on the port 80.Project preparationcd /opt/python-envs mkdir project cd project /opt/python/python-2.6/bin/virtualenv --distribute --no-site-packages . source bin/activateAt this step verify that your Python interpreter is a python 2.6$pythonPython2.6.6(r266:84292,Nov92010,04:51:52)...Now you can install our architecture dependencies for Plone 4easy_installpython-ldapeasy_installpsycopg2easy_installlxml==2.2.8easy_installcelementtreeeasy_installzopeskel.unisYou can check if the new buildout template is well installed by typing the following command:pastercreate--list-templatesAvailabletemplates:...unis_plone4_buildout:AbuildoutforPlone4.xYour new Plone easy installer is ready. You can create a new Plone 4 project.pastercreate-tunis_plone4_buildoutWhat can you configure in the easy mode:buildout directory name (‘builout’ or deployement)the main domain name use for the proxythe id of the Plone site (‘site’ or ‘Plone’)the Plone version (above 4)shared blobs files between zope instances (you should say yes if all instances are on the same server)the ports starting value for all services (we reserve at least 15 ports)install LDAP aware products (python-ldap, PloneLDAP)install CAS aware products (CAS4PAS, collective.castle)install Metnav products (metnav, enslyon.existda)Changelog1.14 2012-12-17Unpin old versions [encolpe]Add a switch for plone IDE [encolpe]1.13 2012-12-17Fix how customer name is added in the project path [encolpe]Remove ploneIDE automatic installation [encolpe]1.12 2012-05-04Fix collective.developermanual checkout using the readonly address for the git repository [encolpe]1.11 2012-03-10synchronize with internal developments [encolpe]Add PloneIDE [encolpe]1.10 2011-10-27Force to use zopeskel<3.0a1 in setup.py [edegoute]1.9 2011-07-28Fix HAProxy configuration [encolpe]1.8 2011-05-02Add a test file for the Hudson server [encolpe]Fix the typo in DSN condition [encolpe]1.7 2011-04-20Update Plone default version to 4.0.5 [encolpe]Fix postgres and oracle DSN [encolpe]1.6 2010-01-27Add zopepy, i18ndude, test and zopeskel parts from the new plone4_buildout template in ZopeSkel 1.19. [encolpe]Add ldap, cas and relstorage options [encolpe]Fix license in setup.py [encolpe]Add paster template usage in documentation [encolpe]Add correct classifiers for pypi [encolpe]1.5 2010-01-07Fix documentation errors [encolpe]1.4 2010-12-23bugfix release [encolpe]1.3 2010-12-23complete the easy mode [encolpe]1.2 2010-12-22Complete installation documentation for Debian Lenny [encolpe]1.1 2010-11-10Add usage documentation in the package description [encolpe]1.0 2010-11-10Initial release [encolpe]
zope.sqlalchemy
IntroductionRunning the testsUsage in shortFull ExampleLong-lasting session scopesDevelopment versionChanges3.1 (2023-09-12)3.0 (2023-06-01)2.0 (2023-02-06)1.6 (2021-09-06)1.5 (2021-07-14)1.4 (2021-04-26)1.3 (2020-02-17)1.2 (2019-10-17)1.1 (2019-01-03)1.0 (2018-01-31)0.7.7 (2016-06-23)0.7.6 (2015-03-20)0.7.5 (2014-06-17)0.7.4 (2014-01-06)0.7.3 (2013-09-25)0.7.2 (2013-02-19)0.7.1 (2012-05-19)0.7 (2011-12-06)0.6.1 (2011-01-08)0.6 (2010-07-24)0.5 (2010-06-07)0.4 (2009-01-20)0.3 (2008-07-29)0.2 (2008-06-28)0.1 (2008-05-15)IntroductionThe aim of this package is to unify the plethora of existing packages integrating SQLAlchemy with Zope’s transaction management. As such it seeks only to provide a data manager and makes no attempt to define azopeishway to configure engines.For WSGI applications, Zope style automatic transaction management is available withrepoze.tm2(used byTurbogears 2and other systems).This package is also used bypyramid_tm(an add-on of thePyramid) web framework.You need to understandSQLAlchemyand theZope transaction managerfor this package and this README to make any sense.Running the testsThis package is distributed as a buildout. Using your desired python run:$ python bootstrap.py $ ./bin/buildoutThis will download the dependent packages and setup the test script, which may be run with:$ ./bin/testor with the standard setuptools test command:$ ./bin/py setup.py testTo enable testing with your own database set the TEST_DSN environment variable to your sqlalchemy database dsn. Two-phase commit behaviour may be tested by setting the TEST_TWOPHASE variable to a non empty string. e.g:$ TEST_DSN=postgres://test:test@localhost/test TEST_TWOPHASE=True bin/testUsage in shortThe integration between Zope transactions and the SQLAlchemy event system is done using theregister()function on the session factory class.fromzope.sqlalchemyimportregisterfromsqlalchemyimportcreate_enginefromsqlalchemy.ormimportsessionmaker,scoped_sessionengine=sqlalchemy.create_engine("postgresql://scott:tiger@localhost/test")DBSession=scoped_session(sessionmaker(bind=engine))register(DBSession)Instantiated sessions commits and rollbacks will now be integrated with Zope transactions.importtransactionfromsqlalchemy.sqlimporttextsession=DBSession()result=session.execute(text("DELETE FROM objects WHERE id=:id"),{"id":2})row=result.fetchone()transaction.commit()Full ExampleThis example is lifted directly from the SQLAlchemy declarative documentation. First the necessary imports.>>> from sqlalchemy import * >>> from sqlalchemy.orm import declarative_base, scoped_session, sessionmaker, relationship >>> from sqlalchemy.sql import text >>> from zope.sqlalchemy import register >>> import transactionNow to define the mapper classes.>>> Base = declarative_base() >>> class User(Base): ... __tablename__ = 'test_users' ... id = Column('id', Integer, primary_key=True) ... name = Column('name', String(50)) ... addresses = relationship("Address", backref="user") >>> class Address(Base): ... __tablename__ = 'test_addresses' ... id = Column('id', Integer, primary_key=True) ... email = Column('email', String(50)) ... user_id = Column('user_id', Integer, ForeignKey('test_users.id'))Create an engine and setup the tables. Note that for this example to work a recent version of sqlite/pysqlite is required. 3.4.0 seems to be sufficient.>>> engine = create_engine(TEST_DSN) >>> Base.metadata.create_all(engine)Now to create the session itself. As zope is a threaded web server we must use scoped sessions. Zope and SQLAlchemy sessions are tied together by using the register>>> Session = scoped_session(sessionmaker(bind=engine, ... twophase=TEST_TWOPHASE))Call the scoped session factory to retrieve a session. You may call this as many times as you like within a transaction and you will always retrieve the same session. At present there are no users in the database.>>> session = Session() >>> register(session) <zope.sqlalchemy.datamanager.ZopeTransactionEvents object at ...> >>> session.query(User).all() []We can now create a new user and commit the changes using Zope’s transaction machinery, just as Zope’s publisher would.>>> session.add(User(id=1, name='bob')) >>> transaction.commit()Engine level connections are outside the scope of the transaction integration.>>> engine.connect().execute(text('SELECT * FROM test_users')).fetchall() [(1, ...'bob')]A new transaction requires a new session. Let’s add an address.>>> session = Session() >>> bob = session.query(User).all()[0] >>> str(bob.name) 'bob' >>> bob.addresses [] >>> bob.addresses.append(Address(id=1, email='[email protected]')) >>> transaction.commit() >>> session = Session() >>> bob = session.query(User).all()[0] >>> bob.addresses [<Address object at ...>] >>> str(bob.addresses[0].email) '[email protected]' >>> bob.addresses[0].email = 'wrong@wrong'To rollback a transaction, use transaction.abort().>>> transaction.abort() >>> session = Session() >>> bob = session.query(User).all()[0] >>> str(bob.addresses[0].email) '[email protected]' >>> transaction.abort()By default, zope.sqlalchemy puts sessions in an ‘active’ state when they are first used. ORM write operations automatically move the session into a ‘changed’ state. This avoids unnecessary database commits. Sometimes it is necessary to interact with the database directly through SQL. It is not possible to guess whether such an operation is a read or a write. Therefore we must manually mark the session as changed when manual SQL statements write to the DB.>>> session = Session() >>> conn = session.connection() >>> users = Base.metadata.tables['test_users'] >>> conn.execute(users.update().where(users.c.name=='bob'), {'name': 'ben'}) <sqlalchemy.engine... object at ...> >>> from zope.sqlalchemy import mark_changed >>> mark_changed(session) >>> transaction.commit() >>> session = Session() >>> str(session.query(User).all()[0].name) 'ben' >>> transaction.abort()If this is a problem you may register the events and tell them to place the session in the ‘changed’ state initially.>>> Session.remove() >>> register(Session, 'changed') <zope.sqlalchemy.datamanager.ZopeTransactionEvents object at ...> >>> session = Session() >>> conn = session.connection() >>> conn.execute(users.update().where(users.c.name=='ben'), {'name': 'bob'}) <sqlalchemy.engine... object at ...> >>> transaction.commit() >>> session = Session() >>> str(session.query(User).all()[0].name) 'bob' >>> transaction.abort()Themark_changedfunction accepts a kwarg forkeep_sessionwhich defaults toFalseand is unaware of the registered extensionskeep_sessionconfiguration.If you intend forkeep_sessionto be True, you can specify it explicitly:>>> from zope.sqlalchemy import mark_changed >>> mark_changed(session, keep_session=True) >>> transaction.commit()You can also use a configured extension to preserve this argument:>>> sessionExtension = register(session, keep_session=True) >>> sessionExtension.mark_changed(session) >>> transaction.commit()Long-lasting session scopesThe default behaviour of the transaction integration is to close the session after a commit. You can tell by trying to access an object after committing:>>> bob = session.query(User).all()[0] >>> transaction.commit() >>> bob.name Traceback (most recent call last): sqlalchemy.orm.exc.DetachedInstanceError: Instance <User at ...> is not bound to a Session; attribute refresh operation cannot proceed...To support cases where a session needs to last longer than a transaction (useful in test suites) you can specify to keep a session when registering the events:>>> Session = scoped_session(sessionmaker(bind=engine, ... twophase=TEST_TWOPHASE)) >>> register(Session, keep_session=True) <zope.sqlalchemy.datamanager.ZopeTransactionEvents object at ...> >>> session = Session() >>> bob = session.query(User).all()[0] >>> bob.name = 'bobby' >>> transaction.commit() >>> bob.name 'bobby'The session must then be closed manually:>>> session.close()Development versionGIT versionChanges3.1 (2023-09-12)Fixpsycopg.errors.OperationalError.sqlstatecan beNone. (#81)3.0 (2023-06-01)Add support for SQLAlchemy 2.0 and for new psycopg v3 backend. (#79)Breaking ChangesNo longer allow callingsession.commit()within a manual nested database transaction (a savepoint). If you want to use savepoints directly in code that is not aware oftransaction.savepoint()withsession.begin_nested()then use the savepoint returned by the function to commit just the nested transaction i.e.savepoint =session.begin_nested();savepoint.commit()or use it as a context manager i.e.withsession.begin_nested():. (for details see #79)2.0 (2023-02-06)Drop support for Python 2.7, 3.5, 3.6.Drop support forSQLAlchemy < 1.1(#65)Add support for Python 3.10, 3.11.1.6 (2021-09-06)Add support for Python 2.7 on SQLAlchemy 1.4. (#71)1.5 (2021-07-14)Callmark_changedalso on thedo_orm_executeevent if the operation is an insert, update or delete. This is SQLAlchemy >= 1.4 only, as it introduced that event. (#67)Fixup get transaction. There was regression introduced in 1.4. (#66)1.4 (2021-04-26)Addmark_changedandjoin_transactionmethods toZopeTransactionEvents. (#46)Reduce DeprecationWarnings with SQLAlchemy 1.4 and require at least SQLAlchemy >= 0.9. (#54)Add support for SQLAlchemy 1.4. (#58)Prevent using an SQLAlchemy 1.4 version with broken flush support. (#57)1.3 (2020-02-17).datamanager.register()now returns theZopeTransactionEventsinstance which was used to register the events. This allows to change its parameters afterwards. (#40)Add preliminary support for Python 3.9a3.1.2 (2019-10-17)Breaking ChangesDrop support for Python 3.4.Add support for Python 3.7 and 3.8.Fix deprecation warnings for the event system. We already used it in general but still leveraged the old extension mechanism in some places. (#31)To make things clearer we renamed theZopeTransactionExtensionclass toZopeTransactionEvents. Existing code using the ‘register’ version stays compatible.Upgrade from 1.1Your old code like this:fromzope.sqlalchemyimportZopeTransactionExtensionDBSession=scoped_session(sessionmaker(extension=ZopeTransactionExtension(),**options))becomes:fromzope.sqlalchemyimportregisterDBSession=scoped_session(sessionmaker(**options))register(DBSession)1.1 (2019-01-03)Add support to MySQL using pymysql.1.0 (2018-01-31)Add support for Python 3.4 up to 3.6.Support SQLAlchemy 1.2.Drop support for Python 2.6, 3.2 and 3.3.Drop support for transaction < 1.6.0.Fix hazard that could cause SQLAlchemy session not to be committed when transaction is committed in rare situations. (#23)0.7.7 (2016-06-23)Support SQLAlchemy 1.1. (#15)0.7.6 (2015-03-20)Make version check in register compatible with prereleases.0.7.5 (2014-06-17)Ensure mapped objects are expired following atransaction.commit()when no database commit was required. (#8)0.7.4 (2014-01-06)Allowsession.commit()on nested transactions to facilitate integration of existing code that might not usetransaction.savepoint(). (#1)Add a new function zope.sqlalchemy.register(), which replaces the direct use of ZopeTransactionExtension to make use of the newer SQLAlchemy event system to establish instrumentation on the given Session instance/class/factory. Requires at least SQLAlchemy 0.7. (#4)Fixkeep_session=Truedoesn’t work when a transaction is joined by flush and other manngers bug. (#5)0.7.3 (2013-09-25)Prevent theSessionobject from getting into a “wedged” state if joining a transaction fails. With thread scoped sessions that are reused this can cause persistent errors requiring a server restart. (#2)0.7.2 (2013-02-19)Make life-time of sessions configurable. Specifykeep_session=Truewhen setting up the SA extension.Python 3.3 compatibility.0.7.1 (2012-05-19)Use@implementeras a class decorator instead ofimplements()at class scope for compatibility withzope.interface4.0. This requireszope.interface>= 3.6.0.0.7 (2011-12-06)Python 3.2 compatibility.0.6.1 (2011-01-08)Update datamanager.mark_changed to handle sessions which have not yet logged a (ORM) query.0.6 (2010-07-24)Implement should_retry for sqlalchemy.orm.exc.ConcurrentModificationError and serialization errors from PostgreSQL and Oracle. (Specify transaction>=1.1 to use this functionality.)Include license files.Addtransaction_managerattribute to data managers for compliance with IDataManager interface.0.5 (2010-06-07)Remove redundant session.flush() / session.clear() on savepoint operations. These were only needed with SQLAlchemy 0.4.x.SQLAlchemy 0.6.x support. Require SQLAlchemy >= 0.5.1.Add support for runningpython setup.py test.Pull in pysqlite explicitly as a test dependency.Setup sqlalchemy mappers in test setup and clear them in tear down. This makes the tests more robust and clears up the global state after. It caused the tests to fail when other tests in the same run called clear_mappers.0.4 (2009-01-20)Bugs fixed:Only raise errors in tpc_abort if we have committed.Remove the session id from the SESSION_STATE just before we de-reference the session (i.e. all work is already successfuly completed). This fixes cases where the transaction commit failed but SESSION_STATE was already cleared. In those cases, the transaction was wedeged as abort would always error. This happened on PostgreSQL where invalid SQL was used and the error caught.Call session.flush() unconditionally in tpc_begin.Change error message on session.commit() to be friendlier to non zope users.Feature changes:Support for bulk update and delete with SQLAlchemy 0.5.10.3 (2008-07-29)Bugs fixed:New objects added to a session did not cause a transaction join, so were not committed at the end of the transaction unless the database was accessed. SQLAlchemy 0.4.7 or 0.5beta3 now required.Feature changes:For correctness and consistency with ZODB, renamed the function ‘invalidate’ to ‘mark_changed’ and the status ‘invalidated’ to ‘changed’.0.2 (2008-06-28)Feature changes:Updated to support SQLAlchemy 0.5. (0.4.6 is still supported).0.1 (2008-05-15)Initial public release.
zope.structuredtext
zope.structuredtextThis package provides a parser and renderers for the classic Zope “structured text” markup dialect (STX). STX is a plain text markup in which document structure is signalled primarily by indentationPlease seehttps://zopestructuredtext.readthedocs.org/for documentation.Changes5.0 (2023-05-09)Drop support for Python 2.7, 3.5, 3.6.Drop support for deprecatedpython setup.py test.Add support for Python 3.11.4.4 (2022-03-18)Add support for Python 3.8, 3.9 and 3.10.Drop support for Python 3.4.4.3 (2018-10-09)Add support for Python 3.7.4.2.0 (2017-09-05)Add support for Python 3.5 and 3.6.Drop support for Python 2.6 and 3.3.Add support for PyPy and PyPy3.Support several new elements (inner and named links, underlines, etc) in the docbook writer.Fix the XML output ofDocBookBook.100% test coverage, maintained by CI and tox.Unused internal code in thestdommodule was removed. Seeissue 3.4.1.0 (2014-12-29)Drop dependency onsix.Add support for Python 3.4.Add support for testing on Travis.4.0.0 (2013-02-25)Add support for Python 3.3.Drop support for Python 2.4 and 2.5.3.5.1 (2010-12-03)Remove antique copyright assertions in regression texts, in conformance with repository policy.3.5.0 (2010-04-30)Update docs to conform to ZTK / Sphinx usage.LP #120376: Output valid html for non-ASCII characters.3.4.0 (2007/09/01)Public release for completeness of Zope 3.4.3.2.0 (2006/01/05)Corresponds to the verison of thezope.structuredtextpackage shipped as part of the Zope 3.2.0 release.Only coding style / documentation changes.3.0.0 (2004/11/07)Corresponds to the verison of thezope.structuredtextpackage shipped as part of the Zope X3.0.0 release.
zope.tal
zope.talThe Zope3 Template Attribute Languate (TAL) specifies the custom namespace and attributes which are used by the Zope Page Templates renderer to inject dynamic markup into a page. It also includes the Macro Expansion for TAL (METAL) macro language used in page assembly.The dynamic values themselves are specified using a companion language, TALES (see thezope.talespackage for more).The reference documentation for the TAL language is available athttps://pagetemplates.readthedocs.io/en/latest/tal.htmlDetailed documentation for this implementation and its API is available athttps://zopetal.readthedocs.io/Changes5.0.1 (2023-01-23)Add missingpython_requirestosetup.py.5.0 (2023-01-19)Add support for Python 3.11.Drop support for Python 2.7, 3.5, 3.6.Add support for Python 3.10.Addnavto the list of HTML block level elements. (#18)Remove.talgettext.UpdatePOEngineand the ability to callzope/tal/talgettext.py(main function). The code was broken and unused.Remove support to run the tests using deprecatedpython setup.py test.4.5 (2021-05-28)Avoid traceback reference cycle inTALInterpreter.do_onError_tal.Add support for Python 3.8 and 3.9.Drop support for Python 3.4.4.4 (2018-10-05)Add support for Python 3.7.4.3.1 (2018-03-21)Host documentation athttps://zopetal.readthedocs.ioFix aNameErroron Python 3 in talgettext.py affecting i18ndude. Seehttps://github.com/zopefoundation/zope.tal/pull/114.3.0 (2017-08-08)Drop support for Python 3.3.Add support for Python 3.6.4.2.0 (2016-04-12)Drop support for Python 2.6 and 3.2.Accept and ignorei18n:ignoreandi18n:ignore-attributesattributes. For compatibility with other tools (such asi18ndude).Add support for Python 3.5.4.1.1 (2015-06-05)Suppress deprecation under Python 3.4 for defaultconvert_charrefsargument (passed toHTMLParser). Also ensures that upcoming change to the default in Python 3.5 will not affect us.Add support for Python 3.2 and PyPy3.4.1.0 (2014-12-19)NoteSupport for PyPy3 is pending release of a fix for:https://bitbucket.org/pypy/pypy/issue/1946Add support for Python 3.4.Add support for testing on Travis.4.0.0 (2014-01-13)Fix possible UnicodeDecodeError in warning when msgid already exists.4.0.0a1 (2013-02-15)Replace deprecatedzope.interface.implementsusage with equivalentzope.interface.implementerdecorator.Add support for Python 3.3 and PyPy.Drop support for Python 2.4 and 2.5.Output attributes generate viatal:attributesandi18n:attributesdirectives in alphabetical order.3.6.1 (2012-03-09)Avoid handling end tags within <script> tags in the HTML parser. This works aroundhttp://bugs.python.org/issue670664Fix documentation link in README.txt.3.6.0 (2011-08-20)Updatetalinterpreter.FasterStringIOto faster list-based implementation.Increase the default value of thewrapargument from 60 to 1023 characters, to avoid extra whitespace and line breaks.Fix printing of error messages for msgid conflict with non-ASCII texts.3.5.2 (2009-10-31)Intalgettext.POEngine.translate, print a warning if a msgid already exists in the domain with a different default.3.5.1 (2009-03-08)Update tests of “bad” entities for compatibility with the stricter HTMLParser module shipped with Python 2.6.x.3.5.0 (2008-06-06)Remove artificial addition of a trailing newline if the output doesn’t end in one; this allows the template source to be the full specification of what should be included. (Seehttps://bugs.launchpad.net/launchpad/+bug/218706.)3.4.1 (2007-11-16)Remove unnecessarydummyenginedependency on zope.i18n to simplify distribution. Thedummyengine.DummyTranslationDomainclass no longer implementszope.i18n.interfaces.ITranslationDomainas a result. Installing zope.tal with easy_install or buildout no longer pulls in many unrelated distributions.Support running tests usingsetup.py test.Stop pinning (no longer required)zope.traversingandzope.app.publisherversions in buildout.cfg.3.4.0 (2007-10-03)Update package meta-data.3.4.0b1Update dependency onzope.i18nto a verions requiring the correct version ofzope.security, avoiding a hidden dependency issue inzope.security.NoteChanges before 3.4.0b1 where not tracked as an individual package and have been documented in the Zope 3 changelog.
zope.tales
zope.taleszope.tales(Template Attribute Language - Expression Syntax) is an expression language designed to work withzope.tal(although it can be used independently). The two are integrated to produce page templates inzope.pagetemplate.The specification for TAL and TALES can be found athttps://pagetemplates.readthedocs.io/en/latest/Documentation on this implementation and its API can be found athttps://zopetales.readthedocs.io/Changes6.0 (2023-07-12)Drop support for Python 2.7, 3.5, 3.6.Add support for Python 3.11.5.2 (2022-08-24)Add support for Python 3.9, 3.10.Fix error message raised if the first element of a path expression is not a valid name.5.1 (2020-07-06)Packaging and test configuration cleanups.ImprovePathExprreusability Provide customizable support for the use of builtins in path expressions (#23).5.0.2 (2020-03-27)Cleanups for Plone 5.2:in path alternatives, whitespace can now surround|,non-ASCII inSubPathExprnow raises aCompilerError(instead of aUnicodeEncodeError; to be compatible with thechameleontemplate engine).5.0.1 (2019-06-26)Fix problem with list comprehensions not working in Python 3. This was due to the code not detecting variables used in side those expressions properly.5.0 (2019-04-08)Drop support for Python 3.4.Fix test failures and deprecation warnings occurring when using Python 3.8a1. (#15)Flake8 the code.4.3 (2018-10-05)Add support for Python 3.7.Host documentation athttps://zopetales.readthedocs.io4.2.0 (2017-09-22)Add support for Python 3.5 and 3.6.Drop support for Python 2.6, 3.2 and 3.3.Drop support forpython setup.py test.Reach 100% test coverage and maintain it via tox.ini and Travis CI.4.1.1 (2015-06-06)Add support for Python 3.2 and PyPy3.4.1.0 (2014-12-29)NoteSupport for PyPy3 is pending release of a fix for:https://bitbucket.org/pypy/pypy/issue/1946Add support for Python 3.4.Add support for testing on Travis.4.0.2 (2013-11-12)Add missingsixdependency4.0.1 (2013-02-22)Fix a previously untested Python 3.3 compatibility problem.4.0.0 (2013-02-14)Remove hard dependency onzope.tal, which was already conditionalized but required viasetup.py.Add support for Python 3.3 and PyPy.Replace deprecatedzope.interface.implementsusage with equivalentzope.interface.implementerdecorator.Drop support for Python 2.4 and 2.5.Fix documentation link in README.txt3.5.2 (2012-05-23)Subexpressions of a ‘string:’ expression can be only path expressions.https://bugs.launchpad.net/zope.tales/+bug/10022423.5.1 (2010-04-30)Remove use ofzope.testing.doctestunitin favor of stdlib’s ‘doctest.3.5.0 (2010-01-01)Port the lazy expression fromProducts.PageTemplates.3.4.0 (2007-10-03)Update package setup.Initial release outside the Zope 3 trunk.3.2.0 (2006-01-05)Corresponds to the verison of the zope.tales package shipped as part of the Zope 3.2.0 release.Documentation / test fixes.3.0.0 (2004-11-07)Corresponds to the verison of the zope.tales package shipped as part of the Zope X3.0.0 release.
zope.testbrowser
zope.testbrowserprovides an easy-to-use programmable web browser with special focus on testing. It is used in Zope, but it’s not Zope specific at all. For instance, it can be used to test or otherwise interact with any web site.Documentation is available at:https://zopetestbrowser.readthedocs.orgCHANGES6.0 (2023-03-27)Drop support for Python 2.7, 3.5, 3.6.Drop support for deprecatedpython setup.py test.Add support for Python 3.11.Do not break inmechReprwhen using<inputtype="date">.5.6.1 (2022-01-21)Ensure all objects have consistent resolution orders.5.6.0 (2022-01-21)Add support for Python 3.9 and 3.10.5.5.1 (2019-11-12)Stop sending aRefererheader whenbrowser.openorbrowser.postis called directly. Seeissue 87.Add error checking to the setters forListControl.displayValueandCheckboxListControl.displayValue: in line with the oldmechanize-based implementation, these will now raiseItemNotFoundErrorif any of the given values are not found, orItemCountErroron trying to set more than one value on a single-valued control. Seeissue 44.Fix AttributeError inadd_filewhen trying to add to a control which is not a file upload.5.5.0 (2019-11-11)Fix a bug wherebrowser.goBack()did not invalidate caches, so subsequent queries could use data from the wrong response. Seeissue 83.Support telling the browser not to follow redirects by settingBrowser.follow_redirectsto False. Seeissue 79.5.4.0 (2019-11-01)Fix a bug where browser.reload() would not follow redirects or raise exceptions for bad HTTP statuses. Seeissue 75.Add Python 3.8 support. Seeissue 80.5.3.3 (2019-07-02)Fix a bug where clicking the selected radio button would unselect it. Seeissue 68.Fix another incompatibility with BeautifulSoup4 >= 4.7 that could result in a SyntaxError from browser.getLink(). Seeissue 61.5.3.2 (2019-02-06)Fix an incompatibility with BeautifulSoup4 >= 4.7 that could result in a SyntaxError from browser.getControl(). Seeissue 61.Fix a bug where you couldn’t set a cookie expiration date when your locale was not English. Seeissue 65.Fix narrative doctests that started failing on January 1st, 2019 due to a hardcoded “future” date. Seeissue 62.5.3.1 (2018-10-23)Fix aDeprecationWarningon Python 3. Seeissue 51.5.3.0 (2018-10-10)Add support for Python 3.7.Drop support for Python 3.3 and 3.4.Drop support for pystone as Python 3.7 dropped pystone. SoBrowser.lastRequestPystonesno longer exists. Rename.browser.PystoneTimerto.browser.Timer.FixmechReprof CheckboxListControl to always return a native str. (https://github.com/zopefoundation/zope.testbrowser/pull/46).AddmechReprto input fields having the typeemail. (https://github.com/zopefoundation/zope.testbrowser/pull/47).5.2.4 (2017-11-24)Fix form submit with GET method if the form action contains a query string (https://github.com/zopefoundation/zope.testbrowser/pull/42).Restore ignoring hidden elements when searching by label (https://github.com/zopefoundation/zope.testbrowser/pull/41).5.2.3 (2017-10-18)FixmechRepron controls to always return a native str (https://github.com/zopefoundation/zope.testbrowser/issues/38).5.2.2 (2017-10-10)Restore raising of AttributeError when trying to set value of a read only control.Fix selecting radio and select control options by index (https://github.com/zopefoundation/zope.testbrowser/issues/31).5.2.1 (2017-09-01)Exclude version 2.0.27 ofWebTestfrom allowed versions as it breaks some tests.Adapt tests to version 2.0.28 ofWebTestbut keeping compatibility to older versions.5.2 (2017-02-25)FixedtoStrto handle lists, for example a list of class names. [maurits]Fixed browser to only follow redirects for HTTP statuses 301, 302, 303, and 307; not other 30x statuses such as 304.Fix passing a real file toadd_file.Addcontrolsproperty to Form class to list all form controls.Restore the ability to use parts of the actually displayed select box titles.Allow to set a string value instead of a list onBrowser.displayValue.Fix setting empty values on a select control.Support Python 3.6, PyPy2.7 an PyPy3.3.5.1 (2017-01-31)Alias.browser.urllib_request.HTTPErrorto.browser.HTTPErrorto have a better API.5.0.0 (2016-09-30)Converted most doctests to Sphinx documentation, and published tohttps://zopetestbrowser.readthedocs.io/.Internal implementation now uses WebTest instead ofmechanize. Themechanizedependency is completely dropped.This is a backwards-incompatible change.Remove APIs:zope.testbrowser.testing.Browser(this is a big one).Instead of usingzope.testbrowser.testing.Browser()and relying on it to magically pick up thezope.app.testing.functionalsingleton application, you now have to define a test layer inheriting fromzope.testbrowser.wsgi.Layer, overrride themake_wsgi_appmethod to create a WSGI application, and then usezope.testbrowser.wsgi.Browser()in your tests.(Or you can set up a WSGI application yourself in whatever way you like and pass it explicitly tozope.testbrowser.browser.Browser(wsgi_app=my_app).)Example: if your test file looked like this# my/package/tests.py from zope.app.testing.functional import defineLayer from zope.app.testing.functional import FunctionalDocFileSuite defineLayer('MyFtestLayer', 'ftesting.zcml', allow_teardown=True) def test_suite(): suite = FunctionalDocFileSuite('test.txt', ...) suite.layer = MyFtestLayer return suitenow you’ll have to use# my/package/tests.py from unittest import TestSuite import doctest import zope.app.wsgi.testlayer import zope.testbrowser.wsgi class Layer(zope.testbrowser.wsgi.TestBrowserLayer, zope.app.wsgi.testlayer.BrowserLayer): """Layer to prepare zope.testbrowser using the WSGI app.""" layer = Layer(my.package, 'ftesting.zcml', allowTearDown=True) def test_suite(): suite = doctest.DocFileSuite('test.txt', ...) suite.layer = layer return suiteand then change all your tests from>>> from zope.testbrowser.testing import Browserto>>> from zope.testbrowser.wsgi import BrowserMaybe the blog postGetting rid of zope.app.testingcould help you adapting to this new version, too.Remove modules:zope.testbrowser.connectionRemove internal classes you were not supposed to use anyway:zope.testbrowser.testing.PublisherResponsezope.testbrowser.testing.PublisherConnectionzope.testbrowser.testing.PublisherHTTPHandlerzope.testbrowser.testing.PublisherMechanizeBrowserzope.testbrowser.wsgi.WSGIConnectionzope.testbrowser.wsgi.WSGIHTTPHandlerzope.testbrowser.wsgi.WSGIMechanizeBrowserRemove internal attributes you were not supposed to use anyway (this list is not necessarily complete):Browser._mech_browserRemove setuptools extras:zope.testbrowser[zope-functional-testing]Changed behavior:The testbrowser no longer follows HTML redirects aka<metahttp-equiv="refresh"... />. This was amechanizefeature which does not seem to be provided byWebTest.Add support for Python 3.3, 3.4 and 3.5.Drop support for Python 2.5 and 2.6.Drop theWebTest <= 1.3.4pin. We requireWebTest >= 2.0.8now.Remove dependency on deprecatedzope.app.testing.Bugfix:browser.getLink()could fail if your HTML contained<a>elements with no href attribute (https://github.com/zopefoundation/zope.testbrowser/pull/3).4.0.3 (2013-09-04)pinning version ‘WebTest <= 1.3.4’, because of some incompatibility and test failuresMake zope.testbrowser installable via pip (https://github.com/zopefoundation/zope.testbrowser/issues/6).WhenBrowser.handleErrorsis False, also addx-wsgiorg.throw_errorsto the environment.http://wsgi.org/wsgi/Specifications/throw_errorsPrevent WebTest from always sendingpaste.throw_errors=Truein the environment by setting it toNonewhenBrowser.handleErrorsisTrue. This makes it easier to test error pages.Make Browser.submit() handleraiseHttpErrors(https://github.com/zopefoundation/zope.testbrowser/pull/4).More friendly error messages from getControl() et al:when you specify an index that is out of bounds, show the available choiceswhen you fail to find anything, show all the available items4.0.2 (2011-05-25)Remove test dependency on zope.pagetemplate.4.0.1 (2011-05-04)Add a hint in documentation how to usezope.testbrowser.wsgi.Browserto test a Zope 2/Zope 3/Bluebream WSGI application.4.0.0 (2011-03-14)LP #721252: AmbiguityError now shows all matching controls.Integrate with WebTest.zope.testbrowser.wsgi.Browseris aBrowserimplementation that useswebtest.TestAppto drive a WSGI application. This this replaces the wsgi_intercept support added in 3.11.Re-write the test application as a pure WSGI application using WebOb. Run the existing tests using the WebTest based BrowserMove zope.app.testing based Browser intozope.app.testing(leaving backwards compatibility imports in-place). Released inzope.app.testing3.9.0.3.11.1 (2011-01-24)Fixing brown bag release 3.11.0.3.11.0 (2011-01-24)Addwsgi_interceptsupport (came fromzope.app.wsgi.testlayer).3.10.4 (2011-01-14)Move the over-the-wire.txt doctest out of the TestBrowserLayer as it doesn’t need or use it.Fix test compatibility with zope.app.testing 3.8.1.3.10.3 (2010-10-15)Fixed backwards compatibility withzope.app.wsgi.testlayer.3.10.2 (2010-10-15)Fixed Python 2.7 compatibility in Browser.handleErrors.3.10.1 (2010-09-21)Fixed a bug that caused theBrowserto keep it’s previouscontentsThe places are: - Link.click() - SubmitControl.click() - ImageControl.click() - Form.submit()Also adjusted exception messages at the above places to match pre version 3.4.1 messages.3.10.0 (2010-09-14)LP #98437: usemechanize’s built-insubmit()to submit forms, allowingmechanizeto set the “Referer:” (sic) header appropriately.Fixed tests to run withzope.app.testing3.8 and above.3.9.0 (2010-05-17)LP #568806: Update dependencymechanize >= 0.2.0, which now includes theClientFormAPIs. Remove use ofurllib2APIs (incompatible withmechanize 0.2.0) in favor ofmechanizeequivalents. Thanks to John J. Lee for the patch.Use stdlibdoctestmodule, instead ofzope.testing.doctest.Caution:This version is no longer fully compatible with Python 2.4:handleErrors = Falseno longer works.3.8.1 (2010-04-19)Pin dependency onmechanizeto prevent use of the upcoming 0.2.0 release before we have time to adjust to its API changes.Fix LP #98396: testbrowser resolves relative URLs incorrectly.3.8.0 (2010-03-05)Addfollowconvenience method which gets and follows a link.3.7.0 (2009-12-17)Movezope.app.testingdependency into the scope of thePublisherConnectionclass. Zope2 specifies its own version ofPublisherConnectionwhich isn’t dependent onzope.app.testing.Fix LP #419119: returnNonewhen the browser has no contents instead of raising an exception.3.7.0a1 (2009-08-29)Update dependency fromzope.app.publishertozope.browserpage,zope.browserresourceandzope.ptresource.Remove dependencies onzope.app.principalannotationandzope.securitypolicyby using the simplePermissiveSecurityPolicy.Replace the testing dependency onzope.app.zcmlfileswith explicit dependencies of a minimal set of packages.Remove unneededzope.app.authenticationfrom ftesting.zcml.Update dependency fromzope.app.securitypolicytozope.securitypolicy.3.6.0a2 (2009-01-31)Update dependency fromzope.app.foldertozope.site.folder.Remove unnecessary test dependency inzope.app.component.3.6.0a1 (2009-01-08)Update author e-mail tozope-devrather thanzope3-dev.No longer strip newlines in XML and HTML code contained in a<textarea>; fix requires ClientForm >= 0.2.10 (LP #268139).Addcookiesattribute to browser for easy manipulation of browser cookies. See brief example in main documentation, plus newcookies.txtdocumentation.3.5.1 (2008-10-10)Work around for amechanize/urllib2bug on Python 2.6 missingtimeoutattribute onRequestbase class.Work around for amechanize/urllib2bug in creating request objects that won’t handle fragment URLs correctly.3.5.0 (2008-03-30)Add azope.testbrowser.testing.Browser.postmethod that allows tests to supply a body and a content type. This is handy for testing Ajax requests with non-form input (e.g. JSON).Remove vendor import ofmechanize.Fix bug that caused HTTP exception tracebacks to differ between version 3.4.0 and 3.4.1.Work around a bug in PythonCookie.SimpleCookiewhen handling unicode strings.Fix bug introduced in 3.4.1 that created incompatible tracebacks in doctests. This necessitated adding a patchedmechanizeto the source tree; patches have been sent to themechanizeproject.Fixhttps://bugs.launchpad.net/bugs/149517by addingzope.interfaceandzope.schemaas real dependenciesFixbrowser.getLinkdocumentation that was not updated since the last API modification.Move tests for fixed bugs to a separate file.Remove non-functional and undocumented code intended to help test servers using virtual hosting.3.4.2 (2007-10-31)ResolveZopeSecurityPolicydeprecation warning.3.4.1 (2007-09-01)Update dependencies tomechanize 0.1.7bandClientForm 0.2.7.Add support for Python 2.5.3.4.0 (2007-06-04)Add the ability to suppress raising exceptions on HTTP errors (raiseHttpErrorsattribute).Make the tests more resilient to HTTP header formatting changes with the REnormalizer.3.4.0a1 (2007-04-22)Initial release as a separate project, corresponds to zope.testbrowser from Zope 3.4.0a1
zope.testing
zope.testingThis package provides a number of testing frameworks.For complete documentation, seehttps://zopetesting.readthedocs.iocleanupProvides a mixin class for cleaning up after tests that make global changes.Seezope.testing.cleanupformparserAn HTML parser that extracts form information.This is intended to support functional tests that need to extract information from HTML forms returned by the publisher.Seezope.testing.formparserloggingsupportSupport for testing logging codeIf you want to test that your code generates proper log output, you can create and install a handler that collects output.Seezope.testing.loggingsupportloghandlerLogging handler for tests that check logging output.Seezope.testing.loghandlermoduleLets a doctest pretend to be a Python module.Seezope.testing.modulerenormalizingRegular expression pattern normalizing output checker. Useful for doctests.Seezope.testing.renormalizingserverProvides a simple HTTP server compatible with the zope.app.testing functional testing API. Lets you interactively play with the system under test. Helpful in debugging functional doctest failures.Python 2 onlySeezope.testing.serversetupstackA simple framework for automating doctest set-up and tear-down.Seezope.testing.setupstackwaitA small utility for dealing with timing non-determinismSeezope.testing.waitdoctestcaseSupport for defining doctests as methods ofunittest.TestCaseclasses so that they can be more easily found by test runners, like nose, that ignore test suites.Seezope.testing.doctestcaseGetting started developing zope.testingzope.testingusestox. To start, installtoxusingpip install tox. Now, runtoxto run thezope.testingtest suite.Changes5.0.1 (2022-12-20)Make wheels no longer universal.5.0 (2022-12-20)Backwards incompatible changesDrop support for Python 2.7, 3.5, 3.6.Drop modules which do not seem to be Python compatible:zope.testing.loghandlerzope.testing.serverDrop doctest optionIGNORE_EXCEPTION_MODULE_IN_PYTHON2.Remove functions:zope.testing.renormalizing.strip_dottedname_from_tracebackzope.testing.renormalizing.is_dotted_nameFeaturesAdd support for Python 3.11.4.10 (2022-03-07)Show deprecation warnings when importing modules which are not ported to Python 3.Improve test coverage.Portzope.testing.formparserto Python 3.Add support for Python 3.10.4.9 (2021-01-08)Makesetupstack.txttest work again if the current directory is empty.4.8 (2021-01-04)Add support for Python 3.8 and 3.9.Drop support for Python 3.3 and 3.4.Extend IGNORE_EXCEPTION_MODULE_IN_PYTHON2 to cover also exceptions without arguments (thus without a colon on the last line of the traceback output).4.7 (2018-10-04)Added support for Python 3.7.4.6.2 (2017-06-12)Remove dependencies onzope.interfaceandzope.exceptions; they’re not used here.Remove use of 2to3 for outdated versions of PyPy3, letting us build universal wheels.4.6.1 (2017-01-04)Add support for Python 3.6.4.6.0 (2016-10-20)Introduce option flagIGNORE_EXCEPTION_MODULE_IN_PYTHON2to normalize exception class names in traceback output. In Python 3 they are displayed as the full dotted name. In Python 2 they are displayed as “just” the class name. When running doctests in Python 3, the option flag will not have any effect, however when running the same test in Python 2, the segments in the full dotted name leading up to the class name are stripped away from the “expected” string.Drop support for Python 2.6 and 3.2.Add support for Python 3.5.Cleaned up useless 2to3 conversion.4.5.0 (2015-09-02)Added meta data for test case methods created withzope.testing.doctestcase.Reasonable values for__name__, making sure that__name__starts withtest.Fordoctestfilemethods, providefilenameandfilepathattributes.The meta data us useful, for example, for selecting tests with the nose attribute mechanism.Addeddoctestcase.doctestfilesDefine multiple doctest files at once.Automatically assign test class members. So rather than:class MYTests(unittest.TestCase): ... test_foo = doctestcase.doctestfile('foo.txt')You can use:@doctestcase.doctestfiles('foo.txt', 'bar.txt', ...) class MYTests(unittest.TestCase): ...4.4.0 (2015-07-16)Addedzope.testing.setupstack.mockas a convenience function for setting up mocks in tests. (The Pythonmockpackage must be in the path for this to work. The excellentmockpackage isn’t a dependency ofzope.testing.)Added the base classzope.testing.setupstack.TestCaseto make it much easier to usezope.testing.setupstackinunittesttest cases.4.3.0 (2015-07-15)Added support for creating doctests as methods ofunittest.TestCaseclasses so that they can found automatically by test runners, likenosethat ignore test suites.4.2.0 (2015-06-01)Actuallyremove long-deprecatedzope.testing.doctest(announced as removed in 4.0.0) andzope.testing.doctestunit.Add support for PyPy and PyPy3.4.1.3 (2014-03-19)Add support for Python 3.4.Updateboostrap.pyto version 2.2.4.1.2 (2013-02-19)Adjust Trove classifiers to reflect the currently supported Python versions. Officially drop Python 2.4 and 2.5. Add Python 3.3.LP: #1055720: Fix failing test on Python 3.3 due to changed exception messaging.4.1.1 (2012-02-01)Fix: Windows test failure.4.1.0 (2012-01-29)Add context-manager support tozope.testing.setupstackMakezope.testing.setupstackusable with all tests, not just doctests and addedzope.testing.setupstack.globs, which makes it easier to write test setup code that workes with doctests and other kinds of tests.Add thewaitmodule, which makes it easier to deal with non-deterministic timing issues.Renamezope.testing.renormalizing.RENormalizingtozope.testing.renormalizing.OutputChecker. The old name is an alias.Update tests to run with Python 3.Label more clearly which features are supported by Python 3.Reorganize documentation.4.0.0 (2011-11-09)Remove the deprecatedzope.testing.doctest.Add Python 3 support.Fix test which fails if there is a file namedData.fsin the current working directory.3.10.2 (2010-11-30)Fix test of broken symlink handling to not break on Windows.3.10.1 (2010-11-29)Fix removal of broken symlinks on Unix.3.10.0 (2010-07-21)Removezope.testing.testrunner, which now is moved to zope.testrunner.Update fix for LP #221151 to a spelling compatible with Python 2.4.3.9.5 (2010-05-19)LP #579019: When layers are run in parallel, ensure that eachtearDownis called, including the first layer which is run in the main thread.Deprecatezope.testing.testrunnerandzope.testing.exceptions. They have been moved to a separate zope.testrunner module, and will be removed from zope.testing in 4.0.0, together withzope.testing.doctest.3.9.4 (2010-04-13)LP #560259: Fix subunit output formatter to handle layer setup errors.LP #399394: Add a--stop-on-error/--stop/-xoption to the testrunner.LP #498162: Add a--pdbalias for the existing--post-mortem/-Doption to the testrunner.LP #547023: Add a--versionoption to the testrunner.Add tests for LP #144569 and #69988.https://bugs.launchpad.net/bugs/69988https://bugs.launchpad.net/zope3/+bug/1445693.9.3 (2010-03-26)Remove import ofzope.testing.doctestfromzope.testing.renormalizer.Suppress output tosys.stderrintestrunner-layers-ntd.txt.Suppresszope.testing.doctestdeprecation warning when running our own test suite.3.9.2 (2010-03-15)Fix brokenfrom zope.testing.doctest import *3.9.1 (2010-03-15)No changes; reupload to fix broken 3.9.0 release on PyPI.3.9.0 (2010-03-12)Modify the testrunner to use the standard Pythondoctestmodule instead of the deprecatedzope.testing.doctest.Fixtestrunner-leaks.txtto use therun_internalhelper, so thatsys.exitisn’t triggered during the test run.Add support for conditionally using a subunit-based output formatter upon request if subunit and testtools are available. Patch contributed by Jonathan Lange.3.8.7 (2010-01-26)Downgrade thezope.testing.doctestdeprecation warning into a PendingDeprecationWarning.3.8.6 (2009-12-23)AddMANIFEST.inand reupload to fix broken 3.8.5 release on PyPI.3.8.5 (2009-12-23)Add backDocFileSuite,DocTestSuite,debug_srcanddebugBBB imports back intozope.testing.doctestunit; apparently many packages still import them from there!Deprecatezope.testing.doctestandzope.testing.doctestunitin favor of the stdlibdoctestmodule.3.8.4 (2009-12-18)Fix missing imports and undefined variables reported by pyflakes, adding tests to exercise the blind spots.Cleaned up unused imports reported by pyflakes.Add two new options to generate randomly ordered list of tests and to select a specific order of tests.Allow combining RENormalizing checkers via+now:checker1 + checker2creates a checker with the transformations of both checkers.Fix tests under Python 2.7.3.8.3 (2009-09-21)Fix test failures due to usingsplit()on filenames when running from a directory with spaces in it.Fix testrunner behavior on Windows for-j2(or greater) combined with-v(or greater).3.8.2 (2009-09-15)Remove hotshot profiler when using Python 2.6. That makes zope.testing compatible with Python 2.63.8.1 (2009-08-12)Avoid hardcodingsys.argv[0]as script; allow, for instance, Zope 2’sbin/instance test(LP#407916).Produce a clear error message when a subprocess doesn’t follow thezope.testing.testrunnerprotocol (LP#407916).Avoid unnecessarily squelching verbose output in a subprocess when there are not multiple subprocesses.Avoid unnecessarily batching subprocess output, which can stymie automated and human processes for identifying hung tests.Include incremental output when there are multiple subprocesses and a verbosity of-vvor greater is requested. This again is not batched, supporting automated processes and humans looking for hung tests.3.8.0 (2009-07-24)Allow testrunner to include descendants ofunittest.TestCasein test modules, which no longer need to providetest_suite().3.7.7 (2009-07-15)Clean up support for displaying tracebacks with supplements by turning it into an always-enabled feature and making the dependency onzope.exceptionsexplicit.Fix #251759: prevent the testrunner descending into directories that aren’t Python packages.Code cleanups.3.7.6 (2009-07-02)Add zope-testrunnerconsole_scriptsentry point. This exposes azope-testrunnerscript with default installs allowing the testrunner to be run from the command line.3.7.5 (2009-06-08)Fix bug when running subprocesses on Windows.The optionREPORT_ONLY_FIRST_FAILURE(command line option “-1”) is now respected even when a doctest declares its ownREPORTING_FLAGS, such asREPORT_NDIFF.Fix bug that broke readline with pdb when using doctest (seehttp://bugs.python.org/issue5727).Make tests pass on Windows and Linux at the same time.3.7.4 (2009-05-01)Filenames of doctest examples now contain the line number and not only the example number. So a stack trace in pdb tells the exact line number of the current example. This fixeshttps://bugs.launchpad.net/bugs/339813Colorization of doctest output correctly handles blank lines.3.7.3 (2009-04-22)Improve handling of rogue threads: always exit with status so even spinning daemon threads won’t block the runner from exiting. This deprecated the--with-exit-statusoption.3.7.2 (2009-04-13)Fix test failure on Python 2.4 due to slight difference in the way coverage is reported (__init__ files with only a single comment line are now not reported)Fix bug that caused the test runner to hang when running subprocesses (as a result Python 2.3 is no longer supported).Work around a bug in Python 2.6 (related tohttp://bugs.python.org/issue1303673) that causes the profile tests to fail.Add explanitory notes tobuildout.cfgabout how to run the tests with multiple versions of Python3.7.1 (2008-10-17)Thesetupstacktemporary directory support now properly handles read-only files by making them writable before removing them.3.7.0 (2008-09-22)Add alterate setuptools / distutils commands for running all tests using our testrunner. See ‘zope.testing.testrunner.eggsupport:ftest’.Add a setuptools-compatible test loader which skips tests with layers: the testrunner used bysetup.py testdoesn’t know about them, and those tests then fail. Seezope.testing.testrunner.eggsupport:SkipLayers.Add support for Jython, when a garbage collector call is sent.Add support to bootstrap on Jython.Fix NameError in StartUpFailure.Open doctest files in universal mode, so that packages released on Windows can be tested on Linux, for example.3.6.0 (2008-07-10)Add-joption to parallel tests run in subprocesses.RENormalizer accepts plain Python callables.Add--slow-testoption.Add--no-progressand--auto-progressoptions.Complete refactoring of the test runner into multiple code files and a more modular (pipeline-like) architecture.Unify unit tests with the layer support by introducing a real unit test layer.Add a doctest forzope.testing.module. There were several bugs that were fixed:README.txtwas a really bad default argument for the module name, as it is not a proper dotted name. The code would immediately fail as it would look for thetxtmodule in theREADMEpackage. The default is now__main__.ThetearDownfunction did not clean up the__name__entry in the global dictionary.Fix a bug that caused a SubprocessError to be generated if a subprocess sent any output to stderr.Fix a bug that caused the unit tests to be skipped if run in a subprocess.3.5.1 (2007-08-14)Invoke post-mortem debugging for layer-setup failures.3.5.0 (2007-07-19)Ensure that the test runner works on Python 2.5.Add support forcProfile.Add output colorizing (-coption).Add--hide-secondary-failuresand--show-secondary-failuresoptions (https://bugs.launchpad.net/zope3/+bug/115454).Fix some problems with Unicode in doctests.Fix “Error reading from subprocess” errors on Unix-like systems.3.4 (2007-03-29)Addexit-with-statussupport (supports use with buildbot andzc.recipe.testing)Add a small framework for automating set up and tear down of doctest tests. Seesetupstack.txt.Allowtestrunner-wo-source.txtandtestrunner-errors.txtto run within a read-only source tree.3.0 (2006-09-20)Update the doctest copy with text-file encoding support.Add logging-level support to theloggingsuppportmodule.At verbosity-level 1, dots are not output continuously, without any line breaks.Improve output when the inability to tear down a layer causes tests to be run in a subprocess.Makezope.exceptionrequired only if thezope_tracebacksextra is requested.Fix the test coverage. If a module, for exampleinterfaces, was in an ignored directory/package, then if a module of the same name existed in a covered directory/package, then it was also ignored there, because the ignore cache stored the result by module name and not the filename of the module.2.0 (2006-01-05)Release a separate project corresponding to the version ofzope.testingshipped as part of the Zope 3.2.0 release.
zope.testrecorder
Test RecorderThe testrecorder is a browser-based tool to support the rapid development of functional tests for Web-based systems and applications. The idea is to “record” tests by exercising whatever is to be tested within the browser. The test recorder will turn a recorded session into a functional test.OutputTest recorder supports two output modes:SeleniumIn this mode, the testrecorder spits out HTML markup that lets you recreate the browser test using theSeleniumfunctional testing framework.Test browserIn this mode, the testrecorder spits out a Pythondoctestthat exercises a functional test using the Zopetestbrowser. The Zope testbrowser allows you to programmatically simulate a browser from Python code. Its main use is to make functional tests easy and runnable without a browser at hand. It is used in Zope, but is not tied to Zope at all.UsageLike Selenium and the Zope test browser, the test recorder can very well be used to test any web application, be it Zope-based or not. Of course, it was developed by folks from the Zope community for use with Zope.CHANGES0.4 (2010-04-14)LP #98368: Ensure that Zope2 helper’sindex_htmlmethod has a docstring.Removed unneeded dependency on zope.app.publisher.0.3 (2007-11-04)Update package meta-data and first0.2 (2006-06-24)First real release with all bells and whistlesRearranged directory structure to match standard Zope repository layoutSome docs polishing0.1 (2005-08-10)First public “release” by being included via an svn:external in the main Zope 3 source tree.
zope.testrunner
zope.testrunnerContentszope.testrunnerUsing zope.testrunnerInstallationBuildout-based projectsVirtualenv-based projectsSome useful command-line options to get you startedWriting testsTest groupingOther featureszope.testrunner Changelog6.4 (2024-02-27)6.3.1 (2024-02-12)6.3 (2024-02-07)6.2.1 (2023-12-22)6.2 (2023-11-08)6.1 (2023-08-26)6.0 (2023-03-28)5.6 (2022-12-09)5.5.1 (2022-09-07)5.5 (2022-06-24)5.4.0 (2021-11-19)5.3.0 (2021-03-17)5.2 (2020-06-29)5.1 (2019-10-19)5.0 (2019-03-19)4.9.2 (2018-11-24)4.9.1 (2018-11-21)4.9 (2018-10-05)4.8.1 (2017-11-12)4.8.0 (2017-11-10)4.7.0 (2017-05-30)4.6.0 (2016-12-28)4.5.1 (2016-06-20)4.5.0 (2016-05-02)4.4.10 (2015-11-10)4.4.9 (2015-05-21)4.4.8 (2015-05-01)4.4.7 (2015-04-02)4.4.6 (2015-01-21)4.4.5 (2015-01-06)4.4.4 (2014-12-27)4.4.3 (2014-03-19)4.4.2 (2014-02-22)4.4.1 (2013-07-10)4.4.0 (2013-06-06)4.3.3 (2013-03-03)4.3.2 (2013-03-03)4.3.1 (2013-03-02)4.3.0 (2013-03-02)4.2.0 (2013-02-12)4.1.1 (2013-02-08)4.1.0 (2013-02-07)4.0.4 (2011-10-25)4.0.3 (2011-03-17)4.0.2 (2011-03-16)4.0.1 (2011-02-21)4.0.0 (2010-10-19)4.0.0b5 (2010-07-20)4.0.0b4 (2010-06-23)4.0.0b3 (2010-06-16)4.0.0b2 (2010-05-03)4.0.0b1 (2010-04-29)This package provides a flexible test runner with layer support.Detailed documentation is hosted athttps://zopetestrunner.readthedocs.ioUsing zope.testrunnerInstallationBuildout-based projectszope.testrunner is often used for projects that usebuildout:[buildout] develop = . parts = ... test ... [test] recipe = zc.recipe.testrunner eggs = mypackageThe usual buildout processpython bootstrap.py bin/buildoutcreates abin/testscript that will run the tests formypackage.Tipzc.recipe.testrunnertakes care to specify the right--test-pathoption in the generated script. You can add other options (such as--tests-pattern) too; checkzc.recipe.testrunner’s documentation for details.Virtualenv-based projectspip install zope.testrunnerand you’ll get azope-testrunnerscript. Run your tests withzope-testrunner --test-path=path/to/your/source/treeYour source code needs to be available for the testrunner to import, so you need to runpython setup.py installorpip install-e.into the samevirtualenv.Some useful command-line options to get you started-pshow a progress indicator-vincrease verbosity-ccolorize the output-ttestspecify test names (one or more regexes)-mmodulespecify test modules (one or more regexes)-spackagespecify test packages (one or more regexes)--list-testsshow names of tests instead of running them-xstop on first error or failure-D,--pdbenable post-mortem debugging of test failures--xmlpathgenerate XML reports to be written at the given path--helpshowallcommand-line options (there are many more!)For examplebin/test -pvc -m test_foo -t TestBarruns all TestBar tests from a module called test_foo.py.Writing testszope.testrunnerexpects to find your tests inside your package directory, in a subpackage or module namedtests. Test modules in a test subpackage should be namedtest*.py.TipYou can change these assumptions with--tests-patternand--test-file-patterntest runner options.Tests themselves should be classes inheriting fromunittest.TestCase, and if you wish to use doctests, please tell the test runner where to find them and what options to use for them in by supplying a function namedtest_suite.Example:import unittest import doctest class TestArithmetic(unittest.TestCase): def test_two_plus_two(self): self.assertEqual(2 + 2, 4) def doctest_string_formatting(): """Test Python string formatting >>> print('{} + {}'.format(2, 2)) 2 + 2 """ def test_suite(): return unittest.TestSuite([ unittest.defaultTestLoader.loadTestsFromName(__name__), doctest.DocTestSuite(), doctest.DocFileSuite('../README.txt', optionflags=doctest.ELLIPSIS), ])Test groupingIn addition to per-package and per-module filtering, zope.testrunner has other mechanisms for grouping tests:layersallow you to have shared setup/teardown code to be used by a group of tests, that is executed only once, and not for each test. Layers are orthogonal to the usual package/module structure and are specified by setting thelayerattribute on test suites.levelsallow you to group slow-running tests and not run them by default. They’re specified by setting thelevelattribute on test suites to an int.Other featureszope.testrunner can profile your tests, measure test coverage, check for memory leaks, integrate withsubunit, shuffle the test execution order, and run multiple tests in parallel.zope.testrunner Changelog6.4 (2024-02-27)Add PEP 440 support (implicit namespaces). (#160)6.3.1 (2024-02-12)Fix XML tests when running in distribution resp. separately. (#163)6.3 (2024-02-07)Exit cleanly when using the test runner--versionargument. (#102)Add new--xml<path>option to write JUnit-like XML reports. Code comes fromcollective.xmltestreport, but be aware that here--xmlis not a boolean, but expects a path! (#148).Add support for Python 3.13a3.6.2.1 (2023-12-22)Work around Python 3.12.1+ no longer callingstartTestfor skipped tests (#157).6.2 (2023-11-08)Add support for Python 3.12.Update code and tests topython-subunit>= 1.4.3thus requiring at least this version.6.1 (2023-08-26)Add preliminary support for Python 3.12b4. (#149)6.0 (2023-03-28)Drop support for Python 2.7, 3.5, 3.6.5.6 (2022-12-09)Add support for Python 3.11.Inline a small part ofrandom.Random.shufflewhich was deprecated in Python 3.9 and removed in 3.11 (#119).Don’t trigger post mortem debugger for skipped tests. (#141).5.5.1 (2022-09-07)Fix: let--at-level=levelwithlevel <= 0run the tests at all levels (rather than at no level)#138.5.5 (2022-06-24)Usesys._current_frames(rather thanthreading.enumerate) as base for new thread detection, fixes#130.New option--gc-after-test. It calls for a garbage collection after each test and can be used to track downResourceWarning``sand cyclic garbage. With ``rv = gc.collect(),!is output on verbosity level 1 whenrvis non zero (i.e. when cyclic structures have been released),[``*rv*]`` on higher verbosity levels and a detailed cyclic garbage analysis on verbosity level 4+. For details, see#133.Allow the filename for the logging configuration to be specified via the envvarZOPE_TESTRUNNER_LOG_INI. If not defined, the configuration continues to be locked for in filelog.iniof the current working directory. Remember the logging configuration file in envvarZOPE_TESTRUNNER_LOG_INIto allow spawned child processes to recreate the logging configuration. For details, see#134.5.4.0 (2021-11-19)Improve--helpdocumentation for--package-pathoption (#121).Do not disable existing loggers during logsupport initialization (#120).Fix tests with testtools >= 2.5.0 (#125).Add support for Python 3.10.5.3.0 (2021-03-17)Add support for Python 3.9.Fixpackage init file missingwarning (#112).Make standard streams provide abufferattribute on Python 3 when using–bufferor testing under subunit.5.2 (2020-06-29)Add support for Python 3.8.When a layer is run in a subprocess, read its stderr in a thread to avoid a deadlock if its stderr output (containing failing and erroring test IDs) overflows the capacity of a pipe (#105).5.1 (2019-10-19)Recover more gracefully when layer setUp or tearDown fails, producing useful subunit output.Prevent a spurious warning from the--require-uniqueoption if the--moduleoption was not used.Add optional buffering of standard output and standard error during tests, requested via the--bufferoption or enabled by default for subunit.Fix incorrect failure counts in per-layer summary output, broken in 4.0.1.5.0 (2019-03-19)Fix test failures and deprecation warnings occurring when using Python 3.8a1. (#89)Drop support for Python 3.4.4.9.2 (2018-11-24)FixTypeError: abytes-likeobject is required, not 'str'running tests in parallel on Python 3. Seeissue 80.4.9.1 (2018-11-21)Fix AssertionError in _DummyThread.isAlive on Python 3 (#81).4.9 (2018-10-05)Drop support for Python 3.3.Add support for Python 3.7.Enable test coverage reporting on coveralls.io and in tox.ini.Host documentation athttps://zopetestrunner.readthedocs.ioRemove untested support for the--pycheckeroption. Seeissue 63.Update the command line interface to useargparseinstead ofoptparse. Seeissue 61.Use ipdb instead of pdb for post-mortem debugging if available (#10).Add a –require-unique option to check for duplicate test IDs. SeeLP #682771.Reintroduce optional support forsubunit, now with support for both version 1 and version 2 of its protocol.Handle string in exception values when formatting chained exceptions. (#74)4.8.1 (2017-11-12)EnableDeprecationWarningearlier, when discovering test modules. This lets warnings that are raised on import (such as those produced byzope.deprecation.moved) be reported. Seeissue 57.4.8.0 (2017-11-10)Automatically enableDeprecationWarningwhen running tests. This is recommended by the Python core developers and matches the behaviour of theunittestmodule. This can be overridden with Python command-line options (-W) or environment variables (PYTHONWARNINGS). Seeissue 54.4.7.0 (2017-05-30)Drop all support forsubunit.4.6.0 (2016-12-28)Make thesubunitsupport purely optional: applications which have been getting the dependencies viazope.testrunnershould either addzope.testrunner[subunit]to theirinstall_requiresor else depend directly onpython-subunit.New option--ignore-new-thread=<regexp>to suppress “New thread(s)” warnings.Support Python 3.6.4.5.1 (2016-06-20)Fixed: Using the-joption to run tests in multiple processes caused tests that used themultiprocessingpackage to hang (because the testrunner replacedsys.stdinwith an unclosable object).Drop conditional dependency onunittest2(redundant after dropping support for Python 2.6).4.5.0 (2016-05-02)Stop tests for all layers when test fails/errors when started with -x/–stop-on-error (#37).Drop support for Python 2.6 and 3.2.4.4.10 (2015-11-10)Add support for Python 3.5 (#31).Insert extra paths (from--path) to the front of sys.argv (#32).4.4.9 (2015-05-21)When using-j, parallelize all the tests, including the first test layer (#28).4.4.8 (2015-05-01)Support skipped tests in subunit output (#25).More efficient test filtering (#26).4.4.7 (2015-04-02)Work around a bug in PyPy3’s curses module (#24).4.4.6 (2015-01-21)Restore support for instance-based test layers that regressed in 4.4.5 (#20).4.4.5 (2015-01-06)Sort related layers close to each other to reduce the number of unnecessary teardowns (fixes#14).Run the unit test layer first (fixesLP #497871).4.4.4 (2014-12-27)When looking for the right location of test code, start with longest location paths first. This fixes problems with nested code locations.4.4.3 (2014-03-19)Added support for Python 3.4.4.4.2 (2014-02-22)Drop support for Python 3.1.Fix post-mortem debugging when a non-printable exception happens (https://github.com/zopefoundation/zope.testrunner/issues/8).4.4.1 (2013-07-10)Updatedboostrap.pyto version 2.2.Fix nondeterministic test failures on Python 3.3Tear down layers afterpost_mortemdebugging is finished.Fix tests that write to source directory, it might be read-only.4.4.0 (2013-06-06)Fix tests selection when the negative “!” pattern is used several times (LP #1160965)Moved tests into a ‘tests’ subpackage.Madepython-mzope.testrunnerwork again.Support ‘skip’ feature of unittest2 (which became the new unittest in Python 2.7).Better diagnostics when communication with subprocess fails (https://github.com/zopefoundation/zope.testrunner/issues/5).Do not break subprocess execution when the test suite changes the working directory (https://github.com/zopefoundation/zope.testrunner/issues/6).Count test module import errors as errors (LP #1026576).4.3.3 (2013-03-03)Running layers in sub-processes did not use to work when run viapython setup.py ftestsince it tried to run setup.py with all the command line options. It now detectssetup.pyruns and we run the test runner directly.4.3.2 (2013-03-03)FixSkipLayersclass in cases where the distribution specifies atest_suitevalue.4.3.1 (2013-03-02)Fixed a bug in theftestcommand and added a test.Fixed a trivial test failure with Python 3 of the previous release.4.3.0 (2013-03-02)Exposeftestdistutils command via an entry point.Added tests forzope.testrunner.eggsupport.4.2.0 (2013-02-12)Dropped use of 2to3, rewrote source code to be compatible with all Python versions. Introduced a dependency onsix.4.1.1 (2013-02-08)Dropped use of zope.fixers (LP: #1118877).Fixed tox test error reporting; fixed tests on Pythons 2.6, 3.1, 3.2, 3.3 and PyPy 1.9.Fix –shuffle ordering on Python 3.2 to be the same as it was on older Python versions.Fix –shuffle nondeterminism when multiple test layers are present. Note: this will likely change the order of tests for the same –shuffle-seed.New option: –profile-directory. Use it in the test suite so that tests executed by detox in parallel don’t conflict.Use a temporary coverage directory in the test suite so that tests executed by detox in parallel don’t conflict.Fix –post-mortem (aka -D, –pdb) when a test module cannot be imported or is invalid (LP #1119363).4.1.0 (2013-02-07)Replaced deprecatedzope.interface.implementsusage with equivalentzope.interface.implementerdecorator.Dropped support for Python 2.4 and 2.5.Made StartUpFailure compatible with unittest.TextTestRunner() (LP #1118344).4.0.4 (2011-10-25)Work around sporadic timing-related issues in the subprocess buffering tests. Thanks to Jonathan Ballet for the patch!4.0.3 (2011-03-17)Added back support for Python <= 2.6 which was broken in 4.0.2.4.0.2 (2011-03-16)Added back Python 3 support which was broken in 4.0.1.FixedUnexpected successsupport by implementing the whole concept.Added support for the new __pycache__ directories in Python 3.2.4.0.1 (2011-02-21)LP #719369: AnUnexpected success(concept introduced in Python 2.7) is no longer handled as success but as failure. This is a workaround. The whole unexpected success concept might be implemented later.4.0.0 (2010-10-19)Show more information about layers whose setup fails (LP #638153).4.0.0b5 (2010-07-20)Update fix for LP #221151 to a spelling compatible with Python 2.4.Timestamps are now always included in subunit output (r114849).LP #591309: fix a crash when subunit reports test failures containing UTF8-encoded data.4.0.0b4 (2010-06-23)Package as a zipfile to work around Python 2.4 distutils bug (no feature changes or bugfixes inzope.testrunneritself).4.0.0b3 (2010-06-16)LP #221151: keepunittest.TestCase.shortDescriptionhappy by supplying a_testMethodDocattribute.LP #595052: keep the distribution installable under Python 2.4: its distutils appears to munge the empty__init__.pyfile in thefoo.baregg used for testing into a directory.LP #580083: fix thebin/testscript to run only tests fromzope.testrunner.LP #579019: When layers were run in parallel, their tearDown was not called. Additionally, the first layer which was run in the main thread did not have its tearDown called either.4.0.0b2 (2010-05-03)Having ‘sampletests’ in the MANIFEST.in gave warnings, but doesn’t actually seem to include any more files, so I removed it.Moved zope.testing.exceptions to zope.testrunner.exceptions. Now zope.testrunner no longer requires zope.testing except for when running its own tests.4.0.0b1 (2010-04-29)Initial release of the testrunner from zope.testrunner as its own module. (Previously it was part of zope.testing.)
zope.thread
This package is deprecated and exists soley for backward compatability.
zope.traversing
zope.traversingThis package provides adapters for resolving object paths by traversing an object hierarchy. This package also includes support for traversal namespaces (e.g.++view++,++skin++, etc.) as well as computing URLs via the@@absolute_urlview.Documentation is hosted athttps://zopetraversing.readthedocs.io/Changes5.0 (2023-03-27)Drop support for Python 2.7, 3.5, 3.6.Add support for Python 3.9, 3.10, 3.11.4.4.1 (2020-03-31)Ensure all objects have consistent resolution orders. Previously, the “debug” namespace’s “errors” flag completely changed the resolution order of the request instead of simply adding the “Debug” skin.4.4.0 (2020-03-30)Drop support for Python 3.4.Add support for Python 3.8.4.3.1 (2018-10-16)Fix DeprecationWarnings forComponentLookupErrorby importing them fromzope.interface.interfaces. Seeissue 10.4.3 (2018-10-05)Add support for Python 3.7.Host documentation athttps://zopetraversing.readthedocs.io4.2.0 (2017-09-23)Add support for Python 3.6.Drop support for Python 3.3.Drop support forpython setup.py test.4.1.0 (2016-08-05)Add support for Python 3.5.Drop support for Python 2.6.Gracefully handleUnicodeEncodeErrorthat can be produced when doing attribute lookup on Python 2 by instead raising aLocationError.4.0.0 (2014-03-21)Add support for Python 3.4.4.0.0a3 (2013-03-12)Add support for PyPy.4.0.0a2 (2013-02-21)Removezope.containertesting dependency to break another circular dependency.Removezope.pagetemplatetesting dependency to break another circular dependency.Removezope.browserpage(ZCML) dependency by using low-level directives.Removezope.sitetesting dependency.4.0.0a1 (2013-02-20)Replace deprecatedzope.component.adaptsusage with equivalentzope.component.adapterdecorator.Replace deprecatedzope.interface.implementsusage with equivalentzope.interface.implementerdecorator.Drop support for Python 2.4 and 2.5.Add support for Python 3.3.Fix dependencies : removedzope.taland addedzope.browserpage.3.14.0 (2011-03-02)Re-release of 3.13.1 as a feature version as it introduces dependencies on new feature releases.3.13.1 (2010-12-14)Fix ZCML-related dependencies.3.13 (2010-07-09)When a__parent__attribute is available on an object, it is always used for absolute URL construction, and no ILocation adapter lookup is performed for it. This was the previous behavior but was broken (around 3.5?) due to dependency refactoring.If the object provides no__parent__then an ILocation adapter lookup will be performed. This will always succeed as zope.location provides a default LocationProxy for everything, but more specific ILocation adapters can also be provided.3.12.1 (2010-04-30)Remove use ofzope.testing.doctestunitin favor of stdlib’s doctest.3.12.0 (2009-12-29)Avoid testing dependencies onzope.securitypoliciesandzope.principalregistry.3.11.0 (2009-12-27)Remove testing dependency onzope.app.publication.3.10.0 (2009-12-16)Remove stray test claiming a no longer existing dependency onzope.app.applicationcontrol.Refactor functional tests to loose dependency on bothzope.app.appsetupandzope.app.testing.Simplify tests for thebrowsersub-package by usingPlacelessSetupfromzope.component.testinginstead ofzope.app.testing.Simplifytest_dependenciesmodule by usingzope.configurationinstead ofzope.app.testing.functional.Remove testing dependency onzope.app.publisher.Replace testing dependency onzope.app.securitywithzope.securitypolicy.Remove testing dependency onzope.app.zcmlfilesin favor of more explicit dependencies.Remove testing dependency onzope.app.component.Replace a test dependency onzope.app.zptpagewith a dependency onzope.pagetemplate.3.9.0 (2009-12-15)MoveIBeforeTraverseEventhere fromzope.app.publication, as we already deal with publication traversal.3.8.0 (2009-09-29)Inzope.traversing.api.getParent(), try to delegate tozope.location.interfaces.ILocationInfo.getParent(), analogous togetParents(). Keep returning the traversal parent as a fallback.BringITraverserback fromzope.locationwhere it had been moved to invert the package interdependency, but where it is now no longer used.3.7.2 (2009-08-29)Make virtual hosting tests compatible withzope.publisher3.9. Redirecting to a different host requires an explicittrustedredirect now.3.7.1 (2009-06-16)AbsoluteURLnow implements the fact that__call__returns the same as__str__in a manner that it applies for subclasses, too, so they only have to override__str__and not both.3.7.0 (2009-05-23)Move thepublicationtraversemodule tozope.traversing, removing thezope.app.publisher->zope.app.publicationdependency (which was a cycle).Look up the application controller through a utility registration rather than a direct reference.3.6.0 (2009-04-06)Changeconfigure.zcmlnot to depend onzope.app.component.This release includes the BBB-incompatiblezope.publisher.skinnablechange from 3.5.3.3.5.4 (2009-04-06)Revert BBB-incompatible use ofzope.publisher.skinnable: that change belongs in a 3.6.0 release, because it requires a BBB-incompatible version ofzope.publisher.3.5.3 (2009-03-10)Use applySkin from new location. zope.publisher.skinnable instead of zope.publisher.browser.Use IAbsoluteURL lookup instead of the “absolute_url” view in the recursive AbsoluteURL adapters (LP: #338101).3.5.2 (2009-02-04)RootPhysicallyLocatableis not the same asLocationPhysicallyLocatable(now inzope.location). Fix the import and testing setups.3.5.1 (2009-02-02)Obsolete theRootPhysicallyLocatableadapter, which has been superseded by the refactoredzope.location.traversing.LocationPhysicallyLocatablethat we depend on since 3.5.0a4.Remove the adapter and its registration, and making its import place pointing tozope.location.traversing.LocationPhysicallyLocatableto maintain backward-compatibility.This also fixes a bug introduced in version 3.5.0a4 when trying to callgetParentsfunction for the root object.Use direct imports instead of compatibility ones for things that were moved tozope.location.Remove thezope.traversing.interfaces.INamespaceHandlerinterface, as it seems not to be used for years.Change package’s mailing list address to zope-dev at zope.org instead of retired zope3-dev at zope.org3.5.0 (2009-01-31)Use zope.container instead ofzope.app.container.Use zope.site instead ofzope.app.folderin the unit tests.Reduce, but not eliminate, test dependencies onzope.app.component.3.5.0a4 (2008-08-01)Reverse dependencies betweenzope.locationandzope.traversing.Update (test) dependencies and tests to expect and work with a spec compliant TAL interpreter as available inzope.tal>= 3.5.0.Fix deprecation warning caused by using an old module name forZopeSecurityPolicyinftesting.zcml.Ensure traversing doesn’t raise an TypeError but a TraversalError when the traversal step before yielded a string.3.5.0a3 (2007-12-28)Back out the controversial++skin++traverser for XML-RPC.3.5.0a2 (2007-11-28)Port 3.4.1a1 to trunkDo not use unicode strings to set the application server in the virtual host namespace. This causedabsolute_urlto create unicode URL’s.Add a traverer for++skin++for XMLRPC skins (IXMLRPCSkinType). This also means that the normal++skin++namespace handler is only bound toIBrowserRequest.Resolve the dependency onzope.app.applicationcontrolby importing the application controller only if the package is available.3.4.1 (2008-07-30)Fix deprecation warning caused by using an old module name forZopeSecurityPolicyinftesting.zcml.3.4.1a1 (2007-11-13)Do not use unicode strings to set the application server in the virtual host namespace. This caused absolute_url to create unicode URL’s.3.4.0 (2007-09-29)No further changes since 3.4.0a1.3.4.0a1 (2007-04-22)Initial release as a separate project, corresponds tozope.traversingfrom Zope 3.4.0a1
zope.ucol
This package provides a Python interface to theInternational Component for Unicode (ICU).ContentsChange History1.0.2 (2006-10-16)1.0.1 (2006-10-16)1.0 (2006-10-16)InstallationDetailed DocumentationCollator attributesDownloadChange History1.0.2 (2006-10-16)Fixed setup file problems.1.0.1 (2006-10-16)Added missing import to setup.py.1.0 (2006-10-16)Initial version.Installationzope.ucol is installed via setup.py in the usual way.You must have ICU installed. If ICU isn’t installed in the usual places for include files and libraries on your system, you can provide command-line options to setup.py when building the extensions, as in:python2.4 setup.py build_ext \ -I/home/jim/p/z4i/jim-icu/var/opt/icu/include \ -L/home/jim/p/z4i/jim-icu/var/opt/icu/lib \ -R/home/jim/p/z4i/jim-icu/var/opt/icu/lib python2.4 setup.py installNote that if the libraries are in an unusual place, you will want to specify their location using the -R option so you don’t have to specify it at run-time.Detailed DocumentationLocale-based text collation using ICUThe zope.ucol package provides a minimal Pythonic wrapper around the u_col C API of the International Components for Unicode (ICU) library. It provides locale-based text collation.To perform collation, you need to create a collator key factory for your locale. We’ll use the special “root” locale in this example:>>> import zope.ucol >>> collator = zope.ucol.Collator("root")The collator has a key method for creating collation keys from unicode strings. The method can be passed as the key argument to list.sort or to the built-in sorted function.>>> sorted([u'Sam', u'sally', u'Abe', u'alice', u'Terry', u'tim', ... u'\U00023119', u'\u62d5'], key=collator.key) [u'Abe', u'alice', u'sally', u'Sam', u'Terry', u'tim', u'\u62d5', u'\U00023119']There is a cmp method for comparing 2 unicode strings, which can also be used when sorting:>>> sorted([u'Sam', u'sally', u'Abe', u'alice', u'Terry', u'tim', ... u'\U00023119', u'\u62d5'], collator.cmp) [u'Abe', u'alice', u'sally', u'Sam', u'Terry', u'tim', u'\u62d5', u'\U00023119']Note that it is almost always more efficient to pass the key method to sorting functions, rather than the cmp method. The cmp method is more efficient in the special case that strings are long and few and when they tend to differ at their beginnings. This is because computing the entire key can be much more expensive than comparison when the order can be determined based on analyzing a small portion of the original strings.Collator attributesYou can ask a collator for it’s locale:>>> collator.locale 'root'and you can find out whether default collation information was used:>>> collator.used_default_information 0 >>> collator = zope.ucol.Collator("eek") >>> collator.used_default_information 1Download
zope.untrustedpython
Sandboxed environment for untrusted code / templates, using zope.security and RestrictedPythonCHANGES6.0 (2023-09-13)Drop support for Python 2.7, 3.5, 3.6.Make sure the tests do not fail even on unsupported PyPy3 because ZTK might run them.5.0 (2022-11-29)Backwards incompatible changesRequireRestrictedPython >= 4.Drop support for writing output ofprintcalls to a variable nameduntrusted_output. It is now done the same wayRestrictedPythonhandles printing, i. e. access it trough the variableprinted..interpreter.CompiledProgramstill supports output to a file like object by implementing accessing the printed data.The following names are no longer available via__builtins__as they are either potentially harmful, not accessible at all or meaningless:__debug____name____doc__copyrightcreditslicensequitDrop support to run the tests usingpython setup.py test.Drop support for Python 2.6.FeaturesAdd support for Python 3.5, 3.6, 3.7, 3.8, 3.9, 3.10, 3.11.4.0.0 (2013-02-12)Test coverage at 100%.Package extracted from zope.security, preserving revision history
zope.viewlet
zope.viewletViewlets provide a generic framework for building pluggable user interfaces. Viewlets are a special type ofcontent providerthat allows a template to define a region (a “viewlet manager”) into which content (“viewlets”) can be plugged.Documentation is hosted athttps://zopeviewlet.readthedocs.io/Changes5.0 (2023-03-27)Drop support for Python 2.7, 3.5, 3.6.Drop support for deprecatedpython setup.py test.Add support for Python 3.11.4.3 (2022-03-18)Add support for Python 3.8, 3.9 and 3.10.Drop support for Python 3.4.4.2.1 (2018-12-17)Fix deprecation warnings. (#11)4.2 (2018-10-09)Add support for Python 3.7.Host documentation athttps://zopeviewlet.readthedocs.io4.1.0 (2017-09-23)Add support for Python 3.5 and 3.6.Drop support for Python 2.6 and 3.3.4.0.0 (2014-12-24)Add support for PyPy and PyPy3.Add support for Python 3.4.Add support for testing on Travis.4.0.0a1 (2013-02-24)Add support for Python 3.3.Replace deprecatedzope.component.adaptsusage with equivalentzope.component.adapterdecorator.Replace deprecatedzope.interface.implementsusage with equivalentzope.interface.implementerdecorator.Drop support for Python 2.4 and 2.5.3.7.2 (2010-05-25)Fix unit tests broken under Python 2.4 by the switch to the standard librarydoctestmodule.3.7.1 (2010-04-30)Remove use of ‘zope.testing.doctest’ in favor of stdlib’s ‘doctest.Fix dubious quoting in metadirectives.py. Closeshttps://bugs.launchpad.net/zope2/+bug/143774.3.7.0 (2009-12-22)Depend onzope.browserpagein favor ofzope.app.pagetemplate.3.6.1 (2009-08-29)Fix unit tests in README.txt.3.6.0 (2009-08-02)Optimize the the script tag for the JS viewlet. This makes YSlow happy.Remove ZCML slugs and old zpkg-related files.Drop all testing dependncies exceptzope.testing.3.5.0 (2009-01-26)Remove the dependency onzope.app.publisherby moving four simple helper functions into this package and making the interface for describing the ZCML content provider directive explicit.Typo fix in CSSViewlet docstring.3.4.2 (2008-01-24)Re-release of 3.4.1 because of brown bag release.3.4.1 (2008-01-21)Implement missing__contains__method in IViewletManagerImplement additional viewlet managers offering weight ordered sortingImplement additional viewlet managers offering conditional filtering3.4.1a (2007-4-22)Add a missing ‘,’ behindzope.i18nmessageid.Recreate theREADME.txtremoving everything except for the overview.3.4.0 (2007-10-10)Initial release independent of the main Zope tree.
zope.vocabularyregistry
zope.vocabularyregistryThis Zope 3 package provides azope.schemavocabulary registry that uses utilities to look up vocabularies.Component-based Vocabulary RegistryThis package provides a vocabulary registry for zope.schema, based on the component architecture.It replaces the zope.schema’s simple vocabulary registry whenzope.vocabularyregistrypackage is imported, so it’s done automatically. All we need is provide vocabulary factory utilities:>>> import zope.vocabularyregistry >>> from zope.component import provideUtility >>> from zope.schema.interfaces import IVocabularyFactory >>> from zope.schema.vocabulary import SimpleTerm >>> from zope.schema.vocabulary import SimpleVocabulary>>> def makeVocabularyFactory(*values): ... def vocabularyFactory(context=None): ... terms = [SimpleTerm(v) for v in values] ... return SimpleVocabulary(terms) ... return vocabularyFactory>>> zope.component.provideUtility( ... makeVocabularyFactory(1, 2), IVocabularyFactory, ... name='SomeVocabulary')Now we can get the vocabulary using standard zope.schema way:>>> from zope.schema.vocabulary import getVocabularyRegistry >>> vr = getVocabularyRegistry() >>> voc = vr.get(None, 'SomeVocabulary') >>> [term.value for term in voc] [1, 2]If vocabulary is not found, VocabularyRegistryError is raised.>>> try: ... vr.get(None, 'NotAvailable') ... except LookupError as error: ... print("%s.%s: %s" % (error.__module__, error.__class__.__name__, error)) zope.schema.vocabulary.VocabularyRegistryError: unknown vocabulary: 'NotAvailable'We can also use vocabularies defined in local component registries. Let’s define some local sites with a vocabulary.>>> import zope.component.hooks >>> from zope.component import globalregistry >>> from zope.component.globalregistry import getGlobalSiteManager>>> from zope.interface.registry import Components >>> class LocalSite(object): ... def __init__(self, name): ... self.sm = Components( ... name=name, bases=(globalregistry.getGlobalSiteManager(), )) ... ... def getSiteManager(self): ... return self.sm>>> local_site_even = LocalSite('local_site_even') >>> local_site_even.sm.registerUtility( ... makeVocabularyFactory(4, 6, 8), IVocabularyFactory, ... name='SomeVocabulary', event=False)>>> local_site_odd = LocalSite('local_site_odd') >>> local_site_odd.sm.registerUtility( ... makeVocabularyFactory(3, 5, 7), IVocabularyFactory, ... name='SomeVocabulary', event=False)Vocabularies defined in local component registries can be accessed in two ways.Using the registry from within a site.>>> with zope.component.hooks.site(local_site_even): ... voc = getVocabularyRegistry().get(None, 'SomeVocabulary') ... [term.value for term in voc] [4, 6, 8]Binding to a context that can be used to look up a local site manager.>>> from zope.interface.interfaces import IComponentLookup >>> zope.component.provideAdapter( ... lambda number: ((local_site_even, local_site_odd)[number % 2]).sm, ... adapts=(int, ), provides=IComponentLookup)>>> context = 4 >>> voc = getVocabularyRegistry().get(context, 'SomeVocabulary') >>> [term.value for term in voc] [4, 6, 8]Binding to a context takes precedence over active site, so we can look up vocabularies from other sites.>>> context = 7 >>> with zope.component.hooks.site(local_site_even): ... voc = getVocabularyRegistry().get(context, 'SomeVocabulary') ... [term.value for term in voc] [3, 5, 7]If we cannot find a local site for given context, currently active site is used.>>> from zope.interface.interfaces import ComponentLookupError >>> def raisingGetSiteManager(context=None): ... if context == 42: ... raise ComponentLookupError(context) ... return zope.component.hooks.getSiteManager(context) >>> hook = zope.component.getSiteManager.sethook(raisingGetSiteManager)>>> context = 42 >>> with zope.component.hooks.site(local_site_odd): ... voc = getVocabularyRegistry().get(context, 'SomeVocabulary') ... [term.value for term in voc] [3, 5, 7]ConfigurationThis package provides configuration that ensures the vocabulary registry is established:>>> from zope.configuration import xmlconfig >>> _ = xmlconfig.string(r""" ... <configure xmlns="http://namespaces.zope.org/zope" i18n_domain="zope"> ... <include package="zope.vocabularyregistry" /> ... </configure> ... """)CHANGES1.2.0 (2021-11-26)Add support for Python 3.8, 3.9, and 3.10.1.1.1 (2018-12-03)Important bugfix for the new feature introduced in 1.1.0: Fall back to active site manager if no local site manager can be looked up for provided context.1.1.0 (2018-11-30)Ensure that a context is provided when looking up the vocabulary factory.Drop support for Python 2.6 and 3.3.Add support for Python 3.5, 3.6, 3.7, PyPy and PyPy3.1.0.0 (2013-03-01)Added support for Python 3.3.Replaced deprecatedzope.interface.implementsusage with equivalentzope.interface.implementerdecorator.Dropped support for Python 2.4 and 2.5.Initial release independent ofzope.app.schema.
zope.weakset
Zope Object Database: object database and persistenceThe Zope Object Database provides an object-oriented database for Python that provides a high-degree of transparency. Applications can take advantage of object database features with few, if any, changes to application logic. ZODB includes features such as a plugable storage interface, rich transaction support, and undo.This distribution includes the weakset module from ZODB.
zope.wfmc
This package provides an implementation of a Workflow-Management Coalition (WFMC) workflow engine. The engine is provided as a collection of workflow process components. Workflow processes can be defined in Python or via the XML Process-Definition Language, XPDL.Detailed DocumentationWorkflow-Management Coalition Workflow EngineThis package provides an implementation of a Workflow-Management Coalition (WFMC) workflow engine. The engine is provided as a collection of workflow process components. Workflow processes can be defined in Python or via the XML Process-Definition Language, XPDL.In this document, we’ll look at Python-defined process definitions:>>> from zope.wfmc import process >>> pd = process.ProcessDefinition('sample')The argument to the process is a process id.A process has a number of parts. Let’s look at a sample review process:----------- -->| Publish | ---------- ---------- / ----------- | Author |-->| Review |- ---------- ---------- ---------- \-->| Reject | ----------Here we have a single start activity and 2 end activities. We could have modeled this with a single end activity, but that is not required. A single start activityisrequired. A process definition has a set of activities, with transitions between them. Let’s define the activities for our process definition:>>> pd.defineActivities( ... author = process.ActivityDefinition(), ... review = process.ActivityDefinition(), ... publish = process.ActivityDefinition(), ... reject = process.ActivityDefinition(), ... )We supply activities as keyword arguments. The argument names provide activity ids that we’ll use when defining transitions:>>> pd.defineTransitions( ... process.TransitionDefinition('author', 'review'), ... process.TransitionDefinition('review', 'publish'), ... process.TransitionDefinition('review', 'reject'), ... )Each transition is constructed with an identifier for a starting activity, and an identifier for an ending activity.Before we can use a workflow definition, we have to register it as a utility. This is necessary so that process instances can find their definitions. In addition, the utility name must match the process id:>>> import zope.component >>> zope.component.provideUtility(pd, name=pd.id)Now, with this definition, we can execute our workflow. We haven’t defined any work yet, but we can see the workflow execute. We’ll see the workflow executing by registering a subscriber that logs workflow events:>>> def log_workflow(event): ... print event>>> import zope.event >>> zope.event.subscribers.append(log_workflow)To use the workflow definition, we need to create an instance:>>> proc = pd()Now, if we start the workflow:>>> proc.start() ProcessStarted(Process('sample')) Transition(None, Activity('sample.author')) ActivityStarted(Activity('sample.author')) ActivityFinished(Activity('sample.author')) Transition(Activity('sample.author'), Activity('sample.review')) ActivityStarted(Activity('sample.review')) ActivityFinished(Activity('sample.review')) Transition(Activity('sample.review'), Activity('sample.publish')) ActivityStarted(Activity('sample.publish')) ActivityFinished(Activity('sample.publish')) ProcessFinished(Process('sample'))we see that we transition immediately into the author activity, then into review and publish. Normally, we’d need to do some work in each activity, and transitions would continue only after work had been done, however, in this case, we didn’t define any work, so each activity completed immediately.Note that we didn’t transition into the rejected activity. By default, when an activity is completed, the first transition for which its condition evaluates toTrueis used. By default, transitions have boolean conditions[1]that evaluate toTrue, so the transition topublishis used because it was defined before the transition toreject. What we want is to transition topublishif a reviewer approves the content for publication, but torejectif the reviewer rejects the content for publication. We can use a condition for this:>>> pd = process.ProcessDefinition('sample') >>> zope.component.provideUtility(pd, name=pd.id) Unregistered event: UtilityRegistration(<BaseGlobalComponents base>, IProcessDefinition, 'sample', ProcessDefinition('sample'), None, u'')>>> pd.defineActivities( ... author = process.ActivityDefinition(), ... review = process.ActivityDefinition(), ... publish = process.ActivityDefinition(), ... reject = process.ActivityDefinition(), ... ) >>> pd.defineTransitions( ... process.TransitionDefinition('author', 'review'), ... process.TransitionDefinition( ... 'review', 'publish', condition=lambda data: data.publish), ... process.TransitionDefinition('review', 'reject'), ... )We redefined the workflow process, specifying a condition for the transition topublish. Boolean conditions are just callable objects that take a data object and return a boolean value. The data object is called “workflow-relevant data”. A process instance has a data object containing this data. In the example, above, the condition simply returned the value of thepublishattribute. How does this attribute get set? It needs to be set by the review activity. To do that, we need to arrange for the activity to set the data. This brings us to applications.Process definitions are meant to be used with different applications. For this reason, process definitions don’t include application logic. What they do include is a specifications of the applications to be invoked and the flow of work-flow-relevant data to and from the application. Now, we can define our applications:>>> pd.defineApplications( ... author = process.Application(), ... review = process.Application( ... process.OutputParameter('publish')), ... publish = process.Application(), ... reject = process.Application(), ... )We used the same names for the applications that we used for our activities. This isn’t required, but is a common practice. Note that thereviewapplication includes a specification of an output parameter. Now that we’ve defined our applications, we need to modify our activities to use them:>>> pd.activities['author'].addApplication('author') >>> pd.activities['review'].addApplication('review', ['publish']) >>> pd.activities['publish'].addApplication('publish') >>> pd.activities['reject'].addApplication('reject')An activity can use many applications, so we calladdApplication. In the application definition for the ‘review’ application, we provided the name of a workflow-relevent data variable corresponding to the output parameter defined for the application. When using an application in an activity, a workflow-relevent data variable name must be provided for each of the parameters in the identified applications’s signature. When an application is used in an activity, workflow-relevent data are passed for each of the input parameters and are set by each of the output parameters. In this example, the output parameter, will be used to add apublishattribute to the workflow relevant data.ParticipantsWe’ve declared some applications, and we’ve wired them up to activities, but we still haven’t specified any application code. Before we can specify application code, we need to consider who will be performing the application. Workflow applications are normally executed by people, or other external actors. As with applications, process definitions allow participants in the workflow to be declared and identified with activities. We declare participants much as we declare applications, except without parameters:>>> pd.defineParticipants( ... author = process.Participant(), ... reviewer = process.Participant(), ... )In this case, we happened to reuse an activity name for one, but not both of the participants. Having defined these participants, we can associate them with activities:>>> pd.activities['author'].definePerformer('author') >>> pd.activities['review'].definePerformer('reviewer')Application IntegrationTo use a process definition to control application logic, we need to associate it with an “integration” object.When a process needs to get a participant, it calls createParticipant on its integration attribute, passing the process id and the performer id. If an activity doesn’t have a performer, then the procedure above is used with an empty performer id.Similarly, when a process needs a work item, it calls createWorkItem on its integration attribute, passing the process id and the application id.Work items provide astartmethod, which is used to start the work and pass input arguments. It is the responsibility of the work item, at some later time, to call theworkItemFinishedmethod on the activity, to notify the activity that the work item was completed. Output parameters are passed to theworkItemFinishedmethod.A simple way to create integration objects is withzope.wfmc.attributeintegration.AttributeIntegration.>>> from zope.wfmc.attributeintegration import AttributeIntegration >>> integration = AttributeIntegration() >>> pd.integration = integrationWe’ll start by defining a simple Participant class:>>> import zope.interface >>> from zope.wfmc import interfaces>>> class Participant(object): ... zope.component.adapts(interfaces.IActivity) ... zope.interface.implements(interfaces.IParticipant) ... ... def __init__(self, activity): ... self.activity = activityWe set attributes on the integration for each participant:>>> integration.authorParticipant = Participant >>> integration.reviewerParticipant = ParticipantWe also define an attribute for participants for activities that don’t have performers:>>> integration.Participant = ParticipantNow we’ll define our work-items. First we’ll define some classes:>>> work_list = []>>> class ApplicationBase: ... zope.component.adapts(interfaces.IParticipant) ... zope.interface.implements(interfaces.IWorkItem) ... ... def __init__(self, participant): ... self.participant = participant ... work_list.append(self) ... ... def start(self): ... pass ... ... def finish(self): ... self.participant.activity.workItemFinished(self)>>> class Review(ApplicationBase): ... def finish(self, publish): ... self.participant.activity.workItemFinished(self, publish)>>> class Publish(ApplicationBase): ... def start(self): ... print "Published" ... self.finish()>>> class Reject(ApplicationBase): ... def start(self): ... print "Rejected" ... self.finish()and then we’ll hook them up with the integration object:>>> integration.authorWorkItem = ApplicationBase >>> integration.reviewWorkItem = Review >>> integration.publishWorkItem = Publish >>> integration.rejectWorkItem = RejectUsing workflow processesTo use a process definition, instantiate it and call its start method to start execution:>>> proc = pd() >>> proc.start() ... # doctest: +NORMALIZE_WHITESPACE ProcessStarted(Process('sample')) Transition(None, Activity('sample.author')) ActivityStarted(Activity('sample.author'))We transition into the author activity and wait for work to get done. To move forward, we need to get at the authoring work item, so we can finish it. Our work items add themselves to a work list, so we can get the item from the list.>>> item = work_list.pop()Now we can finish the work item, by calling its finish method:>>> item.finish() WorkItemFinished('author') ActivityFinished(Activity('sample.author')) Transition(Activity('sample.author'), Activity('sample.review')) ActivityStarted(Activity('sample.review'))We see that we transitioned to the review activity. Note that thefinishmethod isn’t a part of the workflow APIs. It was defined by our sample classes. Other applications could use different mechanisms.Now, we’ll finish the review process by calling the review work item’sfinish. We’ll passFalse, indicating that the content should not be published:>>> work_list.pop().finish(False) WorkItemFinished('review') ActivityFinished(Activity('sample.review')) Transition(Activity('sample.review'), Activity('sample.reject')) ActivityStarted(Activity('sample.reject')) Rejected WorkItemFinished('reject') ActivityFinished(Activity('sample.reject')) ProcessFinished(Process('sample'))Ordering output transitionsNormally, outgoing transitions are ordered in the order of transition definition and all transitions from a given activity are used.If transitions are defined in an inconvenient order, then the workflow might not work as expected. For example, let’s modify the above process by switching the order of definition of some of the transitions. We’ll reuse our integration object from the previous example by passing it to the definition constructor:>>> pd = process.ProcessDefinition('sample', integration) >>> zope.component.provideUtility(pd, name=pd.id) Unregistered event: UtilityRegistration(<BaseGlobalComponents base>, IProcessDefinition, 'sample', ProcessDefinition('sample'), None, u'')>>> pd.defineActivities( ... author = process.ActivityDefinition(), ... review = process.ActivityDefinition(), ... publish = process.ActivityDefinition(), ... reject = process.ActivityDefinition(), ... ) >>> pd.defineTransitions( ... process.TransitionDefinition('author', 'review'), ... process.TransitionDefinition('review', 'reject'), ... process.TransitionDefinition( ... 'review', 'publish', condition=lambda data: data.publish), ... )>>> pd.defineApplications( ... author = process.Application(), ... review = process.Application( ... process.OutputParameter('publish')), ... publish = process.Application(), ... reject = process.Application(), ... )>>> pd.activities['author'].addApplication('author') >>> pd.activities['review'].addApplication('review', ['publish']) >>> pd.activities['publish'].addApplication('publish') >>> pd.activities['reject'].addApplication('reject')>>> pd.defineParticipants( ... author = process.Participant(), ... reviewer = process.Participant(), ... )>>> pd.activities['author'].definePerformer('author') >>> pd.activities['review'].definePerformer('reviewer')and run our process:>>> proc = pd() >>> proc.start() ... # doctest: +NORMALIZE_WHITESPACE ProcessStarted(Process('sample')) Transition(None, Activity('sample.author')) ActivityStarted(Activity('sample.author'))>>> work_list.pop().finish() WorkItemFinished('author') ActivityFinished(Activity('sample.author')) Transition(Activity('sample.author'), Activity('sample.review')) ActivityStarted(Activity('sample.review'))This time, we’ll say that we should publish:>>> work_list.pop().finish(True) WorkItemFinished('review') ActivityFinished(Activity('sample.review')) Transition(Activity('sample.review'), Activity('sample.reject')) ActivityStarted(Activity('sample.reject')) Rejected WorkItemFinished('reject') ActivityFinished(Activity('sample.reject')) ProcessFinished(Process('sample'))But we went to the reject activity anyway. Why? Because transitions are tested in order. Because the transition to the reject activity was tested first and had no condition, we followed it without checking the condition for the transition to the publish activity. We can fix this by specifying outgoing transitions on the reviewer activity directly. To do this, we’ll also need to specify ids in our transitions. Let’s redefine the process:>>> pd = process.ProcessDefinition('sample', integration) >>> zope.component.provideUtility(pd, name=pd.id) Unregistered event: UtilityRegistration(<BaseGlobalComponents base>, IProcessDefinition, 'sample', ProcessDefinition('sample'), None, u'')>>> pd.defineActivities( ... author = process.ActivityDefinition(), ... review = process.ActivityDefinition(), ... publish = process.ActivityDefinition(), ... reject = process.ActivityDefinition(), ... ) >>> pd.defineTransitions( ... process.TransitionDefinition('author', 'review'), ... process.TransitionDefinition('review', 'reject', id='reject'), ... process.TransitionDefinition( ... 'review', 'publish', id='publish', ... condition=lambda data: data.publish), ... )>>> pd.defineApplications( ... author = process.Application(), ... review = process.Application( ... process.OutputParameter('publish')), ... publish = process.Application(), ... reject = process.Application(), ... )>>> pd.activities['author'].addApplication('author') >>> pd.activities['review'].addApplication('review', ['publish']) >>> pd.activities['publish'].addApplication('publish') >>> pd.activities['reject'].addApplication('reject')>>> pd.defineParticipants( ... author = process.Participant(), ... reviewer = process.Participant(), ... )>>> pd.activities['author'].definePerformer('author') >>> pd.activities['review'].definePerformer('reviewer')>>> pd.activities['review'].addOutgoing('publish') >>> pd.activities['review'].addOutgoing('reject')Now, when we run the process, we’ll go to the publish activity as expected:>>> proc = pd() >>> proc.start() ... # doctest: +NORMALIZE_WHITESPACE ProcessStarted(Process('sample')) Transition(None, Activity('sample.author')) ActivityStarted(Activity('sample.author'))>>> work_list.pop().finish() WorkItemFinished('author') ActivityFinished(Activity('sample.author')) Transition(Activity('sample.author'), Activity('sample.review')) ActivityStarted(Activity('sample.review'))>>> work_list.pop().finish(True) WorkItemFinished('review') ActivityFinished(Activity('sample.review')) Transition(Activity('sample.review'), Activity('sample.publish')) ActivityStarted(Activity('sample.publish')) Published WorkItemFinished('publish') ActivityFinished(Activity('sample.publish')) ProcessFinished(Process('sample'))Let’s see the other way also, where we should transition to reject:>>> proc = pd() >>> proc.start() ... # doctest: +NORMALIZE_WHITESPACE ProcessStarted(Process('sample')) Transition(None, Activity('sample.author')) ActivityStarted(Activity('sample.author'))>>> work_list.pop().finish() WorkItemFinished('author') ActivityFinished(Activity('sample.author')) Transition(Activity('sample.author'), Activity('sample.review')) ActivityStarted(Activity('sample.review'))>>> work_list.pop().finish(False) WorkItemFinished('review') ActivityFinished(Activity('sample.review')) Transition(Activity('sample.review'), Activity('sample.reject')) ActivityStarted(Activity('sample.reject')) Rejected WorkItemFinished('reject') ActivityFinished(Activity('sample.reject')) ProcessFinished(Process('sample'))Complex FlowsLets look at a more complex example. In this example, we’ll extend the process to work with multiple reviewers. We’ll also make the work-list handling a bit more sophisticated. We’ll also introduce some new concepts:splits and joinsprocess argumentsConsider the publication process shown below:Author: Tech Tech Editorial Reviewer 1: Reviewer 2: Reviewer: =========== =========== =========== ============== --------- ----------------------------------------------------| Start | / --------- | V ----------- | Prepare |<------------------------------\ ----------- \ | ------------ \ | | Tech |--------------- \ \ |------->| Review 1 | V | | ------------ ---------- ------------- \ | Tech | | Editorial | ---------- ------------------->| Review |--->| Review |-->| Reject | | 2 | ------------- ---------- ---------- | | ----------- / \ | Prepare | / \--------\ | Final |<----------------------------/ | ----------- | ^ | ---------- V | \------------------------------->| Review | ----------- \ | Final |----->| Publish | ------------------------------------| | ----------- ----------Here we’ve arranged the process diagram into columns, with the activities for each participant. We have four participants, the author, two technical reviewers, and an editorial reviewer. The author prepares a draft. The author sends the draft tobothtechnical reviewers for review. When the technical reviews have completed, the editorial review does an initial editorial review. Based on the technical reviews, the editor may choose to:Reject the documentPublish the document as isRequest technical changes (based on the technical reviewers’ comments), orRequest editorial changes.If technical changes are required, the work flows back to the “Prepare” activity. If editorial changes are necessary, then work flows to the “Prepare Final” activity. When the author has made the editorial changes, work flows to “Review Final”. The editor may request additional changes, in which case, work flows back to “Prepare Final”, otherwise, the work flows to “Publish”.This example illustrates different kinds of “joins” and “splits”. The term “join” refers to the way incoming transitions to an activity are handled. There are two kinds of joins: “and” and “xor”. With an “and” join, the activity waits for each of the incoming transitions. In this example, the inputs to the “Editorial Review” activity form an “and” join. Editorial review waits until each of the technical reviews are completed. The rest of the joins in this example are “xor” joins. The activity starts on any transition into the activity.The term “split” refers to way outgoing transitions from an activity are handled. Normally, exactly one transition out of an activity is used. This is called an “xor” split. With an “and” split, all transitions with boolean conditions that evaluate toTrueare used. In this example, the “Prepare” activity has an “and” split. Work flows simultaneously to the two technical review activities. The rest of the splits in this example are “xor” splits.Lets create our new workflow process. We’ll reuse our existing integration object:>>> Publication = process.ProcessDefinition('Publication') >>> Publication.integration = integration >>> zope.component.provideUtility(Publication, name=Publication.id)>>> Publication.defineActivities( ... start = process.ActivityDefinition("Start"), ... prepare = process.ActivityDefinition("Prepare"), ... tech1 = process.ActivityDefinition("Technical Review 1"), ... tech2 = process.ActivityDefinition("Technical Review 2"), ... review = process.ActivityDefinition("Editorial Review"), ... final = process.ActivityDefinition("Final Preparation"), ... rfinal = process.ActivityDefinition("Review Final"), ... publish = process.ActivityDefinition("Publish"), ... reject = process.ActivityDefinition("Reject"), ... )Here, we’ve passed strings to the activity definitions providing names. Names must be either unicode or ASCII strings.We define our transitions:>>> Publication.defineTransitions( ... process.TransitionDefinition('start', 'prepare'), ... process.TransitionDefinition('prepare', 'tech1'), ... process.TransitionDefinition('prepare', 'tech2'), ... process.TransitionDefinition('tech1', 'review'), ... process.TransitionDefinition('tech2', 'review'), ... ... process.TransitionDefinition( ... 'review', 'reject', ... condition=lambda data: not data.publish ... ), ... process.TransitionDefinition( ... 'review', 'prepare', ... condition=lambda data: data.tech_changes ... ), ... process.TransitionDefinition( ... 'review', 'final', ... condition=lambda data: data.ed_changes ... ), ... process.TransitionDefinition('review', 'publish'), ... ... process.TransitionDefinition('final', 'rfinal'), ... process.TransitionDefinition( ... 'rfinal', 'final', ... condition=lambda data: data.ed_changes ... ), ... process.TransitionDefinition('rfinal', 'publish'), ... )We specify our “and” split and join:>>> Publication.activities['prepare'].andSplit(True) >>> Publication.activities['review'].andJoin(True)We define our participants and applications:>>> Publication.defineParticipants( ... author = process.Participant("Author"), ... tech1 = process.Participant("Technical Reviewer 1"), ... tech2 = process.Participant("Technical Reviewer 2"), ... reviewer = process.Participant("Editorial Reviewer"), ... )>>> Publication.defineApplications( ... prepare = process.Application(), ... tech_review = process.Application( ... process.OutputParameter('publish'), ... process.OutputParameter('tech_changes'), ... ), ... ed_review = process.Application( ... process.InputParameter('publish1'), ... process.InputParameter('tech_changes1'), ... process.InputParameter('publish2'), ... process.InputParameter('tech_changes2'), ... process.OutputParameter('publish'), ... process.OutputParameter('tech_changes'), ... process.OutputParameter('ed_changes'), ... ), ... publish = process.Application(), ... reject = process.Application(), ... final = process.Application(), ... rfinal = process.Application( ... process.OutputParameter('ed_changes'), ... ), ... )>>> Publication.activities['prepare'].definePerformer('author') >>> Publication.activities['prepare'].addApplication('prepare')>>> Publication.activities['tech1'].definePerformer('tech1') >>> Publication.activities['tech1'].addApplication( ... 'tech_review', ['publish1', 'tech_changes1'])>>> Publication.activities['tech2'].definePerformer('tech2') >>> Publication.activities['tech2'].addApplication( ... 'tech_review', ['publish2', 'tech_changes2'])>>> Publication.activities['review'].definePerformer('reviewer') >>> Publication.activities['review'].addApplication( ... 'ed_review', ... ['publish1', 'tech_changes1', 'publish2', 'tech_changes2', ... 'publish', 'tech_changes', 'ed_changes'], ... )>>> Publication.activities['final'].definePerformer('author') >>> Publication.activities['final'].addApplication('final')>>> Publication.activities['rfinal'].definePerformer('reviewer') >>> Publication.activities['rfinal'].addApplication( ... 'rfinal', ['ed_changes'], ... )>>> Publication.activities['publish'].addApplication('publish') >>> Publication.activities['reject'].addApplication('reject')We want to be able to specify an author when we start the process. We’d also like to be told the final disposition of the process. To accomplish this, we’ll define parameters for our process:>>> Publication.defineParameters( ... process.InputParameter('author'), ... process.OutputParameter('publish'), ... )Now that we’ve defined the process, we need to provide participant and application components. Let’s start with our participants. Rather than sharing a single work list, we’ll give each user their own work list. We’ll also create preexisting participants and return them. Finally, we’ll create multiple authors and use the selected one:>>> class User: ... def __init__(self): ... self.work_list = []>>> authors = {'bob': User(), 'ted': User(), 'sally': User()}>>> reviewer = User() >>> tech1 = User() >>> tech2 = User()>>> class Author(Participant): ... def __init__(self, activity): ... Participant.__init__(self, activity) ... author_name = activity.process.workflowRelevantData.author ... print "Author `%s` selected" % author_name ... self.user = authors[author_name]In this example, we need to define a separate attribute for each participant:>>> integration.authorParticipant = AuthorWhen the process is created, the author name will be passed in and assigned to the workflow-relevant data. Our author class uses this information to select the named user.>>> class Reviewer(Participant): ... user = reviewer >>> integration.reviewerParticipant = Reviewer>>> class Tech1(Participant): ... user = tech1 >>> integration.tech1Participant = Tech1>>> class Tech2(Participant): ... user = tech2 >>> integration.tech2Participant = Tech2We’ll use our orginal participation class for activities without performers:>>> integration.Participant = ParticipantNow we’ll create our applications. Let’s start with our author:>>> class ApplicationBase(object): ... zope.component.adapts(interfaces.IParticipant) ... zope.interface.implements(interfaces.IWorkItem) ... ... def __init__(self, participant): ... self.participant = participant ... self.activity = participant.activity ... participant.user.work_list.append(self) ... ... def start(self): ... pass ... ... def finish(self): ... self.participant.activity.workItemFinished(self)>>> class Prepare(ApplicationBase): ... ... def summary(self): ... process = self.activity.process ... doc = getattr(process.applicationRelevantData, 'doc', '') ... if doc: ... print 'Previous draft:' ... print doc ... print 'Changes we need to make:' ... for change in process.workflowRelevantData.tech_changes: ... print change ... else: ... print 'Please write the initial draft' ... ... def finish(self, doc): ... self.activity.process.applicationRelevantData.doc = doc ... super(Prepare, self).finish()>>> integration.prepareWorkItem = PrepareSince we used the prepare application for revisions as well as initial preparation, we provide a summary method to show us what we have to do.Here we get the document created by the author passed in as an argument to the finish method. In a more realistic implementation, the author task would create the document at the start of the task and provide a user interface for the user to edit it. We store the document as application-relevant data, since we’ll want reviewers to be able to access it, but we don’t need it directly for workflow control.>>> class TechReview(ApplicationBase): ... ... def getDoc(self): ... return self.activity.process.applicationRelevantData.doc ... ... def finish(self, decision, changes): ... self.activity.workItemFinished(self, decision, changes)>>> integration.tech_reviewWorkItem = TechReviewHere, we provided a method to access the original document.>>> class Review(TechReview): ... ... def start(self, publish1, changes1, publish2, changes2): ... if not (publish1 and publish2): ... # Reject if either tech reviewer rejects ... self.activity.workItemFinished( ... self, False, changes1 + changes2, ()) ... ... if changes1 or changes2: ... # we won't do anything if there are tech changes ... self.activity.workItemFinished( ... self, True, changes1 + changes2, ()) ... ... def finish(self, ed_changes): ... self.activity.workItemFinished(self, True, (), ed_changes)>>> integration.ed_reviewWorkItem = ReviewIn this implementation, we decided to reject outright if either technical editor recommended rejection and to send work back to preparation if there are any technical changes. We also subclassedTechReviewto get thegetDocmethod.We’ll reuse thepublishandrejectapplication from the previous example.>>> class Final(ApplicationBase): ... ... def summary(self): ... process = self.activity.process ... doc = getattr(process.applicationRelevantData, 'doc', '') ... print 'Previous draft:' ... print self.activity.process.applicationRelevantData.doc ... print 'Changes we need to make:' ... for change in process.workflowRelevantData.ed_changes: ... print change ... ... def finish(self, doc): ... self.activity.process.applicationRelevantData.doc = doc ... super(Final, self).finish()>>> integration.finalWorkItem = FinalIn our this application, we simply update the document to reflect changes.>>> class ReviewFinal(TechReview): ... ... def finish(self, ed_changes): ... self.activity.workItemFinished(self, ed_changes)>>> integration.rfinalWorkItem = ReviewFinalOur process now returns data. When we create a process, we need to supply an object that it can call back to:>>> class PublicationContext: ... zope.interface.implements(interfaces.IProcessContext) ... ... def processFinished(self, process, decision): ... self.decision = decisionNow, let’s try out our process:>>> context = PublicationContext() >>> proc = Publication(context) >>> proc.start('bob') ProcessStarted(Process('Publication')) Transition(None, Activity('Publication.start')) ActivityStarted(Activity('Publication.start')) ActivityFinished(Activity('Publication.start')) Author `bob` selected Transition(Activity('Publication.start'), Activity('Publication.prepare')) ActivityStarted(Activity('Publication.prepare'))We should have added an item to bob’s work list. Let’s get it and finish it, submitting a document:>>> item = authors['bob'].work_list.pop() >>> item.finish("I give my pledge, as an American\n" ... "to save, and faithfully to defend from waste\n" ... "the natural resources of my Country.") WorkItemFinished('prepare') ActivityFinished(Activity('Publication.prepare')) Transition(Activity('Publication.prepare'), Activity('Publication.tech1')) ActivityStarted(Activity('Publication.tech1')) Transition(Activity('Publication.prepare'), Activity('Publication.tech2')) ActivityStarted(Activity('Publication.tech2'))Notice that we transitioned totwoactivities,tech1andtech2. This is because the prepare activity has an “and” split. Now we’ll do a tech review. Let’s see what tech1 has:>>> item = tech1.work_list.pop() >>> print item.getDoc() I give my pledge, as an American to save, and faithfully to defend from waste the natural resources of my Country.Let’s tell the author to change “American” to “Earthling”:>>> item.finish(True, ['Change "American" to "Earthling"']) WorkItemFinished('tech_review') ActivityFinished(Activity('Publication.tech1')) Transition(Activity('Publication.tech1'), Activity('Publication.review'))Here we transitioned to the editorial review activity, but we didn’t start it. This is because the editorial review activity has an “and” join, meaning that it won’t start until both transitions have occurred.Now we’ll do the other technical review:>>> item = tech2.work_list.pop() >>> item.finish(True, ['Change "Country" to "planet"']) WorkItemFinished('tech_review') ActivityFinished(Activity('Publication.tech2')) Transition(Activity('Publication.tech2'), Activity('Publication.review')) ActivityStarted(Activity('Publication.review')) WorkItemFinished('ed_review') ActivityFinished(Activity('Publication.review')) Author `bob` selected Transition(Activity('Publication.review'), Activity('Publication.prepare')) ActivityStarted(Activity('Publication.prepare'))Now when we transitioned to the editorial review activity, we started it, because each of the input transitions had happened. Our editorial review application automatically sent the work back to preparation, because there were technical comments. Of course the author is stillbob. Let’s address the comments:>>> item = authors['bob'].work_list.pop() >>> item.summary() Previous draft: I give my pledge, as an American to save, and faithfully to defend from waste the natural resources of my Country. Changes we need to make: Change "American" to "Earthling" Change "Country" to "planet">>> item.finish("I give my pledge, as an Earthling\n" ... "to save, and faithfully to defend from waste\n" ... "the natural resources of my planet.") WorkItemFinished('prepare') ActivityFinished(Activity('Publication.prepare')) Transition(Activity('Publication.prepare'), Activity('Publication.tech1')) ActivityStarted(Activity('Publication.tech1')) Transition(Activity('Publication.prepare'), Activity('Publication.tech2')) ActivityStarted(Activity('Publication.tech2'))As before, after completing the initial edits, we start the technical review activities again. We’ll review it again. This time, we have no comments, because the author applied our requested changes:>>> item = tech1.work_list.pop() >>> item.finish(True, []) WorkItemFinished('tech_review') ActivityFinished(Activity('Publication.tech1')) Transition(Activity('Publication.tech1'), Activity('Publication.review'))>>> item = tech2.work_list.pop() >>> item.finish(True, []) WorkItemFinished('tech_review') ActivityFinished(Activity('Publication.tech2')) Transition(Activity('Publication.tech2'), Activity('Publication.review')) ActivityStarted(Activity('Publication.review'))This time, we are left in the technical review activity because there weren’t any technical changes. We’re ready to do our editorial review. We’ll request an editorial change:>>> item = reviewer.work_list.pop() >>> print item.getDoc() I give my pledge, as an Earthling to save, and faithfully to defend from waste the natural resources of my planet.>>> item.finish(['change "an" to "a"']) WorkItemFinished('ed_review') ActivityFinished(Activity('Publication.review')) Author `bob` selected Transition(Activity('Publication.review'), Activity('Publication.final')) ActivityStarted(Activity('Publication.final'))Because we requested editorial changes, we transitioned to the final editing activity, so that the author (still bob) can make the changes:>>> item = authors['bob'].work_list.pop() >>> item.summary() Previous draft: I give my pledge, as an Earthling to save, and faithfully to defend from waste the natural resources of my planet. Changes we need to make: change "an" to "a">>> item.finish("I give my pledge, as a Earthling\n" ... "to save, and faithfully to defend from waste\n" ... "the natural resources of my planet.") WorkItemFinished('final') ActivityFinished(Activity('Publication.final')) Transition(Activity('Publication.final'), Activity('Publication.rfinal')) ActivityStarted(Activity('Publication.rfinal'))We transition to the activity for reviewing the final edits. We review the document and approve it for publication:>>> item = reviewer.work_list.pop() >>> print item.getDoc() I give my pledge, as a Earthling to save, and faithfully to defend from waste the natural resources of my planet.>>> item.finish([]) WorkItemFinished('rfinal') ActivityFinished(Activity('Publication.rfinal')) Transition(Activity('Publication.rfinal'), Activity('Publication.publish')) ActivityStarted(Activity('Publication.publish')) Published WorkItemFinished('publish') ActivityFinished(Activity('Publication.publish')) ProcessFinished(Process('Publication'))At this point, the rest of the process finished automatically. In addition, the decision was recorded in the process context object:>>> context.decision TrueComing SoonXPDL supportTimeouts/exceptions“otherwise” conditions[1]There are other kinds of conditions, namely “otherwise” and “exception” conditions.See alsohttp://www.wfmc.orghttp://www.wfmc.org/standards/standards.htmXPDL ImportWe can import process definitions from files in the XML Process Definition Language (XPDL) format. An XPDL file contains multiple process definitions arranged in a package. When we load the file, we get a package containing some number of process definitions.Let’s look at an example. The filepublication.xpdlcontains a definition for the publication example developed in the “README.txt” file. We can read it using the xpdl module:>>> from zope.wfmc import xpdl >>> import os >>> package = xpdl.read(open(os.path.join(this_directory, ... 'publication.xpdl')))This package contains a single definition:>>> package {u'Publication': ProcessDefinition(u'Publication')}>>> pd = package[u'Publication'] >>> from zope.wfmc.attributeintegration import AttributeIntegration >>> integration = AttributeIntegration() >>> pd.integration = integrationNow, having read the process definition, we can use it as we did before (in “README.txt”). As before, we’ll create an event subscriber so that we can see what’s going on:>>> def log_workflow(event): ... print event>>> import zope.event >>> zope.event.subscribers.append(log_workflow)and we’ll register the process definition as a utility:>>> import zope.component >>> zope.component.provideUtility(pd, name=pd.id)and we’ll define and register participant and application adapters:>>> import zope.interface >>> from zope.wfmc import interfaces>>> class Participant(object): ... zope.component.adapts(interfaces.IActivity) ... zope.interface.implements(interfaces.IParticipant) ... ... def __init__(self, activity): ... self.activity = activity>>> class User: ... def __init__(self): ... self.work_list = []>>> authors = {'bob': User(), 'ted': User(), 'sally': User()}>>> reviewer = User() >>> tech1 = User() >>> tech2 = User()>>> class Author(Participant): ... def __init__(self, activity): ... Participant.__init__(self, activity) ... author_name = activity.process.workflowRelevantData.author ... print "Author `%s` selected" % author_name ... self.user = authors[author_name]>>> integration.authorParticipant = Author>>> class Reviewer(Participant): ... user = reviewer >>> integration.reviewerParticipant = Reviewer>>> class Tech1(Participant): ... user = tech1 >>> integration.tech1Participant = Tech1>>> class Tech2(Participant): ... user = tech2 >>> integration.tech2Participant = Tech2>>> integration.SystemParticipant = Participant>>> class ApplicationBase(object): ... zope.component.adapts(interfaces.IParticipant) ... zope.interface.implements(interfaces.IWorkItem) ... ... def __init__(self, participant): ... self.participant = participant ... self.activity = participant.activity ... participant.user.work_list.append(self) ... ... def start(self): ... pass ... ... def finish(self): ... self.participant.activity.workItemFinished(self)>>> class Prepare(ApplicationBase): ... ... def summary(self): ... process = self.activity.process ... doc = getattr(process.applicationRelevantData, 'doc', '') ... if doc: ... print 'Previous draft:' ... print doc ... print 'Changes we need to make:' ... for change in process.workflowRelevantData.tech_changes: ... print change ... else: ... print 'Please write the initial draft' ... ... def finish(self, doc): ... self.activity.process.applicationRelevantData.doc = doc ... super(Prepare, self).finish()>>> integration.prepareWorkItem = Prepare>>> class TechReview(ApplicationBase): ... ... def getDoc(self): ... return self.activity.process.applicationRelevantData.doc ... ... def finish(self, decision, changes): ... self.activity.workItemFinished(self, decision, changes)>>> integration.tech_reviewWorkItem = TechReview>>> class Review(TechReview): ... ... def start(self, publish1, changes1, publish2, changes2): ... if not (publish1 and publish2): ... # Reject if either tech reviewer rejects ... self.activity.workItemFinished( ... self, False, changes1 + changes2, ()) ... ... if changes1 or changes2: ... # we won't do anyting if there are tech changes ... self.activity.workItemFinished( ... self, True, changes1 + changes2, ()) ... ... def finish(self, ed_changes): ... self.activity.workItemFinished(self, True, (), ed_changes)>>> integration.ed_reviewWorkItem = Review>>> class Final(ApplicationBase): ... ... def summary(self): ... process = self.activity.process ... doc = getattr(process.applicationRelevantData, 'doc', '') ... print 'Previous draft:' ... print self.activity.process.applicationRelevantData.doc ... print 'Changes we need to make:' ... for change in process.workflowRelevantData.ed_changes: ... print change ... ... def finish(self, doc): ... self.activity.process.applicationRelevantData.doc = doc ... super(Final, self).finish()>>> integration.finalWorkItem = Final>>> class ReviewFinal(TechReview): ... ... def finish(self, ed_changes): ... self.activity.workItemFinished(self, ed_changes)>>> integration.rfinalWorkItem = ReviewFinal>>> class Publish: ... zope.component.adapts(interfaces.IParticipant) ... zope.interface.implements(interfaces.IWorkItem) ... ... def __init__(self, participant): ... self.participant = participant ... ... def start(self): ... print "Published" ... self.finish() ... ... def finish(self): ... self.participant.activity.workItemFinished(self)>>> integration.publishWorkItem = Publish>>> class Reject(Publish): ... def start(self): ... print "Rejected" ... self.finish()>>> integration.rejectWorkItem = Rejectand a process context, so we can pass parameters:>>> class PublicationContext: ... zope.interface.implements(interfaces.IProcessContext) ... ... def processFinished(self, process, decision): ... self.decision = decisionNow, let’s try out our process. We’ll follow the same steps we did in “README.txt”, getting the same results:>>> context = PublicationContext() >>> proc = pd(context) >>> proc.start('bob') ProcessStarted(Process(u'Publication')) Transition(None, Activity(u'Publication.start')) ActivityStarted(Activity(u'Publication.start')) ActivityFinished(Activity(u'Publication.start')) Author `bob` selected Transition(Activity(u'Publication.start'), Activity(u'Publication.prepare')) ActivityStarted(Activity(u'Publication.prepare'))>>> item = authors['bob'].work_list.pop() >>> item.finish("I give my pledge, as an American\n" ... "to save, and faithfully to defend from waste\n" ... "the natural resources of my Country.") WorkItemFinished(u'prepare') ActivityFinished(Activity(u'Publication.prepare')) Transition(Activity(u'Publication.prepare'), Activity(u'Publication.tech1')) ActivityStarted(Activity(u'Publication.tech1')) Transition(Activity(u'Publication.prepare'), Activity(u'Publication.tech2')) ActivityStarted(Activity(u'Publication.tech2'))>>> item = tech1.work_list.pop() >>> print item.getDoc() I give my pledge, as an American to save, and faithfully to defend from waste the natural resources of my Country.>>> item.finish(True, ['Change "American" to "human"']) WorkItemFinished(u'tech_review') ActivityFinished(Activity(u'Publication.tech1')) Transition(Activity(u'Publication.tech1'), Activity(u'Publication.review'))>>> item = tech2.work_list.pop() >>> item.finish(True, ['Change "Country" to "planet"']) WorkItemFinished(u'tech_review') ActivityFinished(Activity(u'Publication.tech2')) Transition(Activity(u'Publication.tech2'), Activity(u'Publication.review')) ActivityStarted(Activity(u'Publication.review')) WorkItemFinished(u'ed_review') ActivityFinished(Activity(u'Publication.review')) Author `bob` selected Transition(Activity(u'Publication.review'), Activity(u'Publication.prepare')) ActivityStarted(Activity(u'Publication.prepare'))>>> item = authors['bob'].work_list.pop() >>> item.summary() Previous draft: I give my pledge, as an American to save, and faithfully to defend from waste the natural resources of my Country. Changes we need to make: Change "American" to "human" Change "Country" to "planet">>> item.finish("I give my pledge, as an human\n" ... "to save, and faithfully to defend from waste\n" ... "the natural resources of my planet.") WorkItemFinished(u'prepare') ActivityFinished(Activity(u'Publication.prepare')) Transition(Activity(u'Publication.prepare'), Activity(u'Publication.tech1')) ActivityStarted(Activity(u'Publication.tech1')) Transition(Activity(u'Publication.prepare'), Activity(u'Publication.tech2')) ActivityStarted(Activity(u'Publication.tech2'))>>> item = tech1.work_list.pop() >>> item.finish(True, []) WorkItemFinished(u'tech_review') ActivityFinished(Activity(u'Publication.tech1')) Transition(Activity(u'Publication.tech1'), Activity(u'Publication.review'))>>> item = tech2.work_list.pop() >>> item.finish(True, []) WorkItemFinished(u'tech_review') ActivityFinished(Activity(u'Publication.tech2')) Transition(Activity(u'Publication.tech2'), Activity(u'Publication.review')) ActivityStarted(Activity(u'Publication.review'))>>> item = reviewer.work_list.pop() >>> print item.getDoc() I give my pledge, as an human to save, and faithfully to defend from waste the natural resources of my planet.>>> item.finish(['change "an" to "a"']) WorkItemFinished(u'ed_review') ActivityFinished(Activity(u'Publication.review')) Author `bob` selected Transition(Activity(u'Publication.review'), Activity(u'Publication.final')) ActivityStarted(Activity(u'Publication.final'))>>> item = authors['bob'].work_list.pop() >>> item.summary() Previous draft: I give my pledge, as an human to save, and faithfully to defend from waste the natural resources of my planet. Changes we need to make: change "an" to "a">>> item.finish("I give my pledge, as a human\n" ... "to save, and faithfully to defend from waste\n" ... "the natural resources of my planet.") WorkItemFinished(u'final') ActivityFinished(Activity(u'Publication.final')) Transition(Activity(u'Publication.final'), Activity(u'Publication.rfinal')) ActivityStarted(Activity(u'Publication.rfinal'))>>> item = reviewer.work_list.pop() >>> print item.getDoc() I give my pledge, as a human to save, and faithfully to defend from waste the natural resources of my planet.>>> item.finish([]) WorkItemFinished(u'rfinal') ActivityFinished(Activity(u'Publication.rfinal')) Transition(Activity(u'Publication.rfinal'), Activity(u'Publication.publish')) ActivityStarted(Activity(u'Publication.publish')) Published WorkItemFinished(u'publish') ActivityFinished(Activity(u'Publication.publish')) ProcessFinished(Process(u'Publication'))>>> context.decision TrueDescriptionsMost process elements can have names and descriptions.>>> pd.__name__ u'Publication'>>> pd.description u'This is the sample process'>>> pd.applications['prepare'].__name__ u'Prepare'>>> pd.applications['prepare'].description u'Prepare the initial draft'>>> pd.activities['tech1'].__name__ u'Technical Review 1'>>> pd.activities['tech1'].description u'This is the first Technical Review.'>>> pd.participants['tech1'].__name__ u'Technical Reviewer 1'>>> pd.participants['tech1'].description u'He is a smart guy.'>>> sorted([item.__name__ for item in pd.transitions]) [u'Transition', u'Transition', u'Transition', u'Transition', u'Transition', u'Transition', u'Transition', u'Transition', u'Transition', u'Transition', u'Transition to Tech Review 1', u'Transition to Tech Review 2']>>> sorted([item.description for item in pd.transitions]) [None, None, None, None, None, None, None, None, None, None, None, u'Use this transition if there are editorial changes required.']CHANGES3.5.0 (2009-07-24)Update tests to latest package versions.3.4.0 (2007-11-02)Initial release independent of the main Zope tree.
zope.xmlpickle
Pickle-based serialization of Python objects to and from XML.CHANGES3.4.0 (2007-11-03)Initial release independent of the main Zope tree.
zope.z2release
Introductionzope.z2releasesis used to generated a PyPI compatible index with references to all pinned package versions based on aversions.cfg.It can handle both a Zope 2 release as well as a Zope Toolkit release.UsageTo generate an index, use:z2_kgs tags/2.12.1 /srv/Zope2/index/2.12.1 ztk_kgs tags/1.0a1 /srv/zopetoolkit/index/1.0a1Changelog0.9 - 2013-03-02Modernizedz2_kgscode and updated it to work with Github.Modernizedztk_kgscode and skip thezopeapp-versionsfile for ZTK 2+.0.8 - 2010-09-09Do not override existing version pins defined in theversions.cfgby versions from the extends lines. This refshttps://bugs.launchpad.net/zope2/+bug/623428.0.7 - 2010-07-13Added support for having anextendsline pointing to another version file and still creating a full index.0.6 - 2010-07-13Support packages with underscores in their name.0.5 - 2010-06-30Disable the index building for a ZTK release.0.4 - 2010-06-26Added support for creating a Zope Toolkit index.Updatepackage_urlstorelease_urlsas specified inhttp://wiki.python.org/moin/PyPiXmlRpc.0.3 - 2010-06-13Added support for inline comments in the versions section.Readme style fixes.0.2 - 2010-04-05Avoid hardcoded upper_names list.0.1.5 - 2009-12-25sanity check for download_urlbetter parameter check0.1.4 - 2009-08-06better parameter check0.1.3 - 2009-04-25generate a versions.cfg file within the index directory0.1.2 - 2009-04-25removed hard-coded Zope 2 version0.1.1 - 2009-04-25bahhh…fixed broken package0.1.0 - 2009-04-24Initial release
zopfli
PYZOPFLIcPython bindings forzopfli.It requires Python 3.8 or greater.USAGEpyzopfli is a straight forward wrapper around zopfli’s ZlibCompress method.from zopfli.zlib import compress from zlib import decompress s = 'Hello World' print decompress(compress(s))pyzopfli also wraps GzipCompress, but the API point does not try to mimic the gzip module.from zopfli.gzip import compress from StringIO import StringIO from gzip import GzipFile print GzipFile(fileobj=StringIO(compress("Hello World!"))).read()Both zopfli.zlib.compress and zopfli.gzip.compress support the following keyword arguments. All values should be integers; boolean parmaters are treated as expected, 0 and >0 as false and true.verbosedumps zopfli debugging data to stderrnumiterationsMaximum amount of times to rerun forward and backward pass to optimize LZ77 compression cost. Good values: 10, 15 for small files, 5 for files over several MB in size or it will be too slow.blocksplittingIf true, splits the data in multiple deflate blocks with optimal choice for the block boundaries. Block splitting gives better compression. Default: true (1).blocksplittinglastIf true, chooses the optimal block split points only after doing the iterative LZ77 compression. If false, chooses the block split points first, then does iterative LZ77 on each individual block. Depending on the file, either first or last gives the best compression. Default: false (0).blocksplittingmaxMaximum amount of blocks to split into (0 for unlimited, but this can give extreme results that hurt compression on some files). Default value: 15.TODOStop reading the entire file into memory and support streamingMonkey patch zlib and gzip so code with an overly tight binding can be easily modified to use zopfli.
zopflipng
ZopfliPNG wrapper for pythonThis library wraps the zopflipng extension to implement lossless compression of PNG.Lossless compression of PNGS implemented by zopfli typically results in a compression ratio of 5% more than other lossless compression tools at the expense of longer compression time.Installpip install zopflipngUsage:# a simple example, using the default configuration from zopflipng import png_optimize data = open('test.png', 'rb').read() result, code = png_optimize(data) # if code ==0 ,png compression success if code == 0: # save png with open('result.png','wb') as f: f.write(result) f.close()Use quick, but not very good, compression:result, code = png_optimize(data, use_zopfli=False)Compress really good and trying all filter strategies:result, code = png_optimize(data, lossy_8bit=True, lossy_transparent=True, filter_strategies='01234mepb', num_iterations=500)If you want to process multiple images, use multiprocessing
zopflipy
APythonbindings forZopfli.Installation$pipinstallzopflipyRequirementsPython 3.8+setuptoolsUsageZopfliCompressor>>>importzopfli>>>c=zopfli.ZopfliCompressor(zopfli.ZOPFLI_FORMAT_DEFLATE)>>>z=c.compress(b'Hello, world!')+c.flush()>>>d=zopfli.ZopfliDecompressor(zopfli.ZOPFLI_FORMAT_DEFLATE)>>>d.decompress(z)+d.flush()b'Hello, world!''ZopfliDeflater>>>importzopfli>>>c=zopfli.ZopfliDeflater()>>>z=c.compress(b'Hello, world!')+c.flush()>>>d=zopfli.ZopfliDecompressor(zopfli.ZOPFLI_FORMAT_DEFLATE)>>>d.decompress(z)+d.flush()b'Hello, world!''ZopfliPNG>>>importzopfli>>>png=zopfli.ZopfliPNG()>>>withopen('in.png','rb')asfp:...data=fp.read()>>>len(png.optimize(data))<len(data)TrueZipFileA subclass ofzipfile.ZipFilewhich usesZopfliCompressorfor thezipfile.ZIP_DEFLATEDcompression method.>>>importzipfile>>>importzopfli>>>withzopfli.ZipFile('a.zip','w',zipfile.ZIP_DEFLATED)aszf:...zf.writestr('a.txt',b'Hello, world!')LicenseZopfliPy is distributed under the terms of the Apache License, Version 2.0.
zopkio
Zopkio - A Functional and Performance Test Framework for Distributed Systems============================================================================.. image:: https://travis-ci.org/linkedin/Zopkio.svg?branch=master:target: https://travis-ci.org/linkedin/Zopkio.. image:: https://coveralls.io/repos/linkedin/Zopkio/badge.svg?branch=master&service=github:target: https://coveralls.io/github/linkedin/Zopkio?branch=masterZopkio is a test framework built to support at scale performance and functionaltesting.Installation------------Zopkio is distributed via pipTo install::(sudo) pip install zopkioIf you want to work with the latest code::git clone [email protected]:linkedin/zopkio.gitcd zopkioOnce you have downloaded the code you can run the zopkio unit tests::python setup.py testOr you can install zopkio and run the sample test::(sudo) python setup.py installzopkio examples/server_client/server_client.pyN.B the example code assumes you can ssh into your own box using yourssh keys so if your are having issues with the tests failing check yourauthorized_keys.In the past there have been issues installing one of our dependencies (Naarad)if you encounter errors installing naarad seehttps://github.com/linkedin/naarad/wiki/InstallationBasic usage-----------Use the zopkio main script::zopkio testfileZopkio takes several optional arguments::--test-only [TEST_LIST [TEST_LIST ...]]run only the named tests to help debug broken tests--machine-list [MACHINE_LIST [MACHINE_LIST ...]]mapping of logical host names to physical namesallowing the same test suite to run on differenthardware, each argument is a pair of logical name andphysical name separated by a =--config-overrides [CONFIG_OVERRIDES [CONFIG_OVERRIDES ...]]config overrides at execution time, each argument is aconfig with its value separated by a =. This has thehighest priority of all configs-d OUTPUT_DIR, --output-dir OUTPUT_DIRSpecify the output directory for logs and test results.By default, Zopkio will write to the current directory.--log-level LOG_LEVELLog level (default INFO)--console-log-level CONSOLE_LEVELConsole Log level (default ERROR)--nopassword Disable password prompt--user USER user to run the test as (defaults to current user)Testing with Zopkio-------------------Zopkio provides the ability to write tests that combine performance andfunctional testing across a distributed service or services.Writing tests using Zopkio should be nearly as simple as writing tests in xUnitor Nose etc. A test suite will consist of a single file specifying fourrequired pieces:#. A deployment file#. One or more test files#. A dynamic configuration file#. A config directoryFor simplicity in the first iteratation this is assumed to be json or a pythonfile with a dictionary called *test*.Deployment~~~~~~~~~~The deployment file should be pointed to by an entry in the dictionary called*deployment_code*. Deplyoment is one of the key features of Zopkio.Developers can write test inwhich they bring up arbtrary sets of services on multiple machines and thenwithin the tests exercise a considerable degree of control over these machines.The deployment section of code will be similar to deployment in other testframeworks but because of the increased complexity and the expectation of reuseacross multiple test suites, it can be broken into its own file.A deployment file can contain four functions:#. ``setup_suite``#. ``setup``#. ``teardown``#. ``teardown_suite``As in other test frameworks, ``setup_suite`` will run before any of tests,``setup`` will run before each test, ``teardown`` will run if ``setup`` ransuccessfully regardless of the test status, and ``teardown_suite`` will run if``setup_suite`` ran successfully regardless of any other conditions. The maindistinction in the case of this framework will be in the extended libraries tosupport deployment.In many cases the main task of the deployment code is creating a Deployer.This can be done using the SSHDeployer provided by the framework or throughcustom code. For more information about deployers see the APIs. The ``runtime``module provides a helpful ``set_deployer(service_name)`` and``get_deployer(service_name)``. In addition to allowing the deployers to beeasily shared across functions and modules, using these functions will allowthe framework to automatically handle certain tasks such as copying logs fromthe remote hosts. Once the deployer is created it can be used in both thesetup and teardown functions to start and stop the services.Since the ``setup`` and ``teardown`` functions run before and after each test atypical use is to restore the state of the system between tests to preventtests from leaking bugs into other tests. If the ``setup`` or ``teardown``fails we will skip the test and mark it as a failure. In an effort to avoidwasting time with a corrupted stack there is a configuration``max_failures_per_suite_before_abort`` which can be set to determine how manytimes the frameworke will skip tests before autmatically skipping the remainingtests in that suite.In addition the entire suite is rerun parameterized by the configurations (Seeconfigs_) there is a second config ``max_suite_failures_before_abort``which behaves similarly.Test Files~~~~~~~~~~Test files are specified by an entry in the test dictionary called *test_code*,which should point to a list of test files.For each test file, the framework will execute any function with *test* in thename (no matter the case) and track if the function executes successfully. Inaddition if there is a function ``test_foo`` and a function ``validate_foo``,after all cleanup and log collection is done, if ``test_foo`` executed successfullythen ``validate_foo`` will be executed and tested for successful execution ifit fails, the original test will fail and the logs from the post execution willbe displayed. Test can be run in either a parallel mode or a serial mode. Bydefault tests are run serially without any specified order. However each test filemay specify an attribute *test_phase*. A test_phase of -1 is equivalent to serialtesting. Otherwise all tests with the same test_phase will be run in paralleltogether. Phases proceed in ascending order.Dynamic Configuration File~~~~~~~~~~~~~~~~~~~~~~~~~~The dynamic configuration component may be specified as either*dynamic_configuration_code* or *perf_code*. This module contains a numberof configurations that can be used during the running of the tests to provideinputs for the test runner. The required elements are a function to return Naaradconfigs, and functions to return the locations of the logs to fetch from theremote hosts. There are also several configs which can be placed either in thismodule as attributes or in the Master config file. The main focus of this moduleis support for Naarad. The output of the loadgeneration can be any format supported by Naarad including JMeter and CSV. Theperformacnce file can also contain rules for Naarad to use to pass/fail thegeneral performance of a run (beyond rules specific to individual tests). Toget the most from Naarad, a Naarad config file can be provided (seehttps://github.com/linkedin/naarad/blob/master/README.md section Usage). Inorder to have Naarad support the module should provide a function``naarad_config()``. There are also two functons``machine_logs()`` and ``naarad_logs()`` that should return dictionariesfrom ``unique_ids`` to the list of logs to collect. Machine logs are theset of logs that should not be processed by naarad... _configs:Configs-------Being able to test with different configurations is extremely important. Theframework distinguishes between three types of configs:#. master config#. test configs#. application configsMaster configs are properties which affect the way zopkio operates. Current propertiesthat are supported include:* ``max_suite_failures_before_abort``* ``max_failures_per_suite_before_abort``* ``LOGS_DIRECTORY``* ``OUTPUT_DIRECTORY``Test configs are properties which affect how the tests are run. They are specificto the tests test writer and accessible from``runtime.get_config(config_name)`` which will return the stored value or theempty string if no property with that name is present. These are the propertiesthat can be overrode by the ``config-overrides`` command line flag.some of the test configs that zopkio recognizes are:* ``loop_all_tests``* ``show_all_iterations``* ``verify_after_each_test``'loop_all_tests' repeats the entire test suite for that config for the specified number of times'show_all_iterations' shows the result in test page for each iteration of the test.'verify_after_each_test' forces the validation before moving onto the next testApplication configs are properties which affect how the remote services areconfigured. There is not currently an official way to copy these configs to remotehosts separately from the code, although there are several utilities to support it.In order to allow the same tests to run over multiple configurations, theframework interprets configs accoriding to the following rules. All configsare grouped under a single folder. If this foldercontains at least one subfolder, then the config files at the top level areconsidered defaults and for each subfolder of the top folder, the entire testsuite will be run using the configs within that folder (plus the defaults andconfig overrides). This is the case in which``max_suite_failures_before_abort`` will be considered. Otherwise the suitewill be run once with the top level config files and overrides.Example Tests-------------1) command : zopkio examples/server_client/server_client.py- Runs bunch of tests with multiple clients and servers deployed2) command : zopkio examples/server_client/single_server_multipleiter_inorder.py --nopassword- The individual tests have the TEST_PHASE set to be 1,2,3 respectively. This enforces order.- To run multiple iterations set loop_all_tests to be <value> in config.json file- To validate each run of the test before moving to next one set verify_after_each_test in configs- To show the pass/fail for each iteration set show_all_iterations to be true in configs- sample settings to get mulitple runs for this test#. "show_all_iterations":true,#. "verify_after_each_test":true,#. "loop_all_tests":2,3) command : zopkio examples/server_client/server_client_multiple_iteration.py- The base_tests_multiple_iteration.py module has TEST_ITER parameter set to 2.- This repeats all the tests twice but does not enfore any ordering4) command : zopkio examples/server_client/client_resilience.py- This is an example of the test recipe feature of zopkio. See test_recipes.py for recipe and test_resilience.py for example used here- This tests the kill_recovery recipe to which you pass the deployer, process list, optional restart func, recovery func and timeout- Zopkio will kill a random process of the deployer and verifies if the system can recover correctly based on recovery function before the timeout value
zopperuuid
Zopper UUID GeneratorThis package will help in creating the uuidFormatingFormating using blackInstallationCommandpip install zopperuuidFor force reinstallpip install --force-reinstall zopperuuidUsageIn [1]: from zopperuuid import uuid In [2]: uuid.create_uuid() Out[2]: 'zopper-d2c3a494-dc37-4c0f-aa87-31a6ea2dde23'
zops
Zops - Utils for devops teams that want to deploy using Zappa
zops.anatomy
Apply and maintain projects templates.
zops.aws
Customized commands for AWS.
zops.code-standards
Apply and check for python code standards.
zops.jenkins-jobs
Manage the creation of jenkins jobs.
zops.requirements-directory
Handles Python requirements in a directory using pip-tools.
zops.virtualenv
Manage virtualenv generation, using cache when possible.
zopyx.authoring
Produce & Publish Authoring EnvironmentThe Produce & Publish Authoring Environment is a Plone-based solution for generating high-quality PDF documents from Plone content and office content supportingmanaging editorial contentconversion assetsconversion configurationconversion and publicationunder one hood.RequirementsPlone 4.1, 4.2 (untested with Plone 4.3)installation of the Produce & Publish server (see documentation)currently supports the commercial PDFreactor and PrinceXML as external PDF convertersupport for free PDF generation using PhantomJS upcoming)NoteWithzopyx.authoringVersion 2.4 or higher you will need to upgrade your Produce & Publish Server to the newpp.serverimplementation.DocumentationSeehttp://pythonhosted.org/zopyx.authoringSource code:https://bitbucket.org/ajung/zopyx.authoring/src/master/src/zopyx.authoringIssue tracker:https://bitbucket.org/ajung/zopyx.authoring/issuesLicenseProduct & Publish Authoring Environmentis published under the GNU Public License V2 (GPL 2).ContactZOPYX LimitedHundskapfklinge 33D-72074 Tuebingen, Germanyinfo@zopyx.comwww.zopyx.comwww.produce-and-publish.infoChangelog2.4.0 (04-10-2013)updated to newpp.server2.3.0 (03-10-2013)documentation updated2.2.6 (02-10-2013)fixed package metadata2.2.4 (02-10-2013)removed ui.multiselect.js (compatiblity foul with Plone 4.2)2.2.0 (06-07-2013)First public open-source release2.1.8 (2013/02/24)removed Products.ImageEditor support2.1.7 (2012/07/04)fixed unbound variable problem causing an error when using cover pages2.1.6 (2012/06/21)integrated collective.zipfiletransport2.1.5 (2012/04/03)DOCX import: removing all border*, padding* and margin* CSS propertiescontent aggregator allows now references to AuthoringContentPage instancessupport for index generation2.1.4 (2011/12/12)support for ZIP archive upload containing the conversion result of a local Open-Office/LibreOffice conversion (HTML + images)improved transformations for office import2.1.3 (2011/10/14)added fixAmpersand transformation for dealing with solitary ‘&’ inside HTML content2.1.2 (2011/10/12)better support for importing footnotes from Word2.1.1 (2011/10/06)enabled JS for table popups by defaultfixed link to import formnot archiving default option in import form2.1.0 (2011/09/22)support for uploading the ZIP archive (@@download_all view) to Dropbox2.0.9 (2011/09/14)integrated ui.multiselect.js for better user experience editing the styles2.0.8 (2011/09/11)removed all BeautifulSoup culpritsUI fine-tuning2.0.7 (2011/09/10)fixed ZCML startup failure (under some conditions)2.0.6 (2011/09/08)added a conversion “preflight” for checking consistency of HTML and image exportPublish-to-Dropbox functionalityadded @@pp-demo-content viewvarious fixes2.0.5 (2011/09/02)fixed issues in office importusing new transformation machinery in office import browser viewmore tests2.0.4 (2011/08/25)syncing of a resource from filesystem to Plone is now more accuratebetter error message if a configured master template (PDF template) could not be foundadded “My Authoring Projects” portletfixed issues with calibre default configuration and parameter escapingbetter support for EPUB coverpages and EPUB author handling2.0.3 (2011/08/15)better checks for Produce & Publish server availabilitymoved office import form (AuthoringContentFolder) to its own browser view and made it available as “Office Import (DOC)” action (while removing the import form from the viewlet configuration)added (undocumented) cleanup functionality for removing drafts older than N days from all conversion folders (@@cleanup-project-form)2.0.2 (2011/08/02)using new Proxy2 implementation of the zopyx.smartprintng.client API2.0.1 (2011/08/02)removing 0x0b char from conversion input in order to avoid trouble with content pasted into Plone from Windows applicationsadded description to GS profile registrationfixed issue with collapsible table in conversionsfolder_view.ptimplemented an experimental table popup/overlay functionality (disabled by default)i18n issues2.0.0 (2011/07/25)final release2.0.0rc4 (2011/07/13)fixed conversion folder view template2.0.0rc3 (2011/07/11)fixed bug in content_type_registry registration code2.0.0rc2 (2011/07/02)minor whitespace cleanup2.0.0rc1-1 (2011/07/01)removed obsolete monkey patch for ATDocument2.0.0rc1 (2011/07/01)disabled image metadata view outside authoring projectsbetter check for ‘tidy’ resultadded support for div.ignore-headings-for-structuredisabled support for nested folders inside AuthoringContentFolders2.0.0b2 (2011/06/16)(temporarily) replace collective.referencedatagrid field with a standard reference fieldippcontent subscriber now limits modification of the HTML to fields with content-type text/html only(optional) back-to-top functionality through Javascript (zopyxauthoring_backtotop.js must be enabled in portal_javascript - disabled by default))2.0.0b1 (2011/05/24)improved S5 functionality for aggregated and single-page documentsimproved office format import2.0.0a4 (2011/05/20)better S5 functionalityfirst integration of the external office format converter through a web service2.0.0a3 (2011/05/17)minor fixesimproved image detail view (colorspace + EXIF metadata)2.0.0a2 (2011/05/14)using collective.referencedatagridfield in content aggregatorminor fixes in inspectors2.0.0a1 (2011/05/10)major refactoringmajor feature update1.5.0 (2011/02/12)major update1.0.9 (2010/10/12)minor fixes in GS profilesintroducing BeforePublishing eventintroducing AfterPublishing eventadded AuthoringConversionsCollection type (for better grouping of conversions)a conversion folder can now reference an AuthoringContentFolder or a subfolder1.0.8 (2010/08/11)fixed some i18n issuesfixed improper default for contents folder when creating a new authoring project1.0.7 (2010/08/06)added ‘comment’ functionality: choose ‘comment’ style in TinyMCE in order to mark a selected piece of text as comment. Comments will removed from the consolidated HTML and PDF.fixed improper image reference in consolidated HTMLrequires zopyx.smartprintng.plone==0.6.201.0.6 (2010/08/05)fixed presets of conversion folder while creating a new authoring project instance1.0.5 (2010/06/12)truncate generate filenames in order to append the date-time string properly because normalizeString() chops off after the 50th characterfixes for consolidated HTML generation1.0.4 (2010/06/10)adjusted TinyMCE configuration in order to avoid relative links1.0.3 (2010/06/07)improved german translation and wordingminor UI tweaks1.0.2 (2010/05/25)i18n supportgerman translationnew conversion option for generation PDF, consolidated HTML and chapter-wise PDF in one runvarious UI tweaksadded (optional) portlet for one-click conversionminor internal cleanup1.0.1 (2010/05/19)switched to convertZIP2() APIfixed content settings of the demo pages while creating a new authoring projectfixed broken indexing calladjusted ordering of folders during creation of a new authoring project1.0.0 (2010/05/10)first public release0.9.0 (2010/04/14)various changes0.4.0 (2010/03/28)replaced most of the reference fields with paths0.3.3 (2010/03/27)fixed manage_afterAdd() implementation of conversion folder implementation0.3.2 (2010/03/26)fixes for missing ‘locales’ directory0.3.0 (2010/03/26)various fixes0.2.0 (2010/03/10)various fixes and additions0.1.0 (2010/02/10)Initial release
zopyx.check-ssl-domains
Check a list of host/domain names for their expiration date.Usagecreate a file domains.txt containing a number of domain names - one per line like:www.example.com www.example2.cominstallzopyx.check-ssl-domainsusing pipruncheck-ssl-domains domains.txtRequirementsPython 3.6 or higherHomepagehttps://github.com/zopyx/ssl-cert-checkAuthorAndreas Jung/ZOPYX [email protected]
zopyx.convert
=======================================A Python interface to XSL-FO libraries.=======================================The zopyx.convert package helps you to convert HTML to PDF, RTF, ODT, DOCX andWML using XSL-FO technology.Requirements============- Java 1.5.0 or higher (FOP 0.94 requires Java 1.6 or higher)- `csstoxslfo`__ (included)__ http://www.re.be/css2xslfo- `XFC-4.0`__ (XMLMind) for ODT, RTF, DOCX and WML support (if needed)__ http://www.xmlmind.com/foconverter- `XINC 2.0`__ (Lunasil) for PDF support (commercial)__ http://www.lunasil.com/products.html- or `FOP 0.94`__ (Apache project) for PDF support (free)__ http://xmlgraphics.apache.org/fop/download.html#dist-type- `BeautifulSoup`__ (will be installed automatically through easy_install. See Installation.)__ http://www.crummy.com/software/BeautifulSoup/- `ElementTree`__ (will be installed automatically through easy_install. See Installation.)__ http://effbot.org/zone/element-index.htmlInstallation============- install **zopyx.convert** either using ``easy_install`` or by downloading the sources from the Python Cheeseshop.This will install automatically the Beautifulsoup and Elementree modules if necessary.- the environment variable *$XFC_DIR* must be set and point to the root of your XFC installation directory- the environment variable *$XINC_HOME* must be set and to point to the root of your XINC installation directory- the environment variable *$FOP_HOME* must be set and point to the root of your FOP installation directorySupported platforms===================Windows, UnixSubversion repository=====================- http://svn-public.zopyx.com/viewvc/python-projects/zopyx.convert/trunk/Usage=====Some examples from the Python command-line::from zopyx.convert import ConverterC = Converter('/path/to/some/file.html')pdf_filename = C('pdf') # using XINCpdf2_filename = C('pdf2') # using FOPrtf_filename = C('rtf')pdt_filename = C('odt')wml_filename = C('wml')docx_filename = C('docx')A very simple command-line converter is also available::xslfo-convert --format rtf --output foo.rtf sample.html`xslfo-convert` has a --test option that will convert somesample HTML. If everything is ok then you should see something like that::>xslfo-convert --testEntering testmodepdf: /tmp/tmpuOb37m.html -> /tmp/tmpuOb37m.pdfrtf: /tmp/tmpuOb37m.html -> /tmp/tmpuOb37m.rtfdocx: /tmp/tmpuOb37m.html -> /tmp/tmpuOb37m.docxodt: /tmp/tmpuOb37m.html -> /tmp/tmpuOb37m.odtwml: /tmp/tmpuOb37m.html -> /tmp/tmpuOb37m.wmlpdf: /tmp/tmpZ6PGo9.html -> /tmp/tmpZ6PGo9.pdfrtf: /tmp/tmpZ6PGo9.html -> /tmp/tmpZ6PGo9.rtfdocx: /tmp/tmpZ6PGo9.html -> /tmp/tmpZ6PGo9.docxodt: /tmp/tmpZ6PGo9.html -> /tmp/tmpZ6PGo9.odtwml: /tmp/tmpZ6PGo9.html -> /tmp/tmpZ6PGo9.wmlHow zopyx.convert works internally==================================- The source HTML file is converted to XHTML using mxTidy- the XHTML file is converted to FO using the great "csstoxslfo" converterwritten by Werner Donne.- the FO file is passed either to the external XINC or XFC converter togenerated the desired output format- all converters are based on Java technology make the conversion solutionhighly portable across operating system (including Windows)Known issues============- If you are using zopyx.convert together with FOP: use the latest FOP 0.94only. Don't use any packaged FOP version like the one from MacPorts which isknown to be broken.- Ensure that you have read the ``csstoxslfo`` documentation. ``csstoxslfo`` hasseveral requirements about the HTML markup. Don't expect that it is the ultimateHTML converter. Any questions regarding the necessary markup are documented in the``csstoxslfo`` documentation and will not be answered.Author======**zopyx.convert** was written by Andreas Jung for ZOPYX Ltd. & Co. KG, Tuebingen, Germany.License=======**zopyx.convert** is published under the Zope Public License 2.1 (ZPL).See LICENSE.txt.Contact=======| ZOPYX Ltd. & Co. KG| c/o Andreas Jung,| Charlottenstr. 37/1| D-72070 Tuebingen, Germany| E-mail: info at zopyx dot com| Web: http://www.zopyx.comChanges:========1.1.11 (07.06.2009)------------------- moved code repository to svn.zope.org- changed license to ZPL1.1.10 (29.05.2009)------------------- support for USE_OS_SYSTEM environment variable (as workaroundfor hanging Java processes)1.1.9 (04.01.2009)------------------- fixed packaging issue1.1.8 (26.06.2008)------------------- changed logging levels- reorganized files1.1.7 (20.06.2008)------------------- better support for csstoxslfo commandline options1.1.6 (19.04.2008)------------------- call 'fop' using bash- better logger configuration- minor code cleanup1.1.5 (01.03.2008)------------------- updated documentation1.1.4 (05.02.2008)------------------- remove duplicate ID attributes1.1.3 (31.01.2008)------------------- clearified Java requirements for FOP1.1.2 (22.01.2008)------------------- removed some nasty debugging code1.1.1 (22.01.2008)------------------- supporting FOP on Windows1.1.0 (20.01.2008)------------------- support for free FOP PDF converter1.0.6 (14.10.2007)------------------- html2fo: added workaround for generated FO code forPRE tags1.0.5 (05.10.2007)------------------- minor bugfixes1.0.4 (05.10.2007)------------------- Windows support added1.0.3 (04.10.2007)------------------- passing -Duser.language=en to java in order toprevent corrupted FO code caused by locales1.0.2 (03.10.2007)------------------- bugfix1.0.1 (03.10.2007)------------------- added --test option to command-line frontend1.0.0 (30.09.2007)------------------- update to css2xslfo V 1.5.0- official 1.0.0 release0.5.0 (09.09.2007)------------------- replaced mxTidy related code with the BeautifulSoupmodule (no longer requires any compiling)- html2fo checks the existence of images0.4.9 (25.07.2007)------------------- support for utidy lib (which is the preferred tidy library).Using mx.Tidy only as fallback0.4.8 (unreleased)------------------- unreleased0.4.7 (08.07.2007)------------------- reSTified documentation0.4.6 (08.07.2007)------------------- fixes in availableFormats()0.4.5 (07.07.2007)------------------- various FO fixes0.4.4 (06.07.2007)------------------- using logging module0.4.3 (05.07.2007)------------------- html2fo: using ElementTree for most FO modifications0.4.2 (30.06.2007)------------------- converting page-break-after: always back into break-after: page0.4.1 (24.06.2007)------------------- various fixes0.4.0 (24.06.2007)------------------- added zope interfaces- converters are now classes- added unittests0.3.1 (18.06.2007)------------------- html2fo() and the converter constructor got a new 'encoding'parameter in order to specify the input encoding of theHTML file. This parameter will be passed down to Tidy in orderto perform a proper conversion of non-ascii characters.0.3.0 (unreleased)------------------- using subprocess module of Python- new Convert() class for high-level XSLFO access- logger added- better checks for XINC, XFC- updated documentation0.2.0 (16.06.2007)------------------- PDF support added- command line interface added- mxTidy integration0.1.0 (16.06.2007)------------------- initial release
zopyx.convert2
zopyx.convert2Thezopyx.convert2package helps you to convert HTML to PDF, RTF, ODT, DOCX and WML using XSL-FO technology or using PrinceXML. This package is used as the low-level API for zopyx.smartprintng.core.RequirementsJava 1.5.0 or higher (FOP 0.94 requires Java 1.6 or higher)csstoxslfo(included)XFC-4.0(XMLMind) for ODT, RTF, DOCX and WML support (if needed)XINC 2.0(Lunasil) for PDF support (commercial)orFOP 0.94(Apache project) for PDF support (free)orPrinceXML(commercial) for PDF supportInstallationinstallzopyx.convert2either usingeasy_installor by downloading the sources from the Python Cheeseshop. This will install automatically the Beautifulsoup and Elementree modules if necessary.the environment variable$XFC_DIRmust be set and point to the root of your XFC installation directorythe environment variable$XINC_HOMEmust be set and to point to the root of your XINC installation directorythe environment variable$FOP_HOMEmust be set and point to the root of your FOP installation directorythe ‘prince’ binary must be in the $PATH if you are using PrinceXMLSupported platformsWindows, UnixSource codehttps://github.com/zopyx/zopyx.convert2Bug trackerhttps://github.com/zopyx/zopyx.convert2/issuesUsageSome examples from the Python command-line:from zopyx.convert2 import Converter C = Converter('/path/to/some/file.html') pdf_filename = C('pdf-xinc')['output_filename'] # using XINC pdf2_filename = C('pdf-pisa')['output_filename'] # using PISA pdf3_filename = C('pdf-fop')['output_filename'] # using FOP pdf4_filename = C('pdf-prince')['output_filename'] # using FOP rtf_filename = C('rtf-xfc')['output_filename'] pdt_filename = C('odt-xfc')['output_filename'] wml_filename = C('wml-xfc')['output_filename'] docx_filename = C('docx-xfc')['output_filename']A very simple command-line converter is also available:html-convert --format rtf --output foo.rtf sample.htmlhtml-converthas a –test option that will convert some sample HTML. If everything is ok then you should see something like that:>html-convert --test Entering testmode pdf: /tmp/tmpuOb37m.html -> /tmp/tmpuOb37m.pdf rtf: /tmp/tmpuOb37m.html -> /tmp/tmpuOb37m.rtf docx: /tmp/tmpuOb37m.html -> /tmp/tmpuOb37m.docx odt: /tmp/tmpuOb37m.html -> /tmp/tmpuOb37m.odt wml: /tmp/tmpuOb37m.html -> /tmp/tmpuOb37m.wml pdf: /tmp/tmpZ6PGo9.html -> /tmp/tmpZ6PGo9.pdf rtf: /tmp/tmpZ6PGo9.html -> /tmp/tmpZ6PGo9.rtf docx: /tmp/tmpZ6PGo9.html -> /tmp/tmpZ6PGo9.docx odt: /tmp/tmpZ6PGo9.html -> /tmp/tmpZ6PGo9.odt wml: /tmp/tmpZ6PGo9.html -> /tmp/tmpZ6PGo9.wmlHow zopyx.convert2 works internallyThe source HTML file is converted to XHTML using mxTidythe XHTML file is converted to FO using the great “csstoxslfo” converter written by Werner Donne.the FO file is passed either to the external XINC or XFC converter to generated the desired output formatall converters are based on Java technology make the conversion solution highly portable across operating system (including Windows)Environment variablesThe following environment variables can be used to resolve OS or distribution specific problems:ZOPYX_CONVERT_SHELL- defaults toshand is used to as shell command to execute external convertersZOPYX_CONVERT_EXECUTION_MODE- default toprocessand refers to the method of Python executing external command (by default using theprocessmodule. Other value:system,commandsKnown issuesIf you are using zopyx.convert2 together with FOP: use the latest FOP 0.94 only. Don’t use any packaged FOP version like the one from MacPorts which is known to be broken.Ensure that you have read thecsstoxslfodocumentation.csstoxslfohas several requirements about the HTML markup. Don’t expect that it is the ultimate HTML converter. Any questions regarding the necessary markup are documented in thecsstoxslfodocumentation and will not be answered.Authorzopyx.convert2was written by Andreas Jung for ZOPYX Ltd., Tuebingen, Germany.Licensezopyx.convert2is published under the Zope Public License (ZPL 2.1). See LICENSE.txt.ContactZOPYX Ltd.Charlottenstr. 37/1D-72070 Tuebingen, [email protected]:Changelog2.4.5 (2012-11-05)fixed typo2.4.4 (2012-11-05)creating tidyed file inside the existing folder instead of in $TMPDIR. This error caused that some style files could not we loaded with PDFreactor2.4.3 (2012-06-20)fixed logger (mis-)usagefixed API documentation2.4.2 (2012-01-01)experimental support for PDFreactor2.4.1 (2011-11-11)fixed BeautifulSoup dependency2.4 (2011-11-07)documentation updated in order to reflect changes to the first public release of the Plone Client Connector2.3.2 (2011-08-23)added support for %(WORKDIR)s substitution in Calibre converter2.3.1 (2011-06-15)support for PISA (pdf-pisa-bin) - requires that ‘pisa’ is found in the $PATH2.3.0 (2011-06-05)support for PISA (pdf-pisa)2.2.5 (2011-04-03)calibre converter now honors the commandlineoptions.txt file2.2.4 (2010-12-16)stripping of BASE tag for XFC-based converters2.2.3 (2010-08-16)made stripping of the BASE tag specific to pdf-fop2.2.2 (2010-08-15)pdf-fop converter not registered properly2.2.1 (2010-07-19)support $ZOPYX_CONVERT_SHELL2.2.0 (2010-05-15)dedicated ConversionError exception added2.1.1 (2010-02-19)relaxed tidy check for existence of images2.1.0 (2009-09-05)Calibre integrationAPI change: convert() now returns a richer dict with all related conversion results2.0.4 (2009-07-07)pinned BeautifulSoup 3.0.x2.0.3 (2009-07-05)fix in fop.py2.0.2 (2009-06-02)fixed broken path for test data files2.0.1 (2009-06-02)added environment variable ZOPYX_CONVERT_EXECUTE_METHOD to control the usage of the process module vs. os.system() (in case of hanging Java processes). Possible values: ‘process’ (default), ‘system’2.0.0 (2009-05-14)final release2.0.0b3 (25.12.2008)tidy: rewrite image references relative to the html file to be converted2.0.0b2 (05.10.2008)fixed some import errorsnow working with zopyx.smartprintng.core2.0.0b1 (04.10.2008)initial releasecomplete new reimplementation of zopyx.convertadded support for PrinceXML
zopyx.ecardsng
zopyx.ecardsngA simple ECard functionality for Plone 3.XCreditsThis product is funded by catWorkX, Germany and the University of Bonn, Germany.ContactZOPYX Ltd. & Co. KGc/o Andreas Jung,Charlottenstr. 37/1D-72070 Tuebingen, GermanyE-mail: info at zopyx dot comWeb:http://www.zopyx.comChangelog0.3.3 (2008-11-24)ECard folder view: id/description are inline editableECard folder view: showing id of current folder0.3.2 (2008-11-13)base class of ECardsFolder is now ATFolderecard selection: show images in original size0.3.1 (2008-11-07)extension profile tweaking0.3.0 (2008-11-07)using a dedicated folder type for saved ecardsdon’t exposing folder with saved ecards to the publicminor tweaks0.2.0 (2008-11-05)german i18n filefixed extension profile0.1.0 - 23.10.2008Initial release
zopyx.ep2011
UNKNOWN
zopyx.existdb
zopyx.existdbNoteThis moduleis nota replacement for the ZODB or any other Plone storage (never was, never will)is nota storage layer for Archetypes or Dexterity content (never was, never will)isa solution for mounting XML databases like eXist-db or BaseX into Plone through their WebDAV portisan _experimental_ solution for mounting general WebDAV services into Plonezopyx.existdbintegrates Plone 4.3 and higher with eXist-db providing the following features:mounts an arbitary eXist-db collection into PloneACE editor integrationZIP export from eXist-dbZIP import into eXist-dbpluggable view mechanism for configuring custom views for XML database content by filename and view namecreate, rename or delete collections through the webextensible architecture through Plone Dexterity behaviorssupport for XQuery scripts called through the RESTXQ layer of eXist-db (allows you to call XQuery scripts and return the output format (JSON, HTML, XML) depending on your application requirements)dedicated per-connector logging facilitysmall and extensibleexperimental support for mounting arbitrary WebDAV service into Plone (set the emulation mode towebdavin the eXist-db control panel of Plone)The primary usecase forzopyx.existdbis the integration of XML document collections into Plone using eXist-db as storage layer.zopyx.existdbis not storage layer for Plone content in the first place although it could be used in some way for storing primary Plone content (or parts of the content) inside eXist-db. There is no build-in support for mapping metadata as stored in XML documents to Plone metadata or vice versa. However this could be implemented easily in application specific code build on top ofzopyx.existdb. The design goal ofzopyx.existdbis to provide the basic functionality for integrating Plone with eXist-db without implementing any further specific application requirements. Additional functionality can be added through Dexterity behaviors, supplementary browser views, event lifecycle subscribers and related technology.InstallationAddzopyx.existdbto theeggsandzcmloptions of your buildout configuration, re-run buildout and install the connector through the add-ons management of Plone.ConfigurationGoto the Plone control panel and click on theExist-DBconfiglet and configure theeXist-db server url e.g.http://localhost:6080The eXist-db subpath/exist/webdav/dbwill be added internally.eXist-db usernameeXist-db passwordeXist-db emulation mode. Set the emulation mode towebdavfor the integration of arbitrary WebDAV services.Using zopyx.existdbThe package provides a new content-typesConnectorthat will include eXist-db into Plone - either from the top-level collection of your eXist-db database or from a subcollection. You can browse and traverse into subcollections, view single documents or edit text-ish content through the web (using the build-in ACE editor integration).All connection settings (URL, username and password can be overriden on the connector level) in order to ignore the Plone site-wide eXist-db settings).NoteThis module provides a generic integration of arbitrary WebDAV services like OwnCloud, BaseX (over WebDAV) or even other Plone serves (exposed through the Plone WebDAV source port) with Plone. This integration is highly experimental and not the primary purpose ofzopyx.existdb. Use the functionality at your own risk. In order to use this module together with WebDAV services other than the XML database eXist-db: you have to set the emulation mode towebdavinside the eXist-db control panel of PloneLicenseThis package is published under the GNU Public License V2 (GPL 2)Source codeSeehttps://bitbucket.org/onkopedia/zopyx.existdbBugtrackerSeehttps://bitbucket.org/onkopedia/zopyx.existdbCreditsThe development ofzopyx.existdbwas funded as part of a customer project by Deutsche Gesellschaft für Hämatologie und medizinische Onkologie (DGHO).AuthorAndreas Jung/ZOPYXHundskapfklinge 33D-72074 Tuebingen, [email protected] (2014-11-08)updated documentation0.2.10 (2014-11-08)bugfix release0.2.9 (2014-11-01)support for overriding credentials locally0.2.8 (2014-11-01)minor fix for mounting Plone sites over WebDAV into another Plone site0.2.7 (2014-11-01)experimental support for BaseX XML database through the WebDAV API. Limitations: REMOVE operations over WebDAV do not seem to work against BaseX 7.90.2.6 (2014-11-01)more tests0.2.5 (2014-10-30)experimental traversal support for accessing WebDAV resources by path using (un)restrictedTraverse()minor URL fixesmore tests0.2.4 (2014-10-22)configuration option for default view for authenticated site visitors0.2.3 (2014-10-13)fix in saving ACE editor content0.2.2 (2014-10-12)typo in page template0.2.1 (2014-10-12)added support for renaming a collection through the web0.2.0 (2014-10-02)various minor bug fixesadded basic tests0.1.17 (2014-09-25)fixed action links0.1.16 (2014-09-25)Connector is no longer a folderish object0.1.15 (2014-09-22)removed indexing support completely (leaving a specific indexing functionality to policy packages using zopyx.existdb)0.1.14 (2014-09-15)fixed subpath handling in create/remove collections0.1.13 (2014-09-07)support for removing collections TTW0.1.12 (2014-09-05)support for creating new collections TTW0.1.11 (2014-08-21)action “Clear log” added0.1.10 (2014-08-05)log() got a new ‘details’ parameter for adding extensive logging information0.1.9 (2014-08-01)human readable timestamps0.1.8 (2014-07-31)minor visual changes0.1.7 (2014-07-29)rewritten code exist-db browser code (dealing the correct way with paths, filenames etc.)0.1.6 (2014-07-29)fixed improper view prefix in directory browser0.1.5 (2014-07-13)minor fixes and cleanup0.1.4 (2014-07-12)made webservice query API aware of all output formats (xml, html, json)timezone handling: using environment variable TZ for converting eXist-db UTC timestamps to the TZ timezone (or UTC as default) for display purposes with Plone0.1.3 (2014-07-07)added webservice API interfacevarious bug fixes0.1.2 (2014-06-30)various bug fixes0.1.0 (2014-06-20)initial release
zopyx_gridfs
zopyx_gridfsThis is a tiny GridFS (MongoDB) to web gateway based on the Pyramid web framework.Installationrequires Python 2.6create a virtualized environment using virtualenvinside the virtualenv environment:bin/easy_install zopyx_gridfsCreate aserver.iniconfiguration file containing:[app:zopyx_gridfs] use = egg:zopyx_gridfs reload_templates = true debug_authorization = false debug_notfound = false debug_routematch = false debug_templates = true default_locale_name = en # MongoDB specific configurations mongo_host = localhost mongo_port = 27017 database = test [pipeline:main] pipeline = egg:WebError#evalerror zopyx_gridfs [server:main] use = egg:Paste#http host = 0.0.0.0 port = 6543 # Begin logging configuration [loggers] keys = root [handlers] keys = console [formatters] keys = generic [logger_root] level = INFO handlers = console [handler_console] class = StreamHandler args = (sys.stderr,) level = NOTSET formatter = generic [formatter_generic] format = %(asctime)s %(levelname)-5.5s [%(name)s][%(threadName)s] %(message)sStart the GridFS server using (this will start a HTTP server on localhost:6543):bin/paster serve server.iniUsage:Downloading filesYou can access files stored inside GridFS through HTTP:http://localhost:6543/<collection>/<filename>wherecollectionrefers to collection used by GridFS andfilenameis the_idused to store the file inside GridFS.The server will return a 404 response if the requested file could not be found.Uploading filesFor uploading files into a collection you need to use the build-in upload form:http://localhost:6543/<collection>/upload_formAuthorZOPYX Limitedc/o Andreas JungCharlottenstr. 37/1D-72070 Tuebingen, [email protected] upload support0.2.2using proper routing mechanism of Pyramid0.2.0switching to traversal instead of using URL parameters0.1.2better header handling0.1.0Initial version
zopyx.ipsumplone
zopyx.ipsumploneThis package provides some browser view for creating demo content and demo images without reinventing functionality for every new project.InstallationAddzopyx.ipsumploneto the eggs options of your buildout configuration, re-run buildout and restart your Plone instance.Usage@@new-sitecalled in the context of the Zope root object or a Zope folder will create a new Plone site with a unique id.@@demo-contentcalled in the context of the a Plone site will create a set of folder for images, news items, events, files and documents.The main purpose of the package to call the views above inside the setuphandler or profile setup step to generate example content on request. Please check thebrowser/setup.pyimplementation to figure out API methods likecreateDocument(),createImage()orcreateNewsitem(). Subclassing theSetupview is obviously a good start for own customizations.Requirementstested with Plone 5.0 and Dexterity content (usezopyx.ipsumplone0.2.X for Archetypes-based content under Plone 4.X)SourcesSeehttps://github.com/zopyx/zopyx.ipsumploneIssue trackerSeehttps://github.com/zopyx/zopyx.ipsumplone/issuesLicencezopyx.ipsumploneis published under the GNU Public Licence Version 2AuthorZOPYX/Andreas JungHundskapfklinge 33D-72070 Tübingen, [email protected] (2021.-11-20)new lorem ipsum moduleadjusted for Plone 6, Python 30.3.11 (2017-10-02)new image service0.3.9 (2016-11-21)new image service0.3.8 (2016-09-29)new image service0.3.7 (2016-04-13)fixed editing issues with images and news items0.3.x (2015-09-26)support for Plone 5/Dexterity0.2.1 (2012-01-30)minor improvements0.2 (2012-01-28)fixesdocumentation updatedcleanupsupport for more types0.1 (2012-01-27)Initial release
zopyx.multieventcalendar
zopyx.multieventcalendarzopyx.multieventcalendar extends the standard Plone ‘Event’ type with five supplementary date fields. The purpose of this extender is to support events with multiple dates associated. E.g. a conference takes place at a particular date but often has additional associated dates like for a call-for-papers or a registration deadline. Instead of having multiple unassociated events within Plone, you can manage all that with one event instance.In addition zopyx.multieventcalendar provides a week and month calendar supporting this event extender. The implementation also supports export/subscription with iCal.RequirementsPlone 3.0 or higherInstallationeither by choosing thezopyx_multieventcalendarextension profile while creating a new Plone siteor using the Plone control panelUsagecreate a newEventcheck out theMoreDatesfieldset while editing the event instancevisithttp://yourhost:yourport/your-plone/zme_calendarAuthorzopyx.multieventcalendarwas written by Andreas Jung for ZOPYX Ltd. & Co. KG, Tuebingen, Germany and partly funded by the Friedrich-Miescher-Laboratory of the Max-Planck-Society, Tuebingen, Germany and the Max Planck Institute for Biological Cybernetics, Tuebingen, Germany.Licensezopyx.multieventcalendaris published under the Zope Public License (ZPL 2.1)Known issueszopyx.multieventcalendardoes not support the standard Plone calendar portlet. (only the default date will be shown within the calendar portlet).no i18n supporteuropean date format hardcoded within templatesTo docustomevent_view.ptshould be replace with a viewlet-based implementationContactZOPYX Ltd. & Co. KGc/o Andreas Jung,Charlottenstr. 37/1D-72070 Tuebingen, GermanyE-mail: info at zopyx dot comWeb:http://www.zopyx.comChangelog0.1.4 - 13.03.2009extended year range0.1.3 - 05.01.2009fixed offset-by-one error within the month calculation0.1.2 - 27.06.2008internal cleanup, no functional changes0.1.1 - 22.06.2008iCal export did not work within the context of the Plone root0.1.0 - 22.06.2008Initial release
zopyx.parallel_svn_externals_updater
zopyx.parallel_svn_externals_updaterRequirementsPython 2.4+, SubversionInstallationUsingeasy_install:easy_install zopyx.parallel_svn_externals_updaterUsageTo update all svn:externals for a given SVN checkout, use:svn-externals-updater --pool-size 10 --recursive /path/to/svn/checkoutAuthorzopyx.parallels_svn_externals_updaterwas written by Andreas Jung for ZOPYX Ltd. & Co. KG, Tuebingen, GermanyLicensezopyx.parallels_svn_externals_updateris published under the Zope Public License (ZPL 2.1)Known issuesno support for WindowsContactZOPYX Ltd. & Co. KGc/o Andreas Jung,Charlottenstr. 37/1D-72070 Tuebingen, GermanyE-mail: info at zopyx dot comWeb:http://www.zopyx.comChangelog0.2.0 - 06.07.2008Added new –recursive argument to the script. [hannosch]Ignore comments in svn:externals. [hannosch]Corrected name of the cli script. [hannosch]0.1.0 - 05.07.2008initial release
zopyx.plone.cassandra
zopyx.plone.cassandraThis module helps you to analyze your current security settings - especially local roles granted on some subfolderRequirementsPlone 5 or higherInstallationaddzopyx.plone.cassandrato theeggsoption of your buildout.cfg.re-run buildoutfor new Plone sites: choose the zopyx.plone.cassandra extension profilefor existing Plone sites: add zopyx.plone.cassandra from Add/remove modules within the Plone site setupUsageAdd/@@cassandrato the url of any object with your Plone site and see what happens.NoteThis module should only be used on development systems since it might reveal security related information to untrusted users.Sourceshttps://github.com/zopyx/zopyx.plone.cassandraIssue trackerhttps://github.com/zopyx/zopyx.plone.cassandra/issuesLicenseThis module is licensed under the Zope Public License (ZPL 2.1).ContactZOPYX .Hundskapfklinge 33D-72074 Tuebingen, GermanyE-mail: info at zopyx dot comWeb:http://www.zopyx.comChangelog0.5.0 - (2019-03-20)Plone 5.2 compatibility, Python 3 compatibility0.4.0 - (2015-11-23)Plone 5 compatibility added0.3.0 - (12.04.2012)Plone 4(-only) compatibility0.2.0 - (30.11.2008)using @@cassandra now requires manager privilegesfixed issues with the extension profile0.1.0 - (29.11.2008)Initial release
zopyx.plone.hyphenator
Plone 5 add-on to provide customizable hyphenation support for custom CSS/jQuery selectors. The hyphenation support is based onhttp://mnater.github.io/Hyphenator/InstallationNothing special. Addzopyx.plone.hyphenatorto you buildout and install it throught the Plone add-on installer. You can configure a list of selectors inside theHyphenatorcontrol panel of Plone that will be considered for hyphenation (Plone 5 toolbar by default).Repositoryhttps://github.com/zopyx/zopyx.plone.hyphenatorBugtrackerhttps://github.com/zopyx/zopyx.plone.hyphenator/issuesAuthorAndreas Jung/ZOPYXHundskapfklinge 33D-72074 Tuebingen, [email protected] (2016-07-27)first release
zopyx.plone.migration
zopyx.plone.migrationExport/import migration script for Plone 2/3 sites to Plone 4The purpose of this package is to provide scripts to export AT-based content into a more generic format that can be used by an importer script for re-import into a Plone 4 site. The main goal of the scripts is to get Plone content in a more clean way out of Plone 2/3 site and to import it into a clean way into a fresh Plone 4 site.InstallationAdd the following to your buildout:[buildout] parts = exportimport [exportimport] recipe = zc.recipe.egg:scripts eggs = zopyx.plone.migrationExport of a Plone sitePrequisites: your Plone site/server must be stopped or you must be running Plone through ZEO.The exporter will export the following items from a Plone site:members (member name, member password, global member roles)groups (group name, group members, global group roles)structure of the site (folder structure including local roles and review state)all Archetypes-based content with all metadata of a content item that has been defined through an Archetype schema (plus some extra data like review state, local roles, related items)workflow states (also deals with PlaceFulworkflow)local roles (including blocking/inheritance of local roles)object position in parentrelated itemsdefault pagesUsage:bin/instance run bin/exporter.py --path /path/to/<plone_id> --output <directory>The exporter will create a self-contained directory with the exported data unter<directory>/<plone_id>. The directory contains two INI filescontents.iniandstructure.inithat describe the hierarchy structure of the exported site and exported contents.The metadata and real content of each object is stored within thecontentsubfolder. This directory will contain on file per exported content object. The filename is determined by the original UID of the content object. For binary files like File or Image there is a <uid>.bin file which will contain the original binary data. The files (except the.binfiles) are serialized using Python’s Pickle mechanism in order to avoid serialization issues and to preserve the data as is.In addition the exporter cares out the export of members and groups (members.ini, groups.ini)Note that thebin/exporterscript isnot directlycallable. It must always be run using thebin/instance run somescript.pymechanism of the Plone startup script - always!The export has been tested against Plone 2.5 and Plone 3.3.Importing to a new Plone siteFor importing a formerly exported Plone site you must use the following command-line:bin/instance run bin/importer -i <input-directory> [-t] [-v]input-directoryis here the full path to the formerly created output directory (--outputparameter + site prefix). The import script will create a new Plone site undersites/<site-prefix>. Thesite-prefixis taken from the last path component of the output directory. You can specify the-tor--timestampoption in order to add a timestamp to the site id of the new Plone site. This is useful for re-running the importer script multiple times. Thesitesprefix (a folder in Plone can be customized using the-dor--dest-foldercommandline option. The importer assumes that there is anadminaccount with manager permissions inside the root acl_users folder (use-uor-useroption for overriding the default admin account name).To dosupport commandline parameter for specifying a list of extension profiles to be used while creating a new Plone sitebetter dealing with arbitrary –dest-folder optionsLicenceThis package is licenced under the Zope Public Licence V 2.1 (ZPL 2.1)AuthorZOPYX LimitedAndreas JungHundskapfklinge 33D-72074 Tübingen, [email protected] for Veit Schiele Communications GmbH (www.veit-schiele.de)Changes0.2.8 (08.07.2013)PloneGazette related fixes and workarounds0.2.0 (14.01.2013)various fixes0.1.0 (18.12.2012)initial release
zopyx.plone.persistentlogger
zopyx.plone.persistentloggerzopyx.plone.persistentloggersupports persistent logging where the log data is stored on an arbitrary persistent Plone object (as annotation). Typical usecases are application specific logging e.g. for logging a history per content object directly in Plone rather then having a huge common log on the filesystem. The log entries are stored using object annotations.Usage:from zopyx.plone.persistentlogger.logger import IPersistentLogger def do_something(...): # ``context`` represents the current context object adapter = IPersistentLogger(context) adapter.log(u'this is a logging message') adapter.log(u'this is an error message', level='error') adapter.log(u'this is an error message', level='error', details='....')detailscan be either a string or a Python datastructure like a dict, a list or a tuple. The logger will convert non-string data using thepprintmodule of Python into a nicely readable string.levelcan be an arbitrary string for indicating the severity of the logging message. The module does not perform any checking on the given messagelevel. Sorting onlevelis accomplished only on the lexicographical ordering of thelevelvalues.The logs can be view through-the-web through the URLhttp://host/path/to/object/@@persistent-log. The logs can be clear using the URLhttp://host/path/to/object/@@persistent-log-clear. Both URLs require the permission of modify the related object.All logs can be searched, sorted and filtered individually based on the Datatables.net implementation.CompatibilityPlone 4.3Plone 5.0Plone 5.1Plone 5.2 (Python 3.6+, Python 2.7)InstallationInstallation on Plone 4.3.X requires the following version pinning:plone.app.jquery = 1.8.3Repository & issue trackerhttps://github.com/zopyx/zopyx.plone.persistentloggerAuthorAndreas Jung/ZOPYXHundskapfklinge 33D-72074 Tuebingen, [email protected] (2023-11-23)updated to DataTables 1.13.x0.5.0 (2021-06-21)add file_logger module with support for “loguru” based loggers0.4.8 (2019-03-03)minor UI tweaks0.4.7 (2018-12-20)Python 3 compatibility0.4.2 (2017-01-28)-fixes0.4.0 (2017-01-27)log() supportsusernameas optional argument for overriding the current usernamelog() now accepts an optional parameterinfo_urlwhich can either be a full URL or a relative URL (relative to the Plone portal root) that will be displayed within the logger table under the new columnInfo0.3.6 (2016-07-15)minor CSS fixes0.3.5 (2016-04-25)update docs0.3.4 (2016-04-22)added preliminary toolbar icon0.3.2 (2016-04-20)added browser layersadded ‘demo’ profile for @@logger-demo view for creating some demo logger entries0.3.1 (2016-04-20)fixes0.3.0 (2016-04-20)full Plone 5 compatibilityswitched from DataTables.net to jsGrid0.2.6 (2016-03-18)i18n_domain missing in configure.zcml0.2.4 (2016-02-02)minor fixes0.2.3 (2015-09-23)some unittest cleanup0.2.2 (2015-09-23)log entries now store the originaldetailsvalue directly as entry keydetails_rawin addition to the pretty-printed representation indetails. Note thatdetailsmust be Python pickable.0.2.1 (2015-09-17)changed action permission for viewing the persistent log0.2.0 (2015-09-10)bugfixes, code cleanupadded “Persistent log” object action0.1.0 (2015-08-31)initial release
zopyx.pysiriproxy
Aboutpysiriproxy is a port of [SiriProxy](https://github.com/plamoni/SiriProxy) (by @plamoni) from Ruby to Python developed.Installing pysiriproxyThe following page contains step by step instructions for installing pysiriproxy on an Ubuntu system. These instructions have been tested on the following Ubuntu versions: 10.04, 11.10, and 12.04.Installing and configuring dnsmasqIn order to intercept the commands being sent from the iPhone to Apple’s server you must install a program calleddnsmasqonto a machine that will be connected to the same network as the iPhone. The following provides instructions on properly installing dnsmasq.Run the following commands:$ sudo apt-get install dnsmasqNow, open the file/etc/dnsmasq.confwith the editor of your choice.Search for#address=/double-click.net/127.0.0.1(this should be roughly the 62nd line). Once the line is found, replace that line with the following two lines:address=/guzzoni.apple.com/(your_machine's_ip_address). address=/kryten.apple.com/(your_machine's_ip_address).Be sure to replace your machine’s IP address and then save the file. This will allow the pysiriproxy server accept connections from devices using either iOS 5 or iOS 6.Finally, restart dnsmasq for the new IP address to take effect:$ sudo /etc/init.d/dnsmasq restartThe above installation sequence was taken fromHow to install Siri Proxy.Once pysiriproxy has been installed and configured you can follow the instructions on*changing the dnsmasq IP address*to easily change the IP address used by dnsmasq.Current maintainerAndreas Jung <[email protected]>
zopyx.sharepoint
zopyx.sharepointzopyx.sharepointallows to interact Python-based application with Sharepointliststhrough the Sharepoint SOAP API (tested against Microsoft Sharepoint Services 3.0).Featuresretrieve Sharepoint list definitionsretrieve all list itemsadd list itemsdelete list itemsupdate list itemsgeneric queriesauthentication over NTLMUsageIn order to connect to Sharepoint you need the following parametersthe Lists WSDL URLthe ID/Name of the related Sharepoint list you want to interact witha valid Sharepoint username and password (having the related rights)API usageConnecting to sharepointIn order to connect to Sharepoint you need to import theConnectormethod which is a factory return aListEndPointinstance:> from zopyx.sharepoint import Connector > url = 'http://sharepoint/bereiche/onlineschulungen/' > username = 'YourDomain\\account' > password = 'secret' > list_id = '60e3f442-6faa-4b49-814d-2ce2ec88b8d5' > service = Connector(url, username, password, list_id)Sharepoint list model introspectionThe internals of the list schema is available through themodelproperty of theListEndPointinstance:> fields = service.modelThe primary key of the list is exposed through theprimary_keyproperty:> primary_key = service.primary_keyThe lists of all required field names and all fields is available through:> all_fields = service.all_fields > required_fields = service.required_fieldsList item deletionIn order to delete list items by their primary key values, you can use thedeleteItems()method:> result = service.deleteItems('54', '55') > print result > print result.result > print result.okTheresultobject is an instance ofParsedSoapResultproviding a flagok(True|False) indicating the overall success or overall failure of the operation. The individual error codes are available by iterating over theresultproperty of theParsedSoapResultinstance.Updating list itemsYou can update existing list items by passing one or multiple dictionaries toupdateItems(). Each dict must contain the value of the related primary key (in this case theIDfield):> data = dict(ID='77', Title=u'Ruebennase', FirstName=u'Heinz') > result = service.updateItems(data) > print result > print result.result > print result.okupdateItems()will not raise any exception. Instead you need to check theokproperty of the result object and if needed the individual items of theresultproperty:# update an item (non-existing ID) > data = dict(ID='77000', Title=u'Becker') > result = service.updateItems(data) > print result > print result.result > print result.okAdding items to a listTheaddItems()method works like theupdateItems()method except that do not have pass in a primary key (since it is not known on the client side). The assigned primary key value after adding the item to the list should be available from theresultobject:> data = dict(Title=u'Ruebennase', FirstName=u'Heinz') > result = service.addItems(data) > print result > print result.result > print result.ok > print 'assigned ID:', result.result[0]['row']._ows_IDRetrieving a single list itemgetItem()will return a single item by its primary key value:> data = service.getItem('77')Retrieving all list itemsgetItems()will return all list items (use with care!):> items = service.getItems()Generic query APIquery(**kw)can be used to query the list with arbitrary query parameters where each subquery must perform an exact match. All subqueries are combined using a logical AND:> items = service.query(FirstName='Heinz', Title='Becker')The result is returned a Python list of dictified list items. All query parameters must represent a valid field name of the list (ValueError exception raised otherwise).In order to perform a substring search across _all_ query parameter you may pass themode='contains'parameter. To specify a prefix search across all query parameters, usemode='beginswith'.View supportzopyx.sharepointsupports list views of Sharepoint. You can either set a default view used for querying Sharepoint like:> service.setDefaultView('{D9DF14B-21F2-4D75-B796-EA74647C30C6'}')or you select the view on a per-query basis by passing the view name asviewNamemethod parameter (applies togetItem(),getItems()andquery()):> items = service.getItems(viewName='{D9DF14B-21F2-4D75-B796-EA74647C30C6'}')Command line usagezopyx.sharepointcomes with a smallsharepoint-inspectorcommandline utility:sharepoint-inspector --url <URL> --list <LIST-ID-OR-NAME> --username <USERNAME> --password <PASSWORD> --cmd <CMD>where <CMD> is eitherfieldsoritemsRequirementsPython 2.4 or higher (no support for Python 3.X)Testedtested with Python 2.4-2.6suds 0.4.1 beta or checkout of the suds trunk (https://fedorahosted.org/suds/). suds 0.4.0 is _not_ sufficient!python-ntlm 1.0Microsoft Sharepoint Services 3.0 APIAuthorWritten for Haufe-Lexware GmbH, Freiburg, Germany.ZOPYX LimitedAndreas JungCharlottenstr. 37/1D-72070 [email protected] - 2011/01/07code fork0.1.9 - 2011/06/03fixed some documentation glitchesadded logging at connection time0.1.8 - 2011/05/30fixed improper parameter usage in exception0.1.7 - 2011/05/24applied third-party patch containing minor fixes0.1.6 - 2011/05/04better connection error handlingWSDL url prefix automatically added to the Sharepoint URLfixed issue in getItems() with empty result sets0.1.5 - 2011/02/23added checkin_file(), checkout_file()the connectiontimeoutis now configurable through the Connector() APIadd setDefaultView() API0.1.4 - 2011/02/22support for exact|substring|prefix search through the query() API0.1.3 - 2011/02/22added generic query() API0.1.2 - 2011/02/21implemented getItem() in a proper way0.1.1 - 2011/02/18minor fixesdocumentation updated0.1 - 2011/02/17Initial release
zopyx.slimp
A Python interface to the Slimserver software by SlimdevicesChanges:0.2.1 (14.06.2007)making package a namespace package0.2.0 (10.06.2007)using entry points for player softwareintegrated slimplayer.pysome cleanup0.1.0 (23.05.2007)initial Cheeseshop release
zopyx.smartprintng.client
zopyx.smartprintng.clientThe zip-client-side implementation of the Produce & Publish server (akazopyx.smartprintng.server).EnvironmentTheKEEP_ZIPenvironment can be set in order to keep the generated ZIP archive for debugging purposes.LicenseThis package is licensed under the Zope Public License V 2.1 (ZPL).ContactZOPYX Limitedc/o Andreas Jung,Charlottenstr. 37/1D-72070 Tuebingen, GermanyE-mail: info at zopyx dot comWeb:http://www.zopyx.comChangelog0.8.5 (2012-10-18)Python 2.7 compatibility0.8.2 (2011-08-11)support for KEEP_ZIP environment variable0.8.1 (2011-08-11)logging spool directory locationcheck spool directory for write permissions0.8.0 (2011-08-02)obsoleted Proxy() implementationadded Proxy2() implementation supporting a standard URL0.7.0 (2011-03-02)removed convertZIP() api methodadded ‘workdir’ parameter to convertZIP2()0.6.0 (2010-05-16)deprecated convertZIP() api methodadded convertZIP2() api method0.5.4 (2010-03-28)better output directory handling0.5.3 (2010-03-27)fixing racing condition in handling of the output directory0.5.2 (2007-09-18)added method for setting the output directory0.5.1 (2007-09-17)restored old API by moving authentication and authorization code into the client API0.5.0 (2007-09-15)adjusted to API changes (authentication and authorization)0.4.0 (2007-08-03)added convertZIPandRedirect() API0.3.0 (2007-07-19)support for the email API (as of zopyx.smartprintng.server>=0.4.0)0.2.0 (2009-07-08)added object-oriented API0.1.1 (2009-07-08)minor cleanup0.1 (2009-07-07)Initial release
zopyx.smartprintng.core
zopyx.smartprintng.coreThis package contains the refactored code-base of the SmartPrintNG product for Plone. The former monolithic implementation is broken into a three-level architecture (top-down):zopyx.smartprintng.plone- the integration layer with Plone (status: not implemented)zopyx.smartprintng.core- the SmartPrintNG backend (status: implemented and almost finished)zopyx.convert2- the low-level converter API (status: implemented and almost finished)ContactZOPYX Ltd. & Co. KGc/o Andreas Jung,Charlottenstr. 37/1D-72070 Tuebingen, GermanyE-mail: info at zopyx dot comWeb:http://www.zopyx.comChangelog2.0.0 (2009-05-14)final release2.0.0b8 (2008-12-09)some more transformations2.0.0b5 (2008-10-26)extended demo22.0.0b4 (26.10.2008)removed zope.app.dependencyfixed logger issue in zcml.py2.0.0b3 (22.10.2008)tweaking the fonts in demo2 in order to make the demos work on Linux2.0.0b2 (19.10.2008)added demo2 application for generating business cards as PDFnow dealingn with images defined within a HTML template instead of the HTML snippet only2.0.0b1 (05.10.2008)Initial release
zopyx.smartprintng.lite
Produce & Publish LiteProduce & Publish Lite is a stripped down version of the Produce & Publish platform (www.produce-and-publish.com). It implements a PDF generation functionality for the Plone content-management system (www.plone.org).Limitationssupports Apache FOP 1.0 or PISA as PDF backendno support for the Produce & Publish server (conversion will take place inside Plone - may block worker threads of Zope)Requirementsrequires Plone 4 or higher (untested with Plone 3.x)Installationaddzopyx.smartprintng.liteto theeggsoption of your buildout.cfg and re-run buildout (as usual)read carefully thezopyx.convert2documentation (especially the section related to the configuration of Apache FOP)Installation of Apache usingzc.buildoutYou can automatically install and configure Apache FOP through your buildout configuration:[buildout] parts = ... fop [instance] ... environment-vars = FOP_HOME ${buildout:directory}/parts/fop [fop] recipe = hexagonit.recipe.download strip-top-level-dir = true url = http://apache.openmirror.de/xmlgraphics/fop/binaries/fop-1.0-bin.tar.gzUsageThe module supports conversion to PDF either using the FOP converter or PISA (installed automatically). Add@@asPlainPDFto the URL of a Plone document, news item or topic in order to convert the current content to PDF. This is use the default PDF converter (Apache FOP). In order to convert the HTML content using PISA you have to use@@asPlainPDF?converter=pdf-pisa.Supplementary informationPDF support for your own content-types:http://docs.produce-and-publish.com/connector/content-types.htmlRegistering your own resource directories:http://docs.produce-and-publish.com/connector/resource-directories.html#registering-your-own-resource-directoryLicenseProduce & Publish Lite is published under the GNU Public License V 2 (GPL 2).AuthorZOPYX Limitedc/o Andreas JungCharlottenstr. 37/1D-72070 Tuebingen, [email protected] (2011/06/15)no more generating a width=100% style for .image-container in order to avoid issues with PISA1.0.5 (2011/06/05)supports PDF generation through Pisa (xhtml2pdf project) (internal pdf-pisa converter name)1.0.4 (2011/06/04)documentation update1.0.2 (2011/06/03)released with full source code1.0.1 (2010/10/30)minor fix1.0.0 (2010/10/20)minor fix1.0.0b1 (2010/10/05)initial release
zopyx.smartprintng.plone
The Produce & Publish Client Connector for PloneDocumentationSeehttp://packages.python.org/zopyx.smartprintng.ploneSource codeSeehttps://github.com/zopyx/zopyx.smartprintng.ploneBugtrackerSeehttps://github.com/zopyx/zopyx.smartprintng.plone/issuesLicencePublished under the GNU Public Licence Version 2 (GPL 2)AuthorZOPYX LimitedCharlottenstr. 37/1D-72070 Tuebingen, [email protected] (2012-08-24)some fixes/workaround for exporting (embedded) images from special types like News Item2.1.25 (2012-08-14)added .mode-flat and mode-nested CSS classes depending on the folder aggregation mode in order to fix a problem with the makeImagesLocal transformation for nested folders2.1.23 (2012-05-08)fix in image resolver2.1.22 (2012-04-04)locale aware sorting of index terms in addIndex()2.1.21 (2012-04-03)fixed bug in endnote number handling in convertEndNotes()2.1.20 (2012-02-26)fixed CSS counter bug (related to PrinceXML 7.1 vs. 8.0)2.1.19 (2012-02-20)unicode fix in HTML splitter code2.1.18 (2012-02-10)folder aggregator now support (experimental) document filter based on UIDs (filter_uid parameter)makeImageLocal() transformation removed parts of the document while replacing the old image with an image containeradded experimental addIndexList transformation2.1.17 (2011-12-28)checking html input in transformation machinery for empty strings2.1.16 (2011-12-21)better footnote handling2.1.15 (2011-12-20)convertWordEndnotes() transformation added2.1.14 (2011-12-19)fixed image width 100% for images inside an image-container (PrinceXML 8 compatibility)2.1.13 (2011-12-18)some fixes discovered using PyFlakes2.1.12 (2011-12-12)added some transformations for better Word import2.1.11 (2011-11-23)update trove classifiers2.1.10 (2011-11-17)improved aggregator for nested content folderssupport for content hierarchies up to level 8support for new environment variable SMARTPRINTNG_ZIP_OUTPUT2.1.9 (2011-11-11)fixed bug in makeImagesLocal() transformation where the document root has not been used properly for finding images by traversal2.1.8 (2011-11-11)support for newSMARTPRINTNG_LOCAL_CONVERSIONenvironment variable2.1.7 (2011-11-08)removed some baggage in order to make distro smaller2.1.6 (2011-11-07)minor fixes in handling of generated files for download2.1.5 (2011-11-07)first public (open-source) release2.1.4 (2011-10-25)fixed unicode/utf-8 issue in makeImagesLocal transformation2.1.3 (2011-10-14)added fixAmpersand transformation2.1.2 (2011-10-10)transformations for dealing with converted footnotes from Word2.1.1 (2011-10-08)compatibility with Dexterity2.1.0 (2011-09-22)final 2.1.0 release2.0.9 (2011-09-20)fixed bug in xpath_query() (using relative query)2.0.8 (2011-09-11)more cleanup2.0.7 (2011-09-10)some ZCML fixes in order to avoid Plone 4.x startup failures under some conditionsrestored compatibility with Plone 3.3.X2.0.6 (2011-09-08)image exporter did not deal proper with duplicate image idsminor fixes2.0.5 (2011-09-02)new lxml backed transformation pipelinemore tests2.0.4 (2011-08-26)logging resource registration using INFO severitynew lxml dependency2.0.3 (2011/08/15)catching HTTPError in image resolverfixed another BeautifulSoup misbehaviour in fixHeadingAfterOfficeImport()2.0.2 (2011-08-02)minor fix2.0.1 (2011-08-02)integration with new zip client version (Proxy2 implementation)2.0.0 (2011-07-25)final release2.0.0rc2 (2011-07-04)fix in logger call in folder.py2.0.0rc1 (2011-07-01)don’t extend images an authoring projectremove class attributes from headings after office importadded ignoreHeadingsForStructure transformation2.0.0b2 (2011-06-16)minor fixes related to office data import2.0.0b1 (2011-05-24)fixes related to office format input2.0.0a3 (2011-05-17)added some workaround for image resolver in order to deal with images referenced through a fully specified URL with a redirection included (TQM issue)2.0.0a2 (2011-05-14)minor fix in safe_get()2.0.0a1 (2011-05-10)simplification and refacoring0.7.0 (2011-02-11)updated for use with zopyx.authoring 1.5.Xadded GenericDownloadView aka ‘@@ppConvert’exported images now contain a proper extension (fixes issues with the XFC converter depending on extension for determining the image format)0.6.24 (2010-12-09)added addDocumentLinks() transformationincluding content ids of aggregated content0.6.23 (2010-09-10)addImageCaptionsInHTML(): honour excludeFromImageEnumeration0.6.22 (2010-09-09)fixed improper stripping of image names using an image scale (causing issues in the consolidated HTML view of the authoring environment)0.6.21 (2010-08-09)added support ‘++resource++’ image references (Patrick Gerken)added support for FSImage (Patrick Gerken)0.6.20 (2010-08-05)added ‘removeComments’ transformationadded ‘makeImageSrcLocal’ transformation0.6.19 (2010-07-13)fixed race condition in makeImagesLocal()0.6.18 (2010-06-14)images got a new PDF conversion option “Exclude from image enumeration”0.6.17 (2010-06-12)inserting H1 title for consolidated HTMLadded extra class to folder title for consolidated HTML0.6.16 (2010-05-29)inserting space for found anchors0.6.15 (2010-04-15)minor fix in image handling0.6.14 (2010-04-14)minor tweaks for image caption markup0.6.13 (2010-03-26)support for span.footnoteText0.6.12 (2010-03-21)support for image urls ‘resolveuid/<uid>’minor fixes and tweaking in image handling (caption generation)0.6.11 (2010-03-10)added document extenderdocument option for suppressing the title in PDFimage caption supportchanged default transformations (to makeImagesLocal only)removed TOC from default PDF template0.6.10 (2010-03-03)support for request/transformations parametervarious fixes0.6.9 (2010-02-22)added <em>[[text:footnote-text]]</em> support for generating footnotesvarious changes related to zopyx.authoring integration0.6.8 (2010-02-03)Folder aggregation now works with all folderish objects providing IATFolder0.6.7 (2009-11-30)makeImagesLocal: better dealing with virtual hosting0.6.6 (2009-11-15)fixed CSS issue with TOC markup0.6.5 (2009-11-12)always use images in their original resolutionoptional content information with link to the edit mode of the aggregated document (you must change the visibility of the .content-info class through CSS)a request parameter ‘show-debug-info’ will enable the additional content-info viewbetter error handlingbetter loggingtweaked markup of generated TOC0.6.3 (2009-10-27)refactored language handlingrefactored PDF view in order to provide a low-level view returning a reference to the generated PDF file instead providing it for HTTP download0.6.2 (2009-10-24)setting anti-cache headerslocale-aware sorting in PloneGlossary code0.6.1 (2009-10-23)PloneGlossary integration: compare title case-insensitive (IDG project)0.6.0 (2009-10-21)refactored and simplified transformation machinery0.5.0 (2009-10-09)major rewrite0.3.0 (2009-09-24)refactored views0.2.0 (2009-09-23)more hyphenation dictsrestructured resources directory0.1 (xxxx-xx-xx)Initial release
zopyx.smartprintng.psd
zopyx.smartprintng.psdA simple converter for parsing PSD (Photoshop) files into PrinceXML templates (HTML/CSS) based on thepsdparseconverter.Requirementsrequirespsdparse:svn checkouthttp://www.telegraphics.com.au/svn/psdparseconfigure; make; make installUsagebin/psd2prince –helpbin/psd2prince <PSD-FILENAME>Licencezopyx.smartprintng.psdis published under the GNU Public License V2 (GPL 2)AuthorZOPYX LimitedAndreas JungCharlottenstr. 37/172070 [email protected] history0.1.1 (2010/08/12)minor fixesdocumentation update0.1.0 (2010/08/11)initial release
zopyx.smartprintng.server
zopyx.smartprintng.serverzopyx.smartprintng.serveris a Pyramid based server implementation and implements the server side functionality of the Produce & Publish platform. It is know as theProduce & Publish Server.RequirementsPython 2.6, 2.7 (no Python 3 support)Installationcreate anvirtualenvenvironment (Python 2.6) - either within your current (empty) directory or by letting virtualenv create one for you. (easy_install virtualenvifvirtualenvis not available on your system):virtualenv --no-site-packages .or:virtualenv --no-site-packages smartprintnginstall the SmartPrintNG server:bin/easy_install zopyx.smartprintng.servercreate aserver.iniconfiguration file (and change it according to your needs):[DEFAULT] debug = true [app:main] use = egg:zopyx.smartprintng.server#app reload_templates = true debug_authorization = false debug_notfound = false [server:main] use = egg:Paste#http host = 127.0.0.1 port = 6543start the server (in foreground):bin/pserve server.inior start it in background:bin/pserve server.ini --daemonUpgradingFor upgrading an existing SmartPrintNG server you should try the following inside your virtualenv environment:bin/easy_install -U zopyx.smartprintng.server bin/easy_install -U zopyx.convert2XMLRPC APIThe SmartPrintNG server exposes several methods through XMLRPC:def convertZIP(auth_token, zip_archive, converter_name): """ 'zip_archive' is ZIP archive (encoded as base-64 byte string). The archive must contain exactly *one* HTML file to be converted including all related resources like stylesheets and images. All files must be stored flat within the archive (no subfolders). All references to externals resources like the 'src' attribute of the IMG tag or references to the stylesheet(s) must use relative paths. The method returns the converted output file also as base64-encoded ZIP archive. """ def convertZIPEmail(auth_token, context, zip_archive, converter_name='pdf-prince', sender=None, recipient=None, subject=None, body=None): """ Similar to convertZIP() except that this method will send the converted output document to a recipient by email. 'subject' and 'body' parameters *must* be utf-8 encoded. """ def availableConverters(): """ Returns a list of available converter names on the SmartPrintNG backend. """ def authenticate(username, password): """ Log into the server. Returns an auth_token. authenticate() must be called before calling any of the methods above. """ def ping(): """ says 'pong' - or something similar """Email configurationFor using the email support through theconvertZIPEmail()the email server must be configured through a dedicated configuration file. Anemail.inimay look like this:[mail] hostname = smtp.gmail.com username = some_username password = some_password force_tls = False no_tls = FalseYou have to pass the name of the email configuration file topservewhen starting then server:bin/pserve server.ini mail_config=/path/to/email.iniSource codehttps://github.com/zopyx/zopyx.smartprintng.server/Bug trackerhttps://github.com/zopyx/zopyx.smartprintng.server/issuesSupportSupport for Produce & Publish Server is currently only available on a project basis.ContactZOPYX LimitedHundskapfklinge 33D-72074 Tuebingen, [email protected] (2012/10/14)documentation updated1.1.1 (2012/02/03)better self-test page (more text, some images)updated dependencies1.1.0 (2011/08/22)compatibility with Pyramid 1.11.0.1 (2011/01/30)compatibility with Pyramid 1.0b3+1.0.0 (2011/01/16)final releasefixed test fixtures0.7.1 (2011/01/10)pinned pyramid_xmlrpc 0.10.7.0 (2010/12/11)converted to Pyramid0.6.7 (2010/07/18)adjusted company name0.6.6 (2010/05/15)include conversion result into ZIP file0.6.5 (2010/02/04)fixed racing condition in cleanup code0.6.4 (2009/12/25)minor fixesdocumentation cleanup0.6.3 (2009/11/29)compatiblity with BFG 1.20.6.1 (2009/10/04)fixed bug in code for cleaning up the spool_directory0.6.0 (2009/09/15)authentication and authorization support0.5.2 (2009/09/05)adjusted to newest zopyx.convert2 version0.6.0 (2009/09/15)added authentication and authorization support0.5.2 (2009/09/05)adjusted to newest zopyx.convert2 version0.5.1 (2009/08/01)added convertZIPandRedirect() methodadded deliver() methodmoved base.ServerCore to models.pydelivered files must be younger than ‘delivery_max_age’ secondscleanup codeinternal refactoringmore tests0.5.0 (2009/07/23)now requires Python 2.60.4.3 (2009/07/22)removed most of the ZCML configurationtests, tests, tests0.4.2 (2009/07/19)switching back to zope.sendmailimplemented asynchronous mail delivery on top of zope.sendmail0.4.1 (2009/07/19)using repoze.sendmail0.4.0 (2009/07/19)added convertZIPEmail() API0.3.4 (2009/07/13)updated documentation0.3.3 (2009/07/12)fix for missing BASE tag within HTML files0.3.2 (2009/07/12)better logging0.3.1 (2009/07/08)disabled check for maximum size of the request within parse_xmlrpc_request() since 8MB is too small for us0.3.0 (2009/07/06)switched to repoze.bfg0.2.0 (2009/07/06)improved handling of temporary directories0.1.2 (2009/07/05)improved handling of temporary directories0.1.1 (2009/07/05)improved logging and error handling0.1 (2009/07/05)Initial release
zopyx.textindexng3
Authorzopyx.textindexng3 was written by Andreas Jung for ZOPYX Ltd. & Co. KG, Tuebingen, Germany.LicenseTextIndexNG 3 is published under the Zope Public License V 2.1 (see ZPL.txt) Other license agreements can be made. Contact us for details ([email protected]).TextIndexNG 3 ships with a copy of the Snowball code (snowball.tartarus.org) for implementing stemming. This code is (C) 2001, Dr. Martin Porter and published under the BSD license.TextIndexNG3 ships with the python-levenshtein extension written by David Necas und published under the GNU Public License (GPL).BuildingBuilding the egg on Windows (basically a reminder for myself):Basically a reminder for myself: - Install Cygwin - Install the Windows Python 2.4 - under Cygwin:: python.exe setup.py build -c mingw32 bdist_egg uploadContactZOPYX Ltd. & Co. KGc/o Andreas Jung,Charlottenstr. 37/1D-72070 Tuebingen, GermanyE-mail: info at zopyx dot comWeb:http://www.zopyx.comChanges4.0.1 (08.06.2008)normalizer: fixed core dump under Python 2.5 (patch by Bruno Desthuillier)4.0.0first release as eggupdated Snowball libs (now includes stemmer support for Turkish, Romanian and Hungarian)
zopyx.tinymceplugins.imgmap
zopyx.tinymceplugins.imgmapThis module allows you to edit image maps inside the TinyMCE editor in Plone 4.0 or higher.The code is based on theimgmapplugin for TinyMCE. Seehttp://code.google.com/p/imgmapfor details.InstallationAs with every Plone add-on: addzopyx.tinymceplugins.imgmapto theeggsoption of your buildout configuration and re-run buildout.ConfigurationRight now you have tomapandareamanually to the list of allowed HTML tags inside the Plone control panel for HTML filtering.UsageInside TinyMCE you have to select an image inside the editor window and choose the imagemap icon from the toolbar of TinyMCE.LicenseThis module is published under the GNU Public License V 2AuthorZOPYX Limitedc/o Andreas JungCharlottenstr. 37/1D-72070 Tuebingen, [email protected]:Harald Friessnegger (fRiSi)Jean Michel Francois (toutpt)Changelog0.3.2.1 (2012-11-07)fix brown bag release (docs/ did not get added to the distribution by zest.releaser so we added it to MANIFEST.in)0.3.2 (2012-11-06)add thezopyx_tinymceplugins_imgmapleayer to every skin defined in portal_skins on installation to prevent people using the product fromgetting confused[fRiSi]0.3.1 (2011-08-03)added dependency to BeautifulSoup [fRiSi]added French translation [toutpt]0.3.0 (2010-11-18)added @@getAnchors() viewaddedAnchorsfieldset for accessing the list of anchors in the underlaying document (works only for ATDocument instance) [ajung, d2m]0.2.0 (2010-10-10)fixed some packaging issues0.1.0 (2010-09-27)Initial release
zopyx.tinymceplugins.tinyautosave
zopyx.tinymceplugins.tinyautosaveAuto-save support for TinyMCE - based on thetinymce.plugins.AutoSaveplugin for TinyMCE.AuthorsAndreas Jung, Simon PamiesFunded by Mentz DV, MunichChangelog1.0.0 (2011/04/25)Initial release
zopyx.together
Experimental integration of Plone 4 with TogetherJSInstallationAddzopyx.togetherto theeggsandzcmloption of your buildout configuration, re-run buildout and activatezopyx.togetherwithin Plone.A new buttonStart TogetherJSwill appear below the content headline. Clicking the button will activate the TogetherJS functionality.RequirementsPlone 4.x (tested with Plone 4.3 only)Changes0.2.0 (2014-02-14)support for custom or self-hosted hub serversadded dedicated control panel to the Plone site setup screen0.1.0 (2014-02-13)Initial releaseAuthorZOPYXAndreas [email protected]
zopyx.trashfinder
Introductionzopyx.pypitrashfinderperforms some sanity checks on packages registered on PyPI (metadata and release files). A proper package should contain at least name and email of the author or maintainer and a reasonable description.Installationeasy_install zopyx.trashfinderUsagepypi-trashfinder <package-prefix>e.g.pypi-trashfinder collective.AuthorAndreas [email protected] under the Zope Public License (ZPL)Changelog0.1.4 (2011/02/06)bug fix in parsing metadata0.1.3 (2009/12/29)bug fix0.1.2 (2009/12/29)added some sanity checks on egg releases files vs. source releases0.1.0 (2009/12/29)Initial release
zopyx.txng3.core
Changes3.6.2 (2017/05/23)pinned zopyx.txng3.ext < 3.53.6.1 (2012/12/10)creating temporary parser files using UID and PID3.6.0 (2012/11/21)replaced popen2.Popen3 by subprocess.Popenremoved zope.app.testing dependencyolder versions than Python 2.6 / Zope 2.12 / Plone 4.0 are no longer supportedupdated portuguese stop word fileparsers/english.py - creating temporary parser files by process id instead of user id3.5.3 (2011/03/20)fixed deprecation zope.app.zapi usage (http://sourceforge.net/tracker/?func=detail&atid=458418&aid=3200370&group_id=50052)3.5.2 (2011/01/11)yet another popen3() fix3.5.1 (2010/11/22)fixed improper popen3() call in baseconverter.py3.5.0 (2010/11/22)mergedthesaurus-improvedbranchThesaurus now treats all words synonomyously (this fixes 3111026) [fRiSi]It’s possible to create a thesaurus based on an input file that is located outside of the zopyx.txng.core package:MyThesaurus = Thesaurus('de', '/path/to/my/thesaurus')3.4.1 (2010/06/22)Fixed a bug in query splitting when usingzopyx.txng3.splitter.default.3.4.0 (2010/05/20)Made the ranking method to be looked up via a utiltiy. This way different ranking methods can be used easily.Provide better backward compatibility in the ‘textindexng’ package by injecting modules from zopyx.txng3.core into sys.modules.Added query argumentsearch_all_fieldsto search in all fields when using dedicated storage.Applying splitter not only to indexed content but also to query.3.3.4 (2009/12/08)workaround for a race condition in storage.py (likely caused by some ZCatalog inconsistency and some too optimistic assumptions).3.3.3 (2009/05/02)removed IObjectWrapper and related code that tried to unwrap wrapped content3.3.2 (2009/03/17)added ‘textindexng’ alias module for backward compatibility3.3.1 (2009/03/15)fixed packaging issue3.3.0 (2009/03/15)fixed Zope trunk compatibilityFixed deprecation warnings (spamsch)Fixed ting.TingIndex:apply to always return a lazy result (spamsch)3.2.2Added grokindex.py to ease to use of TXNG in grok. In future there specific implementation details could be included, hidden from the grok user. [spamsch]Changed python2.4 to python to in runall.sh to make it work with virtualenv environments [spamsch]Fixed setup.py to never make zip file [spamsch]Added dependencies needed for installation in pure zope3 environment. [spamsch]Fixed TingIndex to play nicely with zope 3 conventions. It needs to derive from TextIndex to also work with hurry.query [spamsch]Added simple tests for TingIndex [spamsch]
zopyx.txng3.ext
Authorzopyx.txng3.ext is written by Andreas Jung for ZOPYX Ltd. & Co. KG, Tuebingen, Germany.LicenseTextIndexNG 3 is published under the Zope Public License V 2.1 (see ZPL.txt) Other license agreements can be made. Contact us for details ([email protected]).TextIndexNG 3 ships with a copy of the Snowball code (snowball.tartarus.org) for implementing stemming. This code is (C) 2001, Dr. Martin Porter and published under the BSD license.TextIndexNG3 ships with the python-levenshtein extension written by David Necas und published under the GNU Public License (GPL).Supported Python versionsPython 2.7Python 3.4Python 3.5Python 3.6PyPyContactAndreas Jung/ZOPYXD-72074 Tuebingen, GermanyE-mail: info at zopyx dot comWeb:http://www.zopyx.comChanges4.0.0 (2017/05/22)Added support for Python 3.4, 3.5 and 3.6.3.4.0 (2016/02/02)added support for PyPyhttps://github.com/zopyx/zopyx.txng3.ext/pull/63.3.7 (2014/09/05)Fix missing namespace declaration onext``levelin ``__init__.pyand avoid recent setuptools to spit and fail.3.3.5 (2014/07/13)Fix single-character poisoning bug (http://sourceforge.net/p/textindexng/bugs/125/).fixed improper version number3.3.3 (2012/05/16)applied patch forhttps://sourceforge.net/tracker/?func=detail&atid=458418&aid=3527329&group_id=500523.3.2 (2010/03/10)applied patch for bug #2964362 (fixing several crashes)3.3.1 (2009/03/15)compabitlity with Python 2.4-2.63.3.0 (2009/03/15)refactored and re-released as zopyx.txng3.ext
zopyx.typesense
zopyx.typesenseWhat is zopyx.typesensezopyx.typesensein an add-on for Plone 6 that provides an integration with the search engineTypesense. The functionality is similar withcollective.solr.The reasons for using Typesense arevery easy to install (single binary or via Docker)multi-field text indexesauto-generated (but highly customizable) search UIoptional facted search for refining fulltext queriesminimal invasive into Plone (does not replace the ZCatalog)very fast searchextensible and customizablescalable (through a Typesense cluster)federated search over multiple collections (aka Plone sites)open-sourceon-premise or Typesense cloud (commercial offering)Clickherefor an intro video.zopyx.typesense is nota replacement of the ZCatalog/portal_catalog (document changes are pushed to Typesense as an independent entity completely decoupled from Plone's portal_catalog)a drop-in replacement of the Plone search.zopyx.typesensecomes with its own configurable auto-generated search UIRequirementsPlone 6 (tested)Plone 5.2 (untested, supposed to work for Dexterity-only sites, under Python 3)ArchitectureTypesense runs as dedicated service either on-premise or somewhere in the cloud.![Architecture](https://github.com/zopyx/zopyx.typesense/raw/master/docs/Typesense.pngIndexingzopyx.typesensepushes content changes (new documents, updated documents, deleted documents) through Plone lifecycle hooks into Typesense.SearchingThe search interaction between browser and Typesense happens directlywithoutPlone being in-between. When you open the@@typesense-searchview, the search configuration (as defined through the search templatesearch.ptand an associatedapp.jsfile) is loaded from Plone for auto-generating the search UI (search input, faceted search) within the browser. The search query is directly send to Typesense and the results are directly shown within the browser as soon as they are available. Plone isnotinvolved in the search. No additional filtering (e.g. regarding access control) happens through Plone.InstallationAddzopyx.typesenseto your buildout, re-run buildout and install it within Plone.For Typesense installation, please check the installation docs of Typesense (either for installation through Docker or through the standalone binary).There is no public release at this time. You need to installzopyx.typesenseusingmr.developeras source checkout from Github.ConfigurationTheTypesense settingswithin the Plone controlpanel:Name of Typesense collection- must be a unique name for the document pool of your Plone siteAPI Key- the administrative API key (as configured in Typesense)Search API Key- the search API key (as configured in Typesense)URL of Typesense node X- the URL(s) of the Typesense node or Typesense clusterCollection schema- the schema of the Typesense collecton (see Typesense docs)TheTypesense administrationwithin the Plone controlpanel:Example setupFor a typical Plone dev setup which Plone running on localhost, you want to run Typesense (for dev purpose) on the same machine using Docker:docker run -p 8108:8108 -v /tmp/data:/data typesense/typesense:0.22.1 --data-dir /data --api-key=some_api_key --search-only-api-key=some_search_api_key --enable-corsThis command will store the Typesense data files under/tmp/dataand open a connection on port8108. You need to specify two api keys: one for admin access and one for search api.After installingzopyx.typesensein Plone, you would specify both API keys in the Typesense control panel within Plone along withhttp://localhost:8108as URL for Typesense node 1.Search UIThe search UI is auto-generated from a minimal HTML template which defines the basic layout together with the widgets to be usedsee here.The integration of the template with the Typesense UI generator is impleted through some lines of Javascript code insrc/zopyx/typesense/browser/static/app.js.Views@@typesense-searchrenders the main (auto-generated) search form. This view can be applied on any folder level. This view applied on a folder implies a filter by subpath (only indexed content with the given folder will be searched).@@typesense-settingsrenders the Plone control panel of Typesense@@typesense-settingsrenders the Plone control panel of Typesense@@typesense-adminrenders the administration control panel for Typesense@@typesense-indexed-contentapplied on any arbitrary content object will display all data indexed for the given content objectIndexing integrationzopyx.typesenseintegrates into Plone using the lifecycle event for content being added, updated, deleted (plus workflow changes). By default,zopyx.typesenseindexes all metadata of all content objects (basically Dublin Core) plus the textual content of a content objects (title, description and the content of allRichTextfields). Similar to Plone'sSearchableTextindex, all textual content is being indexed within Typesense in thetextfield.It is possible to override the indexing behavior per-content-type using an indexing adapter implementingITypesenseIndexDataProvider. Seehere for an example.Indexing binary content and office formatsThe indexer for theFilecontent-type has optional support for indexing binary content or office formats using ApacheTIKA. The server URL of the (optional) Tika server must be configured through theTypesensecontrol panel. The most simple approach for running Tika is by using Docker:docker run -d -p 9998:9998 apache/tikaConfigure Tika within the Typesense control panel ashttp://localhost:9998. Ensure that the configuration regarding host, IP address and port numbers fit your security requirements (usually, you don't want expose an internal service on public IP addresses, but localhost only).Bulk reindexingThe Typesense admin control panel contains a buttonReindex allwhich willcreate a new collection whose name is defined as <collection_name>-submit all Dexterity content objects for reindexingalias the new collection with the official name of the configured collectionThis means that an existing Typesense collection remains online until the complete reindexing process has finished. The Typesense collection with the fresh index content replaces then the old collection in an atomic operation. There should be no impact on the availability of the search functionality during reindexing.Custom search viewsThe default Typesense search view@@typesense-searchshould work for most common usecases of a Plone site with the default content types. If you need something different, you have two options:customizesearch.ptandapp.jsaccording to your own need (e.g. usingz3c.jbot)create your search view(s) with your own search template and the related JS configurationTransactions and eventual consistencyAll indexing/unindexing operations happen asyncronously to Plone and outside Plone's transaction system. So, content changes might be available in Typesense with a short delay.Cavecats and known issueszopyx.typesensedoes not integrate (by-design) with Plone's security and access model. The main purpose ofzopyx.typesenseis to act as a search engine for public sites. So it is recommended at this time to index only public content.ResourcesTypesense websiteTypesense APIInstantSearch.jsAuthorAndreas Jung |[email protected]|www.zopyx.comPaid service forzopyx.typesenseis available on request.
zopyx.usersascontent
# zopyx.usersascontentThis add-on provides a new content-typesPloneUserfor representing a user in Plone through a dedicated content-type. The motivation for this add-on is the need for maintaining user profiles a content in order to make them referencable from other content.ThePloneUserprovides the standard fields like fullname, email organization, a member picture etc. and a dedicated view.The add-on also contains some ideas borrowed fromcollective.onloginwith configurable redirections to a user’sPloneUserobject directly after the first login after registration or after each login.zopyx.usersascountentis designed as a lightweight alternative to Membrane & Co.The add-on provides a control panelUsers As Content.## Requirements:Plone 6, Python 3.8+(untested with Plone 5.2)## InstallationInstall zopyx.usersascontent by adding it to your buildout:[buildout]…eggs =zopyx.usersascontentand then runningbin/buildout## ContributeIssue Tracker:https://github.com/zopyx/zopyx.usersascontent/issuesSource Code:https://github.com/zopyx/zopyx.usersascontent## LicenseThe project is licensed under the GPLv2.ContributorsAndreas Jung,[email protected] (unreleased)Initial release. [zopyx]
zopyx.versioning
zopyx.versioningzopyx.versioningis a generic versioning system for schema-oriented content-objects (zope.schema, Archetypes, Dexterity etc.).Why another versioning system?Existing versioning approaches in the Zope world are:CMFEditionswidely usedvery monolithictoo tight integration with CMFfragile implementationdoing “too much”doing “too much” in a very intransparent wayno backend serialization format other than Python picklesonly ZODB-based backendbackend not pluggableBasic conceptsgolden rule #1: keep it simple, keep it smallpluggable storage API (storing the versioned data)using JSON as data exchange format between objects to be versioned and versioner and between versioner and backend storage (the storage may use a different serialization format (e.g. ‘pickle’ for a ZODB based backend or ‘json’ for a typical noSQL backend like MongoDB)making use of the Zope Component Architecture for adopting arbitrary content objects to the storage APIthe solution does not claim to store and restore the complete state of an content object. Instead we focus on dealing with the metadata and the content itself. If an object uses a complex internal data model then it is in responsible to serialize and deserialize the data to JSON.leave complex functionality (likely handling of references, object relations etc.) out of the core versioning engine - this might be handled through adapters implementing IVersionSupport.Open pointsshould de-duplication be handled on the storage layer or the versioning layer (I assume on the storage layer as an optional feature in order to keep the overall complexity low)all versionable objects must provide a unique ID (UIDfor Archetypes-backed content). How about Dexterity? How about ZTK/zope.schema-based content?how deal with “large” content. E.g. a MongoDB-based backend has by default a 4MB limit for embedded documents (usually enough for standard content but not for binary content like images)AuthorZOPYX Ltd.c/o Andreas JungCharlottenstr. 37/1D-72070 [email protected] (2010-07-09)Initial release with MongoDB-based version storage
zopyx.webpage
zopyx.webpage
zora
No description available on PyPI.
zoracloud
No description available on PyPI.
zoran-tools
No description available on PyPI.
zorb
ZorbPyPython library for integrating with theSomatic Zorb EngineInstallationFirst install theAdafruit BluefruitLE library.Please note that this library only currently supports macOS and Linux, as Windows is not currently supported by theunderlying BLEpackage used for this library.After installing the BluefruitLE library, installation of ZorbPy usingpipis simple:pipinstallzorbLibrary UsageFor a quick example on how to use the ZorbPy library, please referenceexample.py.To use the ZorbPy library, you must wrap the functionality of your program in a function that is passed to thezorb.run()function call.Any usage of the functions provided by this library outside of the process started byzorb.run()will produce error behavior.The ZorbPy library provides three main functionalities:connecting to advertising Zorb devicestriggering presets on the Zorb devicedirectly controlling actuator intensity on the Zorb deviceTo connect to an advertising Zorb device:zorb.connect()To trigger one of the available presets:zorb.triggerPattern(zorb.POINT_LEFT)Note that preset haptic emojis are exist for the following emojis:🎊, 👈, 👉, 🤛, 🤜, ⏮️, ⏭️, 🙌, 👋, 😯, 😳, 😬, 😊, 😄, 🤣To directly set the actuator values:duration=100top_left=0top_right=0bottom_left=25bottom_right=25zorb.writeActuators(duration,top_left,top_right,bottom_left,bottom_right)Below is a more comprehensive example of a simple program that connects to a Zorb device, plays a confetti pattern upon successful connection, and then updates actuator values based on some hypothetical sensor output.importzorbdefmainloop():# perform initial connection to Zorb devicezorb.connect()# trigger confetti effect upon successful connectionzorb.triggerPattern(zorb.CONFETTI)# enter infinte loop for updating Zorb devicewhileTrue:top_left=hypothetical_sensor_1.val()top_right=hypothetical_sensor_2.val()bottom_left=hypothetical_sensor_3.val()bottom_right=hypothetical_sensor_4.val()zorb.writeActuators(10,top_left,top_right,bottom_left,bottom_right)time.sleep(0.01)defmain():zorb.run(mainloop)if__name__=='__main__':main()Style GuideContributions to this project should conform to thisPython Style Guide.LicenseZorbPy is released under theMIT license.
zoren-pip-prueba
No description available on PyPI.
zoren-pip-test
Failed to fetch description. HTTP Status Code: 404
zoresearch
zoResearchA notes and annotation manager built on top ofZoteroUsesZoterois a fantastic resource for keeping track of source metadata and citations. But when it comes to note-taking, it's lacking.ZoResearchtakes the sources in your Zotero library, extracts any annotations from associated PDFs and displays them in an easy-to-use interface. For a given project, keep all you notes in an accessible place that updates alongside your research.Organize sources by Zotero collectionAutomatically extract annotations from source PDFsAdd notes for each sourceInstallationpip install zoresearchHow to useimport zoresearchzoresearch.open(zotero_folder_location, zotero_collection_name=all)zotero_folder_locationFilepath for Zotero folder installed on your system.Ex: C:\Users\Username\Zoterozotero_collection_name, default allName of Zotero collection for start-up. Defaults to sources inallcollections. Multiple words permitted. Case agnostic.Ex: My Research ProjectInterfaceZotero sources are displayed on a scrollable sidebar. The main window displays the selected source with user-generated notes as well as citations from the source's associated PDF (if any).Use dropdown menus to select different Zotero collections and to filter sources by either 'Starred' or 'Unread'.Click 'Show PDF' for thumbnails.Source annotationsHighlighting and adding comments to PDFs are convenient ways to take notes. But extracting them can be a pain! zoResearch extracts all these annotations for easy access.Annotations are labeled with their absolute page number in the associated PDF and type (highlight, sticky note).New annotations are added at zoResearch startup.Adding notesIn addition to PDF annotations, users can add additional notes directly to the viewer.zoResearch automatically saves these notes.Starring a sourceWant to designate some important sources? Simply 'Star' the source so that you can easily find them using the dropdown menu.
zoreto
No description available on PyPI.
zorg
Zorg is a Python framework for robotics and physical computing. It is based onCylon.js, a JavaScript framework for robotics.Getting startedInstallationAll you need to get Zorg up and running is thezorgpackage:pip install zorgYou may need to `copy the source <https://github.com/gunthercox/zorg/archive/master.zip>`__ if your device does not support `pip <https://pip.pypa.io/en/stable/>`__.You should also install the packages for the hardware you are looking to support. In our examples, we will be using theIntel Edisonand an LED, so we need theedisonandgpiopackages:pip install zorg-gpio zorg-edisonExamplesIntel Edison and an LEDThis example controls an LED connected to the Intel Edison and blinks it once every 500 milliseconds. This program should be run on the Intel Edison itself.importzorgdefwork(my):whileTrue:# Toggle the LEDmy.led.toggle()# Wait 100ms before doing it againtime.sleep(0.1)robot=zorg.robot({"connections":{"edison":{"adaptor":"zorg_edison.Edison",},},"devices":{"led":{"connection":"edison","driver":"zorg_gpio.Led","pin":13,# 13 is the on-board LED}},"name":"example",# Give your robot a unique name"work":work,# The method (on the main level) where the work will be done})
zorge
No description available on PyPI.
zorg-edison
Thezorg-edisonmodule wraps the mraa library created by intel for interacting with IO pins on the Edison microcontroller. While the Python bindings for mraa work great on their own, the benefit of using Zorg is that we have already created many of the drivers you needed for using sensors and output devices. Zorg also implements multiprocessing so that tasks such as reading and writing from sensors are non-blocking, allowing you to take full advantage of multi-processor boards like the Intel Edison.Zorg also creates a REST API for you :)Installationpip install zorg-edisonDocumentation
zorg-emic
This is a python driver for controlling theEmic2text to speech module with Zorg. Zorg (https://zorg.github.io/) is a Python framework for robotics and physical computing.DescriptionThis driver allows commands to be sent to the Emic 2 text to speech module using a serial connection. The driver automatically queues commands and asynchronously transmits them to the text to speech module when it is ready to process them.More information can be found in the projectdocumentation.ExamplesSee examples for using this library in theexamplesdirectory.Getting StartedInstall the module with:pip installzorg-emicLicenseCopyright (c) 2015 Team Zorg
zorg-firmata
What is Firmata?Firmata is a protocol for communicating with microcontrollers from software on a computer (or smartphone/tablet, etc). The protocol can be implemented in firmware on any microcontroller architecture as well as software on any computer software package (see list of client libraries below). ~Firmata Protocol DocumentationInstallationYou can install this library on your machine using PIP.pip install zorg-firmataSetupTo use this library with your microcontroller, you will need to load the Standard Firmata software onto it first. SeeUploading StandardFirmata To Arduinofor an example of how to do this.ExamplesSeveral examples for using thezorg-firmatamodule are available on GitHub.https://github.com/zorg/zorg-firmata/tree/master/examplesNotesThis module wraps thePyMatalibrary to provide Firmata support within the Zorg robotics framework.
zorg-gpio
Zorg (https://zorg.github.io/) is a Python framework for robotics and physical computing.This module provides drivers forGeneral Purpose Input/Output (GPIO)devices. Typically, this library is registered by an adaptor class such as`zorg-edison<https://github.com/zorg/zorg-edison>`__ that supports the needed interfaces for GPIO devices.Getting StartedInstall the module with:pip install zorgzorg-gpioDocumentationExampleimporttimeimportzorgdefblink_led(my):whileTrue:my.led.toggle()time.sleep(100)robot=zorg.robot({"name":"Test","connections":{"edison":{"adaptor":"zorg_edison.Edison",},},"devices":{"led":{"connection":"edison","driver":"zorg_gpio.Led","pin":4,# Digital pin 4},},"work":blink_led,})robot.start()Hardware SupportZorg has a extensible system for connecting to hardware devices. The following GPIO devices are currently supported:Light sensorButtonAnalog SensorDigital SensorLEDRelayBuzzerOpen a new issueto request support for additional components.LicenseCopyright (c) 2015 Team Zorg
zorg-grove
zorg-groveThis module implements drivers for controling devices using theZorgframework for robotics and physical computing.DocumentationHardware SupportZorg has a extensible system for connecting to hardware devices. The following Grove sensors and devices are currently supported:LCD screenTemperature sensorMicrophoneRotary Angle SensorServoOpen a new issueto request support for additional components.
zorglangue-traductor
Zorglangue TraductorA Python module that allows you to traduce the fake language Zorglangue from the Spirou comic strips. Works from a Latin language (originally French) to Zorglangue and vice versa. Eviv Bulgroz !Installationpy -m pip install zorglangue-traductorHow to use itSimply import the module into your Python 3 program, and you will be able to use the functionzorglondeto traduce your string. The function takes a string as parameter and returns a string.# Zorglangue Program # by Raphaël DENNI # Import import zorglangue_traductor as zt # Code print("--- Zorglangue program ---\n--- by Raphaël DENNI ---") while True: string = input("\nEnter your string : ") zorg_string = zt.zorglonde(string) print(f"\nEviv Bulgroz : {zorg_string}) input("\nPress enter for an another phrase or shutdown the program.")Results example
zorg-network-camera
This module contains device adaptors and drivers that make it possible to connect network cameras to your robot.Installationpip install zorg-network-cameraNetwork Camera AdaptorThis module’s network camera adaptor handles the basic functions of retrieving images from the remote camera when necessary. Because this module is intended to run on devices such as the Intel Edison or the Raspberry Pi, the adaptor has been designed with additional features for efficiency. Mainly, if an images are cached until the image from the remote camera has been updated. This ensures that an image will not be unnecessarily downloaded onto the device.Camera Feed DriverTheFeedmodule provides a driver for accessing the url to of the remote camera’s image. This is a convenience method intended to be used to load the image into your application.Light Sensor DriverTheLightSensormodule allows you to use the camera as a light sensor. This driver provides the ability to get the average lighting level from the camera.OCR DriverOptical character recognition (OCR) is the process of programmatically converting images of typed, handwritten or printed text into machine-encoded text. TheOCRdriver module provided in this package provides a utility that makes it possible for your robot to process written text that it sees.The OCR driver achieves the process of extracting text from an image through the use of the open sourceTesseract OCRmodule. Tesseract is an optical character recognition engine origionally developed by Hewlett-Packard. Development of Tesseract has beensponsored by Google since 2006.
zorg-seeed
A Zorg robotics module for controlling various Seeed hardware.DocumentationHardware SupportMotor Shield:http://wiki.seeedstudio.com/wiki/Motor_Shield_V1.0
zorigoohashcalc
sha256 hash calculation of input file. usage: my_has.py -f filename
zoritori
zōritori 草履取りyet another tool to help Japanese language learners read text in video gamesfeaturesannotate kanji with furiganacolor code proper nouns (like NHK News Web Easy)look up words on mouse hover, or open Jisho or Wikipediaautomatically collect vocabulary with context(optional) English subtitles via machine translationThis is a work in progress and is rough around the edges.requirements:Windows, Linux, or Mac (tested on Windows 10, Ubuntu 22.04, and macOS Montery)Python 3.10.x (tested with 3.10.9)either Tesseract or a Google Cloud Vision API account(optional) DeepL API account for machine translated subtitles(Linux only) scrot, python3-tk, python3-dev. X11 only for now, Wayland may not workinstallation:on Windows, the following worked:install Python 3.10.xinstallzoritorivia pip (optionally via pipx)on Mac and Linux, I ran into numerous issues installing via pip/pipx, so for now use the development process:install Python 3.10.9 (recommended via pyenv)installPoetryclone this repoinstall dependencies viapoetry installwhen runningzoritori, usepoetry run python -m zoritori ...(see below for command line args)for all platforms:download the example config file fromhereif using Tesseract,follow these instructionsto install it, then configure it by specifying the path to thetesseractbinary inconfig.iniif using Google Cloud Vision,follow these stepsto create a project and download a credentials JSON file. then add that as an environment variable. Windows:$env:GOOGLE_APPLICATION_CREDENTIALS="C:\path\to\json", Mac/Linux:export GOOGLE_APPLICATION_CREDENTIALS=/path/to/jsonusagestart:zoritori -e <tesseract|google> -c /path/to/config.inian invisible window (with title "zoritori") should appear. make sure this window has focusidentify the region of the screen containing text you want to readusing your mouse, (left) click and drag a rectangle around the textafter a moment, you should see furigana over any kanji in the region, and proper nouns highlighted (blue, orange, and green boxes). hovering over words inside the region should display a dictionary result, if one is foundkeyboard shortcutskeyDescriptionTtoggle translationCmanual refreshJopen Jisho search for word under cursorWopen Japanese Wikipedia search for word under cursorEopen English Wikipedia search for word under cursorR + mouse-dragselect main region when in click through modeQ + mouse-dragselect one time lookup when in click through modemore options/etcsecondary clippingAfter selecting a region,zoritoriwill watch that area for changes, and refresh if any are detected. If you want to select a new region, just click and drag again. If you want to keep your original region, but want to do a one-time look up a word outside the region, right click and drag around the word.click through modeBy default, the transparent overlay won't send clicks through to underlying applications, including your game. It will steal focus if you click anywhere on the screen. On Windows only (for now) you can enable click through mode in theconfig.inifile or command-line parameters. On Mac and Linux, this is not supported at the moment.When click through mode is enabled, use R (without mouse clicking) to drag select a region, and use Q to select a region for a one-time lookup.comparing OCR enginesTesseract is free, open source, and works offline. Unfortunately, in my experience it has less accurate recognition, and sometimes returns very messy bounding box data, making it difficult to accurately place furigana.Google Cloud Vision hasper usage costs, but should be free for low usage, and is closed source and requires an Internet connection (the selected region is sent as an image to Google for processing)saving vocabularyBy default nothing is saved. But if you want to save vocabulary words, add a folder name in theconfig.inifile or command-line parameters.With onlyNotesFolderset, all vocabulary will be saved in one folder. Fullscreen screenshots are saved each time OCR runs, along with a markdown file that include new vocabulary found, for later review.With onlyNotesRootset, vocabulary will be saved as above but inside individual folders for each session (once for each time you startzoritori) to make review less cumbersome.With bothNotesFolderandNotesRootset,NotesFolderbehavior takes precedence (everything saved in one folder).
zorker
Zorker - A Twitter bot to play text adventure gamesScott TorborgInstallationInstall with pip:$ pip install zorkerRunningFirst set up a new Twitter app, noting consumer key (API key), consumer secret (API secret), access token, and access token secret. There arehelpful instructions for this here.Create a config file, something likezorker.ini:[zorker] consumer_key = ... consumer_secret = ... access_token = ... access_token_secret = ... screen_name = zorker game_file = zork1.z5Run the bot:$ zorker zorker.iniLicenseZorker is licensed under an MIT license. Please see the LICENSE file for more information.
zork-manager
No description available on PyPI.
zorky
This game was inspired by Zork.Just a weekend project I decided to undertake.It’s fairly small scale, with only a few rooms.I really enjoyed making it. I hope someone else enjoys playing it as well!USAGEIf installed using setup.py install, then you should be able to do the following from anywhere in the terminal/cmd:>>>import aliens >>>aliens.start()That should get the ball rolling.Enjoy!
zorm
UNKNOWN