Skip to content
GitLab
Menu
Projects
Groups
Snippets
Loading...
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
Menu
Open sidebar
Websites UFRPE
Wagtail Videos
Commits
79a7a588
Commit
79a7a588
authored
Jul 28, 2016
by
Seb
Browse files
Made plugin python 2 compatible
parent
98086fc0
Changes
30
Hide whitespace changes
Inline
Side-by-side
.travis.yml
View file @
79a7a588
...
@@ -3,6 +3,7 @@ cache: pip
...
@@ -3,6 +3,7 @@ cache: pip
# Matrix of build options
# Matrix of build options
python
:
python
:
-
'
2.7'
-
'
3.4'
-
'
3.4'
-
'
3.5'
-
'
3.5'
...
...
setup.py
View file @
79a7a588
...
@@ -36,6 +36,11 @@ setup(
...
@@ -36,6 +36,11 @@ setup(
'Intended Audience :: Developers'
,
'Intended Audience :: Developers'
,
'Operating System :: OS Independent'
,
'Operating System :: OS Independent'
,
'Programming Language :: Python'
,
'Programming Language :: Python'
,
'Programming Language :: Python :: 2'
,
'Programming Language :: Python :: 2.7'
,
'Programming Language :: Python :: 3'
,
'Programming Language :: Python :: 3.4'
,
'Programming Language :: Python :: 3.5'
,
'Framework :: Django'
,
'Framework :: Django'
,
'License :: OSI Approved :: BSD License'
,
'License :: OSI Approved :: BSD License'
,
],
],
...
...
tests/app/models.py
View file @
79a7a588
from
__future__
import
unicode_literals
from
django.db
import
models
from
django.db
import
models
from
wagtail.wagtailcore.models
import
Page
from
wagtail.wagtailcore.models
import
Page
from
wagtailvideos.edit_handlers
import
VideoChooserPanel
from
wagtailvideos.edit_handlers
import
VideoChooserPanel
...
...
tests/app/settings.py
View file @
79a7a588
from
__future__
import
unicode_literals
import
os
import
os
INSTALLED_APPS
=
[
INSTALLED_APPS
=
[
...
...
tests/app/urls.py
View file @
79a7a588
from
__future__
import
unicode_literals
import
re
import
re
from
django.conf
import
settings
from
django.conf
import
settings
...
...
tests/test_admin_views.py
View file @
79a7a588
from
__future__
import
unicode_literals
import
json
import
json
from
django.contrib.auth
import
get_user_model
from
django.contrib.auth
import
get_user_model
...
@@ -6,13 +8,14 @@ from django.core.files.uploadedfile import SimpleUploadedFile
...
@@ -6,13 +8,14 @@ from django.core.files.uploadedfile import SimpleUploadedFile
from
django.core.urlresolvers
import
reverse
from
django.core.urlresolvers
import
reverse
from
django.template.defaultfilters
import
filesizeformat
from
django.template.defaultfilters
import
filesizeformat
from
django.test
import
TestCase
,
override_settings
from
django.test
import
TestCase
,
override_settings
from
tests.utils
import
create_test_video_file
from
wagtail.tests.utils
import
WagtailTestUtils
from
wagtail.tests.utils
import
WagtailTestUtils
from
wagtail.wagtailcore.models
import
Collection
,
GroupCollectionPermission
from
wagtail.wagtailcore.models
import
Collection
,
GroupCollectionPermission
from
tests.utils
import
create_test_video_file
from
wagtailvideos.models
import
Video
from
wagtailvideos.models
import
Video
class
TestVideoIndexView
(
TestCase
,
WagtailTestUtils
):
class
TestVideoIndexView
(
WagtailTestUtils
,
TestCase
):
def
setUp
(
self
):
def
setUp
(
self
):
self
.
login
()
self
.
login
()
...
...
tests/test_template_tag.py
View file @
79a7a588
from
__future__
import
unicode_literals
from
django.template
import
Context
,
Template
,
TemplateSyntaxError
from
django.template
import
Context
,
Template
,
TemplateSyntaxError
from
django.test
import
TestCase
from
django.test
import
TestCase
from
tests.utils
import
create_test_video_file
from
tests.utils
import
create_test_video_file
from
wagtailvideos.models
import
Video
from
wagtailvideos.models
import
Video
...
...
tests/utils.py
View file @
79a7a588
from
__future__
import
unicode_literals
import
os
import
os
import
tests
from
django.core.files
import
File
from
django.core.files
import
File
import
tests
def
create_test_video_file
():
def
create_test_video_file
():
video_file
=
open
(
os
.
path
.
join
(
tests
.
__path__
[
0
],
'small.mp4'
),
'rb'
)
video_file
=
open
(
os
.
path
.
join
(
tests
.
__path__
[
0
],
'small.mp4'
),
'rb'
)
...
...
tox.ini
View file @
79a7a588
...
@@ -2,15 +2,16 @@
...
@@ -2,15 +2,16 @@
skip_missing_interpreters
=
True
skip_missing_interpreters
=
True
envlist
=
envlist
=
py{34,35}-dj{18,19}-wt{14,15}
py{
27,
34,35}-dj{18,19}-wt{14,15}
[testenv]
[testenv]
commands
=
python runtests.py
commands
=
python runtests.py
{posargs}
usedevelop
=
True
usedevelop
=
True
pip_pre
=
True
pip_pre
=
True
basepython
=
basepython
=
py27:
python2.7
py34:
python3.4
py34:
python3.4
py35:
python3.5
py35:
python3.5
...
...
wagtailvideos/apps.py
View file @
79a7a588
from
__future__
import
absolute_import
,
print_function
,
unicode_literals
from
django.apps
import
AppConfig
from
django.apps
import
AppConfig
from
django.core.checks
import
Error
,
register
from
django.core.checks
import
Error
,
register
from
wagtailvideos.utils
import
which
from
wagtailvideos.utils
import
which
...
...
wagtailvideos/edit_handlers.py
View file @
79a7a588
from
__future__
import
absolute_import
,
unicode_literals
from
__future__
import
absolute_import
,
print_function
,
unicode_literals
from
wagtail.wagtailadmin.edit_handlers
import
BaseChooserPanel
from
wagtail.wagtailadmin.edit_handlers
import
BaseChooserPanel
...
...
wagtailvideos/fields.py
View file @
79a7a588
from
__future__
import
absolute_import
,
print_function
,
unicode_literals
import
os
import
os
from
django.conf
import
settings
from
django.conf
import
settings
...
...
wagtailvideos/forms.py
View file @
79a7a588
from
__future__
import
absolute_import
,
print_function
,
unicode_literals
from
django
import
forms
from
django
import
forms
from
django.forms.models
import
modelform_factory
from
django.forms.models
import
modelform_factory
from
django.utils.translation
import
ugettext
as
_
from
django.utils.translation
import
ugettext
as
_
from
enumchoicefield.forms
import
EnumField
from
wagtail.wagtailadmin
import
widgets
from
wagtail.wagtailadmin
import
widgets
from
wagtail.wagtailadmin.forms
import
(
BaseCollectionMemberForm
,
from
wagtail.wagtailadmin.forms
import
(
BaseCollectionMemberForm
,
collection_member_permission_formset_factory
)
collection_member_permission_formset_factory
)
from
enumchoicefield.forms
import
EnumField
from
wagtailvideos.fields
import
WagtailVideoField
from
wagtailvideos.fields
import
WagtailVideoField
from
wagtailvideos.models
import
MediaFormats
,
Video
from
wagtailvideos.models
import
MediaFormats
,
Video
from
wagtailvideos.permissions
import
\
from
wagtailvideos.permissions
import
\
...
@@ -52,8 +54,8 @@ def get_video_form(model):
...
@@ -52,8 +54,8 @@ def get_video_form(model):
class
VideoTranscodeAdminForm
(
forms
.
Form
):
class
VideoTranscodeAdminForm
(
forms
.
Form
):
media_format
=
EnumField
(
MediaFormats
)
media_format
=
EnumField
(
MediaFormats
)
def
__init__
(
self
,
data
=
None
,
*
,
video
,
**
kwargs
):
def
__init__
(
self
,
video
,
data
=
None
,
**
kwargs
):
super
(
).
__init__
(
**
kwargs
,
data
=
None
)
super
(
VideoTranscodeAdminForm
,
self
).
__init__
(
data
=
None
,
**
kwargs
)
self
.
video
=
video
self
.
video
=
video
def
save
(
self
):
def
save
(
self
):
...
...
wagtailvideos/migrations/0001_initial.py
View file @
79a7a588
# -*- coding: utf-8 -*-
# -*- coding: utf-8 -*-
# Generated by Django 1.9.1 on 2016-03-02 01:50
# Generated by Django 1.9.1 on 2016-03-02 01:50
from
__future__
import
unicode_literals
from
__future__
import
absolute_import
,
print_function
,
unicode_literals
import
django.db.models.deletion
import
django.db.models.deletion
import
taggit.managers
import
taggit.managers
import
wagtail.wagtailadmin.taggable
import
wagtail.wagtailadmin.taggable
import
wagtail.wagtailcore.models
import
wagtail.wagtailcore.models
import
wagtailvideos.models
from
django.conf
import
settings
from
django.conf
import
settings
from
django.db
import
migrations
,
models
from
django.db
import
migrations
,
models
import
wagtailvideos.models
class
Migration
(
migrations
.
Migration
):
class
Migration
(
migrations
.
Migration
):
...
...
wagtailvideos/migrations/0002_auto_20160321_1610.py
View file @
79a7a588
# -*- coding: utf-8 -*-
# -*- coding: utf-8 -*-
# Generated by Django 1.9.1 on 2016-03-21 05:10
# Generated by Django 1.9.1 on 2016-03-21 05:10
from
__future__
import
unicode_literals
from
__future__
import
absolute_import
,
print_function
,
unicode_literals
import
wagtailvideos.models
from
django.db
import
migrations
,
models
from
django.db
import
migrations
,
models
import
wagtailvideos.models
class
Migration
(
migrations
.
Migration
):
class
Migration
(
migrations
.
Migration
):
...
...
wagtailvideos/migrations/0003_auto_20160705_1646.py
View file @
79a7a588
# -*- coding: utf-8 -*-
# -*- coding: utf-8 -*-
# Generated by Django 1.9.7 on 2016-07-05 06:46
# Generated by Django 1.9.7 on 2016-07-05 06:46
from
__future__
import
unicode_literals
from
__future__
import
absolute_import
,
print_function
,
unicode_literals
import
django.db.models.deletion
import
django.db.models.deletion
import
enumchoicefield.fields
import
enumchoicefield.fields
import
wagtailvideos.models
from
django.db
import
migrations
,
models
from
django.db
import
migrations
,
models
import
wagtailvideos.models
class
Migration
(
migrations
.
Migration
):
class
Migration
(
migrations
.
Migration
):
...
...
wagtailvideos/migrations/0004_auto_20160706_1153.py
View file @
79a7a588
# -*- coding: utf-8 -*-
# -*- coding: utf-8 -*-
# Generated by Django 1.9.7 on 2016-07-06 01:53
# Generated by Django 1.9.7 on 2016-07-06 01:53
from
__future__
import
unicode_literals
from
__future__
import
absolute_import
,
print_function
,
unicode_literals
import
wagtailvideos.models
from
django.db
import
migrations
,
models
from
django.db
import
migrations
,
models
import
wagtailvideos.models
class
Migration
(
migrations
.
Migration
):
class
Migration
(
migrations
.
Migration
):
...
...
wagtailvideos/migrations/0005_videotranscode_error_message.py
View file @
79a7a588
# -*- coding: utf-8 -*-
# -*- coding: utf-8 -*-
# Generated by Django 1.9.7 on 2016-07-06 04:59
# Generated by Django 1.9.7 on 2016-07-06 04:59
from
__future__
import
unicode_literals
from
__future__
import
absolute_import
,
print_function
,
unicode_literals
from
django.db
import
migrations
,
models
from
django.db
import
migrations
,
models
...
...
wagtailvideos/migrations/0006_auto_20160707_1413.py
View file @
79a7a588
# -*- coding: utf-8 -*-
# -*- coding: utf-8 -*-
# Generated by Django 1.9.7 on 2016-07-07 04:13
# Generated by Django 1.9.7 on 2016-07-07 04:13
from
__future__
import
unicode_literals
from
__future__
import
absolute_import
,
print_function
,
unicode_literals
import
wagtailvideos.models
from
django.db
import
migrations
,
models
from
django.db
import
migrations
,
models
import
wagtailvideos.models
class
Migration
(
migrations
.
Migration
):
class
Migration
(
migrations
.
Migration
):
...
...
wagtailvideos/migrations/0007_video_duration.py
View file @
79a7a588
# -*- coding: utf-8 -*-
# -*- coding: utf-8 -*-
# Generated by Django 1.9.7 on 2016-07-08 06:48
# Generated by Django 1.9.7 on 2016-07-08 06:48
from
__future__
import
unicode_literals
from
__future__
import
absolute_import
,
print_function
,
unicode_literals
from
django.db
import
migrations
,
models
from
django.db
import
migrations
,
models
...
...
Prev
1
2
Next
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
.
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment