Skip to content

Commit 5d1fd56

Browse files
committed
Merge branch 'upstream'
2 parents df91144 + 8656067 commit 5d1fd56

21 files changed

+749
-225
lines changed

.moban.d/LICENSE

Lines changed: 31 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,31 @@
1+
Copyright (c) {{copyright_year}} by {{company}} and its contributors
2+
All rights reserved.
3+
4+
Redistribution and use in source and binary forms of the software as well
5+
as documentation, with or without modification, are permitted provided
6+
that the following conditions are met:
7+
8+
* Redistributions of source code must retain the above copyright
9+
notice, this list of conditions and the following disclaimer.
10+
11+
* Redistributions in binary form must reproduce the above
12+
copyright notice, this list of conditions and the following
13+
disclaimer in the documentation and/or other materials provided
14+
with the distribution.
15+
16+
* The names of the contributors may not be used to endorse or
17+
promote products derived from this software without specific
18+
prior written permission.
19+
20+
THIS SOFTWARE AND DOCUMENTATION IS PROVIDED BY THE COPYRIGHT HOLDERS AND
21+
CONTRIBUTORS "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT
22+
NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
23+
A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER
24+
OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL,
25+
EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO,
26+
PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR
27+
PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF
28+
LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING
29+
NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS
30+
SOFTWARE AND DOCUMENTATION, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH
31+
DAMAGE.

.moban.d/README.rst

Lines changed: 64 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,64 @@
1+
{%extends 'WEB-README.rst.jj2' %}
2+
3+
{%block header %}
4+
Tested Django Versions
5+
========================
6+
7+
.. image:: https://img.shields.io/badge/django-1.9-green.svg
8+
:target: http://travis-ci.org/pyexcel/django-excel
9+
10+
.. image:: https://img.shields.io/badge/django-1.8.2-green.svg
11+
:target: http://travis-ci.org/pyexcel/django-excel
12+
13+
.. image:: https://img.shields.io/badge/django-1.7.8-green.svg
14+
:target: http://travis-ci.org/pyexcel/django-excel
15+
{%endblock%}
16+
17+
{%block setup%}
18+
Setup
19+
======
20+
21+
You will need to update your *settings.py*:
22+
23+
.. code-block:: python
24+
25+
FILE_UPLOAD_HANDLERS = ("django_excel.ExcelMemoryFileUploadHandler",
26+
"django_excel.TemporaryExcelFileUploadHandler")
27+
28+
{%endblock%}
29+
30+
31+
{% block usage %}
32+
Usage
33+
=========
34+
Here is the example viewing function codes:
35+
36+
.. code-block:: python
37+
38+
from django.shortcuts import render_to_response
39+
from django.http import HttpResponseBadRequest
40+
from django import forms
41+
from django.template import RequestContext
42+
import django_excel as excel
43+
44+
class UploadFileForm(forms.Form):
45+
file = forms.FileField()
46+
47+
def upload(request):
48+
if request.method == "POST":
49+
form = UploadFileForm(request.POST, request.FILES)
50+
if form.is_valid():
51+
filehandle = request.FILES['file']
52+
return excel.make_response(filehandle.get_sheet(), "csv")
53+
else:
54+
return HttpResponseBadRequest()
55+
else:
56+
form = UploadFileForm()
57+
return render_to_response('upload_form.html',
58+
{'form': form},
59+
context_instance=RequestContext(request))
60+
61+
def download(request):
62+
sheet = excel.pe.Sheet([[1, 2],[3, 4]])
63+
return excel.make_response(sheet, "csv")
64+
{% endblock %}

.moban.d/docs/source/conf.py

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
{% extends 'docs/source/conf.py.jj2' %}

.moban.d/docs/source/index.rst.jj2

Lines changed: 431 additions & 0 deletions
Large diffs are not rendered by default.

.moban.d/requirements.txt

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,3 @@
1+
{% for dependency in dependencies: %}
2+
{{dependency}}
3+
{% endfor %}

.moban.d/setup.py

