Commit 7256fafe authored by Nicolas Delaby's avatar Nicolas Delaby

revert 27042, as asked

git-svn-id: https://svn.erp5.org/repos/public/erp5/trunk@27055 20353a03-c40f-0410-a6d1-a30d3c3de9de
parent 34806def
# -*- coding: utf-8 -*-
############################################################################## ##############################################################################
# #
# Copyright (c) 2002 Nexedi SARL and Contributors. All Rights Reserved. # Copyright (c) 2002 Nexedi SARL and Contributors. All Rights Reserved.
...@@ -33,7 +32,8 @@ from Products.ERP5Type import Permissions, PropertySheet, Constraint, Interface ...@@ -33,7 +32,8 @@ from Products.ERP5Type import Permissions, PropertySheet, Constraint, Interface
from Products.ERP5Type.Base import Base from Products.ERP5Type.Base import Base
from Products.ERP5.Document.Coordinate import Coordinate from Products.ERP5.Document.Coordinate import Coordinate
from os import linesep
import string
class GeographicAddress(Coordinate, Base): class GeographicAddress(Coordinate, Base):
""" """
...@@ -86,22 +86,21 @@ class GeographicAddress(Coordinate, Base): ...@@ -86,22 +86,21 @@ class GeographicAddress(Coordinate, Base):
Tries to recognize the coordinate_text to update Tries to recognize the coordinate_text to update
this address this address
""" """
lines = string.split(coordinate_text, '\n')
lines = coordinate_text.split(linesep)
self.setStreetAddress('') self.setStreetAddress('')
self.setZipCode('') self.setZipCode('')
self.setCity('') self.setCity('')
zip_city = None zip_city = None
if len(lines) > 1: if len(lines ) > 1:
self.setStreetAddress(linesep.join(lines[0:-1])) self.setStreetAddress(lines[0:-1])
zip_city = lines[-1].split() zip_city = string.split(lines[-1])
elif lines: elif len(lines ) > 0:
self.setStreetAddress('') self.setStreetAddress('')
zip_city = lines[-1].split() zip_city = string.split(lines[-1])
if zip_city: if zip_city:
self.setZipCode(zip_city[0]) self.setZipCode(zip_city[0])
if len(zip_city) > 1: if len(zip_city) > 1:
self.setCity(' '.join(zip_city[1:])) self.setCity(string.join(zip_city[1:]))
security.declareProtected(Permissions.AccessContentsInformation, security.declareProtected(Permissions.AccessContentsInformation,
'standardTextFormat') 'standardTextFormat')
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment