zope.app.applicationcontrol-3.5.10/0000755000175000017500000000000011654256572017160 5ustar tseavertseaverzope.app.applicationcontrol-3.5.10/INSTALL.txt0000644000175000017500000000431711654256464021034 0ustar tseavertseaver======================= Installing This Package ======================= Prerequisites ------------- The installation steps below assume that you have the cool new 'setuptools' package installed in your Python. Here is where to get it:: $ wget http://peak.telecommunity.com/dist/ez_setup.py $ /path/to/your/python ez_setup.py # req. write access to 'site-packages' - Docs for EasyInstall: http://peak.telecommunity.com/DevCenter/EasyInstall - Docs for setuptools: http://peak.telecommunity.com/DevCenter/setuptools - Docs for eggs: http://peak.telecommunity.com/DevCenter/PythonEggs Installing a Development Checkout --------------------------------- Check out the package from subversion:: $ svn co svn+ssh://svn.zope.org/repos/main/zope.app.applicationcontrol/trunk \ src/zope.app.applicationcontrol $ cd src/zope.app.applicationcontrol Install it as a "devlopment egg" (which also installs its "hard" dependencies):: $ /path/to/your/python setup.py devel The installation of dependency eggs uses the 'setup.cfg' file in the checkout. You can supply '--find-links' on the command line to point it at a non-standard package repository. Running the Tests ----------------- To test the package, you will also need the 'zope.testing' package, which can't (yet) be automatically installed. Eventually, you should be able to type:: $ /path/to/your/python setup.py test and have it install the "testing dependencies." Today, the workaround is to install it manually:: $ /path/to/easy_install --find-links="...." zope.testing You can then run the tests (finally) from the checkout directory:: $ /path/to/your/python test.py Running: ............. Ran 13 tests with 0 failures and 0 errors in 0.094 seconds. Installing a Source Distribution -------------------------------- You can also install it from a source distribution:: $ /path/to/easy_install --find-links="...." -eb src zope.app.applicationcontrol $ cd src/zope.app.applicationcontrol $ /path/to/your/python setup.py devel Installing a Binary Egg ----------------------- Install the package as a "binary egg" (which also installs its "hard" dependencies):: $ /path/to/easy_install --find-links="...." zope.app.applicationcontrol zope.app.applicationcontrol-3.5.10/buildout.cfg0000644000175000017500000000016411654256464021471 0ustar tseavertseaver[buildout] develop = . parts = test [test] recipe = zc.recipe.testrunner eggs = zope.app.applicationcontrol [test] zope.app.applicationcontrol-3.5.10/COPYRIGHT.txt0000644000175000017500000000004011654256464021263 0ustar tseavertseaverZope Foundation and Contributorszope.app.applicationcontrol-3.5.10/README.txt0000644000175000017500000000124711654256464020662 0ustar tseavertseaver=========================== zope.app.applicationcontrol =========================== The application control instance is usually generated upon startup. This package provides runtime information adapter for application control and Zope version. Also provide a utility with methods for shutting down and restarting the server. Developer Resources ------------------- - Subversion browser: http://svn.zope.org/zope.app.applicationcontrol/ - Read-only Subversion checkout:: $ svn co svn://svn.zope.org/repos/main/zope.app.applicationcontrol/trunk - Writable Subversion checkout:: $ svn co svn+ssh://userid@svn.zope.org/repos/main/zope.app.applicationcontrol/trunk zope.app.applicationcontrol-3.5.10/LICENSE.txt0000644000175000017500000000402611654256464021005 0ustar tseavertseaverZope Public License (ZPL) Version 2.1 A copyright notice accompanies this license document that identifies the copyright holders. This license has been certified as open source. It has also been designated as GPL compatible by the Free Software Foundation (FSF). Redistribution and use in source and binary forms, with or without modification, are permitted provided that the following conditions are met: 1. Redistributions in source code must retain the accompanying copyright notice, this list of conditions, and the following disclaimer. 2. Redistributions in binary form must reproduce the accompanying copyright notice, this list of conditions, and the following disclaimer in the documentation and/or other materials provided with the distribution. 3. Names of the copyright holders must not be used to endorse or promote products derived from this software without prior written permission from the copyright holders. 4. The right to distribute this software or to use it for any purpose does not give you the right to use Servicemarks (sm) or Trademarks (tm) of the copyright holders. Use of them is covered by separate agreement with the copyright holders. 5. If any files are modified, you must cause the modified files to carry prominent notices stating that you changed the files and the date of any change. Disclaimer THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS ``AS IS'' AND ANY EXPRESSED OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDERS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. zope.app.applicationcontrol-3.5.10/bootstrap.py0000644000175000017500000000337311654256464021555 0ustar tseavertseaver############################################################################## # # Copyright (c) 2006 Zope Foundation and Contributors. # All Rights Reserved. # # This software is subject to the provisions of the Zope Public License, # Version 2.1 (ZPL). A copy of the ZPL should accompany this distribution. # THIS SOFTWARE IS PROVIDED "AS IS" AND ANY AND ALL EXPRESS OR IMPLIED # WARRANTIES ARE DISCLAIMED, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED # WARRANTIES OF TITLE, MERCHANTABILITY, AGAINST INFRINGEMENT, AND FITNESS # FOR A PARTICULAR PURPOSE. # ############################################################################## """Bootstrap a buildout-based project Simply run this script in a directory containing a buildout.cfg. The script accepts buildout command-line options, so you can use the -c option to specify an alternate configuration file. $Id: bootstrap.py 121717 2011-05-18 19:23:30Z menesis $ """ import os, shutil, sys, tempfile, urllib2 tmpeggs = tempfile.mkdtemp() ez = {} exec urllib2.urlopen('http://peak.telecommunity.com/dist/ez_setup.py' ).read() in ez ez['use_setuptools'](to_dir=tmpeggs, download_delay=0) import pkg_resources cmd = 'from setuptools.command.easy_install import main; main()' if sys.platform == 'win32': cmd = '"%s"' % cmd # work around spawn lamosity on windows ws = pkg_resources.working_set assert os.spawnle( os.P_WAIT, sys.executable, sys.executable, '-c', cmd, '-mqNxd', tmpeggs, 'zc.buildout', dict(os.environ, PYTHONPATH= ws.find(pkg_resources.Requirement.parse('setuptools')).location ), ) == 0 ws.add_entry(tmpeggs) ws.require('zc.buildout') import zc.buildout.buildout zc.buildout.buildout.main(sys.argv[1:] + ['bootstrap']) shutil.rmtree(tmpeggs) zope.app.applicationcontrol-3.5.10/setup.py0000644000175000017500000000531511654256464020676 0ustar tseavertseaver############################################################################## # # Copyright (c) Zope Foundation and Contributors. # All Rights Reserved. # # This software is subject to the provisions of the Zope Public License, # Version 2.1 (ZPL). A copy of the ZPL should accompany this distribution. # THIS SOFTWARE IS PROVIDED "AS IS" AND ANY AND ALL EXPRESS OR IMPLIED # WARRANTIES ARE DISCLAIMED, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED # WARRANTIES OF TITLE, MERCHANTABILITY, AGAINST INFRINGEMENT, AND FITNESS # FOR A PARTICULAR PURPOSE. # ############################################################################## # This package is developed by the Zope Toolkit project, documented here: # http://docs.zope.org/zopetoolkit # When developing and releasing this package, please follow the documented # Zope Toolkit policies as described by this documentation. ############################################################################## import os from setuptools import setup, find_packages version = '3.5.10' def read(*rnames): return open(os.path.join(os.path.dirname(__file__), *rnames)).read() setup(name='zope.app.applicationcontrol', version = version, author='Zope Foundation and Contributors', author_email='zope-dev@zope.org', description='Zope application control', long_description=( read('README.txt') + '\n\n' + read('INSTALL.txt') + '\n\n' + read('CHANGES.txt') ), license='ZPL 2.1', keywords = "zope3 application control", classifiers = [ 'Development Status :: 5 - Production/Stable', 'Environment :: Web Environment', 'Intended Audience :: Developers', 'License :: OSI Approved :: Zope Public License', 'Programming Language :: Python', 'Natural Language :: English', 'Operating System :: OS Independent', 'Topic :: Internet :: WWW/HTTP', 'Framework :: Zope3'], url='http://cheeseshop.python.org/pypi/zope.app.applicationcontrol', extras_require=dict( test=['zope.app.component', 'zope.app.testing', 'zope.app.zcmlfiles', 'zope.login', 'zope.password', 'zope.securitypolicy', 'zope.testbrowser', ]), package_dir = {'': 'src'}, packages=find_packages('src'), namespace_packages=['zope', 'zope.app'], install_requires=[ 'setuptools', 'ZODB3', 'zope.applicationcontrol', 'zope.component', 'zope.i18n', 'zope.i18nmessageid', 'zope.interface', 'zope.size', 'zope.traversing>=3.7.0', ], include_package_data = True, zip_safe = False, ) zope.app.applicationcontrol-3.5.10/src/0000755000175000017500000000000011654256572017747 5ustar tseavertseaverzope.app.applicationcontrol-3.5.10/src/zope/0000755000175000017500000000000011654256572020724 5ustar tseavertseaverzope.app.applicationcontrol-3.5.10/src/zope/app/0000755000175000017500000000000011654256572021504 5ustar tseavertseaverzope.app.applicationcontrol-3.5.10/src/zope/app/__init__.py0000644000175000017500000000031011654256464023607 0ustar tseavertseaver# this is a namespace package try: import pkg_resources pkg_resources.declare_namespace(__name__) except ImportError: import pkgutil __path__ = pkgutil.extend_path(__path__, __name__) zope.app.applicationcontrol-3.5.10/src/zope/app/applicationcontrol/0000755000175000017500000000000011654256572025410 5ustar tseavertseaverzope.app.applicationcontrol-3.5.10/src/zope/app/applicationcontrol/browser/0000755000175000017500000000000011654256572027073 5ustar tseavertseaverzope.app.applicationcontrol-3.5.10/src/zope/app/applicationcontrol/browser/servercontrol.py0000644000175000017500000000304411654256464032355 0ustar tseavertseaver############################################################################## # # Copyright (c) 2001, 2002 Zope Foundation and Contributors. # All Rights Reserved. # # This software is subject to the provisions of the Zope Public License, # Version 2.1 (ZPL). A copy of the ZPL should accompany this distribution. # THIS SOFTWARE IS PROVIDED "AS IS" AND ANY AND ALL EXPRESS OR IMPLIED # WARRANTIES ARE DISCLAIMED, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED # WARRANTIES OF TITLE, MERCHANTABILITY, AGAINST INFRINGEMENT, AND FITNESS # FOR A PARTICULAR PURPOSE. # ############################################################################## """Server Control View $Id: servercontrol.py 121717 2011-05-18 19:23:30Z menesis $ """ __docformat__ = 'restructuredtext' import zope.component from zope.app.applicationcontrol.interfaces import IServerControl from zope.app.applicationcontrol.i18n import ZopeMessageFactory as _ class ServerControlView(object): def serverControl(self): return zope.component.getUtility(IServerControl) def action(self): """Do the shutdown/restart!""" control = self.serverControl() time = self.request.get('time', 0) if 'restart' in self.request: control.restart(time) return _("The server will be restarted in ${number} seconds.", mapping={"number": time}) elif 'shutdown' in self.request: control.shutdown(time) return _("The server will be shutdown in ${number} seconds.", mapping={"number": time}) ././@LongLink0000000000000000000000000000014700000000000011567 Lustar rootrootzope.app.applicationcontrol-3.5.10/src/zope/app/applicationcontrol/browser/translationdomaincontrol.pyzope.app.applicationcontrol-3.5.10/src/zope/app/applicationcontrol/browser/translationdomaincontrol.0000644000175000017500000000424311654256464034226 0ustar tseavertseaver############################################################################## # # Copyright (c) 2001, 2002 Zope Foundation and Contributors. # All Rights Reserved. # # This software is subject to the provisions of the Zope Public License, # Version 2.1 (ZPL). A copy of the ZPL should accompany this distribution. # THIS SOFTWARE IS PROVIDED "AS IS" AND ANY AND ALL EXPRESS OR IMPLIED # WARRANTIES ARE DISCLAIMED, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED # WARRANTIES OF TITLE, MERCHANTABILITY, AGAINST INFRINGEMENT, AND FITNESS # FOR A PARTICULAR PURPOSE. # ############################################################################## """Server Control View $Id: translationdomaincontrol.py 121717 2011-05-18 19:23:30Z menesis $ """ __docformat__ = 'restructuredtext' import zope.component from zope.i18n.interfaces import ITranslationDomain from zope.app.applicationcontrol.i18n import ZopeMessageFactory as _ class TranslationDomainControlView(object): def getCatalogsInfo(self): info = [] for name, domain in zope.component.getUtilitiesFor(ITranslationDomain): if not hasattr(domain, 'getCatalogsInfo'): continue lang_info = [] info.append({'domain': name, 'languagesInfo': lang_info}) for language, fileNames in domain.getCatalogsInfo().items(): lang_info.append({'language': language, 'fileNames': fileNames}) return info def reloadCatalogs(self): """Do the reloading !""" status = '' if 'RELOAD' in self.request: language = self.request.get('language') domain = self.request.get('domain') domain = zope.component.getUtility(ITranslationDomain, domain) for lang, fileNames in domain.getCatalogsInfo().items(): if lang == language: domain.reloadCatalogs(fileNames) status = _('Message Catalog for ${language} language' ' in ${domain} domain successfully reloaded.', mapping = {u'language': language, u'domain': domain.domain}) return status zope.app.applicationcontrol-3.5.10/src/zope/app/applicationcontrol/browser/zodbcontrol.py0000644000175000017500000000507411654256464032012 0ustar tseavertseaver############################################################################## # # Copyright (c) 2001, 2002 Zope Foundation and Contributors. # All Rights Reserved. # # This software is subject to the provisions of the Zope Public License, # Version 2.1 (ZPL). A copy of the ZPL should accompany this distribution. # THIS SOFTWARE IS PROVIDED "AS IS" AND ANY AND ALL EXPRESS OR IMPLIED # WARRANTIES ARE DISCLAIMED, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED # WARRANTIES OF TITLE, MERCHANTABILITY, AGAINST INFRINGEMENT, AND FITNESS # FOR A PARTICULAR PURPOSE. # ############################################################################## """ Server Control View $Id: zodbcontrol.py 121717 2011-05-18 19:23:30Z menesis $ """ __docformat__ = 'restructuredtext' from ZODB.FileStorage.FileStorage import FileStorageError from zope.app.applicationcontrol.i18n import ZopeMessageFactory as _ from zope.size import byteDisplay from ZODB.interfaces import IDatabase from zope import component class ZODBControlView(object): status = None @property def databases(self): res = [] for name, db in component.getUtilitiesFor( IDatabase): d = dict( dbName = db.getName(), utilName = str(name), size = self._getSize(db), ) res.append(d) return res def _getSize(self, db): """Get the database size in a human readable format.""" size = db.getSize() if not isinstance(size, (int, long, float)): return str(size) return byteDisplay(size) def update(self): if self.status is not None: return self.status status = [] if 'PACK' in self.request.form: dbs = self.request.form.get('dbs', []) try: days = int(self.request.form.get('days','').strip() or 0) except ValueError: status.append(_('Error: Invalid Number')) self.status = status return self.status for dbName in dbs: db = component.getUtility(IDatabase, name=dbName) try: db.pack(days=days) status.append(_('ZODB "${name}" successfully packed.', mapping=dict(name=str(dbName)))) except FileStorageError, err: status.append(_('ERROR packing ZODB "${name}": ${err}', mapping=dict(name=str(dbName), err=err))) self.status = status return self.status ././@LongLink0000000000000000000000000000014700000000000011567 Lustar rootrootzope.app.applicationcontrol-3.5.10/src/zope/app/applicationcontrol/browser/translationdomaincontrol.ptzope.app.applicationcontrol-3.5.10/src/zope/app/applicationcontrol/browser/translationdomaincontrol.0000644000175000017500000000243711654256464034231 0ustar tseavertseaver Translation Domains

