From 69998cc2e17f18a98d06dc073c4eab27f88a24b8 Mon Sep 17 00:00:00 2001 From: Steve Nyemba Date: Thu, 7 Nov 2019 01:07:15 -0600 Subject: [PATCH] bug fix with installer --- edi/{parse.py => parser.py} | 9 ++++---- setup.py | 45 ++++++++++++++++++++++--------------- 2 files changed, 32 insertions(+), 22 deletions(-) rename edi/{parse.py => parser.py} (96%) diff --git a/edi/parse.py b/edi/parser.py similarity index 96% rename from edi/parse.py rename to edi/parser.py index 6c362f6..b64ad1e 100644 --- a/edi/parse.py +++ b/edi/parser.py @@ -74,7 +74,7 @@ def format_proc(value): else: return value -def map(row,config,version): +def get_map(row,config,version): label = config['label'] if 'label' in config else None @@ -107,7 +107,7 @@ def map(row,config,version): # we are dealing with a complex object object_value = [] for row_item in row : - object_value.append( list(map(row_item,config,version))) + object_value.append( list(get_map(row_item,config,version))) # object_value = {label:object_value} return object_value @@ -145,7 +145,7 @@ def get_content(filename,config,section=None) : row = split(x12_file[3]) _info = get_config(config,row) - _default_value = list(map(row,_info,VERSION)) if _info else None + _default_value = get_map(row,_info,VERSION) if _info else None N = len(locations) for index in range(0,N-1): @@ -157,7 +157,8 @@ def get_content(filename,config,section=None) : _info = get_config(config,row) if _info : try: - tmp = map(row,_info,VERSION) + # tmp = get_map(row,_info,VERSION) + tmp = get_map(row,_info,VERSION) except Exception as e: if sys.verion_info[0] > 2 : logs.append ({"version":VERSION,"filename":filename,"msg":e.args[0],"X12":x12_file[beg:end]}) diff --git a/setup.py b/setup.py index a7d3906..3d95228 100644 --- a/setup.py +++ b/setup.py @@ -3,23 +3,32 @@ This is a build file for the """ from setuptools import setup, find_packages import os +import sys + def read(fname): return open(os.path.join(os.path.dirname(__file__), fname)).read() -setup( - name = "parse-edi", - version = "1.0.1", - author = "Vanderbilt University Medical Center", - author_email = "steve.l.nyemba@vanderbilt.edu", - license = "MIT", - packages=['edi'], - keywords=['healthcare', 'edi','x12','mongodb','couchdb','rabbitmq','file','read','write','s3'], - install_requires = [ - 'data-transport@git+https://dev.the-phi.com/git/steve/data-transport.git', - 'pymongo','numpy','cloudant','pika','boto','flask-session','smart_open'], - url="https://hiplab.mc.vanderbilt.edu/tools", - use_2to3=True, - long_description=read('README.md'), - convert_2to3_doctests=['README.md'], - #use_2to3_fixers=['your.fixers'], - use_2to3_exclude_fixers=['lib2to3.fixes.fix_import'], - ) +args = {"name":"parse-edi","version":"1.0.0","author":"Vanderbilt University Medical Center","license":"MIT","packages":["edi"],"keywords":["healthcare","edi","x12","data","transport","protocol"]} +args["install_requires"] = ['data-transport@git+https://dev.the-phi.com/git/steve/data-transport.git','pymongo','numpy','cloudant','pika','boto','flask-session','smart_open'] +args['url'] = 'https://hiplab.mc.vanderbilt.edu' +if sys.version_info[0] == 2 : + args['use_2to3'] = False + args['use_2to3_exclude_fixers'] = ['lib2to3.fixes.fix_import'] +setup(**args) +#setup( +# name = "parse-edi", +# version = "1.0", +# author = "Vanderbilt University Medical Center", +# author_email = "steve.l.nyemba@vanderbilt.edu", +# license = "MIT", +# packages=['edi'], +# keywords=['healthcare', 'edi','x12','mongodb','couchdb','rabbitmq','file','read','write','s3'], +# install_requires = [ +# 'data-transport@git+https://dev.the-phi.com/git/steve/data-transport.git', +# 'pymongo','numpy','cloudant','pika','boto','flask-session','smart_open'], +# url="https://hiplab.mc.vanderbilt.edu/tools", +# use_2to3=True, +# long_description=read('README.md'), +# convert_2to3_doctests=['README.md'], +# #use_2to3_fixers=['your.fixers'], +# use_2to3_exclude_fixers=['lib2to3.fixes.fix_import'], +# )