summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorJens Vagelpohl <jens@dataflake.org>2009-06-23 10:11:07 +0000
committerJens Vagelpohl <jens@dataflake.org>2009-06-23 10:11:07 +0000
commit9f4c96b722d1da71573eab056a5617e687fe8bbb (patch)
tree084358439c9f47029a8167962dd8f2c139ea0986
downloadProducts.JRedirector-9f4c96b722d1da71573eab056a5617e687fe8bbb.zip
Products.JRedirector-9f4c96b722d1da71573eab056a5617e687fe8bbb.tar.gz
- import skeleton
git-svn-id: file:///svn-public/Products.JRedirector/trunk@1807 835909ba-7c00-0410-bfa4-884f43845301
-rw-r--r--Products/__init__.py6
-rw-r--r--README.txt1
-rw-r--r--bootstrap.py84
-rw-r--r--buildout.cfg14
-rw-r--r--setup.py50
5 files changed, 155 insertions, 0 deletions
diff --git a/Products/__init__.py b/Products/__init__.py
new file mode 100644
index 0000000..f48ad10
--- /dev/null
+++ b/Products/__init__.py
@@ -0,0 +1,6 @@
+# See http://peak.telecommunity.com/DevCenter/setuptools#namespace-packages
+try:
+ __import__('pkg_resources').declare_namespace(__name__)
+except ImportError:
+ from pkgutil import extend_path
+ __path__ = extend_path(__path__, __name__)
diff --git a/README.txt b/README.txt
new file mode 100644
index 0000000..a133fa1
--- /dev/null
+++ b/README.txt
@@ -0,0 +1 @@
+(See Products/JRedirector/README.txt).
diff --git a/bootstrap.py b/bootstrap.py
new file mode 100644
index 0000000..c262f93
--- /dev/null
+++ b/bootstrap.py
@@ -0,0 +1,84 @@
+##############################################################################
+#
+# Copyright (c) 2006 Zope Corporation 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()
+
+is_jython = sys.platform.startswith('java')
+
+try:
+ import pkg_resources
+except ImportError:
+ 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
+
+if sys.platform == 'win32':
+ def quote(c):
+ if ' ' in c:
+ return '"%s"' % c # work around spawn lamosity on windows
+ else:
+ return c
+else:
+ def quote (c):
+ return c
+
+cmd = 'from setuptools.command.easy_install import main; main()'
+ws = pkg_resources.working_set
+
+if len(sys.argv) > 2 and sys.argv[1] == '--version':
+ VERSION = ' == %s' % sys.argv[2]
+ args = sys.argv[3:] + ['bootstrap']
+else:
+ VERSION = ''
+ args = sys.argv[1:] + ['bootstrap']
+
+if is_jython:
+ import subprocess
+
+ assert subprocess.Popen([sys.executable] + ['-c', quote(cmd), '-mqNxd',
+ quote(tmpeggs), 'zc.buildout' + VERSION],
+ env=dict(os.environ,
+ PYTHONPATH=
+ ws.find(pkg_resources.Requirement.parse('setuptools')).location
+ ),
+ ).wait() == 0
+
+else:
+ assert os.spawnle(
+ os.P_WAIT, sys.executable, quote (sys.executable),
+ '-c', quote (cmd), '-mqNxd', quote (tmpeggs), 'zc.buildout' + VERSION,
+ dict(os.environ,
+ PYTHONPATH=
+ ws.find(pkg_resources.Requirement.parse('setuptools')).location
+ ),
+ ) == 0
+
+ws.add_entry(tmpeggs)
+ws.require('zc.buildout' + VERSION)
+import zc.buildout.buildout
+zc.buildout.buildout.main(args)
+shutil.rmtree(tmpeggs)
diff --git a/buildout.cfg b/buildout.cfg
new file mode 100644
index 0000000..6e1e04a
--- /dev/null
+++ b/buildout.cfg
@@ -0,0 +1,14 @@
+[buildout]
+parts =
+ test
+develop = .
+unzip = true
+find-links =
+ http://download.zope.org/distribution/
+
+[test]
+recipe = zc.recipe.testrunner
+defaults = ['-cv', '--module', '^Products[.]JRedirector']
+eggs =
+ Zope2
+ Products.JRedirector
diff --git a/setup.py b/setup.py
new file mode 100644
index 0000000..6c68713
--- /dev/null
+++ b/setup.py
@@ -0,0 +1,50 @@
+import os
+from setuptools import find_packages
+from setuptools import setup
+
+NAME = 'JRedirector'
+here = os.path.abspath(os.path.dirname(__file__))
+package = os.path.join(here, 'Products', NAME)
+_boundary = '\n' + ('-' * 60) + '\n\n'
+
+def _read(name):
+ f = open(os.path.join(package, name))
+ return f.read()
+
+setup(name='Products.%s' % NAME,
+ version=_read('VERSION.txt').strip(),
+ description="Zope 2 Image with thumbnail and watermarking support",
+ long_description=( _read('README.txt')
+ + _boundary
+ + _read('CHANGES.txt')
+ + _boundary
+ + 'Download\n========'
+ ),
+ classifiers=[
+ "Development Status :: 5 - Production/Stable",
+ "Framework :: Zope2",
+ "Intended Audience :: Developers",
+ "License :: OSI Approved :: Zope Public License",
+ "Programming Language :: Python",
+ "Topic :: Internet :: WWW/HTTP :: Site Management",
+ "Topic :: Software Development",
+ "Topic :: Software Development :: Libraries :: Python Modules",
+ ],
+ keywords='web zope zope2 redirector',
+ author='Jens Vagelpohl',
+ author_email='jens@dataflake.org',
+ url='http://pypi.python.org/pypi/Products.%s' % NAME,
+ license="ZPL 2.1 (http://www.zope.org/Resources/License/ZPL-2.1)",
+ packages=find_packages(),
+ namespace_packages=['Products'],
+ include_package_data=True,
+ zip_safe=False,
+ install_requires=[
+ 'setuptools',
+ # Zope2 >= 2.8
+ ],
+ entry_points="""
+ [zope2.initialize]
+ Products.%s = Products.%s:initialize
+ """ % (NAME, NAME),
+ )