Skip to content

Commit

Permalink
providers fixes
Browse files Browse the repository at this point in the history
  • Loading branch information
gotlium committed Jul 23, 2017
1 parent ce894a4 commit fcdf870
Show file tree
Hide file tree
Showing 9 changed files with 58 additions and 22 deletions.
9 changes: 7 additions & 2 deletions dbmail/providers/boxcar/push.py
Original file line number Diff line number Diff line change
@@ -1,7 +1,12 @@
# -*- encoding: utf-8 -*-

from httplib import HTTPSConnection
from urllib import urlencode

try:
from httplib import HTTPSConnection
from urllib import urlencode
except ImportError:
from http.client import HTTPSConnection
from urllib.parse import urlencode

from dbmail.providers.prowl.push import from_unicode
from dbmail import get_version
Expand Down
10 changes: 8 additions & 2 deletions dbmail/providers/centrifugo/push.py
Original file line number Diff line number Diff line change
@@ -1,10 +1,16 @@
# -*- encoding: utf-8 -*-

try:
from urllib2 import urlopen, Request
from urllib import urlencode
except ImportError:
from urllib.request import urlopen, Request
from urllib.parse import urlencode

import hmac
from hashlib import sha256
from json import dumps
from urllib import urlencode
from urllib2 import urlopen, Request


from django.conf import settings

Expand Down
8 changes: 2 additions & 6 deletions dbmail/providers/google/android.py
Original file line number Diff line number Diff line change
Expand Up @@ -2,16 +2,12 @@

try:
from httplib import HTTPSConnection
except ImportError:
from http.client import HTTPSConnection

from json import dumps, loads

try:
from urlparse import urlparse
except ImportError:
from http.client import HTTPSConnection
from urllib.parse import urlparse

from json import dumps, loads
from django.conf import settings


Expand Down
9 changes: 7 additions & 2 deletions dbmail/providers/http/push.py
Original file line number Diff line number Diff line change
@@ -1,7 +1,12 @@
# -*- encoding: utf-8 -*-

from httplib import HTTPConnection, HTTPSConnection
from urlparse import urlparse
try:
from httplib import HTTPConnection, HTTPSConnection
from urlparse import urlparse
except ImportError:
from http.client import HTTPSConnection, HTTPConnection
from urllib.parse import urlparse

from json import dumps

from django.conf import settings
Expand Down
9 changes: 7 additions & 2 deletions dbmail/providers/iqsms/sms.py
Original file line number Diff line number Diff line change
@@ -1,7 +1,12 @@
# -*- encoding: utf-8 -*-

from httplib import HTTPConnection
from urllib import urlencode
try:
from httplib import HTTPConnection
from urllib import urlencode
except ImportError:
from http.client import HTTPConnection
from urllib.parse import urlencode

from base64 import b64encode

from django.conf import settings
Expand Down
6 changes: 5 additions & 1 deletion dbmail/providers/parse_com/push.py
Original file line number Diff line number Diff line change
@@ -1,6 +1,10 @@
# -*- encoding: utf-8 -*-

from httplib import HTTPSConnection
try:
from httplib import HTTPSConnection
except ImportError:
from http.client import HTTPSConnection

from json import dumps, loads

from django.conf import settings
Expand Down
9 changes: 7 additions & 2 deletions dbmail/providers/pushover/push.py
Original file line number Diff line number Diff line change
@@ -1,7 +1,12 @@
# -*- encoding: utf-8 -*-

from httplib import HTTPSConnection
from urllib import urlencode
try:
from httplib import HTTPSConnection
from urllib import urlencode
except ImportError:
from http.client import HTTPSConnection
from urllib.parse import urlencode

from json import loads

from django.conf import settings
Expand Down
11 changes: 8 additions & 3 deletions dbmail/providers/slack/push.py
Original file line number Diff line number Diff line change
@@ -1,8 +1,13 @@
# -*- encoding: utf-8 -*-

from httplib import HTTPSConnection
from urllib import urlencode
from urlparse import urlparse
try:
from httplib import HTTPSConnection
from urlparse import urlparse
from urllib import urlencode
except ImportError:
from http.client import HTTPSConnection
from urllib.parse import urlparse, urlencode

from json import dumps

from django.conf import settings
Expand Down
9 changes: 7 additions & 2 deletions dbmail/providers/twilio/sms.py
Original file line number Diff line number Diff line change
@@ -1,7 +1,12 @@
# -*- coding: utf-8 -*-

from httplib import HTTPSConnection
from urllib import urlencode
try:
from httplib import HTTPSConnection
from urllib import urlencode
except ImportError:
from http.client import HTTPSConnection
from urllib.parse import urlencode

from base64 import b64encode
from json import loads

Expand Down

0 comments on commit fcdf870

Please sign in to comment.