Saravanan666/pypi-org huggingface dataset:
Package: z3c.recipe.runscript
This run-script URL allows you to specify an arbitrary script to do the work
of the recipe.Detailed DocumentationTherunscriptBuildout RecipeSome software packages are not easily installed using established build patterns, such
as “configure, make, make install”. In those cases you want to be able to use
arbitrary scripts to build a particular part. This recipe provides a simple
implementation to run a Python callable for each installing and updating a
part.>>> import os
>>> import z3c.recipe.runscript.tests
>>> scriptFilename = os.path.join(
...     os.path.dirname(z3c.recipe.runscript.tests.__file__), 'fooscripts.py')Let’s create a sample buildout to install it:>>> write('buildout.cfg',
... """
... [buildout]
... parts = foo
...
... [foo]
... recipe = z3c.recipe.runscript
... install-script = %s:installFoo
... """ %scriptFilename)Theinstall-scriptoption specifies the module and the function to call
during the part installation. The function takes the local and buildout
options as arguments. Seetests/fooscripts.pyfor details.When running buildout, theinstallFoo()function is called:>>> print system('bin/buildout')
Installing foo.
Now executing ``installFoo()``If we run the buildout again, the update method will be called, but since we
did not specify any, nothing happens:>>> print system('bin/buildout')
Updating foo.Let’s now specify the update script as well, causing theupdateFoo()function to be called:>>> write('buildout.cfg',
... """
... [buildout]
... parts = foo
...
... [foo]
... recipe = z3c.recipe.runscript
... install-script = %s:installFoo
... update-script = %s:updateFoo
... """ %(scriptFilename, scriptFilename))But after a change like that, parts will be uninstalled and reinstalled:>>> print system('bin/buildout')
Uninstalling foo.
Installing foo.
Now executing ``installFoo()``Only now we can update the part:>>> print system('bin/buildout')
Updating foo.
Now executing ``updateFoo()``And that’s it.CHANGES0.1.3 (2011-10-07)Bug: fix Windows path support (containing semicolon such as ‘c:')0.1.2 (2010-09-22)Added test extra to declare test dependency onzope.testing.Using Python’sdoctestmodule instead of depreactedzope.testing.doctest.0.1.1 (2008-04-18)Bug: Fix release to include CHANGES.txt.0.1.0 (2007-07-30)Initial Release.
Package: z3c.recipe.winservice
=====================z3c.recipe.winservice=====================This recipe offers windows service installation support.The 'service' recipe installes the required scripts and files which can beused to install a windows service.Using the ``runscript`` option it is able to make any executable a service.Options*******The 'service' recipe accepts the following options:nameThe windows service name option.descriptionThe windows service description option.runzopeThe script name which gets run by the winservice.If the script name contains any path, it's taken as it is, otherwise thebuildout bin folder is prepended. winservice will check on install if thisscript exists.The install takes care of adding ``-script.py`` if necessary.This script can get setup for exmaple with the z3c.recipe.dev.app recipe.runscriptThe script (.py) or executable (.exe) name to be run by the winservice.The value will get NO treatment, you need to pass an exact specification.winservice will check on install if this script/exe exists.Use this option OR runzope, but never both.parametersThis value will get passed to the script (runzope or runscript) as aparameter. The value will get NO treatment, you need to take care of addingany quotes if necessary.debugAdding this option to the recipe wraps the whole script to run intoa catch all except that logs the exception to the windows event log.This is good for debugging weird exceptions that occur before the Zopelogging system is in place.This does not work if runscript is an executable.=======CHANGES=======0.7.0 (2010-10-19)------------------- New feature: ``runscript`` and ``parameters``.With those, this recipe is now capable of making any executable orpython script a service.- Added more docs and tests.- Remove compiled winservice.pyc and pyo if they exist.- Most folder calculation moved to the recipe installer.winservice.py gets constants, that makes it easier to see what happens.- Updated tests to be more tolerant to different Python versions.- Using Python's ``doctest`` module instead of deprecated``zope.testing.doctest``.Version 0.6.3 (2009-11-02)--------------------------- Do nothing on a non windows platform instead of failing.Version 0.6.2 (2009-05-13)--------------------------- Set current dir for CreateProcess to INSTANCE_HOME otherwise pkg_resources willbe pissed (in a combination with paster)Version 0.6.1 (2009-05-12)--------------------------- kill off pythonw.exe - it just causes problems when something iswritten to stdout- Use python.exe in debug mode -- it will display/log exceptionsVersion 0.6.0 (2009-05-10)--------------------------- Added debug option to log exceptions for totally misbehaving scripts- Slight changes to service manager- virtualenv creates no pythonw.exe -- fallback to python.exe- tested on winXP pro workstation:- from service manager:- service start: OK- service stop: OK- service restart: OK- net- net start: OK- net stop: OK- from instance:- ``ZMI restart``: OK (restarts)- task manager kill ``python.exe``: OK (starts again)Version 0.5.0 (2008-04-12)--------------------------- Initial Release
Package: z3c.referercredentials
A package that uses the HTTP referer header to provide credentials.Detailed DocumentationHTTP-Referer CredentialsIt is sometimes necessary to restrict access to a site by looking at the the
site the user is coming from. For example, a user can only enter the site when
he comes from within the corporate network. If the two sites cannot share any
specific information, such as an authentication token, the only useful piece
of information is theHTTP-Refererrequest header.__Note__: Yes I know this is not fully secure and someone could spoof the
header. But this is acceptable in this particular application. I guess it
keeps away the honest. And yes, this is a real world scenario – would I
implement this package otherwise? :-)So let’s have a look at the credentials plugin:>>> from z3c.referercredentials import credentials
>>> creds = credentials.HTTPRefererCredentials()Let’s look at the positive case first. The referer credentials plugin has an
attribute that specifies all allowed hosts:>>> creds.allowedHosts
('localhost',)In this example, we only want to allow peopl eto the site coming fromwww.zope.org.>>> creds.allowedHosts = ('www.zope.org',)Now, a user coming from that site will have a request containing this referer:>>> from zope.publisher.browser import TestRequest
>>> request = TestRequest(HTTP_REFERER='http://www.zope.org/index.html')The credentials can now be extracted as follows:>>> creds.extractCredentials(request)Nothing is returned. This is because we have not defined any credentials that
represent the “referer user”. With setting the credentials, it should work:>>> creds.credentials = {'login': 'mgr', 'password': 'mgrpw'}
>>> creds.extractCredentials(request)
{'login': 'mgr', 'password': 'mgrpw'}Once an acceptable referer has been passed in, the credentials are always
returned:>>> del request._environ['HTTP_REFERER']
>>> creds.extractCredentials(request)
{'login': 'mgr', 'password': 'mgrpw'}We have to log out in order to loose the credentials:>>> creds.logout(request)
TrueNow, no credentials are returned when not sending in a correct referer:>>> creds.extractCredentials(request)When the user could not be authenticated, the plugin is asked to pose a
challenge:>>> creds.challenge(request)
True
>>> request.response.getHeader('Redirect')By default we are getting the “unauthorized.html” view on the site. But you
can change the view name:>>> creds.challengeView = 'challenge.html'
>>> creds.challenge(request)
True
>>> request.response.getHeader('Redirect')Final Note: Of course, this credentials plugin only works with HTTP-based
requests:>>> request = object()>>> creds.extractCredentials(request)>>> creds.challenge(request)
False>>> creds.logout(request)
FalseCHANGESVersion 0.1.0 (6/??/2007)Initial ReleaseImplementation of HTTP-Referer credentials plugin
Package: z3c.requestlet
IntroductionLog and show ram usage of a zope instance per request.By calling @@requestlet, you’ll get a nice graph and
(if you mark something in it) a table with ram usage,
difference to the last request and the URI over time.This product was created in the hope to see patterns
on which requests how much ram is “lost”. It was
inspired byhttp://code.google.com/p/zope-memory-readings/and uses the graph-code from there.The logging was taken from seletz’ requestlet code and
was extended by the ram usage.Installation / UsageAdd this to your buildout.cfg[buildout]
eggs = z3c.requestlet[instance]
zcml = z3c.requestletThen install the product using plone’s portal_quickinstaller.
If the product is not installed, it will not log and it won’t
provide the @@requestlet view.After installation you may callhttp://yoursite/@@requestletThe default logfile is /tmp/requestlet.txt and may be set using
an environment variable called “REQUESTLET_LOGNAME”.You may also log only hits that take more than a specific time
to render using an environment variable called “MIN_LOG_TIME”.The logfile will provide detailled page generation information
like this:2009-07-01 16:21:39,755 requestlet   INFO     ELAPSED 0.038s (min 0s) METHOD GET RAM 423124kB URL: localhost:10054/site/++resource++z3c.requestlet.data/layout.css rinfo: last-modified=’Wed, 01 Jul 2009 12:51:28 GMT’ content-length=’169’ content-type=’text/css; charset=utf-8’ cache-control=’public,max-age=86400’This provides:time to render the page in plone (ELAPSED)request method (METHOD)total vmsize of the zope process (RAM)the called URL (URL)the request info (rinfo)CompatibilityThis product will only work with systems, where you
can get the memory-info from /proc/<pid>/status.
This is linux.ContributionTo contribute, feel free to send patches as we don’t have
this in a public svn currently. It’s managed with bzr ;)AuthorsDaniel Kraft <dk@d9t.de>Stefan Eletzhofer <info@inquant.de>Changelog0.9.1 - Bugfix [20090706] [Daniel Kraft]log as debug, not as info0.9 - Initial useful release [20090701] [Daniel Kraft, Stefan Eletzhofer]view ram usage per request
Package: z3c.resourceinclude
OverviewThe package is able to include the following types of resources:Cascading stylesheets (.css)Kinetic stylesheets (.kss)Javascript (.js)UsageThe package operates with browser resources, registered individually
or using the resource directory factory.A simple example:<configure xmlns="http://namespaces.zope.org/zope"
          xmlns:browser="http://namespaces.zope.org/browser">

  <include package="z3c.resourceinclude" file="meta.zcml" />
  <include package="z3c.resourceinclude" />

  <browser:resource name="example.css" file="example.css" />

  <browser:resourceInclude
       layer="zope.publisher.interfaces.browser.IDefaultBrowserLayer"
       include="example.css"
   />

