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.
......@@ -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')
......
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