Domain
domain
Language Files  
Reload
zope.app.applicationcontrol-3.5.10/src/zope/app/applicationcontrol/browser/configure.zcml0000644000175000017500000000346311654256464031751 0ustar tseavertseaver zope.app.applicationcontrol-3.5.10/src/zope/app/applicationcontrol/browser/runtimeinfo.pt0000644000175000017500000000437511654256464032010 0ustar tseavertseaver Zope Runtime Information
Uptime
Time
System platform
Platform
Zope version
Version
Python version
Version
Command line
Command line
Preferred encoding
Encoding
FileSystem encoding
Encoding
Process id
ID
Developer mode
ID
Python path
  • path
zope.app.applicationcontrol-3.5.10/src/zope/app/applicationcontrol/browser/tests/0000755000175000017500000000000011654256572030235 5ustar tseavertseaver././@LongLink0000000000000000000000000000015100000000000011562 Lustar rootrootzope.app.applicationcontrol-3.5.10/src/zope/app/applicationcontrol/browser/tests/test_runtimeinfoview.pyzope.app.applicationcontrol-3.5.10/src/zope/app/applicationcontrol/browser/tests/test_runtimeinfovie0000644000175000017500000000564311654256464034272 0ustar tseavertseaver############################################################################## # # Copyright (c) 2001, 2002, 2003 Zope Foundation and Contributors. # All Rights Reserved. # # This software is subject to the provisions of the Zope Public License, # Version 2.1 (ZPL). A copy of the ZPL should accompany this distribution. # THIS SOFTWARE IS PROVIDED "AS IS" AND ANY AND ALL EXPRESS OR IMPLIED # WARRANTIES ARE DISCLAIMED, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED # WARRANTIES OF TITLE, MERCHANTABILITY, AGAINST INFRINGEMENT, AND FITNESS # FOR A PARTICULAR PURPOSE. # ############################################################################## """Runtime View tests $Id: test_runtimeinfoview.py 121717 2011-05-18 19:23:30Z menesis $ """ import unittest from types import DictType from zope.app.testing import ztapi from zope.app.applicationcontrol.applicationcontrol import applicationController from zope.app.applicationcontrol.runtimeinfo import RuntimeInfo from zope.app.applicationcontrol.browser.runtimeinfo import RuntimeInfoView from zope.app.applicationcontrol.interfaces import \ IApplicationControl, IRuntimeInfo from zope.app.component.testing import PlacefulSetup class Test(PlacefulSetup, unittest.TestCase): def _TestView__newView(self, container): view = RuntimeInfoView() view.context = container view.request = None return view def test_RuntimeInfoView(self): ztapi.provideAdapter(IApplicationControl, IRuntimeInfo, RuntimeInfo) test_runtimeinfoview = self._TestView__newView(applicationController) test_format = test_runtimeinfoview.runtimeInfo() self.failUnless(isinstance(test_format, DictType)) assert_keys = ['ZopeVersion', 'PythonVersion', 'PythonPath', 'SystemPlatform', 'PreferredEncoding', 'FileSystemEncoding', 'CommandLine', 'ProcessId', 'Uptime', 'DeveloperMode' ] test_keys = test_format.keys() assert_keys.sort() test_keys.sort() self.failUnlessEqual(assert_keys, test_keys) self.failUnlessEqual("Unavailable", test_format["ZopeVersion"]) def test_RuntimeInfoFailureView(self): test_runtimeinfoview = self._TestView__newView(applicationController) test_format = test_runtimeinfoview.runtimeInfo() self.failUnless(isinstance(test_format, DictType)) assert_keys = ['ZopeVersion', 'PythonVersion', 'PythonPath', 'SystemPlatform', 'PreferredEncoding', 'FileSystemEncoding', 'CommandLine', 'ProcessId', 'Uptime', 'DeveloperMode' ] test_keys = test_format.keys() assert_keys.sort() test_keys.sort() self.failUnlessEqual(assert_keys, test_keys) for key in assert_keys: self.failUnlessEqual("Unavailable", test_format[key]) def test_suite(): return unittest.TestSuite(( unittest.makeSuite(Test), )) if __name__ == '__main__': unittest.main() ././@LongLink0000000000000000000000000000016200000000000011564 Lustar rootrootzope.app.applicationcontrol-3.5.10/src/zope/app/applicationcontrol/browser/tests/test_translationdomaincontrol.pyzope.app.applicationcontrol-3.5.10/src/zope/app/applicationcontrol/browser/tests/test_translationdom0000644000175000017500000001010011654256464034245 0ustar tseavertseaver############################################################################## # # Copyright (c) 2008 Zope Foundation and Contributors. # All Rights Reserved. # # This software is subject to the provisions of the Zope Public License, # Version 2.1 (ZPL). A copy of the ZPL should accompany this distribution. # THIS SOFTWARE IS PROVIDED "AS IS" AND ANY AND ALL EXPRESS OR IMPLIED # WARRANTIES ARE DISCLAIMED, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED # WARRANTIES OF TITLE, MERCHANTABILITY, AGAINST INFRINGEMENT, AND FITNESS # FOR A PARTICULAR PURPOSE. # ############################################################################## """Translation Domain Control View Tests $Id: test_translationdomaincontrol.py 121717 2011-05-18 19:23:30Z menesis $ """ import unittest import zope.component from zope.interface import implements from zope.app.applicationcontrol.browser.translationdomaincontrol import ( TranslationDomainControlView) from zope.app.component.testing import PlacefulSetup from zope.i18n.interfaces import ITranslationDomain class TranslationDomainStub(object): implements(ITranslationDomain) def __init__(self, domain, languages): self.domain = domain self.languages = languages self.reloadDone = False def translate(self, msgid, mapping=None, context=None, target_language=None, default=None): return msgid def getCatalogsInfo(self): template = 'locales/%s/LC_MESSAGES/%s.mo' return dict([(lang, template % (lang, self.domain)) for lang in self.languages]) def reloadCatalogs(self, fileNames): self.reloadDone = True class Test(PlacefulSetup, unittest.TestCase): def _TestView__newView(self, request): view = TranslationDomainControlView() view.context = object() # the context does not matter in this view view.request = request return view def test_TranslationDomainControlView(self): languages = ['de', 'en', 'es'] # these are sorted, see below domains = ['zope', 'plone'] translationDomains = [] globalSiteManager = zope.component.getGlobalSiteManager() for domain in domains: translationDomain = TranslationDomainStub(domain, languages) globalSiteManager.registerUtility(translationDomain, ITranslationDomain, domain) translationDomains.append(translationDomain) test_translationDomainView = self._TestView__newView({}) catalogs = test_translationDomainView.getCatalogsInfo() self.assertEqual(len(catalogs), 2) for i, domain in enumerate(domains): catalog = catalogs[i] self.assertEqual(domain, catalog['domain']) langs = [li['language'] for li in catalog['languagesInfo']] self.assertEqual(sorted(langs), languages) files = [li['fileNames'] for li in catalog['languagesInfo']] self.assertEqual(sorted(files), [ 'locales/de/LC_MESSAGES/%s.mo' % domain, 'locales/en/LC_MESSAGES/%s.mo' % domain, 'locales/es/LC_MESSAGES/%s.mo' % domain, ]) # test catalog reloading translationDomain = translationDomains[0] test_translationDomainView = self._TestView__newView({ 'RELOAD': 1, 'domain': 'zope', 'language': 'fr' # fr is not in languages list }) test_translationDomainView.reloadCatalogs() self.assertEqual(translationDomain.reloadDone, False) test_translationDomainView = self._TestView__newView({ 'RELOAD': 1, 'domain': 'zope', 'language': 'en' # en is in languages list }) test_translationDomainView.reloadCatalogs() self.assertEqual(translationDomain.reloadDone, True) def test_suite(): return unittest.TestSuite(( unittest.makeSuite(Test), )) if __name__ == '__main__': unittest.main() ././@LongLink0000000000000000000000000000014700000000000011567 Lustar rootrootzope.app.applicationcontrol-3.5.10/src/zope/app/applicationcontrol/browser/tests/test_errorredirect.pyzope.app.applicationcontrol-3.5.10/src/zope/app/applicationcontrol/browser/tests/test_errorredirect.0000644000175000017500000000277111654256464034157 0ustar tseavertseaver############################################################################## # # Copyright (c) 2001, 2002 Zope Foundation and Contributors. # All Rights Reserved. # # This software is subject to the provisions of the Zope Public License, # Version 2.1 (ZPL). A copy of the ZPL should accompany this distribution. # THIS SOFTWARE IS PROVIDED "AS IS" AND ANY AND ALL EXPRESS OR IMPLIED # WARRANTIES ARE DISCLAIMED, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED # WARRANTIES OF TITLE, MERCHANTABILITY, AGAINST INFRINGEMENT, AND FITNESS # FOR A PARTICULAR PURPOSE. # ############################################################################## """ZODB Control Tests $Id: test_errorredirect.py 121717 2011-05-18 19:23:30Z menesis $ """ import unittest from zope.app.testing.functional import BrowserTestCase from zope.app.applicationcontrol.testing import ApplicationControlLayer class ErrorRedirectTest(BrowserTestCase): def testErrorRedirect(self): response = self.publish('/++etc++process/@@errorRedirect.html', basic='globalmgr:globalmgrpw') self.failUnlessEqual('http://localhost/@@errorRedirect.html', response.getHeader('Location')) self.failUnlessEqual(302, response.getStatus()) def test_suite(): suite = unittest.TestSuite() ErrorRedirectTest.layer = ApplicationControlLayer suite.addTest(unittest.makeSuite(ErrorRedirectTest)) return suite if __name__=='__main__': unittest.main(defaultTest='test_suite') zope.app.applicationcontrol-3.5.10/src/zope/app/applicationcontrol/browser/tests/zodb.txt0000644000175000017500000000153411654256464031737 0ustar tseavertseaver================= ZODB Control View ================= We provide default views which are relevant for administering mount points. >>> from zope.testbrowser.testing import Browser >>> browser = Browser() >>> browser.addHeader('Authorization','Basic mgr:mgrpw') >>> browser.handleErrors = False >>> browser.open('http://localhost/++etc++process/@@ZODBControl.html') All registered databases are displayed. Each database can be packed by selecting the according checkbox. Let us select the second database now: >>> browser.getControl(name='dbs:list').value=['2'] Now we define to pack the database back to 7 days: >>> browser.getControl(name='days').value='7' Finally let's submit the form and start packing the database: >>> browser.getControl(name='PACK').click() >>> 'ZODB "2" successfully packed.' in browser.contents True././@LongLink0000000000000000000000000000015300000000000011564 Lustar rootrootzope.app.applicationcontrol-3.5.10/src/zope/app/applicationcontrol/browser/tests/test_servercontrolview.pyzope.app.applicationcontrol-3.5.10/src/zope/app/applicationcontrol/browser/tests/test_servercontrolv0000644000175000017500000000454311654256464034322 0ustar tseavertseaver############################################################################## # # Copyright (c) 2001, 2002, 2003 Zope Foundation and Contributors. # All Rights Reserved. # # This software is subject to the provisions of the Zope Public License, # Version 2.1 (ZPL). A copy of the ZPL should accompany this distribution. # THIS SOFTWARE IS PROVIDED "AS IS" AND ANY AND ALL EXPRESS OR IMPLIED # WARRANTIES ARE DISCLAIMED, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED # WARRANTIES OF TITLE, MERCHANTABILITY, AGAINST INFRINGEMENT, AND FITNESS # FOR A PARTICULAR PURPOSE. # ############################################################################## """Server Control View Tests $Id: test_servercontrolview.py 121717 2011-05-18 19:23:30Z menesis $ """ import unittest import zope.component from zope.interface import implements from zope.app.applicationcontrol.applicationcontrol import applicationController from zope.app.applicationcontrol.browser.servercontrol import ServerControlView from zope.app.applicationcontrol.interfaces import IServerControl from zope.app.component.testing import PlacefulSetup class ServerControlStub(object): implements(IServerControl) did_restart = None did_shutdown = None def restart(self, time): self.did_restart = time def shutdown(self, time): self.did_shutdown = time class Test(PlacefulSetup, unittest.TestCase): def _TestView__newView(self, container, request): view = ServerControlView() view.context = container view.request = request return view def test_ServerControlView(self): control = ServerControlStub() globalSiteManager = zope.component.getGlobalSiteManager() globalSiteManager.registerUtility(control, IServerControl) test_serverctrl = self._TestView__newView( applicationController, {'shutdown': 1, 'time': 100}, ) test_serverctrl.action() self.assertEqual(control.did_shutdown, 100) test_serverctrl = self._TestView__newView( applicationController, {'restart': 1, 'time': 100}, ) test_serverctrl.action() self.assertEqual(control.did_restart, 100) def test_suite(): return unittest.TestSuite(( unittest.makeSuite(Test), )) if __name__ == '__main__': unittest.main() ././@LongLink0000000000000000000000000000014500000000000011565 Lustar rootrootzope.app.applicationcontrol-3.5.10/src/zope/app/applicationcontrol/browser/tests/test_zodbcontrol.pyzope.app.applicationcontrol-3.5.10/src/zope/app/applicationcontrol/browser/tests/test_zodbcontrol.py0000644000175000017500000000322311654256464034205 0ustar tseavertseaver############################################################################## # # Copyright (c) 2001, 2002 Zope Foundation and Contributors. # All Rights Reserved. # # This software is subject to the provisions of the Zope Public License, # Version 2.1 (ZPL). A copy of the ZPL should accompany this distribution. # THIS SOFTWARE IS PROVIDED "AS IS" AND ANY AND ALL EXPRESS OR IMPLIED # WARRANTIES ARE DISCLAIMED, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED # WARRANTIES OF TITLE, MERCHANTABILITY, AGAINST INFRINGEMENT, AND FITNESS # FOR A PARTICULAR PURPOSE. # ############################################################################## """ZODB Control Tests $Id: test_zodbcontrol.py 121717 2011-05-18 19:23:30Z menesis $ """ import unittest import ZODB.tests.util from ZODB.interfaces import IDatabase from zope.app.testing import functional from zope import component from zope.app.applicationcontrol.testing import ApplicationControlLayer def setUp(test): test.databases = test.globs['getRootFolder']()._p_jar.db().databases db2 = ZODB.tests.util.DB(databases=test.databases, database_name='2') for name, db in test.databases.items(): component.provideUtility(db, IDatabase, name=name) def tearDown(test): for db in test.databases.values(): db.close() def test_suite(): suite = unittest.TestSuite() zodb = functional.FunctionalDocFileSuite('zodb.txt', setUp=setUp, tearDown=tearDown) zodb.layer = ApplicationControlLayer suite.addTest(zodb) return suite if __name__=='__main__': unittest.main(defaultTest='test_suite') ././@LongLink0000000000000000000000000000017500000000000011570 Lustar rootrootzope.app.applicationcontrol-3.5.10/src/zope/app/applicationcontrol/browser/tests/test_translationdomaincontrol_functional.pyzope.app.applicationcontrol-3.5.10/src/zope/app/applicationcontrol/browser/tests/test_translationdom0000644000175000017500000000410211654256464034252 0ustar tseavertseaver############################################################################## # # Copyright (c) 2001, 2002 Zope Foundation and Contributors. # All Rights Reserved. # # This software is subject to the provisions of the Zope Public License, # Version 2.1 (ZPL). A copy of the ZPL should accompany this distribution. # THIS SOFTWARE IS PROVIDED "AS IS" AND ANY AND ALL EXPRESS OR IMPLIED # WARRANTIES ARE DISCLAIMED, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED # WARRANTIES OF TITLE, MERCHANTABILITY, AGAINST INFRINGEMENT, AND FITNESS # FOR A PARTICULAR PURPOSE. # ############################################################################## """Translation Domain Control Tests $Id: test_translationdomaincontrol_functional.py 121717 2011-05-18 19:23:30Z menesis $ """ import unittest from zope.app.testing.functional import BrowserTestCase from zope.app.applicationcontrol.testing import ApplicationControlLayer class MessageCatalogControlTest(BrowserTestCase): def testDomainOverview(self): response = self.publish( '/++etc++process/@@TranslationDomain.html', basic='globalmgr:globalmgrpw') body = response.getBody() self.checkForBrokenLinks(body, '/++etc++process/@@TranslationDomain.html', basic='globalmgr:globalmgrpw') def testReload(self): response = self.publish('/++etc++process/@@TranslationDomain.html', basic='globalmgr:globalmgrpw', form={'language': u'de', 'domain': u'zope', 'RELOAD': u'Reload'}) body = response.getBody() self.assert_('Message Catalog for de language in zope domain' ' successfully reloaded.' in body) def test_suite(): suite = unittest.TestSuite() MessageCatalogControlTest.layer = ApplicationControlLayer suite.addTest(unittest.makeSuite(MessageCatalogControlTest)) return suite if __name__=='__main__': unittest.main(defaultTest='test_suite') zope.app.applicationcontrol-3.5.10/src/zope/app/applicationcontrol/browser/tests/__init__.py0000644000175000017500000000007511654256464032350 0ustar tseavertseaver# # This file is necessary to make this directory a package. zope.app.applicationcontrol-3.5.10/src/zope/app/applicationcontrol/browser/__init__.py0000644000175000017500000000007511654256464031206 0ustar tseavertseaver# # This file is necessary to make this directory a package. zope.app.applicationcontrol-3.5.10/src/zope/app/applicationcontrol/browser/zodbcontrol.pt0000644000175000017500000000343411654256464032003 0ustar tseavertseaver ZODB Controller
Pack Utility Name Database Name Size
Keep up to days
zope.app.applicationcontrol-3.5.10/src/zope/app/applicationcontrol/browser/runtimeinfo.py0000644000175000017500000000461711654256464032014 0ustar tseavertseaver############################################################################## # # Copyright (c) 2001, 2002 Zope Foundation and Contributors. # All Rights Reserved. # # This software is subject to the provisions of the Zope Public License, # Version 2.1 (ZPL). A copy of the ZPL should accompany this distribution. # THIS SOFTWARE IS PROVIDED "AS IS" AND ANY AND ALL EXPRESS OR IMPLIED # WARRANTIES ARE DISCLAIMED, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED # WARRANTIES OF TITLE, MERCHANTABILITY, AGAINST INFRINGEMENT, AND FITNESS # FOR A PARTICULAR PURPOSE. # ############################################################################## """Define runtime information view component for Application Control $Id: runtimeinfo.py 121717 2011-05-18 19:23:30Z menesis $ """ __docformat__ = 'restructuredtext' from zope.app.applicationcontrol.interfaces import IRuntimeInfo from zope.app.applicationcontrol.i18n import ZopeMessageFactory as _ class RuntimeInfoView(object): _fields = ( "ZopeVersion", "PythonVersion", "PythonPath", "SystemPlatform", "PreferredEncoding", "FileSystemEncoding", "CommandLine", "ProcessId", "DeveloperMode", ) _unavailable = _("Unavailable") def runtimeInfo(self): try: ri = IRuntimeInfo(self.context) except TypeError: formatted = dict.fromkeys(self._fields, self._unavailable) formatted["Uptime"] = self._unavailable else: formatted = self._getInfo(ri) return formatted def _getInfo(self, ri): formatted = {} for name in self._fields: try: value = getattr(ri, "get" + name)() except ValueError: value = self._unavailable formatted[name] = value formatted["Uptime"] = self._getUptime(ri) return formatted def _getUptime(self, ri): # make a unix "uptime" uptime format uptime = long(ri.getUptime()) minutes, seconds = divmod(uptime, 60) hours, minutes = divmod(minutes, 60) days, hours = divmod(hours, 24) return _('${days} day(s) ${hours}:${minutes}:${seconds}', mapping = {'days': '%d' % days, 'hours': '%02d' % hours, 'minutes': '%02d' % minutes, 'seconds': '%02d' % seconds}) zope.app.applicationcontrol-3.5.10/src/zope/app/applicationcontrol/browser/servercontrol.pt0000644000175000017500000000233511654256464032352 0ustar tseavertseaver Zope Stub Server Controller
Countdown until restart or shutdown
 seconds

