[FIX] typo convertion/conversion in file_parser derived classes

This commit is contained in:
unknown
2013-02-26 09:19:44 +01:00
parent c292adb42a
commit 22e49ae4b6
2 changed files with 6 additions and 5 deletions

View File

@@ -30,7 +30,7 @@ except:
raise Exception(_('Please install python lib xlrd')) raise Exception(_('Please install python lib xlrd'))
def float_or_zero(val): def float_or_zero(val):
""" Convertion function used to manage """ Conversion function used to manage
empty string into float usecase""" empty string into float usecase"""
return val and float(val) or 0.0 return val and float(val) or 0.0
@@ -43,7 +43,7 @@ class GenericFileParser(FileParser):
""" """
def __init__(self, parse_name, ftype='csv'): def __init__(self, parse_name, ftype='csv'):
convertion_dict = { conversion_dict = {
'ref': unicode, 'ref': unicode,
'label': unicode, 'label': unicode,
'date': datetime.datetime, 'date': datetime.datetime,
@@ -52,7 +52,7 @@ class GenericFileParser(FileParser):
} }
# Order of cols does not matter but first row of the file has to be header # Order of cols does not matter but first row of the file has to be header
keys_to_validate = ['ref', 'label', 'date', 'amount', 'commission_amount'] keys_to_validate = ['ref', 'label', 'date', 'amount', 'commission_amount']
super(GenericFileParser, self).__init__(parse_name, keys_to_validate=keys_to_validate, ftype=ftype, convertion_dict=convertion_dict) super(GenericFileParser, self).__init__(parse_name, keys_to_validate=keys_to_validate, ftype=ftype, conversion_dict=conversion_dict)
@classmethod @classmethod
def parser_for(cls, parser_name): def parser_for(cls, parser_name):

View File

@@ -30,7 +30,7 @@ class TransactionIDFileParser(FileParser):
""" """
def __init__(self, parse_name, ftype='csv'): def __init__(self, parse_name, ftype='csv'):
convertion_dict = { conversion_dict = {
'transaction_id': unicode, 'transaction_id': unicode,
'label': unicode, 'label': unicode,
'date': datetime.datetime, 'date': datetime.datetime,
@@ -39,7 +39,8 @@ class TransactionIDFileParser(FileParser):
} }
# Order of cols does not matter but first row of the file has to be header # Order of cols does not matter but first row of the file has to be header
keys_to_validate = ['transaction_id', 'label', 'date', 'amount', 'commission_amount'] keys_to_validate = ['transaction_id', 'label', 'date', 'amount', 'commission_amount']
super(TransactionIDFileParser, self).__init__(parse_name, keys_to_validate=keys_to_validate, ftype=ftype, convertion_dict=convertion_dict) super(TransactionIDFileParser, self).__init__(parse_name, keys_to_validate=keys_to_validate,
ftype=ftype, conversion_dict=conversion_dict)
@classmethod @classmethod
def parser_for(cls, parser_name): def parser_for(cls, parser_name):