Skip to content
This repository has been archived by the owner on Feb 1, 2019. It is now read-only.

Python 3 support in build_html_iframe() #14

Open
wants to merge 1 commit into
base: master
Choose a base branch
from

Conversation

trawick
Copy link

@trawick trawick commented Dec 18, 2015

build_html_iframe() uses dict.iteritems() and unicode(), which aren't part of Python 3. This patch uses six to make the code work under Python 3.

Testcase:

from aldryn_video.models import OEmbedVideoPlugin
o = OEmbedVideoPlugin()
o.oembed_data = dict(provider_name='foo')
o.iframe_width = "800"
o.iframe_height = "600"
o.oembed_data['html'] = '<iframe src="http://www.w3schools.com" frameborder="1" name="foo"></iframe>'
o.html

Expected result:

'<iframe frameborder="1" height="600" name="foo" src="//www.w3schools.com" width="800"></iframe>'

(or equivalent Unicode literal with Python 2)

@trawick
Copy link
Author

trawick commented Jan 16, 2016

AFAICT the failure of some of the Travis builds has nothing to do with this pull request. Here's a common one:

  File "/home/travis/build/aldryn/aldryn-video/.tox/py34-dj17-cms32/lib/python3.4/site-packages/cms/utils/placeholder.py", line 9, in <module>
    from django.template import TemplateSyntaxError, NodeList, Variable, engines
ImportError: cannot import name 'engines'
ERROR: InvocationError: '/home/travis/build/aldryn/aldryn-video/.tox/py34-dj17-cms32/bin/coverage run test_settings.py'

@FinalAngel
Copy link
Contributor

@trawick we fixed some issues on the test environments. Can you rebase to master and push again?
Additionally please create an entry in the Changelog (1.0.1) for your changes.

I'll see to it that it gets merged once adapted :)

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants