Revision 9520
Added by Aaron Marcuse-Kubitza over 11 years ago
lib/tnrs.py | ||
---|---|---|
190 | 190 |
profiler.stop(name_ct) |
191 | 191 |
sys.stderr.write(profiler.msg()+'\n') |
192 | 192 |
|
193 |
def repeated_tnrs_request(names, debug=False, **kw_args):
|
|
193 |
def tnrs_request(names, debug=False, **kw_args): |
|
194 | 194 |
for try_num in xrange(2): |
195 | 195 |
try: return single_tnrs_request(names, debug, **kw_args) |
196 | 196 |
except (urllib2.HTTPError, InvalidResponse), e: |
bin/tnrs_client | ||
---|---|---|
22 | 22 |
if not names: raise SystemExit('Usage: '+opts.env_usage(env_names, True) |
23 | 23 |
+' '+sys.argv[0]+' name... >out 2>>log') |
24 | 24 |
|
25 |
streams.copy(tnrs.repeated_tnrs_request(names, debug), sys.stdout)
|
|
25 |
streams.copy(tnrs.tnrs_request(names, debug), sys.stdout) |
|
26 | 26 |
|
27 | 27 |
main() |
bin/tnrs_db | ||
---|---|---|
54 | 54 |
# Run TNRS |
55 | 55 |
log('Making TNRS request') |
56 | 56 |
tnrs_profiler.start() |
57 |
try: stream = tnrs.repeated_tnrs_request(names)
|
|
57 |
try: stream = tnrs.tnrs_request(names) |
|
58 | 58 |
finally: |
59 | 59 |
tnrs_profiler.stop(iter_ct=this_ct) |
60 | 60 |
log('Cumulatively: '+tnrs_profiler.msg()) |
Also available in: Unified diff
lib/tnrs.py: repeated_tnrs_request(): renamed to tnrs_request() since this is the function that should usually be used, to ensure that debugging information is output in the case of an error. (the TNRS request must be made again to output this information.)