diff --git a/APNSWrapper/__init__.py b/APNSWrapper/__init__.py index d50ef9b..c87bdb4 100644 --- a/APNSWrapper/__init__.py +++ b/APNSWrapper/__init__.py @@ -10,8 +10,8 @@ # limitations under the License. -from utils import _doublequote, if_else, find_executable -from apnsexceptions import * -from connection import * -from notifications import * -from feedback import * +from .utils import _doublequote, if_else, find_executable +from .apnsexceptions import * +from .connection import * +from .notifications import * +from .feedback import * diff --git a/APNSWrapper/connection.py b/APNSWrapper/connection.py index ebfd0da..f767624 100644 --- a/APNSWrapper/connection.py +++ b/APNSWrapper/connection.py @@ -15,8 +15,8 @@ from socket import SHUT_RDWR import subprocess -from apnsexceptions import * -from utils import * +from .apnsexceptions import * +from .utils import * __all__ = ('APNSConnectionContext', 'OpenSSLCommandLine', \ @@ -373,7 +373,7 @@ def write(self, data=None): """ Make connection to the host and port. """ - print self.connectionContext + print(self.connectionContext) return self.connectionContext.write(data) def connect(self, host, port): diff --git a/APNSWrapper/feedback.py b/APNSWrapper/feedback.py index 6d2a68d..0c60255 100644 --- a/APNSWrapper/feedback.py +++ b/APNSWrapper/feedback.py @@ -13,7 +13,7 @@ import sys import struct -from connection import * +from .connection import * __all__ = ('APNSFeedbackWrapper',) diff --git a/APNSWrapper/notifications.py b/APNSWrapper/notifications.py index 0403ea3..53b3837 100644 --- a/APNSWrapper/notifications.py +++ b/APNSWrapper/notifications.py @@ -14,10 +14,10 @@ import base64 import binascii -from __init__ import * -from connection import * -from apnsexceptions import * -from utils import _doublequote +from .__init__ import * +from .connection import * +from .apnsexceptions import * +from .utils import _doublequote from select import select NULL = 'null' @@ -265,12 +265,12 @@ def notify(self): if error_detected: cmd, status, identifier = struct.unpack("!BBL", self.read_buf[0]) - print "Error detected on notification: %d" % (identifier) + print("Error detected on notification: %d" % (identifier)) for i, (wrapper_id, global_id) in enumerate(sent_notifications): if wrapper_id == identifier: sent_notifications = sent_notifications[:i] break - print sent_notifications + print(sent_notifications) try: self.disconnect() diff --git a/catalog-info.yaml b/catalog-info.yaml new file mode 100644 index 0000000..dfa66cf --- /dev/null +++ b/catalog-info.yaml @@ -0,0 +1,16 @@ +apiVersion: backstage.io/v1alpha1 +kind: Component +metadata: + name: apns-python-wrapper + description: Apple Push Notification Python Wrapper + annotations: + business-unit: EverHealth + github.com/project-slug: drchrono/apns-python-wrapper + product: DRC +spec: + type: service + lifecycle: production + owner: EverHealth + implementation: + languages: + - Python