[Checkins] SVN: z3c.configurator/trunk/ Moved to GitHub.
Stephen Richter
cvs-admin at zope.org
Wed Feb 27 14:23:41 UTC 2013
Log message for revision 129899:
Moved to GitHub.
Changed:
D z3c.configurator/trunk/CHANGES.txt
D z3c.configurator/trunk/COPYRIGHT.txt
D z3c.configurator/trunk/LICENSE.txt
A z3c.configurator/trunk/MOVED_TO_GITHUB
D z3c.configurator/trunk/README.txt
D z3c.configurator/trunk/bootstrap.py
D z3c.configurator/trunk/buildout.cfg
D z3c.configurator/trunk/importchecker.py
D z3c.configurator/trunk/setup.py
D z3c.configurator/trunk/src/
-=-
Deleted: z3c.configurator/trunk/CHANGES.txt
===================================================================
--- z3c.configurator/trunk/CHANGES.txt 2013-02-27 13:47:13 UTC (rev 129898)
+++ z3c.configurator/trunk/CHANGES.txt 2013-02-27 14:23:41 UTC (rev 129899)
@@ -1,59 +0,0 @@
-=======
-CHANGES
-=======
-
-
-1.3.1 (unreleased)
-------------------
-
-- Nothing changed yet.
-
-
-1.3.0 (2010-12-12)
-------------------
-
-- Updated test set up to run with ZTK 1.0.
-
-
-Version 1.2.1 (2009-12-27)
---------------------------
-
-- Moved browser dependencies to 'zmi' extras
-
-
-Version 1.2.0 (2009-12-19)
---------------------------
-
-- Made registration of browser views conditional
-
-- Move packages required for testing to 'test' extras
-
-- Remove old zpkg-related SETUP.cfg file.
-
-- Copyright "Zope Foundation and Contributors"
-
-
-Version 1.1.2 (2009-01-04)
---------------------------
-
-- Added possibility to apply only specific named plugins in configure.
-
-- New option to configure allows to have namespaced data to resolve
- naming conflicts.
-
-- Added a page to call configurators TTW. This is the first step
- towards mergin z3c.configurator and z3c.sampledata into one package.
-
-- Added documentation to Pypi home page.
-
-- bugfix: Defining recursive dependent names in IConfigurationPlugin
- dependencies, ends in recursive plugin lookup.
-
-- bugfix: SchemaConfigurationPluginBase now implements
- ISchemaConfigurationPluginBase.
-
-
-Version 1.1.1 (unknown)
------------------------
-
-- Initial Release
Deleted: z3c.configurator/trunk/COPYRIGHT.txt
===================================================================
--- z3c.configurator/trunk/COPYRIGHT.txt 2013-02-27 13:47:13 UTC (rev 129898)
+++ z3c.configurator/trunk/COPYRIGHT.txt 2013-02-27 14:23:41 UTC (rev 129899)
@@ -1 +0,0 @@
-Zope Foundation and Contributors
\ No newline at end of file
Deleted: z3c.configurator/trunk/LICENSE.txt
===================================================================
--- z3c.configurator/trunk/LICENSE.txt 2013-02-27 13:47:13 UTC (rev 129898)
+++ z3c.configurator/trunk/LICENSE.txt 2013-02-27 14:23:41 UTC (rev 129899)
@@ -1,44 +0,0 @@
-Zope 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.
Added: z3c.configurator/trunk/MOVED_TO_GITHUB
===================================================================
--- z3c.configurator/trunk/MOVED_TO_GITHUB (rev 0)
+++ z3c.configurator/trunk/MOVED_TO_GITHUB 2013-02-27 14:23:41 UTC (rev 129899)
@@ -0,0 +1 @@
+See https://github.com/zopefoundation/z3c.configurator
\ No newline at end of file
Deleted: z3c.configurator/trunk/README.txt
===================================================================
--- z3c.configurator/trunk/README.txt 2013-02-27 13:47:13 UTC (rev 129898)
+++ z3c.configurator/trunk/README.txt 2013-02-27 14:23:41 UTC (rev 129899)
@@ -1,2 +0,0 @@
-This package provides a configurator which is designed to extend a component
-after its creation for Zope3.
Deleted: z3c.configurator/trunk/bootstrap.py
===================================================================
--- z3c.configurator/trunk/bootstrap.py 2013-02-27 13:47:13 UTC (rev 129898)
+++ z3c.configurator/trunk/bootstrap.py 2013-02-27 14:23:41 UTC (rev 129899)
@@ -1,52 +0,0 @@
-##############################################################################
-#
-# 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$
-"""
-
-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)
Deleted: z3c.configurator/trunk/buildout.cfg
===================================================================
--- z3c.configurator/trunk/buildout.cfg 2013-02-27 13:47:13 UTC (rev 129898)
+++ z3c.configurator/trunk/buildout.cfg 2013-02-27 14:23:41 UTC (rev 129899)
@@ -1,10 +0,0 @@
-[buildout]
-develop = .
-parts = test
-
-[test]
-recipe = zc.recipe.testrunner
-eggs = z3c.configurator [test]
-
-
-
Deleted: z3c.configurator/trunk/importchecker.py
===================================================================
--- z3c.configurator/trunk/importchecker.py 2013-02-27 13:47:13 UTC (rev 129898)
+++ z3c.configurator/trunk/importchecker.py 2013-02-27 14:23:41 UTC (rev 129899)
@@ -1,353 +0,0 @@
-#!/usr/bin/env python2.4
-##############################################################################
-#
-# 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.
-#
-##############################################################################
-"""Import checker
-
-This utility finds is based on the zope importchecker script, prints
-out unused imports, imports that are only for tests packages and
-runtime imports.
-
-$Id$
-"""
-import compiler
-import os, os.path
-import sys
-
-def _findDottedNamesHelper(node, result):
- more_node = node
- name = node.__class__.__name__
- if name == 'Getattr':
- dotted = []
- while name == 'Getattr':
- dotted.append(node.attrname)
- node = node.expr
- name = node.__class__.__name__
- if name == 'Name':
- dotted.append(node.name)
- dotted.reverse()
- for i in range(1, len(dotted)):
- result.append('.'.join(dotted[:i]))
- result.append('.'.join(dotted))
- return
- elif name == 'Name':
- result.append(node.name)
- return
- elif name == 'AssAttr':
- return
- for child in more_node.getChildNodes():
- _findDottedNamesHelper(child, result)
-
-def findDottedNames(node):
- """Find dotted names in an AST tree node
- """
- result = []
- _findDottedNamesHelper(node, result)
- return result
-
-class ImportFinder:
- """An instance of this class will be used to walk over a compiler AST
- tree (a module). During that operation, the appropriate methods of
- this visitor will be called
- """
-
- def __init__(self):
- self._map = {}
-
- def visitFrom(self, stmt):
- """Will be called for 'from foo import bar' statements
- """
- module_name, names = stmt.asList()
- if module_name == '__future__':
- # we don't care what's imported from the future
- return
- names_dict = {}
- for orig_name, as_name in names:
- # we don't care about from import *
- if orig_name == '*':
- continue
- if as_name is None:
- name = orig_name
- else:
- name = as_name
- names_dict[name] = orig_name
- self._map.setdefault(module_name, {'names': names_dict,
- 'lineno': stmt.lineno})
-
- def visitImport(self, stmt):
- """Will be called for 'import foo.bar' statements
- """
- for orig_name, as_name in stmt.names:
- if as_name is None:
- name = orig_name
- else:
- name = as_name
- self._map.setdefault(orig_name, {'names': {name: orig_name},
- 'lineno': stmt.lineno})
-
- def getMap(self):
- return self._map
-
-def findImports(mod):
- """Find import statements in module and put the result in a mapping.
- """
- visitor = ImportFinder()
- compiler.walk(mod, visitor)
- return visitor.getMap()
-
-class Module:
- """This represents a python module.
- """
-
- def __init__(self, path):
- mod = compiler.parseFile(path)
- self._path = path
- self._map = findImports(mod)
- dottednames = {}
- self._dottednames = findDottedNames(mod)
-
- def getPath(self):
- """Return the path to this module's file.
- """
- return self._path
-
- def getImportedModuleNames(self):
- """Return the names of imported modules.
- """
- return self._map.keys()
-
- def getImportNames(self):
- """Return the names of imports; add dottednames as well.
- """
- result = []
- map = self._map
- for module_name in map.keys():
- for usedname, originalname in map[module_name]['names'].items():
- result.append((originalname, module_name))
- # add any other name that we could be using
- for dottedname in self._dottednames:
- usednamedot = usedname + '.'
- if dottedname.startswith(usednamedot):
- attrname = dottedname[len(usednamedot):].split('.')[0]
- result.append((attrname, module_name))
-
- return result
-
- def getUnusedImports(self):
- """Get unused imports of this module (the whole import info).
- """
- result = []
- for value in self._map.values():
- for usedname, originalname in value['names'].items():
- if usedname not in self._dottednames:
- result.append((originalname, value['lineno']))
- return result
-
-class ModuleFinder:
-
- def __init__(self):
- self._files = []
-
- def visit(self, arg, dirname, names):
- """This method will be called when we walk the filesystem
- tree. It looks for python modules and stored their filenames.
- """
- for name in names:
- # get all .py files that aren't weirdo emacs droppings
- if name.endswith('.py') and not name.startswith('.#'):
- self._files.append(os.path.join(dirname, name))
-
- def getModuleFilenames(self):
- return self._files
-
-def findModules(path):
- """Find python modules in the given path and return their absolute
- filenames in a sequence.
- """
- finder = ModuleFinder()
- os.path.walk(path, finder.visit, ())
- return finder.getModuleFilenames()
-
-class ImportDatabase:
- """This database keeps tracks of imports.
-
- It allows to NOT report cases where a module imports something
- just so that another module can import it (import dependencies).
- """
-
- def __init__(self, root_path):
- self._root_path = root_path
- self._modules = {}
- self._names = {}
-
- def resolveDottedModuleName(self, dotted_name, module):
- """Return path to file representing module, or None if no such
- thing. Can do this relative from module.
- """
- dotted_path = dotted_name.replace('.', '/')
- # try relative import first
- path = os.path.join(os.path.dirname(module.getPath()), dotted_path)
- path = self._resolveHelper(path)
- if path is not None:
- return path
- # absolute import (assumed to be from this tree)
- if os.path.isfile(os.path.join(self._root_path, '__init__.py')):
- startpath, dummy = os.path.split(self._root_path)
- else:
- startpath = self._root_path
- return self._resolveHelper(os.path.join(startpath, dotted_path))
-
- def _resolveHelper(self, path):
- if os.path.isfile(path + '.py'):
- return path + '.py'
- if os.path.isdir(path):
- path = os.path.join(path, '__init__.py')
- if os.path.isfile(path):
- return path
- return None
-
- def findModules(self):
- """Find modules in the given path.
- """
- for modulepath in findModules(self._root_path):
- module = Module(modulepath)
- self.addModule(module)
-
- def addModule(self, module):
- """Add information about a module to the database. A module in
- this case is not a python module object, but an instance of
- the above defined Module class.w
- """
- self_path = module.getPath()
- # do nothing if we already know about it
- if self._modules.has_key(self_path):
- return
-
- self._modules[self_path] = module
-
- # add imported names to internal names mapping; this will
- # allow us identify dependent imports later
- names = self._names
- for name, from_module_name in module.getImportNames():
- path = self.resolveDottedModuleName(from_module_name, module)
- t = (path, name)
- modulepaths = names.get(t, {})
- if not modulepaths.has_key(self_path):
- modulepaths[self_path] = 1
- names[t] = modulepaths
-
- def getUnusedImports(self):
- """Get unused imports of all known modules.
- """
- result = {}
- for path, module in self._modules.items():
- result[path] = self.getUnusedImportsInModule(module)
- return result
-
- def getImportedModuleNames(self, tests=False):
- """returns all names imported by modules"""
- result = set()
- import os
- for path, module in self._modules.items():
- # remove .py
- parts = path[:-3].split(os.path.sep)
- isTest = 'tests' in parts or 'testing' in parts \
- or 'ftests' in parts
- if (tests and isTest) or (not tests and not isTest):
- result.update(module.getImportedModuleNames())
- return sorted(result)
-
- def getUnusedImportsInModule(self, module):
- """Get all unused imports in a module.
- """
- result = []
- for name, lineno in module.getUnusedImports():
- if not self.isNameImportedFrom(name, module):
- result.append((name, lineno))
- return result
-
- def isNameImportedFrom(self, name, module):
- """Return true if name is imported from module by another module.
- """
- return self._names.has_key((module.getPath(), name))
-
- def getModulesImportingNameFrom(self, name, module):
- """Return list of known modules that import name from module.
- """
- result = []
- for path in self._names.get((module.getPath(), name), {}).keys():
- result.append(self._modules[path])
- return result
-
-def main():
- try:
- path = os.path.abspath(sys.argv[1])
- except IndexError:
- path = os.path.abspath(os.getcwd())
- path = os.path.join(path, 'src')
-
- if not os.path.exists(path):
- print "Please provide a valid path %r" % path
- sys.exit(1)
- print "-"*79
- print "Path: %r" % path
- print "-"*79
- print
-
- path = os.path.abspath(path)
- if not os.path.isdir(path):
- print "Unknown path:", path
- sys.exit(1)
-
- db = ImportDatabase(path)
- db.findModules()
- unused_imports = db.getUnusedImports()
- module_paths = unused_imports.keys()
- module_paths.sort()
- print "-"*79
- print "Unused Imports:"
- print "-"*79
- for path in module_paths:
- info = unused_imports[path]
- if not info:
- continue
- line2names = {}
- for name, line in info:
- names = line2names.get(line, [])
- names.append(name)
- line2names[line] = names
- lines = line2names.keys()
- lines.sort()
- for line in lines:
- names = ', '.join(line2names[line])
- print "%s:%s: %s" % (path, line, names)
- testImports = db.getImportedModuleNames(tests=True)
- installImports = db.getImportedModuleNames(tests=False)
- print "-"*79
- print
- print "-"*79
- print "Imports for 'tests' and 'testing' packages"
- print "-"*79
- for name in [name for name in testImports if name not in installImports]:
- print name
- print "-"*79
- print
- print "-"*79
- print "Install imports"
- print "-"*79
- for name in installImports:
- print name
- print "-"*79
-
-if __name__ == '__main__':
- main()
Deleted: z3c.configurator/trunk/setup.py
===================================================================
--- z3c.configurator/trunk/setup.py 2013-02-27 13:47:13 UTC (rev 129898)
+++ z3c.configurator/trunk/setup.py 2013-02-27 14:23:41 UTC (rev 129899)
@@ -1,81 +0,0 @@
-##############################################################################
-#
-# 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.
-#
-##############################################################################
-"""
-$Id$
-"""
-
-import os
-from setuptools import setup, find_packages
-
-def read(*rnames):
- return open(os.path.join(os.path.dirname(__file__), *rnames)).read()
-
-setup(
- name = 'z3c.configurator',
- version='1.3.1dev',
- author = "Zope Community",
- author_email = "zope-dev at zope.org",
- description = "Dynamic configuration",
- long_description=(
- read('README.txt')
- + '\n\n.. contents::\n\n' +
- read('src', 'z3c', 'configurator', 'README.txt')
- + '\n\n' +
- read('src', 'z3c', 'configurator', 'browser', 'README.txt')
- + '\n\n' +
- read('CHANGES.txt')
- ),
- license = 'ZPL 2.1',
- keywords = 'zope3 z3c configurator configuration',
- 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://pypi.python.org/pypi/z3c.configurator',
- packages = find_packages('src'),
- include_package_data = True,
- package_dir = {'':'src'},
- namespace_packages = ['z3c'],
- extras_require = dict(
- test = [
- 'zope.annotation',
- 'zope.dublincore',
- 'zope.formlib',
- 'zope.securitypolicy',
- 'zope.testbrowser',
- 'zope.testing',
- 'zope.app.pagetemplate',
- 'zope.app.testing',
- 'zope.app.zcmlfiles',
- ],
- zmi = [
- 'zope.browserpage',
- 'zope.formlib',
- ],
- ),
- install_requires = [
- 'setuptools',
- 'zope.component',
- 'zope.i18nmessageid',
- 'zope.interface',
- 'zope.schema',
- ],
- zip_safe=False,
- )
More information about the checkins
mailing list