summaryrefslogtreecommitdiff
path: root/archaeological_operations/utils.py
diff options
context:
space:
mode:
authorÉtienne Loks <etienne.loks@iggdrasil.net>2019-02-27 20:44:52 +0100
committerÉtienne Loks <etienne.loks@iggdrasil.net>2019-06-17 13:21:27 +0200
commit86c03a98d11e93880b4568776e0939113a92a707 (patch)
treee07ad2e91e2544f7b2d61e8f3f653fdda26bfd52 /archaeological_operations/utils.py
parent52f442699a72ff5d0341a7d15d5b966a3cc2bd60 (diff)
downloadIshtar-86c03a98d11e93880b4568776e0939113a92a707.tar.bz2
Ishtar-86c03a98d11e93880b4568776e0939113a92a707.zip
Migrate to python 3 - Clean old migrations and some old scripts
Diffstat (limited to 'archaeological_operations/utils.py')
-rw-r--r--archaeological_operations/utils.py16
1 files changed, 8 insertions, 8 deletions
diff --git a/archaeological_operations/utils.py b/archaeological_operations/utils.py
index 3a5057cd5..801cc6ea4 100644
--- a/archaeological_operations/utils.py
+++ b/archaeological_operations/utils.py
@@ -270,7 +270,7 @@ def parse_trunc_patriarche(value):
int(value)
except ValueError:
return
- return '18' + unicode(value)
+ return '18' + str(value)
def parse_operation_code(value):
@@ -468,11 +468,11 @@ def parse_insee(value):
PARCEL_YEAR_REGEXP = re.compile(r"^([0-9]{4})[ :]+")
PARCEL_SECTION_REGEXP = re.compile(
- ur"(?: )*(?:[Ss]ection(?:s)?)?(?: )*([A-Z][A-Z0-9]{0,3})[ :]*"
- ur"((?:(?: |;|,|[Pp]arcelle(?:s)?|n°|et|à|to)*[0-9]+[p]?)+)")
-PARCEL_NB_RANGE_REGEXP = re.compile(ur'([0-9]+[p]?) (?:à|to) ([0-9]+[p]?)')
+ r"(?: )*(?:[Ss]ection(?:s)?)?(?: )*([A-Z][A-Z0-9]{0,3})[ :]*"
+ r"((?:(?: |;|,|[Pp]arcelle(?:s)?|n°|et|à|to)*[0-9]+[p]?)+)")
+PARCEL_NB_RANGE_REGEXP = re.compile(r'([0-9]+[p]?) (?:à|to) ([0-9]+[p]?)')
PARCEL_NB_REGEXP = re.compile(
- ur'(?: |;|,|[Pp]arcelle(?:s)?|n°|et|à|to)*([0-9]+[p]?)')
+ r'(?: |;|,|[Pp]arcelle(?:s)?|n°|et|à|to)*([0-9]+[p]?)')
def parse_parcels(parcel_str, insee_code=None, owner=None):
@@ -492,7 +492,7 @@ def parse_parcels(parcel_str, insee_code=None, owner=None):
for parcel in PARCEL_SECTION_REGEXP.findall(parcel_str):
sector, nums = parcel[0], parcel[1]
for num in PARCEL_NB_REGEXP.findall(nums):
- if len(unicode(num)) > 6:
+ if len(str(num)) > 6:
continue
dct = {'year': year, 'section': sector, 'parcel_number': num}
if town:
@@ -508,9 +508,9 @@ def parse_parcels(parcel_str, insee_code=None, owner=None):
higher_range = int(higher_range)
except ValueError:
continue
- for num in xrange(lower_range, higher_range):
+ for num in range(lower_range, higher_range):
dct = {'year': year, 'section': sector,
- 'parcel_number': unicode(num)}
+ 'parcel_number': str(num)}
if town:
dct['town'] = town
if owner: