Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Use of collections.OrderedDict ties funnelweb to Python 2.7 #22

Closed
mjpieters opened this issue Jan 16, 2013 · 3 comments
Closed

Use of collections.OrderedDict ties funnelweb to Python 2.7 #22

mjpieters opened this issue Jan 16, 2013 · 3 comments

Comments

@mjpieters
Copy link
Member

collections.OrderedDict was added to Python in version 2.7 making funnelweb not usable for Python 2.6 users.

A backport is available, so it should be easy to make funnelweb use that:

try:
    from collections import OrderedDict
except ImportError:
    # python 2.6 or earlier, use backport
    from ordereddict import OrderedDict

and extend setup.py to add ordereddict to the install_requires list if from collections import OrderedDIct fails:

install_requires = [
    'setuptools',
    'collective.transmogrifier',
    'transmogrify.webcrawler>=1.1',
    'transmogrify.siteanalyser>=1.2',
    'transmogrify.htmlcontentextractor>=1.0',
    'transmogrify.ploneremote>=1.2',
    'mr.migrator>=1.0',
]
try:
    from collections import OrderedDict
except ImportError:
    # No OrderedDict, add `ordereddict` to requirements
    install_requires.append('ordereddict')

setup(
    # everything else
    install_requires = install_requires,
    # and the rest
)
@djay
Copy link
Member

djay commented Jan 17, 2013

I've made those changes and committed that code. Waiting to release the packages.

@djay djay closed this as completed Jan 17, 2013
@mjpieters
Copy link
Member Author

Thanks Dylan! I probably should have filed this in the transmogrify.webcrawler package instead, but this worked, obviously.

@mjpieters
Copy link
Member Author

The transmogrify.ploneremote package has the same problem (transmogrify/ploneremote/remoteprune.py). There may be more.

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

No branches or pull requests

2 participants