From 727dc8ef8de754545e8e951e0109ff8cd167da05 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Bernardo=20Mart=C3=ADnez=20Garrido?= Date: Fri, 17 Apr 2015 09:32:50 +0200 Subject: [PATCH 1/3] Corrected download link on the setup module. --- setup.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/setup.py b/setup.py index eb7abc3..cc04f8a 100644 --- a/setup.py +++ b/setup.py @@ -42,7 +42,7 @@ author_email='weso@weso.es', license='MIT', url='https://github.com/weso/CWR-DataApi', - download_url='https://github.com/weso/CWR-DataApi', + download_url='https://pypi.python.org/pypi/CWR-API', keywords=['CWR', 'commonworks', 'api', 'CISAC', 'parser'], platforms='any', classifiers=['License :: OSI Approved :: MIT License', 'Development Status :: 3 - Alpha', From d81ca6889955a5dcbebcd104f3bb2d71ba57fc58 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Bernardo=20Mart=C3=ADnez=20Garrido?= Date: Fri, 17 Apr 2015 10:21:19 +0200 Subject: [PATCH 2/3] Fixed imports. --- cwr/grammar/factory/field.py | 3 --- cwr/grammar/factory/rule.py | 1 - cwr/grammar/field/basic.py | 6 ------ cwr/grammar/field/record.py | 1 - cwr/grammar/field/special.py | 3 +-- cwr/interested_party.py | 4 ---- cwr/utils/mongo_encoder.py | 2 +- tests/visual/parsing_speed.py | 6 ++++-- 8 files changed, 6 insertions(+), 20 deletions(-) diff --git a/cwr/grammar/factory/field.py b/cwr/grammar/factory/field.py index 68d968b..a3581ca 100644 --- a/cwr/grammar/factory/field.py +++ b/cwr/grammar/factory/field.py @@ -1,7 +1,5 @@ # -*- coding: utf-8 -*- -import logging - from data.accessor import CWRConfiguration from cwr.grammar.factory.adapter import * from cwr.grammar.factory.rule import TerminalRuleFactory @@ -45,7 +43,6 @@ def get_field_base(self, id): characters. :param id: unique id in the system for the field - :param compulsory: indicates if the empty string is rejected or not :return: the rule of a field """ if self._logger: diff --git a/cwr/grammar/factory/rule.py b/cwr/grammar/factory/rule.py index 59563c1..476a0fd 100644 --- a/cwr/grammar/factory/rule.py +++ b/cwr/grammar/factory/rule.py @@ -1,7 +1,6 @@ # -*- coding: utf-8 -*- from abc import ABCMeta, abstractmethod -import logging import pyparsing as pp diff --git a/cwr/grammar/field/basic.py b/cwr/grammar/field/basic.py index 00a9ec9..1f45bae 100644 --- a/cwr/grammar/field/basic.py +++ b/cwr/grammar/field/basic.py @@ -189,7 +189,6 @@ def numeric_float(columns, nums_int, name=None): :param columns: number of columns for this field :param name: name for the field :param nums_int: characters, counting from the left, for the integer value - :param compulsory: indicates if the zero is disallowed :return: grammar for the float numeric field """ @@ -272,7 +271,6 @@ def boolean(name=None): Creates the grammar for a Boolean (F) field, accepting only 'Y' or 'N' :param name: name for the field - :param compulsory: indicates if the field must be filled :return: grammar for the flag field """ @@ -325,7 +323,6 @@ def flag(name=None): Creates the grammar for a Flag (F) field, accepting only 'Y', 'N' or 'U'. :param name: name for the field - :param compulsory: indicates if the empty flag is disallowed :return: grammar for the flag field """ @@ -384,7 +381,6 @@ def date(name=None): The field can be compulsory, in which case the empty date, composed only of zeros, is disallowed. :param name: name for the field - :param compulsory: indicates if the empty date is disallowed :return: grammar for the date field """ @@ -424,7 +420,6 @@ def time(name=None): Creates the grammar for a Time (D) field, accepting only numbers in a certain pattern. :param name: name for the field - :param compulsory: indicates if the empty time is disallowed :return: grammar for the date field """ @@ -465,7 +460,6 @@ def lookup(values, columns=1, name=None): :param columns: number of columns, for the case this field is left empty :param name: name for the field - :param compulsory: indicates if the empty string is disallowed :return: grammar for the lookup field """ if name is None: diff --git a/cwr/grammar/field/record.py b/cwr/grammar/field/record.py index 8c42549..f95de12 100644 --- a/cwr/grammar/field/record.py +++ b/cwr/grammar/field/record.py @@ -33,7 +33,6 @@ def record_type(values): While it is possible to set this field as optional, it is expected to be compulsory. :param values: allowed record type codes - :param compulsory: indicates if the empty string is disallowed :return: grammar for the record type field """ field = basic.lookup(values, columns=_config.field_size('record', 'record_type'), diff --git a/cwr/grammar/field/special.py b/cwr/grammar/field/special.py index 107355f..9acf3c7 100644 --- a/cwr/grammar/field/special.py +++ b/cwr/grammar/field/special.py @@ -388,8 +388,7 @@ def _combine_date_time(data): """ Combines the received date and time. - :param date: date to combine - :param time: time to combine + :param data: date and time to combine :return: the date and time combined """ return datetime.datetime.combine(data.date, data.time) \ No newline at end of file diff --git a/cwr/interested_party.py b/cwr/interested_party.py index b6a1d8a..bd5689a 100644 --- a/cwr/interested_party.py +++ b/cwr/interested_party.py @@ -97,10 +97,6 @@ def __init__(self, record_type, transaction_sequence_n, record_sequence_n, sr_society=None, sr_ownership_share=0): """ Constructs an InterestedPartyRecord. - - :param first_recording_refusal: record refusal status flag - :param first_record_refusal: first record refusal flag - :param usa_license: USA license rights flag """ super(InterestedPartyRecord, self).__init__(record_type, transaction_sequence_n, record_sequence_n) # Flags diff --git a/cwr/utils/mongo_encoder.py b/cwr/utils/mongo_encoder.py index bca8fbf..b031e42 100644 --- a/cwr/utils/mongo_encoder.py +++ b/cwr/utils/mongo_encoder.py @@ -1,5 +1,5 @@ # -*- coding: utf-8 -*- -from cwr.utils.dict_encoder import CWRDictionaryEncoder +from cwr.parser.dictionary import CWRDictionaryEncoder """ Offers classes to create Mongo dictionaries from model objects. diff --git a/tests/visual/parsing_speed.py b/tests/visual/parsing_speed.py index 3333912..8ec68f3 100644 --- a/tests/visual/parsing_speed.py +++ b/tests/visual/parsing_speed.py @@ -4,7 +4,7 @@ import sys import chardet -from cwr.grammar.transaction import file as rule_file +from cwr.parser.file import CWRFileDecoder """ @@ -62,8 +62,10 @@ def _read(file): time_read = (finish - start) time_read_avg += time_read + decoder = CWRFileDecoder() + start = time.clock() - data = rule_file.cwr_transmission.parseString(file)[0] + data = decoder.decode(path) finish = time.clock() time_parse = (finish - start) time_parse_avg += time_parse From 4e12d7a441eface63c5ec7f60ba95d3de6c637ce Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Bernardo=20Mart=C3=ADnez=20Garrido?= Date: Fri, 17 Apr 2015 10:23:08 +0200 Subject: [PATCH 3/3] Updated version number. --- cwr/__init__.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/cwr/__init__.py b/cwr/__init__.py index e2e76a9..be7a5c5 100644 --- a/cwr/__init__.py +++ b/cwr/__init__.py @@ -7,5 +7,5 @@ :license: MIT, see LICENSE for more details. """ -__version__ = '0.0.8' +__version__ = '0.0.9' __license__ = 'MIT' \ No newline at end of file