From 7256fafe2d1f94676c5b7381252509ae8d9f1d61 Mon Sep 17 00:00:00 2001 From: Nicolas Delaby <nicolas@nexedi.com> Date: Tue, 19 May 2009 14:12:17 +0000 Subject: [PATCH] revert 27042, as asked git-svn-id: https://svn.erp5.org/repos/public/erp5/trunk@27055 20353a03-c40f-0410-a6d1-a30d3c3de9de --- product/ERP5/Document/GeographicAddress.py | 19 +++++++++---------- 1 file changed, 9 insertions(+), 10 deletions(-) diff --git a/product/ERP5/Document/GeographicAddress.py b/product/ERP5/Document/GeographicAddress.py index 436e4a0358..8c4ca4374b 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') -- 2.30.9