Skip to content

Commit d5f6c44

Browse files
author
afabiani
committed
- Bump to Python 3
1 parent b1ba71f commit d5f6c44

File tree

7 files changed

+56
-31
lines changed

7 files changed

+56
-31
lines changed

.gitignore

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,2 @@
1+
/build/
2+
/dist/

MANIFEST

Lines changed: 22 additions & 21 deletions
Original file line numberDiff line numberDiff line change
@@ -1,21 +1,22 @@
1-
# file GENERATED by distutils, do NOT edit
2-
setup.py
3-
arcrest\__init__.py
4-
arcrest\ago.py
5-
arcrest\compat.py
6-
arcrest\geometry.py
7-
arcrest\gptypes.py
8-
arcrest\projections.py
9-
arcrest\server.py
10-
arcrest\utils.py
11-
arcrest\admin\__init__.py
12-
arcrest\admin\admin_objects.py
13-
arcrest\admin\cmdline.py
14-
cmdline\convertcachestorageformat.py
15-
cmdline\createcacheschema.py
16-
cmdline\createservice.py
17-
cmdline\deletecache.py
18-
cmdline\managecachetiles.py
19-
cmdline\manageservice.py
20-
cmdline\managesite.py
21-
cmdline\reportcachestatus.py
1+
# file GENERATED by distutils, do NOT edit
2+
setup.py
3+
arcrest/__init__.py
4+
arcrest/ago.py
5+
arcrest/compat.py
6+
arcrest/geometry.py
7+
arcrest/gptypes.py
8+
arcrest/portal.py
9+
arcrest/projections.py
10+
arcrest/server.py
11+
arcrest/utils.py
12+
arcrest/admin/__init__.py
13+
arcrest/admin/admin_objects.py
14+
arcrest/admin/cmdline.py
15+
cmdline/convertcachestorageformat.py
16+
cmdline/createcacheschema.py
17+
cmdline/createservice.py
18+
cmdline/deletecache.py
19+
cmdline/managecachetiles.py
20+
cmdline/manageservice.py
21+
cmdline/managesite.py
22+
cmdline/reportcachestatus.py

arcrest/admin/admin_objects.py

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -13,6 +13,12 @@
1313
'Directory', 'Directories',
1414
'Clusters', 'Cluster']
1515

16+
try:
17+
long, unicode, basestring
18+
except NameError:
19+
long, unicode, basestring = int, str, str
20+
21+
1622
class Admin(server.RestURL):
1723
"""Represents the top level URL resource of the ArcGIS Server
1824
Administration API"""

arcrest/admin/cmdline.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -230,7 +230,7 @@ def manageservice(action):
230230
service = services[args.name]
231231
operation = (args.operation or '').lower()
232232
if operation == 'status':
233-
for key, item in sorted(service.status.iteritems()):
233+
for key, item in sorted(service.status.items()):
234234
print("{0}: {1}".format(key, item))
235235
elif operation == 'start':
236236
with action("starting service"):

arcrest/compat.py

Lines changed: 14 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -7,6 +7,11 @@
77
'urljoin', 'urlunsplit', 'urlencode', 'quote', 'string_type',
88
'ensure_string', 'ensure_bytes', 'get_headers']
99

10+
try:
11+
long, unicode, basestring
12+
except NameError:
13+
long, unicode, basestring = int, str, str
14+
1015
try:
1116
import cookielib
1217
except ImportError:
@@ -43,9 +48,15 @@
4348
string_type = str
4449

4550
def ensure_string(payload_bytes):
46-
if isinstance(payload_bytes, bytes):
47-
return payload_bytes.decode("utf-8")
48-
return payload_bytes
51+
import re
52+
_payload = payload_bytes
53+
try:
54+
_payload = payload_bytes.decode("utf-8")
55+
except:
56+
pass
57+
if re.match(r'b\'(.*)\'', _payload):
58+
_payload = re.match(r'b\'(.*)\'', _payload).groups()[0]
59+
return _payload
4960

5061
def ensure_bytes(payload_string):
5162
if isinstance(payload_string, unicode):

arcrest/geometry.py

Lines changed: 9 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -7,6 +7,11 @@
77

88
from .projections import projected, geographic
99

10+
try:
11+
long, unicode, basestring
12+
except NameError:
13+
long, unicode, basestring = int, str, str
14+
1015
def pointlist(points, sr):
1116
"""Convert a list of the form [[x, y] ...] to a list of Point instances
1217
with the given x, y coordinates."""
@@ -587,14 +592,14 @@ def fromJson(struct, attributes=None):
587592
return Envelope(*map(float, struct.split(',')))
588593
# Look for telltale attributes in the dict
589594
if isinstance(struct, dict):
590-
for key, cls in indicative_attributes.iteritems():
595+
for key, cls in indicative_attributes.items():
591596
if key in struct:
592597
ret = cls.fromJson(dict((str(key), value)
593-
for (key, value) in struct.iteritems()))
598+
for (key, value) in struct.items()))
594599
if attributes:
595600
ret.attributes = dict((str(key.lower()), val)
596601
for (key, val)
597-
in attributes.iteritems())
602+
in attributes.items())
598603
return ret
599604
raise ValueError("Unconvertible to geometry")
600605

@@ -638,7 +643,7 @@ def fromGeoJson(struct, attributes=None):
638643
if attributes:
639644
if not hasattr(instance, 'attributes'):
640645
instance.attributes = {}
641-
for k, v in attributes.iteritems():
646+
for k, v in attributes.items():
642647
instance.attributes[k] = v
643648
i.append(instance)
644649
if i:

setup.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -5,8 +5,8 @@
55
import os
66

77
setup(
8-
name='arcrest',
9-
version='10.3',
8+
name='gn-arcrest',
9+
version='10.5',
1010
summary="ArcGIS for Server REST API wrapper",
1111
description="""Wrapper to the ArcGIS REST API, and a Python analogue to the Javascript APIs""",
1212
author="Esri",

0 commit comments

Comments
 (0)