</configure>This registration means that whenever the request providesIDefaultBrowserLayerthe resource named ‘example.css’ will be
included on the page.To render HTML snippets that include applicable resources, a content
provider is provided, seez3c/resourceinclude/provide.py. You may
also use one of the viewlets:<browser:viewlet
   name="resourceinclude"
   class="z3c.resourceinclude.viewlets.CacheOneHourViewlet"
   permission="zope.View" />A convenience method is provided to require a given resource layer:>>> from z3c.resourceinclude import include
>>> include(IMyLayer)OrderingResources are included in the order they’re registered; that is, the
order in which the ZCML-directives are processed.Stylesheets are included before javascripts as per general
recommendation. Kinetic stylesheets are included last.MergingWhen not in ‘devmode’, the resource collector will automatically merge
resources, giving them a filename based on the contents (sha
digest). This has the side effect that merged resources are set to
never expire.
Package: z3c.rotterdam
Introduction============This skin is a derivative of the zope.app.rotterdam.Rotterdam skin, whichsupports pagelets, forms and javascript forms.Usage=====z3c.rotterdam includes the information needed to configure itself. To add itto your configuration;1.  Add it to your buildout...eggs=...z3c.rotterdam2.  To use the skin, you can use a traversal adapter:http://localhost:8080/++skin++z3c_rotterdam/index.html3.  To configure this as your default skin, add this line to yoursite.zcml file:&lt;includeOverrides package="z3c.rotterdam" file="default_skin.zcml" /&gt;Changelog=========1.0.1dev - Unreleased----------------* Initial release
Package: z3c.setuptools_mercurial
A simple setuptools plugin to support creating distributions from a
mercurial-based package checkout.Detailed DocumentationMercurial File Finder Plugin for SetuptoolsThis package provides a simple, command-based file finder plugin for
setuptools. Once installed, one can create distributions using a pacakge that
has been checked out with Mercurial.So let’s create a workspace:>>> import tempfile
>>> ws = tempfile.mkdtemp()Since the workspace is not a mercurial repository, the finder returns an empty
list and leaves an error message in the logs:>>> from z3c.setuptools_mercurial import finder>>> finder.find_files(ws)
abort: There is no Mercurial repository here (.hg not found)! (code 255)
<BLANKLINE>
[]Also, if the directory does not exist, we get an error message, but an empty
result set:>>> finder.find_files('/foo')
[Errno 2] No such file or directory: '/foo'
[]Let’s now create a new repository:>>> import os
>>> repos = os.path.join(ws, 'test')
>>> cmd('hg init ' + repos)The finder still fails with error code 1, since no file is yet added in the
repository:>>> finder.find_files(repos)
(code 1)
[]Let’s now add soem directories and files and the finder should be happy.>>> cmd('touch ' + os.path.join(repos, 'data.txt'))
>>> cmd('hg add ' + os.path.join(repos, 'data.txt'))>>> cmd('mkdir ' + os.path.join(repos, 'dir1'))
>>> cmd('touch ' + os.path.join(repos, 'dir1', 'data1.txt'))
>>> cmd('hg add ' + os.path.join(repos, 'dir1', 'data1.txt'))>>> cmd('mkdir ' + os.path.join(repos, 'dir1', 'dir11'))
>>> cmd('touch ' + os.path.join(repos, 'dir1', 'dir11', 'data1.txt'))
>>> cmd('hg add ' + os.path.join(repos, 'dir1', 'dir11', 'data1.txt'))>>> finder.find_files(repos)
['data.txt',
 'dir1/data1.txt',
 'dir1/dir11/data1.txt']Note that the result of the finder is always a list of relative locations
