diff --git a/product/ERP5/Document/GeographicAddress.py b/product/ERP5/Document/GeographicAddress.py index 436e4a03587237fc06ccd7aff9015794cb624558..8c4ca4374bc9af3e6a515126095f4ef774a0147f 100644 --- a/product/ERP5/Document/GeographicAddress.py +++ b/product/ERP5/Document/GeographicAddress.py @@ -1,4 +1,3 @@ -# -*- coding: utf-8 -*- ############################################################################## # # Copyright (c) 2002 Nexedi SARL and Contributors. All Rights Reserved. @@ -33,7 +32,8 @@ from Products.ERP5Type import Permissions, PropertySheet, Constraint, Interface from Products.ERP5Type.Base import Base from Products.ERP5.Document.Coordinate import Coordinate -from os import linesep + +import string class GeographicAddress(Coordinate, Base): """ @@ -86,22 +86,21 @@ class GeographicAddress(Coordinate, Base): Tries to recognize the coordinate_text to update this address """ - - lines = coordinate_text.split(linesep) + lines = string.split(coordinate_text, '\n') self.setStreetAddress('') self.setZipCode('') self.setCity('') zip_city = None - if len(lines) > 1: - self.setStreetAddress(linesep.join(lines[0:-1])) - zip_city = lines[-1].split() - elif lines: + if len(lines ) > 1: + self.setStreetAddress(lines[0:-1]) + zip_city = string.split(lines[-1]) + elif len(lines ) > 0: self.setStreetAddress('') - zip_city = lines[-1].split() + zip_city = string.split(lines[-1]) if zip_city: self.setZipCode(zip_city[0]) if len(zip_city) > 1: - self.setCity(' '.join(zip_city[1:])) + self.setCity(string.join(zip_city[1:])) security.declareProtected(Permissions.AccessContentsInformation, 'standardTextFormat')