Skip to content
This repository was archived by the owner on Oct 6, 2020. It is now read-only.

Commit 491913a

Browse files
committed
Merge pull request johnsensible#28 from NotSqrt/master
2 parents b99f963 + 31ceca3 commit 491913a

File tree

11 files changed

+57
-38
lines changed

11 files changed

+57
-38
lines changed

.gitignore

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -9,3 +9,4 @@
99
/lib
1010
/build
1111
.Python
12+
.tox

examples/protected_downloads/download/tests.py

Lines changed: 0 additions & 16 deletions
This file was deleted.

examples/protected_downloads/example/__init__.py

Whitespace-only changes.

examples/protected_downloads/settings.py renamed to examples/protected_downloads/example/settings.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -67,7 +67,7 @@
6767
'django.contrib.auth.middleware.AuthenticationMiddleware',
6868
)
6969

70-
ROOT_URLCONF = 'protected_downloads.urls'
70+
ROOT_URLCONF = 'example.urls'
7171

7272
TEMPLATE_DIRS = (
7373
os.path.join(PROJECT_ROOT, 'templates'),
Lines changed: 6 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -1,14 +1,10 @@
11
#!/usr/bin/env python
2+
import os
3+
import sys
24

3-
from __future__ import absolute_import
5+
if __name__ == "__main__":
6+
os.environ.setdefault("DJANGO_SETTINGS_MODULE", "example.settings")
47

5-
from django.core.management import execute_manager
6-
try:
7-
from . import settings # Assumed to be in the same directory.
8-
except ImportError:
9-
import sys
10-
sys.stderr.write("Error: Can't find the file 'settings.py' in the directory containing %r. It appears you've customized things.\nYou'll have to run django-admin.py, passing it your settings module.\n(If the file settings.py does indeed exist, it's causing an ImportError somehow.)\n" % __file__)
11-
sys.exit(1)
8+
from django.core.management import execute_from_command_line
129

13-
if __name__ == "__main__":
14-
execute_manager(settings)
10+
execute_from_command_line(sys.argv)

examples/protected_downloads/sendfile

Lines changed: 0 additions & 1 deletion
This file was deleted.

sendfile/tests.py

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,7 @@
11
# coding=utf-8
22

3+
from __future__ import unicode_literals
4+
35
from django.conf import settings
46
from django.test import TestCase
57
from django.http import HttpResponse, Http404, HttpRequest
@@ -107,7 +109,7 @@ def test_correct_file_in_xsendfile_header(self):
107109
self.assertEqual(filepath, response['X-Sendfile'])
108110

109111
def test_xsendfile_header_containing_unicode(self):
110-
filepath = self.ensure_file(u'péter_là_gueule.txt')
112+
filepath = self.ensure_file('péter_là_gueule.txt')
111113
response = real_sendfile(HttpRequest(), filepath)
112114
self.assertTrue(response is not None)
113115
self.assertEqual(smart_str(filepath), response['X-Sendfile'])
@@ -129,7 +131,7 @@ def test_correct_url_in_xaccelredirect_header(self):
129131
self.assertEqual('/private/readme.txt', response['X-Accel-Redirect'])
130132

131133
def test_xaccelredirect_header_containing_unicode(self):
132-
filepath = self.ensure_file(u'péter_là_gueule.txt')
134+
filepath = self.ensure_file('péter_là_gueule.txt')
133135
response = real_sendfile(HttpRequest(), filepath)
134136
self.assertTrue(response is not None)
135137
self.assertEqual(u'/private/péter_là_gueule.txt'.encode('utf-8'), unquote(response['X-Accel-Redirect']))

setup.cfg

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,3 @@
1+
[wheel]
2+
# create "py2.py3-none-any.whl" package
3+
universal = 1

setup.py

Lines changed: 6 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -1,9 +1,4 @@
1-
from distutils.core import setup
2-
3-
try:
4-
from distutils.command.build_py import build_py_2to3 as build_py
5-
except ImportError:
6-
from distutils.command.build_py import build_py
1+
from setuptools import setup
72

83

94
version = __import__('sendfile').__version__
@@ -40,8 +35,11 @@
4035
'License :: OSI Approved :: BSD License',
4136
'Operating System :: OS Independent',
4237
'Programming Language :: Python',
38+
'Programming Language :: Python :: 2.6',
39+
'Programming Language :: Python :: 2.7',
40+
'Programming Language :: Python :: 3.2',
41+
'Programming Language :: Python :: 3.3',
42+
'Programming Language :: Python :: 3.4',
4343
'Topic :: Software Development :: Libraries :: Python Modules',
4444
],
45-
46-
cmdclass={'build_py': build_py},
4745
)

0 commit comments

Comments
 (0)