Skip to content

Commit 9612015

Browse files
committed
python 3 compatibility
1 parent b354f8d commit 9612015

18 files changed

Lines changed: 68 additions & 27 deletions

identify/http_clients/base_client.py

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,15 +1,16 @@
1+
from __future__ import absolute_import, division, print_function, \
2+
unicode_literals
13
import abc
24
import re
5+
import six
36
from identify.util.exceptions import MissingParametersException
47

5-
class BaseHttpClient:
8+
class BaseHttpClient(six.with_metaclass(abc.ABCMeta)):
69
'''
710
Abstrac class providing an interface and generic methods of the HTTP client
811
responsible for interacting with the Identify APIs
912
'''
1013

11-
__metaclass__ = abc.ABCMeta
12-
1314
def __init__(self, baseurl, auth_token):
1415
'''
1516
Class constructor. Sotores basic connection information.

identify/http_clients/sync_client.py

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,5 @@
1+
from __future__ import absolute_import, division, print_function, \
2+
unicode_literals
13
import json
24
from functools import partial
35
import requests

identify/main/identify_client.py

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,5 @@
1+
from __future__ import absolute_import, division, print_function, \
2+
unicode_literals
13
import abc
24

35

identify/main/identify_sync_client.py

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,5 @@
1+
from __future__ import absolute_import, division, print_function, \
2+
unicode_literals
13
from identify.main.identify_client import BaseIdentifyClient
24
from identify.http_clients.sync_client import SyncHttpClient
35
from identify.resources.traffic_type import TrafficType

identify/resources/attribute.py

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,5 @@
1+
from __future__ import absolute_import, division, print_function, \
2+
unicode_literals
13
from identify.resources.base_resource import BaseResource
24
from identify.util.logger import LOGGER
35
from identify.util.exceptions import HTTPResponseError, \

identify/resources/base_resource.py

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1,20 +1,20 @@
1+
from __future__ import absolute_import, division, print_function, \
2+
unicode_literals
13
import abc
24
import six
35
from identify.util import validation
46
from identify.util.logger import LOGGER
5-
from identify.util.abstract_extra import classabstract_v2
7+
from identify.util.abstract_extra import classabstract, staticabstract
68
from identify.util import camelcase
79
from identify.util.exceptions import HTTPResponseError, \
810
EndpointNotImplemented, UnknownIdentifyClientError
911

1012

11-
class BaseResource:
13+
class BaseResource(six.with_metaclass(abc.ABCMeta)):
1214
'''
1315
Abstract class to handle resources uniformely.
1416
'''
1517

16-
__metaclass__ = abc.ABCMeta
17-
1818
def __init__(self, client, id):
1919
'''
2020
Constructs (a child) resource instance (called via super or __init__,
@@ -52,7 +52,7 @@ def _process_all_response(cls, client, response):
5252
for item in response
5353
]
5454

55-
@classabstract_v2
55+
@classabstract
5656
def _build_single_from_collection_response(cls, client, response):
5757
'''
5858
Abstract Class method to construct a resource instance from a single

identify/resources/environment.py

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,5 @@
1+
from __future__ import absolute_import, division, print_function, \
2+
unicode_literals
13
from identify.resources.base_resource import BaseResource
24
from identify.util.logger import LOGGER
35

identify/resources/identity.py

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,5 @@
1+
from __future__ import absolute_import, division, print_function, \
2+
unicode_literals
13
from identify.resources.base_resource import BaseResource
24
from identify.util.exceptions import HTTPResponseError, MethodNotApplicable, \
35
UnknownIdentifyClientError

identify/resources/traffic_type.py

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,5 @@
1+
from __future__ import absolute_import, division, print_function, \
2+
unicode_literals
13
from identify.resources.base_resource import BaseResource
24
from identify.resources.attribute import Attribute
35
from identify.util.logger import LOGGER

identify/tests/e2e/e2etests.py

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,5 @@
1+
from __future__ import absolute_import, division, print_function, \
2+
unicode_literals
13
import subprocess
24
import time
35
import os

0 commit comments

Comments
 (0)