based on the input directory.>>> finder.find_files(os.path.join(repos, 'dir1'))
['data1.txt',
 'dir11/data1.txt']Buildout 1.5 and higherWhen one uses zc.buildout 1.5 or higher, the system’s environment is
manipulated. In particular, the PYTHONPATH OS environment variable is
rewritten. In that case it should be deleted:>>> import os
>>> bo_orig_path = os.environ.pop('BUILDOUT_ORIGINAL_PYTHONPATH', None)
>>> orig_path = os.environ.get('PYTHONPATH')
>>> os.environ['PYTHONPATH'] = '/bogus'>>> finder.find_files(os.path.join(repos, 'dir1'))
['data1.txt', 'dir11/data1.txt']>>> if bo_orig_path:
...     os.environ['BUILDOUT_ORIGINAL_PYTHONPATH'] = bo_orig_path
>>> if orig_path:
...     os.environ['PYTHONPATH'] = orig_pathCHANGES1.1.1 (2010-08-30)Bug: Improve the Buildout support. Thanks to Gary Poster for helping me out.1.1.0 (2010-08-30)Feature: Makez3c.setuptools_mercurialcompatible with Buildout 1.5,
which does not include the standard PYTHONPATH by default anymore. This
caused mercurial not to find its library.Feature: Usedoctestinstead ofzope.testing.doctest.Feature: Update coverage setup.1.0.1 (2009-12-16)Feature: Add a test for getting the file list within a sub-directory of the
repository.Bug: It turns out that setuptools does not like “./<path>” notation but only
“<path>”. Fixed the problem.1.0.0 (2009-12-15)Initial release.
Package: z3c.skin.pagelet
This package provides a base skin for people wanting to develop
pagelet-based applications.Detailed DcoumentationA base Skin based on PageletsThez3c.skin.pageletpackage provides a skin for thez3c.pageletpackage.  Note, the pagelet skin is only registered in the test layer. You can
use this skin as a base for your own skins or just use it as a sample for thez3c.pageletpackage.Open a browser and access thePageletskin:>>> from z3c.etestbrowser.testing import ExtendedTestBrowser
>>> user = ExtendedTestBrowser()
>>> user.addHeader('Accept-Language', 'en')
>>> user.open('http://localhost/++skin++Pagelet')Let’s see how such a skin looks like:>>> print user.contents
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml" xml:lang="en"
      lang="en">
