Permalink
Browse files

initial commiit

  • Loading branch information...
0 parents commit a3ce7231071712efc1ecc7dd5044d4cc06931b45 @fivethreeo committed Sep 12, 2011
3 MANIFEST.in
@@ -0,0 +1,3 @@
+recursive-include filer_gallery/templates *
+recursive-include filer_gallery/locale *
+recursive-include filer_gallery/static *
3 README.rst
@@ -0,0 +1,3 @@
+Docs can be found at http://django-filer-gallery.readthedocs.org/
+
+Translation project at transifex: http://www.transifex.net/projects/p/django-filer-gallery/
11 coveragerc
@@ -0,0 +1,11 @@
+[run]
+branch = True
+source =
+ filer_gallery
+omit =
+ filer_gallery/migrations/*
+ filer_gallery/tests/*
+ filer_gallery/test/*
+ filer_gallery/test/testapp/*
+[report]
+precision = 2
88 docs/Makefile
@@ -0,0 +1,88 @@
+# Makefile for Sphinx documentation
+#
+
+# You can set these variables from the command line.
+SPHINXOPTS =
+SPHINXBUILD = sphinx-build
+PAPER =
+
+# Internal variables.
+PAPEROPT_a4 = -D latex_paper_size=a4
+PAPEROPT_letter = -D latex_paper_size=letter
+ALLSPHINXOPTS = -d build/doctrees $(PAPEROPT_$(PAPER)) $(SPHINXOPTS) .
+
+.PHONY: help clean html dirhtml pickle json htmlhelp qthelp latex changes linkcheck doctest
+
+help:
+ @echo "Please use \`make <target>' where <target> is one of"
+ @echo " html to make standalone HTML files"
+ @echo " dirhtml to make HTML files named index.html in directories"
+ @echo " pickle to make pickle files"
+ @echo " json to make JSON files"
+ @echo " htmlhelp to make HTML files and a HTML help project"
+ @echo " qthelp to make HTML files and a qthelp project"
+ @echo " latex to make LaTeX files, you can set PAPER=a4 or PAPER=letter"
+ @echo " changes to make an overview of all changed/added/deprecated items"
+ @echo " linkcheck to check all external links for integrity"
+ @echo " doctest to run all doctests embedded in the documentation (if enabled)"
+
+clean:
+ -rm -rf build/*
+
+html:
+ $(SPHINXBUILD) -b html $(ALLSPHINXOPTS) build/html
+ @echo
+ @echo "Build finished. The HTML pages are in build/html."
+
+dirhtml:
+ $(SPHINXBUILD) -b dirhtml $(ALLSPHINXOPTS) build/dirhtml
+ @echo
+ @echo "Build finished. The HTML pages are in build/dirhtml."
+
+pickle:
+ $(SPHINXBUILD) -b pickle $(ALLSPHINXOPTS) build/pickle
+ @echo
+ @echo "Build finished; now you can process the pickle files."
+
+json:
+ $(SPHINXBUILD) -b json $(ALLSPHINXOPTS) build/json
+ @echo
+ @echo "Build finished; now you can process the JSON files."
+
+htmlhelp:
+ $(SPHINXBUILD) -b htmlhelp $(ALLSPHINXOPTS) build/htmlhelp
+ @echo
+ @echo "Build finished; now you can run HTML Help Workshop with the" \
+ ".hhp project file in build/htmlhelp."
+
+qthelp:
+ $(SPHINXBUILD) -b qthelp $(ALLSPHINXOPTS) build/qthelp
+ @echo
+ @echo "Build finished; now you can run "qcollectiongenerator" with the" \
+ ".qhcp project file in build/qthelp, like this:"
+ @echo "# qcollectiongenerator build/qthelp/FeinCMS.qhcp"
+ @echo "To view the help file:"
+ @echo "# assistant -collectionFile build/qthelp/FeinCMS.qhc"
+
+latex:
+ $(SPHINXBUILD) -b latex $(ALLSPHINXOPTS) build/latex
+ @echo
+ @echo "Build finished; the LaTeX files are in build/latex."
+ @echo "Run \`make all-pdf' or \`make all-ps' in that directory to" \
+ "run these through (pdf)latex."
+
+changes:
+ $(SPHINXBUILD) -b changes $(ALLSPHINXOPTS) build/changes
+ @echo
+ @echo "The overview file is in build/changes."
+
+linkcheck:
+ $(SPHINXBUILD) -b linkcheck $(ALLSPHINXOPTS) build/linkcheck
+ @echo
+ @echo "Link check complete; look for any errors in the above output " \
+ "or in build/linkcheck/output.txt."
+
+doctest:
+ $(SPHINXBUILD) -b doctest $(ALLSPHINXOPTS) build/doctest
+ @echo "Testing of doctests in the sources finished, look at the " \
+ "results in build/doctest/output.txt."
212 docs/conf.py
@@ -0,0 +1,212 @@
+# -*- coding: utf-8 -*-
+#
+# django cms documentation build configuration file, created by
+# sphinx-quickstart on Tue Sep 15 10:47:03 2009.
+#
+# This file is execfile()d with the current directory set to its containing
+# dir.
+#
+# Note that not all possible configuration values are present in this
+# autogenerated file.
+#
+# All configuration values have a default; values that are commented out serve
+# to show the default.
+
+import sys, os
+
+# If extensions (or modules to document with autodoc) are in another
+# directory, add these directories to sys.path here. If the directory is
+# relative to the documentation root, use os.path.abspath to make it absolute,
+# like shown here.
+
+sys.path.append(os.path.abspath('.'))
+sys.path.append(os.path.abspath('..'))
+sys.path.append(os.path.join(os.path.abspath('.'), '_ext'))
+
+# -- General configuration -----------------------------------------------------
+
+# Add any Sphinx extension module names here, as strings. They can be
+# extensions coming with Sphinx (named 'sphinx.ext.*') or your custom ones.
+#extensions = ['sphinx.ext.autodoc']
+
+extensions = ['filer_gallery', 'sphinx.ext.intersphinx']
+intersphinx_mapping = {
+ 'python': ('http://docs.python.org/2.6', None),
+ 'django': ('http://readthedocs.org/docs/django/en/latest/', None)
+}
+
+# Add any paths that contain templates here, relative to this directory.
+templates_path = ['templates']
+
+# The suffix of source filenames.
+source_suffix = '.rst'
+
+# The encoding of source files.
+source_encoding = 'utf-8'
+
+# The master toctree document.
+master_doc = 'index'
+
+# General information about the project.
+project = u'django-filer-gallery'
+copyright = u'2011, \xc3yvind Saltvik'
+
+# The version info for the project you're documenting, acts as replacement for
+# |version| and |release|, also used in various other places throughout the
+# built documents.
+#
+# The short X.Y version.
+
+path = os.path.split(os.path.dirname(__file__))[0]
+path = os.path.split(path)[0]
+sys.path.insert(0, path)
+import filer_gallery
+
+version = filer_gallery.get_version()
+# The full version, including alpha/beta/rc tags.
+release = filer_gallery.get_version()
+
+# The language for content autogenerated by Sphinx. Refer to documentation for
+# a list of supported languages.
+language = "en"
+
+# There are two options for replacing |today|: either, you set today to some
+# non-false value, then it is used:
+#today = ''
+# Else, today_fmt is used as the format for a strftime call.
+#today_fmt = '%B %d, %Y'
+
+# List of documents that shouldn't be included in the build.
+#unused_docs = []
+
+# List of directories, relative to source directory, that shouldn't be
+# searched for source files.
+exclude_trees = ['build']
+
+# The reST default role (used for this markup: `text`) to use for all
+# documents.
+#default_role = None
+
+# If true, '()' will be appended to :func: etc. cross-reference text.
+add_function_parentheses = True
+
+# If true, the current module name will be prepended to all description unit
+# titles (such as .. function::).
+#add_module_names = True
+
+# If true, sectionauthor and moduleauthor directives will be shown in the
+# output. They are ignored by default.
+#show_authors = False
+
+# The name of the Pygments (syntax highlighting) style to use.
+pygments_style = 'sphinx'
+
+# A list of ignored prefixes for module index sorting.
+#modindex_common_prefix = []
+
+
+# -- Options for HTML output ---------------------------------------------------
+
+# The theme to use for HTML and HTML Help pages. Major themes that come with
+# Sphinx are currently 'default' and 'sphinxdoc'.
+html_theme = 'default'
+
+# Theme options are theme-specific and customize the look and feel of a theme
+# further. For a list of options available for each theme, see the
+# documentation.
+#html_theme_options = {}
+
+# Add any paths that contain custom themes here, relative to this directory.
+#html_theme_path = []
+
+# The name for this set of Sphinx documents. If None, it defaults to
+# "<project> v<release> documentation".
+#html_title = None
+
+# A shorter title for the navigation bar. Default is the same as html_title.
+#html_short_title = None
+
+# The name of an image file (relative to this directory) to place at the top
+# of the sidebar.
+#html_logo = None
+
+# The name of an image file (within the static path) to use as favicon of the
+# docs. This file should be a Windows icon file (.ico) being 16x16 or 32x32
+# pixels large.
+#html_favicon = None
+
+# Add any paths that contain custom static files (such as style sheets) here,
+# relative to this directory. They are copied after the builtin static files,
+# so a file named "default.css" will overwrite the builtin "default.css".
+html_static_path = ['static']
+
+# If not '', a 'Last updated on:' timestamp is inserted at every page bottom,
+# using the given strftime format.
+#html_last_updated_fmt = '%b %d, %Y'
+
+# If true, SmartyPants will be used to convert quotes and dashes to
+# typographically correct entities.
+#html_use_smartypants = True
+
+# Custom sidebar templates, maps document names to template names.
+#html_sidebars = {}
+
+# Additional templates that should be rendered to pages, maps page names to
+# template names.
+#html_additional_pages = {}
+
+# If false, no module index is generated.
+#html_use_modindex = True
+
+# If false, no index is generated.
+#html_use_index = True
+
+# If true, the index is split into individual pages for each letter.
+#html_split_index = False
+
+# If true, links to the reST sources are added to the pages.
+#html_show_sourcelink = True
+
+# If true, an OpenSearch description file will be output, and all pages will
+# contain a <link> tag referring to it. The value of this option must be the
+# base URL from which the finished HTML is served.
+#html_use_opensearch = ''
+
+# If nonempty, this is the file name suffix for HTML files (e.g. ".xhtml").
+#html_file_suffix = ''
+
+# Output file base name for HTML help builder.
+htmlhelp_basename = 'filer_gallerydoc'
+
+
+# -- Options for LaTeX output --------------------------------------------------
+
+# The paper size ('letter' or 'a4').
+latex_paper_size = 'a4'
+
+# The font size ('10pt', '11pt' or '12pt').
+#latex_font_size = '10pt'
+
+# Grouping the document tree into LaTeX files. List of tuples
+# (source start file, target name, title, author, documentclass [howto/manual]).
+latex_documents = [
+ ('index', 'filer_gallery.tex', u'django-filer-gallery Documentation',
+ u'\xc3yvind Saltvik', 'manual'),
+]
+
+# The name of an image file (relative to this directory) to place at the top
+# of the title page.
+#latex_logo = None
+
+# For "manual" documents, if this is true, then toplevel headings are parts,
+# not chapters.
+#latex_use_parts = False
+
+# Additional stuff for the LaTeX preamble.
+#latex_preamble = ''
+
+# Documents to append as an appendix to all manuals.
+#latex_appendices = []
+
+# If false, no module index is generated.
+#latex_use_modindex = True
167 docs/contribution.rst
@@ -0,0 +1,167 @@
+##########################
+Contributing to django-filer-gallery
+##########################
+
+Like every open-source project, django-filer-gallery is always looking for motivated
+individuals to contribute to it's source code.
+However, to ensure the highest code quality and keep the repository nice and
+tidy, everybody has to follow a few rules (nothing major, I promise :) )
+
+*************
+In a nutshell
+*************
+
+Here's what the contribution process looks like, in a bullet-points fashion, and
+only for the stuff we host on GitHub:
+
+#. django-filer-gallery is hosted on `GitHub`_, at `fork`_
+#. The best method to contribute back is to create an account there, then fork
+ the app. You can use this fork as if it was your own project, and should
+ push your changes to it.
+#. When you feel your code is good enough for inclusion, "send a `pull
+ request`_", by using the nice GitHub web interface.
+
+
+*****************
+Contributing Code
+*****************
+
+Getting the source code
+=======================
+
+- Code *must* be tested. Your pull request should include unit-tests (that cover
+ the piece of code you're submitting, obviously)
+- Documentation should reflect your changes if relevant. There is nothing worse
+ than invalid documentation.
+- Usually, if unit tests are written, pass, and your change is relevant, then
+ it'll be merged.
+
+Since we're hosted on GitHub, django-filer-gallery uses `git`_ as a version control system.
+
+The `GitHub help`_ is very well written and will get you started on using git
+and GitHub in a jiffy. It is an invaluable resource for newbies and old timers
+alike.
+
+
+Syntax and conventions
+======================
+
+We try to conform to `PEP8`_ as much as possible. A few highlights:
+
+- Indentation should be exactly 4 spaces. Not 2, not 6, not 8. **4**. Also, tabs
+ are evil.
+- We try (loosely) to keep the line length at 79 characters. Generally the rule
+ is "it should look good in a terminal-base editor" (eg vim), but we try not be
+ [Godwin's law] about it.
+
+
+Process
+=======
+
+This is how you fix a bug or add a feature:
+
+#. `fork`_ on GitHub.
+#. Checkout your fork.
+#. Hack hack hack, test test test, commit commit commit, test again.
+#. Push to your fork.
+#. Open a pull request.
+
+
+Tests
+=====
+
+Having a wide and comprehensive library of unit-tests and integration tests is
+of exceeding importance. Contributing tests is widely regarded as a very
+prestigious contribution (you're making everybody's future work much easier by
+doing so). Good karma for you. Cookie points. Maybe even a beer if we meet in
+person :)
+
+Generally tests should be:
+
+- Unitary (as much as possible). I.E. should test as much as possible only one
+ function/method/class. That's the
+ very definition of unit tests. Integration tests are interesting too
+ obviously, but require more time to maintain since they have a higher
+ probability of breaking.
+- Short running. No hard numbers here, but if your one test doubles the time it
+ takes for everybody to run them, it's probably an indication that you're doing
+ it wrong.
+
+In a similar way to code, pull requests will be reviewed before pulling
+(obviously), and we encourage discussion via code review (everybody learns
+something this way) or IRC discussions.
+
+Running the tests
+-----------------
+
+To run the tests simply execute ``runtests.sh`` from your shell. To make sure
+you have the correct environment you should also provide the ``--rebuild-env``
+flag, but since that makes running the test suite slower, it's disabled by
+default. You can also see all flags using ``--help``.
+
+
+**************************
+Contributing Documentation
+**************************
+
+Perhaps considered "boring" by hard-core coders, documentation is sometimes even
+more important than code! This is what brings fresh blood to a project, and
+serves as a reference for old timers. On top of this, documentation is the one
+area where less technical people can help most - you just need to write a
+semi-decent English. People need to understand you. We don't care about style or
+correctness.
+
+Documentation should be:
+
+- We use `Sphinx`_/`restructuredText`_. So obviously this is the format you should
+ use :) File extensions should be .rst.
+- Written in English. We can discuss how it would bring more people to the
+ project to have a Klingon translation or anything, but that's a problem we
+ will ask ourselves when we already have a good documentation in English.
+- Accessible. You should assume the reader to be moderately familiar with
+ Python and Django, but not anything else. Link to documentation of libraries
+ you use, for example, even if they are "obvious" to you (South is the first
+ example that comes to mind - it's obvious to any Django programmer, but not to
+ any newbie at all).
+ A brief description of what it does is also welcome.
+
+Pulling of documentation is pretty fast and painless. Usually somebody goes over
+your text and merges it, since there are no "breaks" and that GitHub parses rst
+files automagically it's really convenient to work with.
+
+Also, contributing to the documentation will earn you great respect from the
+core developers. You get good karma just like a test contributor, but you get
+double cookie points. Seriously. You rock.
+
+Section style
+=============
+
+We use Python documentation conventions fo section marking:
+
+* ``#`` with overline, for parts
+* ``*`` with overline, for chapters
+* ``=``, for sections
+* ``-``, for subsections
+* ``^``, for subsubsections
+* ``"``, for paragraphs
+
+
+************
+Translations
+************
+
+For translators we have a `Transifex account
+<http://www.transifex.net/projects/p/django-filer-gallery/>`_ where you can translate
+the .po files and don't need to install git or mercurial to be able to
+contribute. All changes there will be automatically sent to the project.
+
+
+.. _fork: http://github.com/fivethreeo/django-filer-gallery.git
+.. _Sphinx: http://sphinx.pocoo.org/
+.. _PEP8: http://www.python.org/dev/peps/pep-0008/
+.. _GitHub : http://www.github.com
+.. _GitHub help : http://help.github.com
+.. _freenode : http://freenode.net/
+.. _pull request : http://help.github.com/send-pull-requests/
+.. _git : http://git-scm.com/
+.. _restructuredText: http://docutils.sourceforge.net/docs/ref/rst/introduction.html
38 docs/index.rst
@@ -0,0 +1,38 @@
+.. django-filer-gallery documentation master file, created by
+ sphinx-quickstart on Tue Sep 15 10:47:03 2009.
+ You can adapt this file completely to your liking, but it should at least
+ contain the root `toctree` directive.
+
+######################################
+Welcome to django-filer-gallery's documentation!
+######################################
+
+This document refers to version |release|
+
+***************
+Getting Started
+***************
+
+.. toctree::
+ :maxdepth: 2
+ :numbered:
+
+
+**************************************
+Contributing to django-filer-gallery
+**************************************
+
+.. toctree::
+ :maxdepth: 2
+ :numbered:
+
+ contribution
+
+
+
+Indices and tables
+==================
+
+* :ref:`genindex`
+* :ref:`modindex`
+* :ref:`search`
13 filer_gallery/__init__.py
@@ -0,0 +1,13 @@
+# -*- coding: utf-8 -*-
+VERSION = (1, 0, 0, 'alpha', 0)
+
+def get_version():
+ version = '%s.%s' % (VERSION[0], VERSION[1])
+ if VERSION[2]:
+ version = '%s.%s' % (version, VERSION[2])
+ if VERSION[3:] == ('alpha', 0):
+ version = '%s pre-alpha' % version
+ else:
+ if VERSION[3] != 'final':
+ version = '%s %s %s' % (version, VERSION[3], VERSION[4])
+ return version
3 filer_gallery/admin.py
@@ -0,0 +1,3 @@
+# -*- coding: utf-8 -*-
+from django.contrib import admin
+from filer_gallery.models import *
0 filer_gallery/locale/en/LC_MESSAGES/django.po
No changes.
0 filer_gallery/locale/en/LC_MESSAGES/djangojs.po
No changes.
1 filer_gallery/models.py
@@ -0,0 +1 @@
+# -*- coding: utf-8 -*-
1 filer_gallery/test/__init__.py
@@ -0,0 +1 @@
+# -*- coding: utf-8 -*-
67 filer_gallery/test/run_tests.py
@@ -0,0 +1,67 @@
+# -*- coding: utf-8 -*-
+import sys
+import django
+
+INSTALLED_APPS=[
+ 'filer_gallery.test.testapp',
+ 'django.contrib.auth',
+ 'django.contrib.contenttypes',
+ 'django.contrib.sessions',
+ 'django.contrib.admin',
+ 'django.contrib.sites',
+ 'filer_gallery'
+]
+
+MIDDLEWARE_CLASSES = [
+ 'django.contrib.sessions.middleware.SessionMiddleware',
+ 'django.middleware.common.CommonMiddleware',
+ 'django.contrib.auth.middleware.AuthenticationMiddleware',
+ 'django.middleware.doc.XViewMiddleware',
+ 'django.contrib.csrf.middleware.CsrfViewMiddleware'
+]
+
+TEMPLATE_CONTEXT_PROCESSORS = [
+ "django.core.context_processors.auth",
+ "django.core.context_processors.i18n",
+ "django.core.context_processors.debug",
+ "django.core.context_processors.request",
+ "django.core.context_processors.media"
+]
+
+if django.VERSION[1] < 3: # pragma: no cover
+ MIDDLEWARE_CLASSES.insert(6, 'cbv.middleware.DeferredRenderingMiddleware')
+ INSTALLED_APPS.append('staticfiles')
+ INSTALLED_APPS.append('cbv')
+ TEMPLATE_CONTEXT_PROCESSORS.append('staticfiles.context_processors.static')
+else:
+ INSTALLED_APPS.append('django.contrib.staticfiles')
+ TEMPLATE_CONTEXT_PROCESSORS.append('django.core.context_processors.static')
+
+def run_tests():
+
+ from django.conf import settings
+
+ settings.configure(
+ INSTALLED_APPS = INSTALLED_APPS,
+ MIDDLEWARE_CLASSES = MIDDLEWARE_CLASSES,
+ TEMPLATE_CONTEXT_PROCESSORS = TEMPLATE_CONTEXT_PROCESSORS,
+ DATABASES = {
+ 'default': {
+ 'ENGINE': 'django.db.backends.sqlite3',
+ 'NAME': 'filer_gallery_tests.db',
+ }
+ },
+ ROOT_URLCONF='filer_gallery.test.testapp.urls',
+ LANGUAGES=(('en', 'English'),('de','German'),('nb','Norwegian'),('nn','Norwegian Nynorsk')),
+ STATIC_URL='/some/url/',
+ TEST_RUNNER = 'xmlrunner.extra.djangotestrunner.XMLTestRunner',
+ TEST_OUTPUT_VERBOSE = True
+ )
+
+ from django.test.utils import get_runner
+
+ failures = get_runner(settings)().run_tests(['filer_gallery'])
+ sys.exit(failures)
+
+if __name__ == '__main__':
+ run_tests()
1 filer_gallery/test/testapp/__init__.py
@@ -0,0 +1 @@
+# -*- coding: utf-8 -*-
1 filer_gallery/test/testapp/models.py
@@ -0,0 +1 @@
+# -*- coding: utf-8 -*-
0 filer_gallery/test/testapp/templates/filer_gallery/filer_gallery_base.html
No changes.
10 filer_gallery/test/testapp/urls.py
@@ -0,0 +1,10 @@
+# -*- coding: utf-8 -*-
+from django.conf.urls.defaults import *
+from django.contrib import admin
+
+admin.autodiscover()
+
+urlpatterns = patterns('',
+ (r'^admin/', include(admin.site.urls)),
+ (r'^jsi18n/(?P<packages>\S+?)/$', 'django.views.i18n.javascript_catalog'),
+)
6 filer_gallery/urls.py
@@ -0,0 +1,6 @@
+# -*- coding: utf-8 -*-
+from django.conf.urls.defaults import *
+
+urlpatterns = patterns('',
+ (r'^$', '%(module).views.default'),
+)
2 filer_gallery/views.py
@@ -0,0 +1,2 @@
+# -*- coding: utf-8 -*-
+# -*- coding: utf-8 -*-
3 requirements-12.txt
@@ -0,0 +1,3 @@
+Django==1.2.5
+django-cbv
+django-staticfiles
1 requirements-13.txt
@@ -0,0 +1 @@
+Django==1.3
1 requirements-trunk.txt
@@ -0,0 +1 @@
+-e git+http://github.com/django/django.git#egg=Django
5 requirements.txt
@@ -0,0 +1,5 @@
+django-categories
+django-sekizai
+coverage
+unittest-xml-reporting==1.2
+Sphinx
99 runtests.sh
@@ -0,0 +1,99 @@
+#!/bin/bash
+
+find . -name '*.pyc' -delete
+
+args=("$@")
+num_args=${#args[@]}
+index=0
+
+django=12
+reuse_env=true
+disable_coverage=true
+update_requirements=false
+
+python="python" # to ensure this script works if no python option is specified
+while [ "$index" -lt "$num_args" ]
+do
+case "${args[$index]}" in
+ "-f"|"--failfast")
+ failfast="--failfast"
+ ;;
+
+ "-r"|"--rebuild-env")
+ reuse_env=false
+ ;;
+
+ "-u"|"--update-requirements")
+ update_requirements=true
+ ;;
+
+ "-d"|"--django")
+ let "index = $index + 1"
+ django="${args[$index]}"
+ ;;
+
+ "-p"|"--python")
+ let "index = $index + 1"
+ python="${args[$index]}"
+ ;;
+
+ "-c"|"--with-coverage")
+ disable_coverage=false
+ ;;
+
+ "-h"|"--help")
+ echo ""
+ echo "usage:"
+ echo " runtests.sh"
+ echo ""
+ echo "flags:"
+ echo " -r, --rebuild-env - delete virtualenv and rebuild virtualenv before the tests"
+ echo " -u, --update-requirements - update requirements before the tests"
+ echo " -d, --django <version> - run tests against a django version, options: 12, 13 or trunk"
+ echo " -c, --with-coverage - enables coverage"
+ echo " -p, --python /path/to/python - python version to use to run the tests"
+ echo " -h, --help - display this help"
+ exit 1
+ ;;
+ esac
+let "index = $index + 1"
+done
+
+python_executeable=`which $python`
+
+echo "using python at: $python_executeable"
+
+venv="venv-$python-$django"
+
+if [ $reuse_env == false ]; then
+ rm -rf $venv
+ echo "deleted virtualenv: $venv"
+fi
+
+if [ ! -d $venv ]; then
+ echo "building virtualenv"
+ virtualenv $venv --distribute -p $python_executeable
+ update_requirements=true
+else
+ echo "reusing current virualenv: $venv"
+fi
+
+if [ $update_requirements == true ]; then
+ echo "updating requirements"
+ $venv/bin/pip install -r requirements-$django.txt
+ $venv/bin/pip install -r requirements.txt
+fi
+
+if [ $disable_coverage == false ]; then
+ $venv/bin/coverage run --rcfile=coveragerc setup.py test
+ retcode=$?
+ echo "build coverage reports"
+
+ $venv/bin/coverage xml --rcfile=coveragerc
+ $venv/bin/coverage html --rcfile=coveragerc
+ $venv/bin/coverage report -m --rcfile=coveragerc
+else
+ $venv/bin/python setup.py test
+ retcode=$?
+fi
+exit $retcode
29 setup.py
@@ -0,0 +1,29 @@
+from setuptools import setup, find_packages
+import os
+import filer_gallery
+
+CLASSIFIERS=[
+ 'Development Status :: 4 - Beta',
+ 'Environment :: Web Environment',
+ 'Intended Audience :: Developers',
+ 'License :: OSI Approved :: BSD License',
+ 'Operating System :: OS Independent',
+ 'Programming Language :: Python',
+ 'Framework :: Django'
+]
+
+setup(
+ name='django-filer-gallery',
+ version=filer_gallery.get_version(),
+ description='A gallery using django-filer',
+ long_description=open(os.path.join(os.path.dirname(__file__), 'README.rst')).read(),
+ author='\xc3yvind Saltvik',
+ author_email='oyvind.saltvik@gmail.com',
+ url='http://github.com/fivethreeo/django-filer-gallery.git',
+ packages=find_packages(),
+ classifiers = CLASSIFIERS,
+ test_suite = "filer_gallery.test.run_tests.run_tests",
+ include_package_data=True,
+ zip_safe=False,
+ install_requires=[],
+)

0 comments on commit a3ce723

Please sign in to comment.