If you specify a time of 0 seconds, then the server will be shutdown or restarted immediately.

 
zope.app.applicationcontrol-3.5.10/src/zope/app/applicationcontrol/testing.py0000644000175000017500000000201111654256464027431 0ustar tseavertseaver############################################################################## # # Copyright (c) 2007 Zope Foundation and Contributors. # All Rights Reserved. # # This software is subject to the provisions of the Zope Public License, # Version 2.1 (ZPL). A copy of the ZPL should accompany this distribution. # THIS SOFTWARE IS PROVIDED "AS IS" AND ANY AND ALL EXPRESS OR IMPLIED # WARRANTIES ARE DISCLAIMED, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED # WARRANTIES OF TITLE, MERCHANTABILITY, AGAINST INFRINGEMENT, AND FITNESS # FOR A PARTICULAR PURPOSE. # ############################################################################## """zope.app.applicationcontrol common test related classes/functions/objects. $Id: testing.py 121717 2011-05-18 19:23:30Z menesis $ """ __docformat__ = "reStructuredText" import os from zope.app.testing.functional import ZCMLLayer ApplicationControlLayer = ZCMLLayer( os.path.join(os.path.split(__file__)[0], 'ftesting.zcml'), __name__, 'ApplicationControlLayer', allow_teardown=True) zope.app.applicationcontrol-3.5.10/src/zope/app/applicationcontrol/interfaces.py0000644000175000017500000000166211654256464030112 0ustar tseavertseaver############################################################################## # # Copyright (c) 2001, 2002 Zope Foundation and Contributors. # All Rights Reserved. # # This software is subject to the provisions of the Zope Public License, # Version 2.1 (ZPL). A copy of the ZPL should accompany this distribution. # THIS SOFTWARE IS PROVIDED "AS IS" AND ANY AND ALL EXPRESS OR IMPLIED # WARRANTIES ARE DISCLAIMED, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED # WARRANTIES OF TITLE, MERCHANTABILITY, AGAINST INFRINGEMENT, AND FITNESS # FOR A PARTICULAR PURPOSE. # ############################################################################## """Application Control Interface $Id: interfaces.py 121717 2011-05-18 19:23:30Z menesis $ """ __docformat__ = 'restructuredtext' from zope.interface import Interface # BBB from zope.applicationcontrol.interfaces import ( IApplicationControl, IRuntimeInfo, IZopeVersion, IServerControl) zope.app.applicationcontrol-3.5.10/src/zope/app/applicationcontrol/zopeversion.py0000644000175000017500000000715711654256464030357 0ustar tseavertseaver############################################################################## # # Copyright (c) 2001, 2002 Zope Foundation and Contributors. # All Rights Reserved. # # This software is subject to the provisions of the Zope Public License, # Version 2.1 (ZPL). A copy of the ZPL should accompany this distribution. # THIS SOFTWARE IS PROVIDED "AS IS" AND ANY AND ALL EXPRESS OR IMPLIED # WARRANTIES ARE DISCLAIMED, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED # WARRANTIES OF TITLE, MERCHANTABILITY, AGAINST INFRINGEMENT, AND FITNESS # FOR A PARTICULAR PURPOSE. # ############################################################################## """Utility to retrieve the Zope version. $Id: zopeversion.py 123225 2011-11-01 14:04:38Z tseaver $ """ __docformat__ = 'restructuredtext' import os import re import subprocess from zope.applicationcontrol.interfaces import IZopeVersion from zope.interface import implements class ZopeVersion(object): implements(IZopeVersion) __tags = re.compile(r'/(tags|branches)/([^/]+)/') def __init__(self, path=None): if path is None: # This used to look at zope.app.__file__. But zope.app is a # namespace package these days. # easy_install makes zope.app.__file__ be something random, like # /path/to/zope.app.renderer-x.y.z-py2.x.egg/zope/app/__init__.pyc # pip install makes zope.app have no __file__ at all, breaking # the old code. self.path = None self.result = "Meaningless" else: self.path = path self.result = None def getZopeVersion(self): """See zope.app.applicationcontrol.interfaces.IZopeVersion""" if self.result is not None: return self.result self.result = "Development/Unknown" # is this a SVN checkout? svndir = os.path.join(self.path, ".svn") if os.path.isdir(svndir): self.__setSVNVersion(svndir) else: # try to get official Zope release information versionfile = os.path.join(self.path, "version.txt") if os.path.isfile(versionfile): f = file(versionfile) try: self.result = f.readline().strip() or self.result finally: f.close() return self.result def _getSVNInfoOutput(self): try: env = os.environ.copy() env['LANG'] = env['LC_ALL'] = env['LC_MESSAGES'] = 'C' proc = subprocess.Popen('svn info "%s"' % self.path, shell=True, stdout=subprocess.PIPE, env=env) except OSError: pass else: if proc.wait() == 0: return proc.stdout return None def __setSVNVersion(self, svndir): output = self._getSVNInfoOutput() if not output: return info = {} for line in output: parts = line.rstrip().split(": ", 1) if len(parts) == 2: key, value = parts info[key] = value revision = info.get("Revision", "") url = info.get("URL", "") if revision and url: match = self.__tags.search(url) if match is None: tag = "" else: type, value = match.groups() if type == "tags": tag = "/Tag: %s" % value elif type == "branches": tag = "/Branch: %s" % value self.result = ("Development/Revision: %s%s" % (revision, tag)) ZopeVersionUtility = ZopeVersion() zope.app.applicationcontrol-3.5.10/src/zope/app/applicationcontrol/configure.zcml0000644000175000017500000000050111654256464030254 0ustar tseavertseaver zope.app.applicationcontrol-3.5.10/src/zope/app/applicationcontrol/tests/0000755000175000017500000000000011654256572026552 5ustar tseavertseaverzope.app.applicationcontrol-3.5.10/src/zope/app/applicationcontrol/tests/test_zopeversion.py0000644000175000017500000001147011654256464032551 0ustar tseavertseaver############################################################################## # # Copyright (c) 2001, 2002 Zope Foundation and Contributors. # All Rights Reserved. # # This software is subject to the provisions of the Zope Public License, # Version 2.1 (ZPL). A copy of the ZPL should accompany this distribution. # THIS SOFTWARE IS PROVIDED "AS IS" AND ANY AND ALL EXPRESS OR IMPLIED # WARRANTIES ARE DISCLAIMED, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED # WARRANTIES OF TITLE, MERCHANTABILITY, AGAINST INFRINGEMENT, AND FITNESS # FOR A PARTICULAR PURPOSE. # ############################################################################## """Zope Version Tests $Id: test_zopeversion.py 121717 2011-05-18 19:23:30Z menesis $ """ import os import sys import shutil import subprocess import tempfile import unittest from zope.interface.verify import verifyObject from zope.applicationcontrol.interfaces import IZopeVersion from zope.app.applicationcontrol.zopeversion import ZopeVersion def isSVNAvailable(): try: proc = subprocess.Popen('svn help', shell=True, stdout=subprocess.PIPE) except OSError: return False else: return proc.wait() == 0 def isSVNCheckout(dir): return os.path.isdir(os.path.join(dir, '.svn')) class MockZopeVersion(ZopeVersion): def setSVNInfoOutput(self, lines): self.__lines = lines def _getSVNInfoOutput(self): return self.__lines class Test(unittest.TestCase): def setUp(self): self.tmpdir = tempfile.mkdtemp(prefix="test-zopeversion-") self.zopeVersion = MockZopeVersion(self.tmpdir) def tearDown(self): shutil.rmtree(self.tmpdir) def prepare(self, version, fields): if version: f = open(os.path.join(self.tmpdir, "version.txt"), "w") try: f.write(version) if not version.endswith("\n"): f.write("\n") finally: f.close() if fields: os.mkdir(os.path.join(self.tmpdir, ".svn")) self.zopeVersion.setSVNInfoOutput(fields) def test_IVerify(self): verifyObject(IZopeVersion, self.zopeVersion) def test_ZopeVersion(self): self.prepare(None, None) self.assertEqual(self.zopeVersion.getZopeVersion(), "Development/Unknown") def test_ZopeVersion_svntrunk(self): self.prepare(None, [ "URL: svn+ssh://svn.zope.org/repos/main/Zope3/trunk/src/zope", "Revision: 10000" ]) self.assertEqual(self.zopeVersion.getZopeVersion(), "Development/Revision: 10000") def test_ZopeVersion_svnbranch(self): self.prepare(None, [ "URL: svn+ssh://svn.zope.org/repos/main/Zope3/branches/Zope3-1.0/src/zope", "Revision: 10000" ]) self.assertEqual(self.zopeVersion.getZopeVersion(), "Development/Revision: 10000/Branch: Zope3-1.0") def test_ZopeVersion_svntag(self): self.prepare(None, [ "URL: svn+ssh://svn.zope.org/repos/main/Zope3/tags/Zope3-1.0/src/zope", "Revision: 10000" ]) self.assertEqual(self.zopeVersion.getZopeVersion(), "Development/Revision: 10000/Tag: Zope3-1.0") def test_ZopeVersion_svn_unknown(self): self.prepare(None, ["Nope: "]) self.assertEqual(self.zopeVersion.getZopeVersion(), "Development/Unknown") def test_ZopeVersion_release(self): self.prepare("Zope 3 1.0.0", None) self.assertEqual(self.zopeVersion.getZopeVersion(), "Zope 3 1.0.0") def test_ZopeVersion_release_empty(self): self.prepare(" ", None) self.assertEqual(self.zopeVersion.getZopeVersion(), "Development/Unknown") def test_ZopeVersion_release_svntrunk(self): # demonstrate that the version.txt data is discarded if # there's revision-control metadata: self.prepare("Zope 3 1.0.0", [ "URL: svn+ssh://svn.zope.org/repos/main/Zope3/trunk/src/zope", "Revision: 10000" ]) self.assertEqual(self.zopeVersion.getZopeVersion(), "Development/Revision: 10000") def test_WrongLocale(self): """Demonstrate bug 177733""" currentPath = os.path.dirname(os.path.abspath(__file__)) if isSVNAvailable() and isSVNCheckout(currentPath): zv = ZopeVersion(currentPath) zv.getZopeVersion() # check that we don't get a 'Development/Unknown' version self.assert_(zv.result.startswith('Development/Revision: ')) def test_ZopeVersion_no_path_specified(self): zopeVersion = ZopeVersion(None) self.assertEqual(zopeVersion.result, "Meaningless") def test_suite(): return unittest.makeSuite(Test) if __name__ == '__main__': unittest.main(defaultTest="test_suite") zope.app.applicationcontrol-3.5.10/src/zope/app/applicationcontrol/tests/__init__.py0000644000175000017500000000007511654256464030665 0ustar tseavertseaver# # This file is necessary to make this directory a package. zope.app.applicationcontrol-3.5.10/src/zope/app/applicationcontrol/__init__.py0000644000175000017500000000007511654256464027523 0ustar tseavertseaver# # This file is necessary to make this directory a package. zope.app.applicationcontrol-3.5.10/src/zope/app/applicationcontrol/i18n.py0000644000175000017500000000165611654256464026551 0ustar tseavertseaver############################################################################## # # Copyright (c) 2003 Zope Foundation and Contributors. # All Rights Reserved. # # This software is subject to the provisions of the Zope Public License, # Version 2.1 (ZPL). A copy of the ZPL should accompany this distribution. # THIS SOFTWARE IS PROVIDED "AS IS" AND ANY AND ALL EXPRESS OR IMPLIED # WARRANTIES ARE DISCLAIMED, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED # WARRANTIES OF TITLE, MERCHANTABILITY, AGAINST INFRINGEMENT, AND FITNESS # FOR A PARTICULAR PURPOSE. # ############################################################################## """Customization of zope.i18n for the Zope application server $Id: i18n.py 121717 2011-05-18 19:23:30Z menesis $ """ __docformat__ = 'restructuredtext' # import this as _ to create i18n messages in the zope domain from zope.i18nmessageid import MessageFactory ZopeMessageFactory = MessageFactory('zope') zope.app.applicationcontrol-3.5.10/src/zope/app/applicationcontrol/applicationcontrol.py0000644000175000017500000000162311654256464031670 0ustar tseavertseaver############################################################################## # # Copyright (c) 2001, 2002 Zope Foundation and Contributors. # All Rights Reserved. # # This software is subject to the provisions of the Zope Public License, # Version 2.1 (ZPL). A copy of the ZPL should accompany this distribution. # THIS SOFTWARE IS PROVIDED "AS IS" AND ANY AND ALL EXPRESS OR IMPLIED # WARRANTIES ARE DISCLAIMED, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED # WARRANTIES OF TITLE, MERCHANTABILITY, AGAINST INFRINGEMENT, AND FITNESS # FOR A PARTICULAR PURPOSE. # ############################################################################## """Application Control $Id: applicationcontrol.py 121717 2011-05-18 19:23:30Z menesis $""" __docformat__ = 'restructuredtext' # BBB from zope.applicationcontrol.applicationcontrol import ( ApplicationControl, applicationControllerRoot, applicationController) zope.app.applicationcontrol-3.5.10/src/zope/app/applicationcontrol/ftesting.zcml0000644000175000017500000000212511654256464030122 0ustar tseavertseaver zope.app.applicationcontrol-3.5.10/src/zope/app/applicationcontrol/runtimeinfo.py0000644000175000017500000000150711654256464030324 0ustar tseavertseaver############################################################################## # # Copyright (c) 2001, 2002 Zope Foundation and Contributors. # All Rights Reserved. # # This software is subject to the provisions of the Zope Public License, # Version 2.1 (ZPL). A copy of the ZPL should accompany this distribution. # THIS SOFTWARE IS PROVIDED "AS IS" AND ANY AND ALL EXPRESS OR IMPLIED # WARRANTIES ARE DISCLAIMED, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED # WARRANTIES OF TITLE, MERCHANTABILITY, AGAINST INFRINGEMENT, AND FITNESS # FOR A PARTICULAR PURPOSE. # ############################################################################## """ Runtime Information $Id: runtimeinfo.py 121717 2011-05-18 19:23:30Z menesis $ """ __docformat__ = 'restructuredtext' # BBB from zope.applicationcontrol.runtimeinfo import ( RuntimeInfo) zope.app.applicationcontrol-3.5.10/src/zope/__init__.py0000644000175000017500000000031011654256464023027 0ustar tseavertseaver# this is a namespace package try: import pkg_resources pkg_resources.declare_namespace(__name__) except ImportError: import pkgutil __path__ = pkgutil.extend_path(__path__, __name__) zope.app.applicationcontrol-3.5.10/src/zope.app.applicationcontrol.egg-info/0000755000175000017500000000000011654256572027100 5ustar tseavertseaverzope.app.applicationcontrol-3.5.10/src/zope.app.applicationcontrol.egg-info/not-zip-safe0000644000175000017500000000000111654256541031322 0ustar tseavertseaver zope.app.applicationcontrol-3.5.10/src/zope.app.applicationcontrol.egg-info/namespace_packages.txt0000644000175000017500000000001611654256572033430 0ustar tseavertseaverzope zope.app zope.app.applicationcontrol-3.5.10/src/zope.app.applicationcontrol.egg-info/requires.txt0000644000175000017500000000040111654256572031473 0ustar tseavertseaversetuptools ZODB3 zope.applicationcontrol zope.component zope.i18n zope.i18nmessageid zope.interface zope.size zope.traversing>=3.7.0 [test] zope.app.component zope.app.testing zope.app.zcmlfiles zope.login zope.password zope.securitypolicy zope.testbrowserzope.app.applicationcontrol-3.5.10/src/zope.app.applicationcontrol.egg-info/SOURCES.txt0000644000175000017500000000421611654256572030767 0ustar tseavertseaverCHANGES.txt COPYRIGHT.txt INSTALL.txt LICENSE.txt README.txt bootstrap.py buildout.cfg setup.py src/zope/__init__.py src/zope.app.applicationcontrol.egg-info/PKG-INFO src/zope.app.applicationcontrol.egg-info/SOURCES.txt src/zope.app.applicationcontrol.egg-info/dependency_links.txt src/zope.app.applicationcontrol.egg-info/namespace_packages.txt src/zope.app.applicationcontrol.egg-info/not-zip-safe src/zope.app.applicationcontrol.egg-info/requires.txt src/zope.app.applicationcontrol.egg-info/top_level.txt src/zope/app/__init__.py src/zope/app/applicationcontrol/__init__.py src/zope/app/applicationcontrol/applicationcontrol.py src/zope/app/applicationcontrol/configure.zcml src/zope/app/applicationcontrol/ftesting.zcml src/zope/app/applicationcontrol/i18n.py src/zope/app/applicationcontrol/interfaces.py src/zope/app/applicationcontrol/runtimeinfo.py src/zope/app/applicationcontrol/testing.py src/zope/app/applicationcontrol/zopeversion.py src/zope/app/applicationcontrol/browser/__init__.py src/zope/app/applicationcontrol/browser/configure.zcml src/zope/app/applicationcontrol/browser/runtimeinfo.pt src/zope/app/applicationcontrol/browser/runtimeinfo.py src/zope/app/applicationcontrol/browser/servercontrol.pt src/zope/app/applicationcontrol/browser/servercontrol.py src/zope/app/applicationcontrol/browser/translationdomaincontrol.pt src/zope/app/applicationcontrol/browser/translationdomaincontrol.py src/zope/app/applicationcontrol/browser/zodbcontrol.pt src/zope/app/applicationcontrol/browser/zodbcontrol.py src/zope/app/applicationcontrol/browser/tests/__init__.py src/zope/app/applicationcontrol/browser/tests/test_errorredirect.py src/zope/app/applicationcontrol/browser/tests/test_runtimeinfoview.py src/zope/app/applicationcontrol/browser/tests/test_servercontrolview.py src/zope/app/applicationcontrol/browser/tests/test_translationdomaincontrol.py src/zope/app/applicationcontrol/browser/tests/test_translationdomaincontrol_functional.py src/zope/app/applicationcontrol/browser/tests/test_zodbcontrol.py src/zope/app/applicationcontrol/browser/tests/zodb.txt src/zope/app/applicationcontrol/tests/__init__.py src/zope/app/applicationcontrol/tests/test_zopeversion.pyzope.app.applicationcontrol-3.5.10/src/zope.app.applicationcontrol.egg-info/top_level.txt0000644000175000017500000000000511654256572031625 0ustar tseavertseaverzope zope.app.applicationcontrol-3.5.10/src/zope.app.applicationcontrol.egg-info/dependency_links.txt0000644000175000017500000000000111654256572033146 0ustar tseavertseaver zope.app.applicationcontrol-3.5.10/src/zope.app.applicationcontrol.egg-info/PKG-INFO0000644000175000017500000001774311654256572030211 0ustar tseavertseaverMetadata-Version: 1.0 Name: zope.app.applicationcontrol Version: 3.5.10 Summary: Zope application control Home-page: http://cheeseshop.python.org/pypi/zope.app.applicationcontrol Author: Zope Foundation and Contributors Author-email: zope-dev@zope.org License: ZPL 2.1 Description: =========================== zope.app.applicationcontrol =========================== The application control instance is usually generated upon startup. This package provides runtime information adapter for application control and Zope version. Also provide a utility with methods for shutting down and restarting the server. Developer Resources ------------------- - Subversion browser: http://svn.zope.org/zope.app.applicationcontrol/ - Read-only Subversion checkout:: $ svn co svn://svn.zope.org/repos/main/zope.app.applicationcontrol/trunk - Writable Subversion checkout:: $ svn co svn+ssh://userid@svn.zope.org/repos/main/zope.app.applicationcontrol/trunk ======================= Installing This Package ======================= Prerequisites ------------- The installation steps below assume that you have the cool new 'setuptools' package installed in your Python. Here is where to get it:: $ wget http://peak.telecommunity.com/dist/ez_setup.py $ /path/to/your/python ez_setup.py # req. write access to 'site-packages' - Docs for EasyInstall: http://peak.telecommunity.com/DevCenter/EasyInstall - Docs for setuptools: http://peak.telecommunity.com/DevCenter/setuptools - Docs for eggs: http://peak.telecommunity.com/DevCenter/PythonEggs Installing a Development Checkout --------------------------------- Check out the package from subversion:: $ svn co svn+ssh://svn.zope.org/repos/main/zope.app.applicationcontrol/trunk \ src/zope.app.applicationcontrol $ cd src/zope.app.applicationcontrol Install it as a "devlopment egg" (which also installs its "hard" dependencies):: $ /path/to/your/python setup.py devel The installation of dependency eggs uses the 'setup.cfg' file in the checkout. You can supply '--find-links' on the command line to point it at a non-standard package repository. Running the Tests ----------------- To test the package, you will also need the 'zope.testing' package, which can't (yet) be automatically installed. Eventually, you should be able to type:: $ /path/to/your/python setup.py test and have it install the "testing dependencies." Today, the workaround is to install it manually:: $ /path/to/easy_install --find-links="...." zope.testing You can then run the tests (finally) from the checkout directory:: $ /path/to/your/python test.py Running: ............. Ran 13 tests with 0 failures and 0 errors in 0.094 seconds. Installing a Source Distribution -------------------------------- You can also install it from a source distribution:: $ /path/to/easy_install --find-links="...." -eb src zope.app.applicationcontrol $ cd src/zope.app.applicationcontrol $ /path/to/your/python setup.py devel Installing a Binary Egg ----------------------- Install the package as a "binary egg" (which also installs its "hard" dependencies):: $ /path/to/easy_install --find-links="...." zope.app.applicationcontrol ======= CHANGES ======= 3.5.10 (2011-11-02) ------------------- - Extended the locale-specific fix from version 3.5.6 for hosts which set ``LC_*`` in the environment: those variables shadow ``LANG``. - Replaced a testing dependency on zope.app.authentication with zope.password. - Removed unneeded zope.app.appsetup test dependency. 3.5.9 (2010-12-18) ------------------ - Bugfix: AttributeError: 'module' object has no attribute '__file__' when you used ``pip install`` instead of ``easy_install``. The IZopeVersion utility now returns "Meaningless", since there's no monolithic Zope 3 in the modern eggified world. 3.5.8 (2010-09-17) ------------------ - Replaced a testing dependency on zope.app.securitypolicy with one on zope.securitypolicy. 3.5.7 (2010-07-08) ------------------ - 3.5.6 was a bad egg release. 3.5.6 (2010-07-07) ------------------ - Bugfix: Launching ``svn`` replaced the whole environment instead of just appending ``LANG``. 3.5.5 (2010-01-09) ------------------ - Extracted RuntimeInfo and ApplicationRoot functionality into zope.applicationcontrol. Import this functionality from this package instead (see BBB imports inside this package). 3.5.4 (2010-01-08) ------------------ - Test dependency on zptpage removed. 3.5.3 (2010-01-05) ------------------ - Updated to use newer zope.publisher 3.12 and zope.login to make tests work. 3.5.2 (2009-12-19) ------------------ - Move 'zope.ManageApplication' permission from zope.app.security package - Break dependency on ``zope.app.appsetup`` by using a conditional import 3.5.1 (2009-08-15) ------------------ - Added missing (normal and test) dependencies. - Renenabled functional tests. 3.5.0 (2009-05-23) ------------------ - The application controller is now registered as a utility so that other packages like zope.traversing and zope.app.publication do not need to depend on this package directly. This also makes the application controller pluggable. 3.4.3 (2008-07-30) ------------------ - Make the test for the ZopeVersion bugfix in 3.4.2 not fail when run from an egg rather than a checkout. 3.4.2 (2008-07-30) ------------------ - Substitute zope.app.zapi by direct calls to its wrapped apis. See http://launchpad.net/bugs/219302 - Bugfix: ZopeVersion used to report an unknown version when running on a machine with a locale different than English. See http://launchpad.net/bugs/177733 - Fixed deprecation warning in ftesting.zcml: import ZopeSecurityPolicy from the new location. 3.4.1 (2007-09-27) ------------------ - rebumped to replace faulty egg 3.4.0 (2007-09-25) ------------------ - Initial documented release - Reflect changes form zope.app.error refactoring Keywords: zope3 application control Platform: UNKNOWN Classifier: Development Status :: 5 - Production/Stable Classifier: Environment :: Web Environment Classifier: Intended Audience :: Developers Classifier: License :: OSI Approved :: Zope Public License Classifier: Programming Language :: Python Classifier: Natural Language :: English Classifier: Operating System :: OS Independent Classifier: Topic :: Internet :: WWW/HTTP Classifier: Framework :: Zope3 zope.app.applicationcontrol-3.5.10/CHANGES.txt0000644000175000017500000000526111654256464020775 0ustar tseavertseaver======= CHANGES ======= 3.5.10 (2011-11-02) ------------------- - Extended the locale-specific fix from version 3.5.6 for hosts which set ``LC_*`` in the environment: those variables shadow ``LANG``. - Replaced a testing dependency on zope.app.authentication with zope.password. - Removed unneeded zope.app.appsetup test dependency. 3.5.9 (2010-12-18) ------------------ - Bugfix: AttributeError: 'module' object has no attribute '__file__' when you used ``pip install`` instead of ``easy_install``. The IZopeVersion utility now returns "Meaningless", since there's no monolithic Zope 3 in the modern eggified world. 3.5.8 (2010-09-17) ------------------ - Replaced a testing dependency on zope.app.securitypolicy with one on zope.securitypolicy. 3.5.7 (2010-07-08) ------------------ - 3.5.6 was a bad egg release. 3.5.6 (2010-07-07) ------------------ - Bugfix: Launching ``svn`` replaced the whole environment instead of just appending ``LANG``. 3.5.5 (2010-01-09) ------------------ - Extracted RuntimeInfo and ApplicationRoot functionality into zope.applicationcontrol. Import this functionality from this package instead (see BBB imports inside this package). 3.5.4 (2010-01-08) ------------------ - Test dependency on zptpage removed. 3.5.3 (2010-01-05) ------------------ - Updated to use newer zope.publisher 3.12 and zope.login to make tests work. 3.5.2 (2009-12-19) ------------------ - Move 'zope.ManageApplication' permission from zope.app.security package - Break dependency on ``zope.app.appsetup`` by using a conditional import 3.5.1 (2009-08-15) ------------------ - Added missing (normal and test) dependencies. - Renenabled functional tests. 3.5.0 (2009-05-23) ------------------ - The application controller is now registered as a utility so that other packages like zope.traversing and zope.app.publication do not need to depend on this package directly. This also makes the application controller pluggable. 3.4.3 (2008-07-30) ------------------ - Make the test for the ZopeVersion bugfix in 3.4.2 not fail when run from an egg rather than a checkout. 3.4.2 (2008-07-30) ------------------ - Substitute zope.app.zapi by direct calls to its wrapped apis. See http://launchpad.net/bugs/219302 - Bugfix: ZopeVersion used to report an unknown version when running on a machine with a locale different than English. See http://launchpad.net/bugs/177733 - Fixed deprecation warning in ftesting.zcml: import ZopeSecurityPolicy from the new location. 3.4.1 (2007-09-27) ------------------ - rebumped to replace faulty egg 3.4.0 (2007-09-25) ------------------ - Initial documented release - Reflect changes form zope.app.error refactoring zope.app.applicationcontrol-3.5.10/setup.cfg0000644000175000017500000000007311654256572021001 0ustar tseavertseaver[egg_info] tag_build = tag_date = 0 tag_svn_revision = 0 zope.app.applicationcontrol-3.5.10/PKG-INFO0000644000175000017500000001774311654256572020271 0ustar tseavertseaverMetadata-Version: 1.0 Name: zope.app.applicationcontrol Version: 3.5.10 Summary: Zope application control Home-page: http://cheeseshop.python.org/pypi/zope.app.applicationcontrol Author: Zope Foundation and Contributors Author-email: zope-dev@zope.org License: ZPL 2.1 Description: =========================== zope.app.applicationcontrol =========================== The application control instance is usually generated upon startup. This package provides runtime information adapter for application control and Zope version. Also provide a utility with methods for shutting down and restarting the server. Developer Resources ------------------- - Subversion browser: http://svn.zope.org/zope.app.applicationcontrol/ - Read-only Subversion checkout:: $ svn co svn://svn.zope.org/repos/main/zope.app.applicationcontrol/trunk - Writable Subversion checkout:: $ svn co svn+ssh://userid@svn.zope.org/repos/main/zope.app.applicationcontrol/trunk ======================= Installing This Package ======================= Prerequisites ------------- The installation steps below assume that you have the cool new 'setuptools' package installed in your Python. Here is where to get it:: $ wget http://peak.telecommunity.com/dist/ez_setup.py $ /path/to/your/python ez_setup.py # req. write access to 'site-packages' - Docs for EasyInstall: http://peak.telecommunity.com/DevCenter/EasyInstall - Docs for setuptools: http://peak.telecommunity.com/DevCenter/setuptools - Docs for eggs: http://peak.telecommunity.com/DevCenter/PythonEggs Installing a Development Checkout --------------------------------- Check out the package from subversion:: $ svn co svn+ssh://svn.zope.org/repos/main/zope.app.applicationcontrol/trunk \ src/zope.app.applicationcontrol $ cd src/zope.app.applicationcontrol Install it as a "devlopment egg" (which also installs its "hard" dependencies):: $ /path/to/your/python setup.py devel The installation of dependency eggs uses the 'setup.cfg' file in the checkout. You can supply '--find-links' on the command line to point it at a non-standard package repository. Running the Tests ----------------- To test the package, you will also need the 'zope.testing' package, which can't (yet) be automatically installed. Eventually, you should be able to type:: $ /path/to/your/python setup.py test and have it install the "testing dependencies." Today, the workaround is to install it manually:: $ /path/to/easy_install --find-links="...." zope.testing You can then run the tests (finally) from the checkout directory:: $ /path/to/your/python test.py Running: ............. Ran 13 tests with 0 failures and 0 errors in 0.094 seconds. Installing a Source Distribution -------------------------------- You can also install it from a source distribution:: $ /path/to/easy_install --find-links="...." -eb src zope.app.applicationcontrol $ cd src/zope.app.applicationcontrol $ /path/to/your/python setup.py devel Installing a Binary Egg ----------------------- Install the package as a "binary egg" (which also installs its "hard" dependencies):: $ /path/to/easy_install --find-links="...." zope.app.applicationcontrol ======= CHANGES ======= 3.5.10 (2011-11-02) ------------------- - Extended the locale-specific fix from version 3.5.6 for hosts which set ``LC_*`` in the environment: those variables shadow ``LANG``. - Replaced a testing dependency on zope.app.authentication with zope.password. - Removed unneeded zope.app.appsetup test dependency. 3.5.9 (2010-12-18) ------------------ - Bugfix: AttributeError: 'module' object has no attribute '__file__' when you used ``pip install`` instead of ``easy_install``. The IZopeVersion utility now returns "Meaningless", since there's no monolithic Zope 3 in the modern eggified world. 3.5.8 (2010-09-17) ------------------ - Replaced a testing dependency on zope.app.securitypolicy with one on zope.securitypolicy. 3.5.7 (2010-07-08) ------------------ - 3.5.6 was a bad egg release. 3.5.6 (2010-07-07) ------------------ - Bugfix: Launching ``svn`` replaced the whole environment instead of just appending ``LANG``. 3.5.5 (2010-01-09) ------------------ - Extracted RuntimeInfo and ApplicationRoot functionality into zope.applicationcontrol. Import this functionality from this package instead (see BBB imports inside this package). 3.5.4 (2010-01-08) ------------------ - Test dependency on zptpage removed. 3.5.3 (2010-01-05) ------------------ - Updated to use newer zope.publisher 3.12 and zope.login to make tests work. 3.5.2 (2009-12-19) ------------------ - Move 'zope.ManageApplication' permission from zope.app.security package - Break dependency on ``zope.app.appsetup`` by using a conditional import 3.5.1 (2009-08-15) ------------------ - Added missing (normal and test) dependencies. - Renenabled functional tests. 3.5.0 (2009-05-23) ------------------ - The application controller is now registered as a utility so that other packages like zope.traversing and zope.app.publication do not need to depend on this package directly. This also makes the application controller pluggable. 3.4.3 (2008-07-30) ------------------ - Make the test for the ZopeVersion bugfix in 3.4.2 not fail when run from an egg rather than a checkout. 3.4.2 (2008-07-30) ------------------ - Substitute zope.app.zapi by direct calls to its wrapped apis. See http://launchpad.net/bugs/219302 - Bugfix: ZopeVersion used to report an unknown version when running on a machine with a locale different than English. See http://launchpad.net/bugs/177733 - Fixed deprecation warning in ftesting.zcml: import ZopeSecurityPolicy from the new location. 3.4.1 (2007-09-27) ------------------ - rebumped to replace faulty egg 3.4.0 (2007-09-25) ------------------ - Initial documented release - Reflect changes form zope.app.error refactoring Keywords: zope3 application control Platform: UNKNOWN Classifier: Development Status :: 5 - Production/Stable Classifier: Environment :: Web Environment Classifier: Intended Audience :: Developers Classifier: License :: OSI Approved :: Zope Public License Classifier: Programming Language :: Python Classifier: Natural Language :: English Classifier: Operating System :: OS Independent Classifier: Topic :: Internet :: WWW/HTTP Classifier: Framework :: Zope3