Migrate to python 3.
This commit is contained in:
parent
9d53cabfdf
commit
94fbb68004
|
@ -5,8 +5,7 @@ from trytond.pool import PoolMeta
|
||||||
__all__ = ['Address']
|
__all__ = ['Address']
|
||||||
|
|
||||||
|
|
||||||
class Address:
|
class Address(metaclass=PoolMeta):
|
||||||
__metaclass__ = PoolMeta
|
|
||||||
__name__ = 'party.address'
|
__name__ = 'party.address'
|
||||||
|
|
||||||
@classmethod
|
@classmethod
|
||||||
|
|
|
@ -46,11 +46,11 @@ class LoadCountryZips(Wizard):
|
||||||
os.path.dirname(__file__), 'country_zip_es.csv'))
|
os.path.dirname(__file__), 'country_zip_es.csv'))
|
||||||
try:
|
try:
|
||||||
rows = reader(data, delimiter=delimiter, quotechar=quotechar)
|
rows = reader(data, delimiter=delimiter, quotechar=quotechar)
|
||||||
except TypeError, e:
|
except TypeError as e:
|
||||||
self.raise_user_error('error',
|
self.raise_user_error('error',
|
||||||
error_description='read_error',
|
error_description='read_error',
|
||||||
error_description_args=('country_zip_es.csv', e))
|
error_description_args=('country_zip_es.csv', e))
|
||||||
rows.next()
|
next(rows)
|
||||||
|
|
||||||
records = []
|
records = []
|
||||||
for row in rows:
|
for row in rows:
|
||||||
|
|
5
setup.py
5
setup.py
|
@ -7,10 +7,7 @@ from setuptools import setup
|
||||||
import re
|
import re
|
||||||
import os
|
import os
|
||||||
import io
|
import io
|
||||||
try:
|
from configparser import ConfigParser
|
||||||
from configparser import ConfigParser
|
|
||||||
except ImportError:
|
|
||||||
from ConfigParser import ConfigParser
|
|
||||||
|
|
||||||
MODULE = 'country_zip_es'
|
MODULE = 'country_zip_es'
|
||||||
PREFIX = 'trytonspain'
|
PREFIX = 'trytonspain'
|
||||||
|
|
|
@ -31,6 +31,6 @@ Ensure that banks are loaded::
|
||||||
>>> CountryZip = Model.get('country.zip')
|
>>> CountryZip = Model.get('country.zip')
|
||||||
>>> czip, = CountryZip.find([('zip', '=', '25001')])
|
>>> czip, = CountryZip.find([('zip', '=', '25001')])
|
||||||
>>> czip.city
|
>>> czip.city
|
||||||
u'Lleida'
|
'Lleida'
|
||||||
>>> czip.country.code
|
>>> czip.country.code
|
||||||
u'ES'
|
'ES'
|
||||||
|
|
Loading…
Reference in New Issue