Lines changed: 23 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,23 @@
1+
{% extends 'setup.py.jj2' %}
2+
{%block extras %}
3+
{%endblock %}
4+
{%block additional_keywords%}
5+
'API',
6+
'Django'
7+
{%endblock%}
8+
9+
{%block additional_classifers%}
10+
'Development Status :: 3 - Alpha',
11+
'Environment :: Web Environment',
12+
'Topic :: Internet :: WWW/HTTP',
13+
'Topic :: Software Development :: Libraries :: Python Modules',
14+
'Framework :: Django :: 1.7',
15+
'Framework :: Django :: 1.8',
16+
'Framework :: Django :: 1.9',
17+
'Programming Language :: Python :: 2',
18+
'Programming Language :: Python :: 2.7',
19+
'Programming Language :: Python :: 3',
20+
'Programming Language :: Python :: 3.3',
21+
'Programming Language :: Python :: 3.4',
22+
'Programming Language :: Python :: 3.5'
23+
{%endblock%}

.moban.d/tests/requirements.txt

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,7 @@
1+
{% extends 'tests/requirements.txt.jj2' %}
2+
{%block extras %}
3+
lxml
4+
pyexcel-ods3>=0.1.0
5+
pyexcel-xls>=0.1.0
6+
pyexcel-xlsx>=0.1.0
7+
{%endblock%}

.moban.d/travis.yml

Lines changed: 25 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,25 @@
1+
{% extends "travis.yml.jj2" %}
2+
{%block test_other_environments%}
3+
- DJANGO_VERSION=1.7.8
4+
- DJANGO_VERSION=1.8.2
5+
- DJANGO_VERSION=1.9
6+
{%endblock%}
7+
8+
{%block exclusion_matrix%}
9+
matrix:
10+
exclude:
11+
- python: 3.3
12+
env: DJANGO_VERSION=1.9
13+
- python: 3.5
14+
env: DJANGO_VERSION=1.7.8
15+
- python: 3.5
16+
env: DJANGO_VERSION=1.8.2
17+
{%endblock%}
18+
19+
{%block test_other_python_versions%} - 3.3
20+
- 3.4
21+
- 3.5
22+
{%endblock%}
23+
24+
{% block custom_install %} - pip install Django==$DJANGO_VERSION
25+
{% endblock%}

.travis.yml

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -20,10 +20,11 @@ matrix:
2020
- python: 3.5
2121
env: DJANGO_VERSION=1.8.2
2222
install:
23+
- rm applymoban.py
2324
- pip install Django==$DJANGO_VERSION
2425
- pip install -r requirements.txt
25-
- pip install -r test_requirements.txt
26+
- pip install -r tests/requirements.txt
2627
script:
2728
make test
2829
after_success:
29-
codecov
30+
codecov

LICENSE

Lines changed: 19 additions & 17 deletions
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,9 @@
1-
Copyright (c) 2015, Onni Software Ltd.
1+
Copyright (c) 2015-2016 by Onni Software Ltd. and its contributors
22
All rights reserved.
33

4-
Redistribution and use in source and binary forms, with or without
5-
modification, are permitted provided that the following conditions are met:
4+
Redistribution and use in source and binary forms of the software as well
5+
as documentation, with or without modification, are permitted provided
6+
that the following conditions are met:
67

78
* Redistributions of source code must retain the above copyright notice, this
89
list of conditions and the following disclaimer.
@@ -11,18 +12,19 @@ modification, are permitted provided that the following conditions are met:
1112
this list of conditions and the following disclaimer in the documentation
1213
and/or other materials provided with the distribution.
1314

14-
* Neither the name of Flask-Excel nor the names of its
15-
contributors may be used to endorse or promote products derived from
16-
this software without specific prior written permission.
17-
18-
THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
19-
AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
20-
IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
21-
DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE
22-
FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
23-
DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR
24-
SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER
25-
CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY,
26-
OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
27-
OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
15+
* Neither the name of 'django-excel' nor the names of the contributors
16+
may not be used to endorse or promote products derived from this software
17+
without specific prior written permission.
2818

19+
THIS SOFTWARE AND DOCUMENTATION IS PROVIDED BY THE COPYRIGHT HOLDERS AND
20+
CONTRIBUTORS "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT
21+
NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
22+
A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER
23+
OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL,
24+
EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO,
25+
PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR
26+
PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF
27+
LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING
28+
NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS
29+
SOFTWARE AND DOCUMENTATION, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH
30+
DAMAGE.

0 commit comments

Comments
 (0)