Project

General

Profile

« Previous | Next » 

Revision 9525

lib/tnrs.py: single_tnrs_request(): added support for a cumulative profiler using the cumulative_profiler kw param

View differences:

lib/tnrs.py
109 109
            +response)
110 110
    return match.groups()
111 111

  
112
def single_tnrs_request(names, debug=False):
112
def single_tnrs_request(names, debug=False, cumulative_profiler=None):
113 113
    '''
114 114
    Note that names containing only whitespace characters (after gwt_encode())
115 115
    are ignored by TNRS and do not receive a response row. Thus, you should
......
189 189
    finally:
190 190
        profiler.stop(name_ct)
191 191
        sys.stderr.write(profiler.msg()+'\n')
192
        
193
        if cumulative_profiler != None:
194
            cumulative_profiler.add_subprofiler(profiler)
195
            sys.stderr.write('Cumulatively: '+cumulative_profiler.msg()+'\n')
192 196

  
193 197
def tnrs_request(names, debug=False, **kw_args):
194 198
    for try_num in xrange(2):

Also available in: Unified diff