dreipol / django-scarface

Send push notifications to mobile devices using Amazon SNS
MIT License
43 stars 21 forks source link

Update platform_strategy.py to support Python 2.x #11

Closed neosergio closed 8 years ago

neosergio commented 8 years ago

metaclass change in Python 3.x, but there are lot of projects still using Python 2.x, so for compatibility is good to change metaclass syntax

philipplaeubli commented 8 years ago

Hey there, many thanks! As I understand though, this won't run on Python 3, see http://python-future.org/compatible_idioms.html#metaclasses

So we should use this:

class PlatformStrategy(with_metaclass(ABCMeta)):
    def __init__(self, platform_application):
...

Could you update this and add six or future to the requirements.txt?

neosergio commented 8 years ago

Thank you for your feedback @philipplaeubli, I changed the pull request as you recommend

alexgv14 commented 8 years ago

this would be sweet thanks @neosergio can't wait for it to get merged.

philipplaeubli commented 8 years ago

Dear @neosergio, thank you very much. There are some other compatibility issues i've stumbled upon while testing your changes. I'll merge your branch, clean up some other issues and release a new version on pypi.

neosergio commented 8 years ago

Thank you @philipplaeubli