Skip to content

Commit 511a22c

Browse files
authored
Merge pull request #20 from divio/feature/cleanup
Code cleanup and features
2 parents 6a35288 + fc219d8 commit 511a22c

37 files changed

+743
-402
lines changed

.coveragerc

Lines changed: 18 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,18 @@
1+
[run]
2+
branch = True
3+
source = djangocms_file
4+
omit =
5+
migrations/*
6+
tests/*
7+
8+
[report]
9+
exclude_lines =
10+
pragma: no cover
11+
def __repr__
12+
if self.debug:
13+
if settings.DEBUG
14+
raise AssertionError
15+
raise NotImplementedError
16+
if 0:
17+
if __name__ == .__main__.:
18+
ignore_errors = True

.editorconfig

Lines changed: 31 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,31 @@
1+
# editorconfig.org
2+
3+
root = true
4+
5+
[*]
6+
indent_style = space
7+
indent_size = 4
8+
end_of_line = lf
9+
charset = utf-8
10+
trim_trailing_whitespace = true
11+
insert_final_newline = true
12+
max_line_length = 80
13+
14+
[*.py]
15+
max_line_length = 120
16+
quote_type = single
17+
18+
[*.{scss,js,html}]
19+
max_line_length = 120
20+
indent_style = space
21+
quote_type = double
22+
23+
[*.js]
24+
max_line_length = 120
25+
quote_type = single
26+
27+
[*.rst]
28+
max_line_length = 80
29+
30+
[*.yml]
31+
indent_size = 2

.gitignore

Lines changed: 7 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,8 @@
1-
*.log
2-
*.pot
31
*.pyc
4-
local_settings.py
5-
djangocms_file.egg-info
6-
.tox
7-
build
8-
dist
2+
*.egg-info
3+
.DS_Store
4+
.idea/
5+
.tox/
6+
.eggs/
7+
dist/
8+
build/

.travis.yml

Lines changed: 17 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -1,24 +1,27 @@
11
language: python
22

3-
# Use container based infrastructure
43
sudo: false
54

65
env:
7-
matrix:
8-
- TOXENV=flake8
9-
10-
cache:
11-
directories:
12-
- $HOME/.wheelhouse
6+
- TOX_ENV=flake8
7+
- TOX_ENV=py27-latest
8+
- TOX_ENV=py34-latest
9+
# Django 1.8
10+
- TOX_ENV=py34-dj18-cms33
11+
- TOX_ENV=py34-dj18-cms32
12+
- TOX_ENV=py27-dj18-cms33
13+
- TOX_ENV=py27-dj18-cms32
14+
# Django 1.9
15+
- TOX_ENV=py34-dj19-cms33
16+
- TOX_ENV=py34-dj19-cms32
17+
- TOX_ENV=py27-dj19-cms33
18+
- TOX_ENV=py27-dj19-cms32
1319

1420
install:
15-
- pip install tox
16-
- pip install coveralls
21+
- pip install tox coverage
1722

1823
script:
19-
- tox -e $TOXENV
20-
21-
after_success: coveralls
24+
- tox -e $TOX_ENV
2225

23-
notifications:
24-
webhooks: http://addons.us-iad-rs.aldryn.io/en/travis-endpoint/
26+
after_success:
27+
- bash <(curl -s https://codecov.io/bash)

.tx/config

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,10 +1,8 @@
1-
21
[main]
32
host = https://www.transifex.com
43

5-
[django-cms.djangocms-file]
4+
[djangocms-file.djangocms_file]
65
file_filter = djangocms_file/locale/<lang>/LC_MESSAGES/django.po
76
source_file = djangocms_file/locale/en/LC_MESSAGES/django.po
87
source_lang = en
98
type = PO
10-

CHANGELOG.rst

Lines changed: 18 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,18 @@
1+
=========
2+
Changelog
3+
=========
4+
5+
6+
2.0.0 (unreleased)
7+
==================
8+
9+
* Added tests
10+
* Cleaned up file structure
11+
* Removed Django < 1.8 support
12+
* Adapted ``README.txt``
13+
14+
15+
1.0.0 (2016-03-04)
16+
==================
17+
18+
* Use this version for Django < 1.8 support

LICENSE.txt

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -8,17 +8,17 @@ modification, are permitted provided that the following conditions are met:
88
* Redistributions in binary form must reproduce the above copyright
99
notice, this list of conditions and the following disclaimer in the
1010
documentation and/or other materials provided with the distribution.
11-
* Neither the name of Djeese Factory GmbH nor the
11+
* Neither the name of Divio AG nor the
1212
names of its contributors may be used to endorse or promote products
1313
derived from this software without specific prior written permission.
1414

1515
THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND
1616
ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED
1717
WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
18-
DISCLAIMED. IN NO EVENT SHALL DJEESE FACTORY GMBH BE LIABLE FOR ANY
18+
DISCLAIMED. IN NO EVENT SHALL DIVIO AG BE LIABLE FOR ANY
1919
DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES
2020
(INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES;
2121
LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND
2222
ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
2323
(INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS
24-
SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
24+
SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.

MANIFEST.in

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,4 +2,4 @@ include LICENSE.txt
22
include README.rst
33
recursive-include djangocms_file/locale *
44
recursive-include djangocms_file/templates *
5-
recursive-exclude * *.py[co]
5+
recursive-exclude * *.pyc

README.rst

Lines changed: 81 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -1,25 +1,92 @@
1-
djangocms-file
2-
==============
1+
===============
2+
django CMS File
3+
===============
34

4-
A file plugin for django CMS.
5+
6+
|pypi| |build| |coverage|
7+
8+
**django CMS File** is a set of plugins for `django CMS <http://django-cms.org>`_
9+
that allow you to add files to your site You can either choose a single file or
10+
an entire folder.
11+
12+
It uses files managed by `Django Filer <https://github.com/divio/django-filer>`_.
13+
14+
This addon is compatible with `Aldryn <http://aldryn.com>`_ and is also available on the
15+
`django CMS Marketplace <https://marketplace.django-cms.org/en/addons/browse/djangocms-file/>`_
16+
for easy installation.
17+
18+
.. image:: preview.gif
19+
20+
21+
Contributing
22+
============
23+
24+
This is a an open-source project. We'll be delighted to receive your
25+
feedback in the form of issues and pull requests. Before submitting your
26+
pull request, please review our `contribution guidelines
27+
<http://docs.django-cms.org/en/latest/contributing/index.html>`_.
28+
29+
One of the easiest contributions you can make is helping to translate this addon on
30+
`Transifex <https://www.transifex.com/projects/p/djangocms-file/>`_.
31+
32+
33+
Documentation
34+
=============
35+
36+
See ``REQUIREMENTS`` in the `setup.py <https://github.com/divio/djangocms-file/blob/master/setup.py>`_
37+
file for additional dependencies:
38+
39+
* Python 2.7, 3.3 or higher
40+
* Django 1.8 or higher
41+
42+
Make sure `django Filer <http://django-filer.readthedocs.io/en/latest/installation.html>`_
43+
is installed and configured appropriately.
544

645

746
Installation
847
------------
948

10-
This plugin requires `django CMS` 3.0 or higher to be properly installed.
49+
For a manual install:
1150

12-
* In your projects `virtualenv`, run ``pip install djangocms-file``.
13-
* Add ``'djangocms_file'`` to your ``INSTALLED_APPS`` setting.
14-
* If using Django 1.6 and South < 1.0.2 add ``'djangocms_file': 'djangocms_file.south_migrations',``
15-
to ``SOUTH_MIGRATION_MODULES`` (or define ``SOUTH_MIGRATION_MODULES`` if it
16-
does not exists);
17-
* Run ``manage.py migrate djangocms_file``.
51+
* run ``pip install djangocms-file``
52+
* add ``djangocms_file`` to your ``INSTALLED_APPS``
53+
* run ``python manage.py migrate djangocms_file``
1854

1955

20-
Translations
21-
------------
56+
Configuration
57+
-------------
58+
59+
Note that the provided templates are very minimal by design. You are encouraged
60+
to adapt and override them to your project's requirements.
61+
62+
This addon provides a ``default`` template for all instances. You can provide
63+
additional template choices by adding a ``DJANGOCMS_FILE_TEMPLATES``
64+
setting::
65+
66+
DJANGOCMS_FILE_TEMPLATES = [
67+
('feature', _('Featured Version')),
68+
]
69+
70+
You'll need to create the `feature` folder inside ``templates/djangocms_file/``
71+
otherwise you will get a *template does not exist* error. You can do this by
72+
copying the ``default`` folder inside that directory and renaming it to
73+
``feature``.
74+
75+
76+
Running Tests
77+
-------------
78+
79+
You can run tests by executing::
80+
81+
virtualenv env
82+
source env/bin/activate
83+
pip install -r tests/requirements.txt
84+
python setup.py test
2285

23-
If you want to help translate the plugin please do it on transifex:
2486

25-
https://www.transifex.com/projects/p/django-cms/resource/djangocms-file/
87+
.. |pypi| image:: https://badge.fury.io/py/djangocms-file.svg
88+
:target: http://badge.fury.io/py/djangocms-file
89+
.. |build| image:: https://travis-ci.org/divio/djangocms-file.svg?branch=master
90+
:target: https://travis-ci.org/divio/djangocms-file
91+
.. |coverage| image:: https://codecov.io/gh/divio/djangocms-file/branch/master/graph/badge.svg
92+
:target: https://codecov.io/gh/divio/djangocms-file

addon.json

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,6 @@
1+
{
2+
"package-name": "djangocms-file",
3+
"installed-apps": [
4+
"djangocms_file"
5+
]
6+
}

0 commit comments

Comments
 (0)