diff --git a/.coveragerc b/.coveragerc new file mode 100644 index 0000000..1b12d28 --- /dev/null +++ b/.coveragerc @@ -0,0 +1,6 @@ +[run] +source = formtools +branch = 1 + +[report] +omit = localflavor/*tests* diff --git a/.editorconfig b/.editorconfig new file mode 100644 index 0000000..de58f86 --- /dev/null +++ b/.editorconfig @@ -0,0 +1,14 @@ +# http://editorconfig.org + +root = true + +[*] +indent_style = space +indent_size = 4 +insert_final_newline = true +trim_trailing_whitespace = true +end_of_line = lf +charset = utf-8 + +[*.bat] +end_of_line = crlf diff --git a/.gitignore b/.gitignore new file mode 100644 index 0000000..5636b3d --- /dev/null +++ b/.gitignore @@ -0,0 +1,10 @@ +*.pyc +.*.swp +MANIFEST +build +dist +*.egg-info +docs/_build +.tox/ +*.egg/ +.coverage diff --git a/.tx/config b/.tx/config new file mode 100644 index 0000000..3a93ee5 --- /dev/null +++ b/.tx/config @@ -0,0 +1,9 @@ +[main] +host = https://www.transifex.com +lang_map = sr@latin:sr_Latn +type = PO + +[django-formtools.main] +file_filter = formtools/locale//LC_MESSAGES/django.po +source_file = formtools/locale/en/LC_MESSAGES/django.po +source_lang = en diff --git a/AUTHORS.rst b/AUTHORS.rst new file mode 100644 index 0000000..2f25187 --- /dev/null +++ b/AUTHORS.rst @@ -0,0 +1,48 @@ +Authors +======= + +* Adam Haney +* Adrian Holovaty +* Alasdair Nicol +* Alex Gaynor +* Andrew Godwin +* Anubhav Joshi +* Areski Belaid +* Aymeric Augustin +* Berker Peksag +* Bouke Haarsma +* Carl Meyer +* Christopher Medrela +* Claude Paroz +* Curtis Maloney +* Erik Romijn +* Florian Apolloner +* Gary Wilson Jr +* Hiroki Kiyohara +* Honza Král +* Ian Clelland +* Ilya Baryshev +* Jacob Kaplan-Moss +* James Jenkins +* Jannis Leidel +* Jason Myers +* Julian Wachholz +* Julien Phalip +* Justin Bronn +* Karen Tracey +* Kathryn Killebrew +* Kent Hauser +* Loic Bistuer +* Luke Plant +* Malcolm Tredinnick +* Maurycy +* Preston Holmes +* Preston Timmons +* Ramiro Morales +* Rodolfo Carvalho +* Russell Keith-Magee +* Simon Charette +* Stephan Jaekel +* Tim Graham +* Trey Hunner +* Vishal Lal diff --git a/CONTRIBUTING.rst b/CONTRIBUTING.rst new file mode 100644 index 0000000..e6f2224 --- /dev/null +++ b/CONTRIBUTING.rst @@ -0,0 +1,60 @@ +================================ +Contributing to django-formtools +================================ + +As an open source project, django-formtools welcomes contributions of many +forms, similar to its origin in the Django framework. + +Examples of contributions include: + +* Code patches +* Documentation improvements +* Bug reports and patch reviews + +Extensive contribution guidelines are available online at: + + https://docs.djangoproject.com/en/dev/internals/contributing/ + +`File a ticket`__ to suggest changes or send pull requests. + +django-formtools uses Github's issue system to keep track of bugs, feature +requests, and pull requests for patches. + +Running tests is as simple as `installing Tox`__ and running it in the root +Git clone directory:: + + $ git clone https://github.com/django/django-formtools + [..] + $ cd django-formtools + $ tox + [..] + congratulations :) + +The previous command will run the tests in different combinations of Python +(if available) and Django versions. To see the full list of combinations use +the ``-l`` option:: + + $ tox -l + py26-1.5 + py26-1.6 + py27-1.5 + py27-1.6 + py32-1.5 + py32-1.6 + py33-1.5 + py33-1.6 + +You can run each environment with the ``-e`` option:: + + $ tox -e py27-1.6 # runs the tests only on Pyton 2.7 and Django 1.6.x + +Optionally you can also specify a country whose tests you want to run:: + + $ COUNTRY=us tox + +And combine both options:: + + $ COUNTRY=us tox -e py27-1.6 + +__ https://github.com/django/django-formtools/issues +__ http://tox.readthedocs.org/en/latest/install.html diff --git a/LICENSE b/LICENSE new file mode 100644 index 0000000..3dd0e2d --- /dev/null +++ b/LICENSE @@ -0,0 +1,27 @@ +Copyright (c) Django Software Foundation and individual contributors. +All rights reserved. + +Redistribution and use in source and binary forms, with or without modification, +are permitted provided that the following conditions are met: + + 1. Redistributions of source code must retain the above copyright notice, + this list of conditions and the following disclaimer. + + 2. Redistributions in binary form must reproduce the above copyright + notice, this list of conditions and the following disclaimer in the + documentation and/or other materials provided with the distribution. + + 3. Neither the name of django-formtools nor the names of its contributors + may be used to endorse or promote products derived from this software + without specific prior written permission. + +THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND +ANY EXPRESS 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 OWNER OR CONTRIBUTORS 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. diff --git a/MANIFEST.in b/MANIFEST.in new file mode 100644 index 0000000..f29b300 --- /dev/null +++ b/MANIFEST.in @@ -0,0 +1,10 @@ +include LICENSE +include AUTHORS.rst +include README.rst +include CONTRIBUTING.rst +include tasks.py +include tox.ini +include .coveragerc +recursive-include formtools/locale *.po *.mo +recursive-include docs * +recursive-include tests * diff --git a/README.rst b/README.rst new file mode 100644 index 0000000..18c5615 --- /dev/null +++ b/README.rst @@ -0,0 +1,22 @@ +================ +django-formtools +================ + +.. image:: https://secure.travis-ci.org/django/django-formtools.png + :target: http://travis-ci.org/django/django-formtools + +.. image:: https://coveralls.io/repos/django/django-formtools/badge.png?branch=master + :target: https://coveralls.io/r/django/django-formtools + +Django's "formtools" is a set of high-level abstractions for Django forms. +Currently for form previews and multi-step forms. + +This code used to live in Django proper -- in ``django.contrib.formtools`` +-- but was separated into a standalone package in Django 1.8 to keep the +framework's core clean. + +For a full list of available formtoolss, see +http://django-formtools.readthedocs.org/ + +django-formtools can also be found on and installed from the Python +Package Index: https://pypi.python.org/pypi/django-formtools diff --git a/setup.cfg b/setup.cfg new file mode 100644 index 0000000..bde0098 --- /dev/null +++ b/setup.cfg @@ -0,0 +1,5 @@ +[metadata] +license-file = LICENSE + +[wheel] +universal=1 diff --git a/setup.py b/setup.py new file mode 100644 index 0000000..b3e0c81 --- /dev/null +++ b/setup.py @@ -0,0 +1,139 @@ +import os +import re +import sys +import codecs +from fnmatch import fnmatchcase +from distutils.util import convert_path +from setuptools import setup, find_packages + + +def read(*parts): + filename = os.path.join(os.path.dirname(__file__), *parts) + with codecs.open(filename, encoding='utf-8') as fp: + return fp.read() + + +def find_version(*file_paths): + version_file = read(*file_paths) + version_match = re.search(r"^__version__ = ['\"]([^'\"]*)['\"]", + version_file, re.M) + if version_match: + return version_match.group(1) + raise RuntimeError("Unable to find version string.") + + +# Provided as an attribute, so you can append to these instead +# of replicating them: +standard_exclude = ('*.py', '*.pyc', '*$py.class', '*~', '.*', '*.bak') +standard_exclude_directories = ('.*', 'CVS', '_darcs', './build', + './dist', 'EGG-INFO', '*.egg-info') + + +# (c) 2005 Ian Bicking and contributors; written for Paste (http://pythonpaste.org) +# Licensed under the MIT license: http://www.opensource.org/licenses/mit-license.php +# Note: you may want to copy this into your setup.py file verbatim, as +# you can't import this from another package, when you don't know if +# that package is installed yet. +def find_package_data(where='.', package='', + exclude=standard_exclude, + exclude_directories=standard_exclude_directories, + only_in_packages=True, + show_ignored=False): + """ + Return a dictionary suitable for use in ``package_data`` + in a distutils ``setup.py`` file. + + The dictionary looks like:: + + {'package': [files]} + + Where ``files`` is a list of all the files in that package that + don't match anything in ``exclude``. + + If ``only_in_packages`` is true, then top-level directories that + are not packages won't be included (but directories under packages + will). + + Directories matching any pattern in ``exclude_directories`` will + be ignored; by default directories with leading ``.``, ``CVS``, + and ``_darcs`` will be ignored. + + If ``show_ignored`` is true, then all the files that aren't + included in package data are shown on stderr (for debugging + purposes). + + Note patterns use wildcards, or can be exact paths (including + leading ``./``), and all searching is case-insensitive. + """ + + out = {} + stack = [(convert_path(where), '', package, only_in_packages)] + while stack: + where, prefix, package, only_in_packages = stack.pop(0) + for name in os.listdir(where): + fn = os.path.join(where, name) + if os.path.isdir(fn): + bad_name = False + for pattern in exclude_directories: + if (fnmatchcase(name, pattern) or fn.lower() == pattern.lower()): + bad_name = True + if show_ignored: + print >> sys.stderr, ( + "Directory %s ignored by pattern %s" + % (fn, pattern)) + break + if bad_name: + continue + if (os.path.isfile(os.path.join(fn, '__init__.py')) and not prefix): + if not package: + new_package = name + else: + new_package = package + '.' + name + stack.append((fn, '', new_package, False)) + else: + stack.append((fn, prefix + name + '/', package, only_in_packages)) + elif package or not only_in_packages: + # is a file + bad_name = False + for pattern in exclude: + if (fnmatchcase(name, pattern) or fn.lower() == pattern.lower()): + bad_name = True + if show_ignored: + print >> sys.stderr, ( + "File %s ignored by pattern %s" + % (fn, pattern)) + break + if bad_name: + continue + out.setdefault(package, []).append(prefix + name) + return out + +setup( + name="django-formtools", + version=find_version("formtools", "__init__.py"), + url='http://django-formtools.readthedocs.org/en/latest/', + license='BSD', + description="A set of high-level abstractions for Django forms", + # long_description=read('README.rst'), + author='Django Software Foundation', + author_email='foundation@djangoproject.com', + packages=find_packages(exclude=['tests', 'tests.*']), + package_data=find_package_data(), + classifiers=[ + 'Development Status :: 5 - Production/Stable', + 'Environment :: Web Environment', + 'Framework :: Django', + 'Intended Audience :: Developers', + 'License :: OSI Approved :: BSD License', + 'Operating System :: OS Independent', + 'Programming Language :: Python', + 'Programming Language :: Python :: 2', + 'Programming Language :: Python :: 2.6', + 'Programming Language :: Python :: 2.7', + 'Programming Language :: Python :: 3', + 'Programming Language :: Python :: 3.2', + 'Programming Language :: Python :: 3.3', + 'Topic :: Internet :: WWW/HTTP', + ], + zip_safe=False, +)