Skip to content

Commit 07a9da2

Browse files
authored
Addon code alignments (#39)
* code alignments * isort adaptions * add unicode_literals import * adapted tox file
1 parent 3dee6bb commit 07a9da2

17 files changed

+148
-49
lines changed

.gitignore

Lines changed: 21 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,26 @@
1-
*.pyc
1+
*.py[cod]
2+
*$py.class
23
*.egg-info
4+
*.log
5+
*.pot
36
.DS_Store
7+
.coverage/
8+
.eggs/
49
.idea/
10+
.project/
11+
.pydevproject/
12+
.settings/
513
.tox/
6-
.eggs/
7-
dist/
14+
__pycache__/
815
build/
16+
dist/
17+
env/
18+
19+
/~
20+
/node_modules
21+
.sass-cache
22+
*.css.map
23+
npm-debug.log
24+
package-lock.json
25+
26+
local.sqlite

.travis.yml

Lines changed: 8 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -6,24 +6,28 @@ matrix:
66
include:
77
- python: 3.5
88
env: TOX_ENV='flake8'
9-
# Django 1.11
9+
- python: 3.5
10+
env: TOX_ENV='isort'
11+
# Django 1.11
1012
- python: 2.7
1113
env: DJANGO='dj111' CMS='cms34'
12-
- python: 3.5
14+
- python: 3.4
1315
env: DJANGO='dj111' CMS='cms35'
1416
- python: 3.5
1517
env: DJANGO='dj111' CMS='cms36'
1618
# Django 2.0
1719
- python: 3.5
1820
env: DJANGO='dj20' CMS='cms36'
1921
# Django 2.1
20-
- python: 3.5
22+
- python: 3.6
2123
env: DJANGO='dj21' CMS='cms36'
2224

2325
install:
24-
- pip install tox coverage
26+
- pip install coverage isort tox
2527
- "if [[ $TRAVIS_PYTHON_VERSION == '2.7' ]]; then export PY_VER=py27; fi"
28+
- "if [[ $TRAVIS_PYTHON_VERSION == '3.4' ]]; then export PY_VER=py34; fi"
2629
- "if [[ $TRAVIS_PYTHON_VERSION == '3.5' ]]; then export PY_VER=py35; fi"
30+
- "if [[ $TRAVIS_PYTHON_VERSION == '3.6' ]]; then export PY_VER=py36; fi"
2731
- "if [[ ${DJANGO}z != 'z' ]]; then export TOX_ENV=$PY_VER-$DJANGO-$CMS; fi"
2832

2933
script:

CHANGELOG.rst

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -2,6 +2,15 @@
22
Changelog
33
=========
44

5+
6+
2.2.1 (unreleased)
7+
==================
8+
9+
* Extended test matrix
10+
* Added isort and adapted imports
11+
* Adapted code base to align with other supported addons
12+
13+
514
2.2.0 (2018-12-12)
615
==================
716

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 * *.pyc
5+
recursive-exclude * *.py[co]

README.rst

Lines changed: 15 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,6 @@
22
django CMS File
33
===============
44

5-
65
|pypi| |build| |coverage|
76

87
**django CMS File** is a set of plugins for `django CMS <http://django-cms.org>`_
@@ -26,6 +25,10 @@ feedback in the form of issues and pull requests. Before submitting your
2625
pull request, please review our `contribution guidelines
2726
<http://docs.django-cms.org/en/latest/contributing/index.html>`_.
2827

28+
We're grateful to all contributors who have helped create and maintain this package.
29+
Contributors are listed at the `contributors <https://github.com/divio/djangocms-file/graphs/contributors>`_
30+
section.
31+
2932
One of the easiest contributions you can make is helping to translate this addon on
3033
`Transifex <https://www.transifex.com/projects/p/djangocms-file/>`_.
3134

@@ -36,8 +39,8 @@ Documentation
3639
See ``REQUIREMENTS`` in the `setup.py <https://github.com/divio/djangocms-file/blob/master/setup.py>`_
3740
file for additional dependencies:
3841

39-
* Python 2.7, 3.4 or higher
40-
* Django 1.11 or higher
42+
|python| |django| |djangocms|
43+
4144
* Django Filer 1.2.4 or higher
4245

4346
Make sure `django Filer <http://django-filer.readthedocs.io/en/latest/installation.html>`_
@@ -62,9 +65,7 @@ to adapt and override them to your project's requirements.
6265

6366
This addon provides a ``default`` template for all instances. You can provide
6467
additional template choices by adding a ``DJANGOCMS_FILE_TEMPLATES``
65-
setting:
66-
67-
.. code-block:: python
68+
setting::
6869

6970
DJANGOCMS_FILE_TEMPLATES = [
7071
('feature', _('Featured Version')),
@@ -79,9 +80,7 @@ copying the ``default`` folder inside that directory and renaming it to
7980
Running Tests
8081
-------------
8182

82-
You can run tests by executing:
83-
84-
.. code-block:: bash
83+
You can run tests by executing::
8584

8685
virtualenv env
8786
source env/bin/activate
@@ -95,3 +94,10 @@ You can run tests by executing:
9594
:target: https://travis-ci.org/divio/djangocms-file
9695
.. |coverage| image:: https://codecov.io/gh/divio/djangocms-file/branch/master/graph/badge.svg
9796
:target: https://codecov.io/gh/divio/djangocms-file
97+
98+
.. |python| image:: https://img.shields.io/badge/python-2.7%20%7C%203.4+-blue.svg
99+
:target: https://pypi.org/project/djangocms-file/
100+
.. |django| image:: https://img.shields.io/badge/django-1.11%20%7C%202.0%20%7C%202.1-blue.svg
101+
:target: https://www.djangoproject.com/
102+
.. |djangocms| image:: https://img.shields.io/badge/django%20CMS-3.4%2B-blue.svg
103+
:target: https://www.django-cms.org/

djangocms_file/cms_plugins.py

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,8 @@
11
# -*- coding: utf-8 -*-
2+
from django.utils.translation import ugettext_lazy as _
3+
24
from cms.plugin_base import CMSPluginBase
35
from cms.plugin_pool import plugin_pool
4-
from django.utils.translation import ugettext_lazy as _
56

67
from .models import File, Folder
78

djangocms_file/migrations/0001_initial.py

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,10 +1,11 @@
11
# -*- coding: utf-8 -*-
22
from __future__ import unicode_literals
33

4-
import cms.models.pluginmodel
54
import django.db.models.deletion
65
from django.db import migrations, models
76

7+
import cms.models.pluginmodel
8+
89

910
class Migration(migrations.Migration):
1011

djangocms_file/migrations/0006_migrate_to_filer.py

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,9 +2,10 @@
22
from __future__ import unicode_literals
33

44
import django.db.models.deletion
5-
import filer.fields.file
65
from django.db import migrations, models
76

7+
import filer.fields.file
8+
89

910
def migrate_to_filer(apps, schema_editor):
1011
# Because filer is polymorphic, Djangos migration can't handle

djangocms_file/migrations/0007_adapted_fields.py

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,9 +2,10 @@
22
from __future__ import unicode_literals
33

44
import django.db.models.deletion
5+
from django.db import migrations, models
6+
57
import djangocms_attributes_field.fields
68
import filer.fields.file
7-
from django.db import migrations, models
89

910
from djangocms_file.models import get_templates
1011

djangocms_file/migrations/0008_add_folder.py

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,9 +2,10 @@
22
from __future__ import unicode_literals
33

44
import django.db.models.deletion
5+
from django.db import migrations, models
6+
57
import djangocms_attributes_field.fields
68
import filer.fields.folder
7-
from django.db import migrations, models
89

910
from djangocms_file.models import get_templates
1011

0 commit comments

Comments
 (0)