<head>
<base href="http://localhost/++skin++Pagelet/@@index.html" />
<BLANKLINE>
<BLANKLINE>
            <title>Pagelet skin</title>
<BLANKLINE>
<meta http-equiv="cache-control" content="no-cache" />
<meta http-equiv="pragma" content="no-cache" />
<link type="text/css" rel="stylesheet"
      href="http://localhost/++skin++Pagelet/@@/pagelet.css"
      media="all" />
<BLANKLINE>
<script type="text/javascript">
        var contextURL='http://localhost/++skin++Pagelet/';</script>
<BLANKLINE>
<link rel="icon" type="image/png"
      href="http://localhost/++skin++Pagelet/@@/favicon.png" />
</head>
<body>
<div id="layoutWrapper">
  <div id="layoutContainer">
    <div id="headerContainer">
      <div id="breadcrumbs" class="sortable">
<BLANKLINE>
      </div>
      <div id="user">
        User: Manager
      </div>
      <img id="logo"
           src="http://localhost/++skin++Pagelet/@@/img/logo.gif"
           width="53" height="51" alt="logo" />
    </div>
    <div id="menuContainer"></div>
    <div id="naviContainer" class="sortable">
<BLANKLINE>
<BLANKLINE>
    </div>
    <div id="contentContainer">
      <div id="tabContainer"></div>
      <div id="content">
        <div>This is the default index view</div>
