Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with
or
.
Download ZIP
Browse files

Generated with paster

svn path=/buildout/collective.recipe.backup/trunk/; revision=66996
  • Loading branch information...
commit f865fb51812c1ae70e681d35258b9a7b89922b9e 0 parents
@reinout reinout authored
4 CHANGES.txt
@@ -0,0 +1,4 @@
+0.1 (xxxx-xx-xx)
+==================
+
+ - Created recipe with ZopeSkel [Reinout van Rees].
2  CONTRIBUTORS.txt
@@ -0,0 +1,2 @@
+Reinout van Rees, Author
+
17 README.txt
@@ -0,0 +1,17 @@
+.. contents::
+
+.. Note to recipe author!
+ ---------------------
+ Update the following URLs to point to your:
+
+ - code repository
+ - bug tracker
+ - questions/comments feedback mail
+ (do not set a real mail, to avoid spams)
+
+ Or remove it if not used.
+
+- Code repository: http://svn.somewhere.com/...
+- Questions and comments to somemailing_list
+- Report bugs at http://bug.somewhere.com/..
+
52 bootstrap.py
@@ -0,0 +1,52 @@
+##############################################################################
+#
+# 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()
+
+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)
8 buildout.cfg
@@ -0,0 +1,8 @@
+[buildout]
+develop = .
+parts = test
+
+[test]
+recipe = zc.recipe.testrunner
+eggs = collective.recipe.backup [tests]
+
2  collective.recipe.backup.egg-info/paster_plugins.txt
@@ -0,0 +1,2 @@
+ZopeSkel
+PasteScript
6 collective/__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__)
6 collective/recipe/__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__)
61 collective/recipe/backup/README.txt
@@ -0,0 +1,61 @@
+Supported options
+=================
+
+The recipe supports the following options:
+
+.. Note to recipe author!
+ ----------------------
+ For each option the recipe uses you shoud include a description
+ about the purpose of the option, the format and semantics of the
+ values it accepts, whether it is mandatory or optional and what the
+ default value is if it is omitted.
+
+option1
+ Description for ``option1``...
+
+option2
+ Description for ``option2``...
+
+
+Example usage
+=============
+
+.. Note to recipe author!
+ ----------------------
+ zc.buildout provides a nice testing environment which makes it
+ relatively easy to write doctests that both demonstrate the use of
+ the recipe and test it.
+ You can find examples of recipe doctests from the PyPI, e.g.
+
+ http://pypi.python.org/pypi/zc.recipe.egg
+
+ The PyPI page for zc.buildout contains documentation about the test
+ environment.
+
+ http://pypi.python.org/pypi/zc.buildout#testing-support
+
+ Below is a skeleton doctest that you can start with when building
+ your own tests.
+
+We'll start by creating a buildout that uses the recipe::
+
+ >>> write('buildout.cfg',
+ ... """
+ ... [buildout]
+ ... parts = test1
+ ...
+ ... [test1]
+ ... recipe = collective.recipe.backup
+ ... option1 = %(foo)s
+ ... option2 = %(bar)s
+ ... """ % { 'foo' : 'value1', 'bar' : 'value2'})
+
+Running the buildout gives us::
+
+ >>> print 'start', system(buildout) # doctest:+ELLIPSIS
+ start...
+ Installing test1.
+ Unused options for test1: 'option2' 'option1'.
+ <BLANKLINE>
+
+
20 collective/recipe/backup/__init__.py
@@ -0,0 +1,20 @@
+# -*- coding: utf-8 -*-
+"""Recipe backup"""
+
+class Recipe(object):
+ """zc.buildout recipe"""
+
+ def __init__(self, buildout, name, options):
+ self.buildout, self.name, self.options = buildout, name, options
+
+ def install(self):
+ """Installer"""
+ # XXX Implement recipe functionality here
+
+ # Return files that were created by the recipe. The buildout
+ # will remove all returned files upon reinstall.
+ return tuple()
+
+ def update(self):
+ """Updater"""
+ pass
1  collective/recipe/backup/tests/__init__.py
@@ -0,0 +1 @@
+# package
47 collective/recipe/backup/tests/test_docs.py
@@ -0,0 +1,47 @@
+# -*- coding: utf-8 -*-
+"""
+Doctest runner for 'collective.recipe.backup'.
+"""
+__docformat__ = 'restructuredtext'
+
+import unittest
+import zc.buildout.tests
+import zc.buildout.testing
+
+from zope.testing import doctest, renormalizing
+
+optionflags = (doctest.ELLIPSIS |
+ doctest.NORMALIZE_WHITESPACE |
+ doctest.REPORT_ONLY_FIRST_FAILURE)
+
+def setUp(test):
+ zc.buildout.testing.buildoutSetUp(test)
+
+ # Install the recipe in develop mode
+ zc.buildout.testing.install_develop('collective.recipe.backup', test)
+
+ # Install any other recipes that should be available in the tests
+ #zc.buildout.testing.install('collective.recipe.foobar', test)
+
+def test_suite():
+ suite = unittest.TestSuite((
+ doctest.DocFileSuite(
+ '../README.txt',
+ setUp=setUp,
+ tearDown=zc.buildout.testing.buildoutTearDown,
+ optionflags=optionflags,
+ checker=renormalizing.RENormalizing([
+ # If want to clean up the doctest output you
+ # can register additional regexp normalizers
+ # here. The format is a two-tuple with the RE
+ # as the first item and the replacement as the
+ # second item, e.g.
+ # (re.compile('my-[rR]eg[eE]ps'), 'my-regexps')
+ zc.buildout.testing.normalize_path,
+ ]),
+ ),
+ ))
+ return suite
+
+if __name__ == '__main__':
+ unittest.main(defaultTest='test_suite')
3  setup.cfg
@@ -0,0 +1,3 @@
+[egg_info]
+tag_build = dev
+tag_svn_revision = true
68 setup.py
@@ -0,0 +1,68 @@
+# -*- coding: utf-8 -*-
+"""
+This module contains the tool of collective.recipe.backup
+"""
+import os
+from setuptools import setup, find_packages
+
+def read(*rnames):
+ return open(os.path.join(os.path.dirname(__file__), *rnames)).read()
+
+version = '0.1'
+
+long_description = (
+ read('README.txt')
+ + '\n' +
+ 'Detailed Documentation\n'
+ '**********************\n'
+ + '\n' +
+ read('collective', 'recipe', 'backup', 'README.txt')
+ + '\n' +
+ 'Contributors\n'
+ '************\n'
+ + '\n' +
+ read('CONTRIBUTORS.txt')
+ + '\n' +
+ 'Change history\n'
+ '**************\n'
+ + '\n' +
+ read('CHANGES.txt')
+ + '\n' +
+ 'Download\n'
+ '********\n'
+ )
+entry_point = 'collective.recipe.backup:Recipe'
+entry_points = {"zc.buildout": ["default = %s" % entry_point]}
+
+tests_require=['zope.testing', 'zc.buildout']
+
+setup(name='collective.recipe.backup',
+ version=version,
+ description="bin/backup script: sensible defaults around bin/repozo",
+ long_description=long_description,
+ # Get more strings from http://www.python.org/pypi?%3Aaction=list_classifiers
+ classifiers=[
+ 'Framework :: Buildout',
+ 'Intended Audience :: Developers',
+ 'Topic :: Software Development :: Build Tools',
+ 'Topic :: Software Development :: Libraries :: Python Modules',
+ 'License :: OSI Approved :: GNU General Public License (GPL)',
+ ],
+ keywords='buildout backup repozo zope',
+ author='Reinout van Rees',
+ author_email='reinout@vanrees.org',
+ url='',
+ license='GPL',
+ packages=find_packages(exclude=['ez_setup']),
+ namespace_packages=['collective', 'collective.recipe'],
+ include_package_data=True,
+ zip_safe=False,
+ install_requires=['setuptools',
+ 'zc.buildout'
+ # -*- Extra requirements: -*-
+ ],
+ tests_require=tests_require,
+ extras_require=dict(tests=tests_require),
+ test_suite = 'collective.recipe.backup.tests.test_docs.test_suite',
+ entry_points=entry_points,
+ )
Please sign in to comment.
Something went wrong with that request. Please try again.