Skip to content

Commit

Permalink
MNT : removed debugging, converted print to logging
Browse files Browse the repository at this point in the history
  • Loading branch information
tacaswell committed Dec 31, 2014
1 parent 9b47371 commit 4f079de
Show file tree
Hide file tree
Showing 2 changed files with 9 additions and 25 deletions.
12 changes: 3 additions & 9 deletions vt_config/NSLS-II/init.py
Original file line number Diff line number Diff line change
Expand Up @@ -110,7 +110,6 @@ def get_modules():
'vttools.to_wrap.fitting',
]

fail_count = 0
for mod_name in mod_targets:
print('=' * 25)
print('starting module {}'.format(mod_name))
Expand All @@ -123,14 +122,9 @@ def get_modules():
tmp = wrap_lib.wrap_function(**spec_dict)
vtfuncs.append(tmp)
except Exception as e:
fail_count += 1
print('+' * 25)
print('failed wrapping on {}.{}'.format(mod_name, ftw))
print(e)
# print(traceback.format_exc())
print('+' * 25)

print("TOTAL FAILED TO WRAP: ", fail_count)
logger.warn("%s failed wrapping on %s.%s",
e, mod_name, ftw)

all_mods = vtmods + vtfuncs
if len(all_mods) != len(set(all_mods)):
raise ValueError('Some modules have been imported multiple times.\n'
Expand Down
22 changes: 6 additions & 16 deletions vttools/scrape.py
Original file line number Diff line number Diff line change
Expand Up @@ -539,10 +539,8 @@ def define_input_ports(docstring, func, short_description_word_count=4):
if try_norm is not None:
is_enum = False
enum_list = []
print('-' * 25)
print("abuse of enum {} |{} <{}>|".format(
func.__name__, the_name, the_type))
print('-' * 25)
logger.warning("abuse of enum %s |%s <%s>|",
func.__name__, the_name, the_type)
normed_type = try_norm
# see if we still need to normalize
if normed_type is None:
Expand Down Expand Up @@ -577,12 +575,6 @@ def define_input_ports(docstring, func, short_description_word_count=4):
'optional': is_optional,
'signature': sig_map[port_type]}


## try:
## pdict['default'] = default_dict[port_name]
## except KeyError:
## pass

# deal with if the function as an enum attribute
if hasattr(func, port_name):
f_enums = getattr(func, port_name)
Expand Down Expand Up @@ -638,7 +630,8 @@ def define_output_ports(docstring, short_description_word_count=4):
if try_norm is not None:
is_enum = False
enum_list = []
print("abuse of enum", docstring['Signature'], the_type)
logger.warning("abuse of enum %s | <%s>|",
docstring['Signature'], the_type)
normed_type = try_norm

# first try to parse
Expand Down Expand Up @@ -807,10 +800,7 @@ def scrape_module(module_path, black_list=None,
spec_dict = scrape_function(ftw, module_path)
ret[ftw] = spec_dict
except Exception as e:
print('*' * 25)
print('failed scraping on {}.{}'.format(module_path, ftw))
print(e)
# print(traceback.format_exc())
print('*' * 25)
logger.warn("%s failed scraping on %s.%s",
e, module_path, ftw)

return ret

0 comments on commit 4f079de

Please sign in to comment.