<BLANKLINE>
      </div>
    </div>
  </div>
</div>
</body>
</html>
<BLANKLINE>CHANGES1.0.2 (2007-11-01)Add doctests to long description of package data.1.0.1 (2007-11-01)ResolveZopeSecurityPolicydeprecation warning.1.0.0 (2007-09-22)Initial Release
Package: z3c.suds
Introductionz3c.suds manages a connection pool ofsudsclient objects in the context of
a ZODB-based application.  (suds is a lightweight client library for consuming
SOAP web services in Python.)  Using it avoids the need for instantiating a new
client for the same webservice in multiple requests (which may be expensive due
to parsing WSDL, etc.)UsageA client may be obtained via theget_suds_clientmethod:client = get_suds_client(wsdl_uri, context=None)This returns an existing suds client if one is found in the cache for the given
WSDL; otherwise it returns a new client object and stores it in the cache.wsdl_pathis the URI of the WSDL (web service definition language)
description of the web service. (Use afile://URI for a locally stored WSDL.)contextis a persistent object (in the ZODB sense). If not provided, thegetSitemethod of zope.site.hooks will be used to obtain an object (which
is probably only sensible within the context of a Zopish framework). If the
context object is associated with a ZODB connection, the client will be cached
in the connection’sforeign_connectionsdictionary. If the context object is
not yet associated with a ZODB connection, the client will be cached in a
volatile attribute instead. This approach to piggybacking a pool of connections
on the ZODB connection pool is based onalm.solrindex, and further documented
there.Changelog1.0 (2010-09-17)Initial release
Package: z3c.taskqueue
Overviewz3c.taskqueueis a persistent queue that holds and schedules tasks.It depends onzc.queue.Historyz3c.taskqueueis factored out oflovely.remotetask.
It is the backend code only. IOW, no UI code is included.Changelog0.2.1 (2013-05-03)Store string representation of job error instead of error instance,
to avoid issue when unpickling certain strange error types.0.2.0 (2012-11-12)Simplify start service code; get rid of start * services.0.1-alpha-4 (2011-05-16)Avoid thread to stop if there is an error inprocessNext.0.1-alpha-3 (2010-11-19)service.processNextwould not resetCronJob runCount.0.1-alpha-2 (2010-10-19)Removed use of_p_jar.0.1-alpha-1 (2010-09-27)Initial release.
Package: z3c.testing
This package provides a collection of high-level test setups for unit and
functional testing. In particular, it provides a testing layer that can use an
existing, pre-populated database as a starting point, which speeds up the test
setup phase for large testing data sets.CHANGES1.0.0 (2022-08-05)Add support for Python 3.7, 3.8, 3.9, 3.10.Drop support for Python 3.4.1.0.0a4 (2017-06-19)Standardize namespace __init__Add support for Python 3.4 up to 3.6, PyPy2 and PyPy3.Drop support for Python 2.6 and 3.3.1.0.0a3 (2013-02-28)Bugfix: container test bad keys for Python 3.1.0.0a2 (2013-02-28)Migrate to the newestzope.interfaceversion and remove the
forked code inverify.py.1.0.0a1 (2013-02-28)Dropped Python 2.4 and 2.5 support, added Python 3.3 support.Made functional test tools into thefunctionalextra, so no
zope.app packages are required.0.3.2 (2010-08-23)Do someInterfaceBaseTestattributes to be able to write less code:ifaceprovide the interface hereklassprovide the class hereposprovide the positional arguments herekwsprovide the keyword arguments hereAvoid depreactedzope.testing.doctestby using python’sdoctest.0.3.1 (2009-12-26)Removed install dependency onzope.app.security.Removed test dependency onzope.app.securitypolicy.Removed test dependency onzope.app.zcmlfiles.0.3.0 (2009-02-01)Usingzope.containerinstead ofzope.app.containerUsingzope.siteinstead ofzope.app.component0.2.0 (2007-10-31)Fixed package data.Moved functional tests to tests.Removed deprecation warning.0.1.1b1 (2007-06-21)Makez3ca namespace.PreventConnectionStateErrorin layer afterappsetupis run
in layer.
Package: z3c.testsummarizer
Script that checks a pipermail archive for recent messages, parses them
according to a test result format and creates a summary.To use, write a configuration file like this:[testsummarizer]
archive_url = https://mail.zope.org/pipermail/zope-tests/
listname = zope-tests
from = Zope tests summarizer <noreply@localhost>
to = user@localhost
smtpserver = localhostand then calltest-summarizerexample.ini.CHANGES2.0 (2011-03-31)New output format that is more suitable to accomodate a large amount of
results.Restructured and cleaned up the code.1.0 (unknown)first incarnation written by Stefan Holek.
Package: z3c.webdriver
z3c.webdriverThis package provides tools and wrappers aroundselenium.webdriver.We specially care aboutselenium.webdriver.PhantomJS, because:it’s easy to deploy, it’s a single executable,gp.recipe.phantomjsworksit’s built onwebkitit can be debugged with aChromium/Chromebrowser, incl. breakpointsThings to watch out for:any single instance of PhantomJS acts as a single browser instance
that means cookies and whatnot aresharedif you intantiate more
browsers for a single driver.
Workaround could be to start more drivers.the headless browser is trulyasync, that means an AJAX click does NOT
wait for the AJAX request to complete, you explicitely need to wait for itany single call to PhantomJS via selenium takes TIMEzope.testbrowser supporting methods likegetControlare slow nowthere are 2 options for setUp/tearDown, either the driver is started and torn
down with the layer or with each test. Starting and stopping takes around
1.5-2 secs, so you decide whether you need separation or speed.WARNINGThis is WORK IN PROGRESS0.0.1 (2013-05-09)Initial Release