Skip to content

Commit

Permalink
Merge pull request #18 from raiderrobert/develop
Browse files Browse the repository at this point in the history
Bringing everything up to date for pypi
  • Loading branch information
raiderrobert committed Jan 28, 2016
2 parents 75d169d + 5e59a0e commit a911945
Show file tree
Hide file tree
Showing 6 changed files with 50 additions and 27 deletions.
27 changes: 21 additions & 6 deletions .gitignore
Original file line number Diff line number Diff line change
@@ -1,7 +1,22 @@
*.pyc
*.py[co]

# Packages
*.egg
*.egg-info
dist
build
eggs
parts
bin
var
sdist
develop-eggs
.installed.cfg
_build

# pycharm files
.idea/

# Unit test / coverage reports
.coverage
htmlcov
dist/
*.egg-info/
.tox/
.idea/
.tox
2 changes: 2 additions & 0 deletions MANIFEST.in
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
# Include the license file
include LICENSE.txt
4 changes: 4 additions & 0 deletions multiurl.py
Original file line number Diff line number Diff line change
Expand Up @@ -2,13 +2,16 @@

from django.core import urlresolvers


class ContinueResolving(Exception):
pass


def multiurl(*urls, **kwargs):
exceptions = kwargs.get('catch', (ContinueResolving,))
return MultiRegexURLResolver(urls, exceptions)


class MultiRegexURLResolver(urlresolvers.RegexURLResolver):
def __init__(self, urls, exceptions):
super(MultiRegexURLResolver, self).__init__('', None)
Expand Down Expand Up @@ -40,6 +43,7 @@ def resolve(self, path):
return MultiResolverMatch(matched, self._exceptions, patterns_matched, path)
raise urlresolvers.Resolver404({'tried': tried, 'path': path})


class MultiResolverMatch(object):
def __init__(self, matches, exceptions, patterns_matched, path):
self.matches = matches
Expand Down
5 changes: 5 additions & 0 deletions setup.cfg
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
[metadata]
description-file = README.rst

[bdist_wheel]
universal=1
34 changes: 14 additions & 20 deletions setup.py
Original file line number Diff line number Diff line change
@@ -1,24 +1,18 @@
import os
from setuptools import setup

def read(fname):
return open(os.path.join(os.path.dirname(__file__), fname)).read()
from setuptools import setup, find_packages

setup(
name = 'django-multiurl',
version = '1.1.0',
description = 'Allow multiple views to match the same URL.',
license = 'BSD',
long_description = read('README.rst'),
url = 'https://github.com/jacobian/django-multiurl',

author = 'Jacob Kaplan-Moss and Robert Roskam',
author_email = '[email protected]',

py_modules = ['multiurl'],
install_requires = ['django>=1.5'],

classifiers = (
name='django-multiurl',
py_modules=['multiurl'],
version='1.1.0',
description='Allow multiple views to match the same URL.',
license='BSD',
url='https://github.com/raiderrobert/django-multiurl',
download_url='https://github.com/raiderrobert/django-multiurl/tarball/v1.1.0',
author='Jacob Kaplan-Moss and Robert Roskam',
author_email='[email protected]',
install_requires=['django>=1.5'],
keywords='django urls',
classifiers=[
'Development Status :: 4 - Beta',
'Environment :: Web Environment',
'Framework :: Django',
Expand All @@ -29,5 +23,5 @@ def read(fname):
'Programming Language :: Python :: 2.7',
'Programming Language :: Python :: 3.2',
'Programming Language :: Python :: 3.3',
),
],
)
5 changes: 4 additions & 1 deletion tests.py
Original file line number Diff line number Diff line change
@@ -1,12 +1,15 @@
from __future__ import unicode_literals

import unittest

from django.conf import settings
from django.conf.urls import url
from django.core.urlresolvers import RegexURLResolver, Resolver404, NoReverseMatch
from django.http import HttpResponse
import unittest

from multiurl import multiurl, ContinueResolving


class MultiviewTests(unittest.TestCase):
def setUp(self):
# Patterns with a "catch all" view (thing) at the end.
Expand Down

0 comments on commit a911945

Please sign in to comment.