Skip to content

Commit b257c7c

Browse files
committed
Removed six dependencies.
1 parent 772d77e commit b257c7c

File tree

3 files changed

+6
-8
lines changed

3 files changed

+6
-8
lines changed

raster/algebra/parser.py

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,6 @@
88
from pyparsing import Forward, Keyword, Literal, Optional, Regex, Word, ZeroOrMore, alphanums, delimitedList, oneOf
99

1010
from django.contrib.gis.gdal import GDALRaster
11-
from django.utils import six
1211
from raster.algebra import const
1312
from raster.exceptions import RasterAlgebraException
1413

@@ -121,10 +120,10 @@ def evaluate_stack(self, stack):
121120
op2 = self.evaluate_stack(stack)
122121
op1 = self.evaluate_stack(stack)
123122
# Handle null case
124-
if isinstance(op1, six.string_types) and op1 == const.NULL:
123+
if isinstance(op1, str) and op1 == const.NULL:
125124
op2 = self.get_mask(op2, op)
126125
op1 = True
127-
elif isinstance(op2, six.string_types) and op2 == const.NULL:
126+
elif isinstance(op2, str) and op2 == const.NULL:
128127
op1 = self.get_mask(op1, op)
129128
op2 = True
130129
return const.OPERATOR_MAP[op](op1, op2)

raster/tiles/parser.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -6,6 +6,8 @@
66
import tempfile
77
import uuid
88
import zipfile
9+
from urllib.parse import urlparse
10+
from urllib.request import urlretrieve
911

1012
import boto3
1113
import numpy
@@ -15,8 +17,6 @@
1517
from django.contrib.gis.gdal.error import GDALException
1618
from django.core.files import File
1719
from django.dispatch import Signal
18-
from django.utils.six.moves.urllib.parse import urlparse
19-
from django.utils.six.moves.urllib.request import urlretrieve
2020
from raster.exceptions import RasterException
2121
from raster.models import RasterLayer, RasterLayerBandMetadata, RasterLayerReprojected, RasterTile
2222
from raster.tiles import utils

raster/utils.py

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,6 @@
44
from PIL import Image
55

66
from django.contrib.gis.gdal import OGRGeometry
7-
from django.utils import six
87
from raster.algebra.parser import FormulaParser
98
from raster.exceptions import RasterException
109

@@ -127,9 +126,9 @@ def colormap_to_rgba(colormap):
127126
Convert color ma to rgba colors.
128127
"""
129128
if 'continuous' in colormap:
130-
return {k: hex_to_rgba(v) if isinstance(v, (six.string_types, int)) and k in ['from', 'to', 'over'] else v for k, v in colormap.items()}
129+
return {k: hex_to_rgba(v) if isinstance(v, (str, int)) and k in ['from', 'to', 'over'] else v for k, v in colormap.items()}
131130
else:
132-
return {k: hex_to_rgba(v) if isinstance(v, (six.string_types, int)) else v for k, v in colormap.items()}
131+
return {k: hex_to_rgba(v) if isinstance(v, (str, int)) else v for k, v in colormap.items()}
133132

134133

135134
def pixel_value_from_point(raster, point, band=0):

0 commit comments

Comments
 (0)