Skip to content

Commit

Permalink
Merge pull request #4 from Scifabric/python3
Browse files Browse the repository at this point in the history
Python3
  • Loading branch information
teleyinex authored Sep 12, 2017
2 parents 7a942f5 + 45a8fac commit 2c49e2a
Show file tree
Hide file tree
Showing 5 changed files with 13 additions and 7 deletions.
1 change: 1 addition & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -9,3 +9,4 @@
env/
dist/
pybossa_onesignal.egg-info/
env3/
2 changes: 2 additions & 0 deletions .travis.yml
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,8 @@ sudo: false
language: python
python:
- "2.7"
- "3.5"
- "3.6"
install:
- pip install -r requirements.txt
- pip install -r requirements-testing.txt
Expand Down
3 changes: 3 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
@@ -1,5 +1,8 @@
# PYBOSSA OneSignal library
[![Build Status](https://travis-ci.org/Scifabric/pybossa-onesignal.svg?branch=master)](https://travis-ci.org/Scifabric/pybossa-onesignal) [![Coverage Status](https://coveralls.io/repos/github/Scifabric/pybossa-onesignal/badge.svg?branch=master)](https://coveralls.io/github/Scifabric/pybossa-onesignal?branch=master) [![Code Health](https://landscape.io/github/Scifabric/pybossa-onesignal/master/landscape.svg?style=flat)](https://landscape.io/github/Scifabric/pybossa-onesignal/master)
[![Python 2.7](https://img.shields.io/badge/python-2.7-green.svg)](https://pypi.python.org/pypi/pybossa-onesignal/)
[![Python 3.5](https://img.shields.io/badge/python-3.5-blue.svg)](https://pypi.python.org/pypi/pybossa-onesignal/)
[![Python 3.6](https://img.shields.io/badge/python-3.6-orange.svg)](https://pypi.python.org/pypi/pybossa-onesignal/)

## Intro

Expand Down
12 changes: 6 additions & 6 deletions pbsonesignal/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,7 @@
"""
import requests
from exceptions import *
from .exceptions import *


class PybossaOneSignal(object):
Expand Down Expand Up @@ -51,7 +51,7 @@ def __init__(self, api_key=None, app_id=None, app_ids=None, auth_key=None):
else:
self.app_ids = app_ids
except Exception as e:
print "ERROR: %s: %s" % (type(e), e)
print("ERROR: %s: %s" % (type(e), e))
raise e

def header(self, auth):
Expand Down Expand Up @@ -130,12 +130,12 @@ def push_msg(self, contents={"en": "English Message"},

response = req.json()

if 'errors' in response.keys():
if 'errors' in list(response.keys()):
for error in response['errors']:
raise CreateNotification(error)
return (req.status_code, req.reason, req.json())
except CreateNotification as e:
print "ERROR: %s: %s" % (type(e), e)
print("ERROR: %s: %s" % (type(e), e))
raise e

def create_app(self, name,
Expand Down Expand Up @@ -163,11 +163,11 @@ def create_app(self, name,

response = req.json()

if 'errors' in response.keys():
if 'errors' in list(response.keys()):
for error in response['errors']:
raise CreateApp(error)
return (req.status_code, req.reason, req.json())
except CreateApp as e:
print "ERROR: %s: %s" % (type(e), e)
print("ERROR: %s: %s" % (type(e), e))
raise e

2 changes: 1 addition & 1 deletion setup.py
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@

setup(
name='pybossa-onesignal',
version='1.0',
version='1.1',
packages=find_packages(),
install_requires=['requests>=0.13.0'],
# metadata for upload to PyPI
Expand Down

0 comments on commit 2c49e2a

Please sign in to comment.