From 1fec6dce6638bb019206c205f719d504061656e3 Mon Sep 17 00:00:00 2001
From: Benoit Thiell <bthiell@cfa.harvard.edu>
Date: Mon, 2 Aug 2010 07:26:30 -0400
Subject: [PATCH] WebSearch: Verbosity of the search engine via CLI
* The debug messages are now written to stdout if no
request object is passed to the functions.
(fixes #223)
---
modules/websearch/lib/search_engine.py | 105 ++++++++++++++++---------------
1 files changed, 54 insertions(+), 51 deletions(-)
diff --git a/modules/websearch/lib/search_engine.py b/modules/websearch/lib/search_engine.py
index 9d83b5c..d6d288d 100644
|
a
|
b
|
def create_basic_search_units(req, p, f, m=None, of='hb'): |
| 597 | 597 | else: |
| 598 | 598 | opfts.append(['|', word, f, 'w']) # '|' in further units |
| 599 | 599 | else: |
| 600 | | if of.startswith("h"): |
| | 600 | if of.startswith("h") or req is None: |
| 601 | 601 | print_warning(req, "Matching type '%s' is not implemented yet." % cgi.escape(m), "Warning") |
| 602 | 602 | opfts.append(['+', "%" + p + "%", f, 'w']) |
| 603 | 603 | else: |
| … |
… |
def create_basic_search_units(req, p, f, m=None, of='hb'): |
| 688 | 688 | try: |
| 689 | 689 | pi = opfts[i][1] |
| 690 | 690 | if pi == '*': |
| 691 | | if of.startswith("h"): |
| | 691 | if of.startswith("h") or req is None: |
| 692 | 692 | print_warning(req, "Ignoring standalone wildcard word.", "Warning") |
| 693 | 693 | del opfts[i] |
| 694 | 694 | if pi == '' or pi == ' ': |
| 695 | 695 | fi = opfts[i][2] |
| 696 | 696 | if fi: |
| 697 | | if of.startswith("h"): |
| | 697 | if of.startswith("h") or req is None: |
| 698 | 698 | print_warning(req, "Ignoring empty <em>%s</em> search term." % fi, "Warning") |
| 699 | 699 | del opfts[i] |
| 700 | 700 | except: |
| … |
… |
def search_pattern(req=None, p=None, f=None, m=None, ap=0, of="id", verbose=0, l |
| 1741 | 1741 | # no pattern, so return all universe |
| 1742 | 1742 | return hitset_full |
| 1743 | 1743 | # search stage 1: break up arguments into basic search units: |
| 1744 | | if verbose and of.startswith("h"): |
| | 1744 | if verbose and (of.startswith("h") or req is None): |
| 1745 | 1745 | t1 = os.times()[4] |
| 1746 | 1746 | basic_search_units = create_basic_search_units(req, p, f, m, of) |
| 1747 | | if verbose and of.startswith("h"): |
| | 1747 | if verbose and (of.startswith("h") or req is None): |
| 1748 | 1748 | t2 = os.times()[4] |
| 1749 | 1749 | print_warning(req, "Search stage 1: basic search units are: %s" % cgi.escape(repr(basic_search_units))) |
| 1750 | 1750 | print_warning(req, "Search stage 1: execution took %.2f seconds." % (t2 - t1)) |
| 1751 | 1751 | # search stage 2: do search for each search unit and verify hit presence: |
| 1752 | | if verbose and of.startswith("h"): |
| | 1752 | if verbose and (of.startswith("h") or req is None): |
| 1753 | 1753 | t1 = os.times()[4] |
| 1754 | 1754 | basic_search_units_hitsets = [] |
| 1755 | 1755 | #prepare hiddenfield-related.. |
| … |
… |
def search_pattern(req=None, p=None, f=None, m=None, ap=0, of="id", verbose=0, l |
| 1773 | 1773 | if samelenfield == htag: #user searches by a hidden tag |
| 1774 | 1774 | #we won't show you anything.. |
| 1775 | 1775 | basic_search_unit_hitset = HitSet() |
| 1776 | | if verbose >= 9 and of.startswith("h"): |
| | 1776 | if verbose >= 9 and (of.startswith("h") or req is None): |
| 1777 | 1777 | print_warning(req, "Pattern %s hitlist omitted since \ |
| 1778 | 1778 | it queries in a hidden tag %s" % |
| 1779 | 1779 | (repr(bsu_p), repr(myhiddens))) |
| 1780 | 1780 | display_nearest_terms_box=False #..and stop spying, too. |
| 1781 | 1781 | |
| 1782 | | if verbose >= 9 and of.startswith("h"): |
| | 1782 | if verbose >= 9 and (of.startswith("h") or req is None): |
| 1783 | 1783 | print_warning(req, "Search stage 1: pattern %s gave hitlist %s" % (cgi.escape(bsu_p), basic_search_unit_hitset)) |
| 1784 | 1784 | if len(basic_search_unit_hitset) > 0 or \ |
| 1785 | 1785 | ap==0 or \ |
| … |
… |
def search_pattern(req=None, p=None, f=None, m=None, ap=0, of="id", verbose=0, l |
| 1798 | 1798 | bsu_pn = re.sub(r'[^a-zA-Z0-9\s\:]+', "*", bsu_p) |
| 1799 | 1799 | else: # it is WRD query |
| 1800 | 1800 | bsu_pn = re.sub(r'[^a-zA-Z0-9\s\:]+', " ", bsu_p) |
| 1801 | | if verbose and of.startswith('h') and req: |
| | 1801 | if verbose and (of.startswith('h') or req is None): |
| 1802 | 1802 | print_warning(req, "Trying (%s,%s,%s)" % (cgi.escape(bsu_pn), cgi.escape(bsu_f), cgi.escape(bsu_m))) |
| 1803 | | basic_search_unit_hitset = search_pattern(req=None, p=bsu_pn, f=bsu_f, m=bsu_m, of="id", ln=ln) |
| | 1803 | basic_search_unit_hitset = search_pattern(req=None, p=bsu_pn, |
| | 1804 | f=bsu_f, m=bsu_m, of="id", verbose=verbose, ln=ln) |
| 1804 | 1805 | if len(basic_search_unit_hitset) > 0: |
| 1805 | 1806 | # we retain the new unit instead |
| 1806 | | if of.startswith('h'): |
| | 1807 | if of.startswith('h') or req is None: |
| 1807 | 1808 | print_warning(req, _("No exact match found for %(x_query1)s, using %(x_query2)s instead...") % \ |
| 1808 | 1809 | {'x_query1': "<em>" + cgi.escape(bsu_p) + "</em>", |
| 1809 | 1810 | 'x_query2': "<em>" + cgi.escape(bsu_pn) + "</em>"}) |
| … |
… |
def search_pattern(req=None, p=None, f=None, m=None, ap=0, of="id", verbose=0, l |
| 1811 | 1812 | basic_search_units_hitsets.append(basic_search_unit_hitset) |
| 1812 | 1813 | else: |
| 1813 | 1814 | # stage 2-3: no hits found either, propose nearest indexed terms: |
| 1814 | | if of.startswith('h') and display_nearest_terms_box: |
| 1815 | | if req: |
| 1816 | | if bsu_f == "recid": |
| 1817 | | print_warning(req, _("Requested record does not seem to exist.")) |
| 1818 | | else: |
| 1819 | | print_warning(req, create_nearest_terms_box(req.argd, bsu_p, bsu_f, bsu_m, ln=ln)) |
| 1820 | | return hitset_empty |
| 1821 | | else: |
| 1822 | | # stage 2-3: no hits found either, propose nearest indexed terms: |
| 1823 | | if of.startswith('h') and display_nearest_terms_box: |
| 1824 | | if req: |
| | 1815 | if req is not None and of.startswith('h') and display_nearest_terms_box: |
| 1825 | 1816 | if bsu_f == "recid": |
| 1826 | 1817 | print_warning(req, _("Requested record does not seem to exist.")) |
| 1827 | 1818 | else: |
| 1828 | 1819 | print_warning(req, create_nearest_terms_box(req.argd, bsu_p, bsu_f, bsu_m, ln=ln)) |
| | 1820 | return hitset_empty |
| | 1821 | else: |
| | 1822 | # stage 2-3: no hits found either, propose nearest indexed terms: |
| | 1823 | if req is not None and of.startswith('h') and display_nearest_terms_box: |
| | 1824 | if bsu_f == "recid": |
| | 1825 | print_warning(req, _("Requested record does not seem to exist.")) |
| | 1826 | else: |
| | 1827 | print_warning(req, create_nearest_terms_box(req.argd, bsu_p, bsu_f, bsu_m, ln=ln)) |
| 1829 | 1828 | return hitset_empty |
| 1830 | | if verbose and of.startswith("h"): |
| | 1829 | if verbose and (of.startswith("h") or req is None): |
| 1831 | 1830 | t2 = os.times()[4] |
| 1832 | 1831 | for idx_unit in range(0, len(basic_search_units)): |
| 1833 | 1832 | print_warning(req, "Search stage 2: basic search unit %s gave %d hits." % |
| 1834 | 1833 | (basic_search_units[idx_unit][1:], len(basic_search_units_hitsets[idx_unit]))) |
| 1835 | 1834 | print_warning(req, "Search stage 2: execution took %.2f seconds." % (t2 - t1)) |
| 1836 | 1835 | # search stage 3: apply boolean query for each search unit: |
| 1837 | | if verbose and of.startswith("h"): |
| | 1836 | if verbose and (of.startswith("h") or req is None): |
| 1838 | 1837 | t1 = os.times()[4] |
| 1839 | 1838 | # let the initial set be the complete universe: |
| 1840 | 1839 | hitset_in_any_collection = HitSet(trailing_bits=1) |
| … |
… |
def search_pattern(req=None, p=None, f=None, m=None, ap=0, of="id", verbose=0, l |
| 1849 | 1848 | elif this_unit_operation == '|': |
| 1850 | 1849 | hitset_in_any_collection.union_update(this_unit_hitset) |
| 1851 | 1850 | else: |
| 1852 | | if of.startswith("h"): |
| | 1851 | if of.startswith("h") or req is None: |
| 1853 | 1852 | print_warning(req, "Invalid set operation %s." % cgi.escape(this_unit_operation), "Error") |
| 1854 | 1853 | if len(hitset_in_any_collection) == 0: |
| 1855 | 1854 | # no hits found, propose alternative boolean query: |
| … |
… |
def search_pattern(req=None, p=None, f=None, m=None, ap=0, of="id", verbose=0, l |
| 1873 | 1872 | text = websearch_templates.tmpl_search_no_boolean_hits( |
| 1874 | 1873 | ln=ln, nearestterms=nearestterms) |
| 1875 | 1874 | print_warning(req, text) |
| 1876 | | if verbose and of.startswith("h"): |
| | 1875 | if verbose and (of.startswith("h") or req is None): |
| 1877 | 1876 | t2 = os.times()[4] |
| 1878 | 1877 | print_warning(req, "Search stage 3: boolean query gave %d hits." % len(hitset_in_any_collection)) |
| 1879 | 1878 | print_warning(req, "Search stage 3: execution took %.2f seconds." % (t2 - t1)) |
| … |
… |
def search_pattern_parenthesised(req=None, p=None, f=None, m=None, ap=0, of="id" |
| 1905 | 1904 | |
| 1906 | 1905 | # parse the query. The result is list of [op1, expr1, op2, expr2, ..., opN, exprN] |
| 1907 | 1906 | parsing_result = parser.parse_query(p) |
| 1908 | | if verbose and of.startswith("h"): |
| | 1907 | if verbose and (of.startswith("h") or req is None): |
| 1909 | 1908 | print_warning(req, "Search stage 1: search_pattern_parenthesised() returned %s." % repr(parsing_result)) |
| 1910 | 1909 | |
| 1911 | 1910 | # go through every pattern |
| … |
… |
def intersect_results_with_collrecs(req, hitset_in_any_collection, colls, ap=0, |
| 2204 | 2203 | _ = gettext_set_language(ln) |
| 2205 | 2204 | |
| 2206 | 2205 | # search stage 4: intersect with the collection universe: |
| 2207 | | if verbose and of.startswith("h"): |
| | 2206 | if verbose and (of.startswith("h") or req is None): |
| 2208 | 2207 | t1 = os.times()[4] |
| 2209 | 2208 | results = {} |
| 2210 | 2209 | results_nbhits = 0 |
| … |
… |
def intersect_results_with_collrecs(req, hitset_in_any_collection, colls, ap=0, |
| 2231 | 2230 | "If you were looking for a non-public document, please choose " |
| 2232 | 2231 | "the desired restricted collection first.")) |
| 2233 | 2232 | results = {} |
| 2234 | | if verbose and of.startswith("h"): |
| | 2233 | if verbose and (of.startswith("h") or req is None): |
| 2235 | 2234 | t2 = os.times()[4] |
| 2236 | | print_warning(req, "Search stage 4: intersecting with collection universe gave %d hits." % results_nbhits) |
| | 2235 | print_warning(req, "Search stage 4: intersecting with collection%s '%s' " |
| | 2236 | "gave %d hits." % (len(colls) > 1 and 's' or '', |
| | 2237 | ', '.join(colls), results_nbhits)) |
| 2237 | 2238 | print_warning(req, "Search stage 4: execution took %.2f seconds." % (t2 - t1)) |
| 2238 | 2239 | return results |
| 2239 | 2240 | |
| … |
… |
def get_modification_date(recID, fmt="%Y-%m-%d"): |
| 2957 | 2958 | |
| 2958 | 2959 | def print_warning(req, msg, type='', prologue='<br />', epilogue='<br />'): |
| 2959 | 2960 | "Prints warning message and flushes output." |
| 2960 | | if req and msg: |
| | 2961 | if req is None: |
| | 2962 | print msg |
| | 2963 | elif msg: |
| 2961 | 2964 | req.write(websearch_templates.tmpl_print_warning( |
| 2962 | 2965 | msg = msg, |
| 2963 | 2966 | type = type, |
| … |
… |
def perform_request_search(req=None, cc=CFG_SITE_NAME, c=None, p="", f="", rg=CF |
| 4303 | 4306 | # Print empty, but valid XML |
| 4304 | 4307 | print_records_prologue(req, of) |
| 4305 | 4308 | print_records_epilogue(req, of) |
| 4306 | | elif of.startswith("h"): |
| 4307 | | if req.header_only: |
| | 4309 | elif of.startswith("h") or req is None: |
| | 4310 | if req is not None and req.header_only: |
| 4308 | 4311 | raise apache.SERVER_RETURN, apache.HTTP_NOT_FOUND |
| 4309 | 4312 | else: |
| 4310 | 4313 | print_warning(req, _("Requested record does not seem to exist.")) |
| … |
… |
def perform_request_search(req=None, cc=CFG_SITE_NAME, c=None, p="", f="", rg=CF |
| 4341 | 4344 | p2, f2, m2, op2, p3, f3, m3, sc, pl, d1y, d1m, d1d, d2y, d2m, d2d, dt, jrec, ec, action)) |
| 4342 | 4345 | if record_exists(p[6:]) != 1: |
| 4343 | 4346 | # record does not exist |
| 4344 | | if of.startswith("h"): |
| 4345 | | if req.header_only: |
| | 4347 | if of.startswith("h") or req is None: |
| | 4348 | if req is not None and req.header_only: |
| 4346 | 4349 | raise apache.SERVER_RETURN, apache.HTTP_NOT_FOUND |
| 4347 | 4350 | else: |
| 4348 | 4351 | print_warning(req, _("Requested record does not seem to exist.")) |
| … |
… |
def perform_request_search(req=None, cc=CFG_SITE_NAME, c=None, p="", f="", rg=CF |
| 4375 | 4378 | results_similar_relevances, results_similar_relevances_prologue, results_similar_relevances_epilogue, search_pattern=p, verbose=verbose) |
| 4376 | 4379 | else: |
| 4377 | 4380 | # rank_records failed and returned some error message to display: |
| 4378 | | if of.startswith("h"): |
| | 4381 | if of.startswith("h") or req is None: |
| 4379 | 4382 | print_warning(req, results_similar_relevances_prologue) |
| 4380 | 4383 | print_warning(req, results_similar_relevances_epilogue) |
| 4381 | 4384 | print_warning(req, results_similar_comments) |
| … |
… |
def perform_request_search(req=None, cc=CFG_SITE_NAME, c=None, p="", f="", rg=CF |
| 4395 | 4398 | recID = p[12:] |
| 4396 | 4399 | if record_exists(recID) != 1: |
| 4397 | 4400 | # record does not exist |
| 4398 | | if of.startswith("h"): |
| | 4401 | if of.startswith("h") or req is None: |
| 4399 | 4402 | print_warning(req, _("Requested record does not seem to exist.")) |
| 4400 | 4403 | if of == "id": |
| 4401 | 4404 | return [] |
| … |
… |
def perform_request_search(req=None, cc=CFG_SITE_NAME, c=None, p="", f="", rg=CF |
| 4423 | 4426 | |
| 4424 | 4427 | else: |
| 4425 | 4428 | # cited rank_records failed and returned some error message to display: |
| 4426 | | if of.startswith("h"): |
| | 4429 | if of.startswith("h") or req is None: |
| 4427 | 4430 | print_warning(req, "nothing found") |
| 4428 | 4431 | if of == "id": |
| 4429 | 4432 | return [] |
| … |
… |
def perform_request_search(req=None, cc=CFG_SITE_NAME, c=None, p="", f="", rg=CF |
| 4455 | 4458 | if result[1] == None or result[1] == False: |
| 4456 | 4459 | # these are the searches the returned no or zero results |
| 4457 | 4460 | if verbose: |
| 4458 | | print_warning(req, "Hosted collections (perform_search_request): %s returned no results" % result[0][1].name) |
| | 4461 | print_warning(req, "Hosted collections (perform_request_search): %s returned no results" % result[0][1].name) |
| 4459 | 4462 | else: |
| 4460 | 4463 | # these are the searches that actually returned results on time |
| 4461 | 4464 | hosted_colls_true_results.append(result) |
| 4462 | 4465 | if verbose: |
| 4463 | | print_warning(req, "Hosted collections (perform_search_request): %s returned %s results in %s seconds" % (result[0][1].name, result[1], result[2])) |
| | 4466 | print_warning(req, "Hosted collections (perform_request_search): %s returned %s results in %s seconds" % (result[0][1].name, result[1], result[2])) |
| 4464 | 4467 | else: |
| 4465 | 4468 | if verbose: |
| 4466 | | print_warning(req, "Hosted collections (perform_search_request): there were no hosted collections results to be printed at this time") |
| | 4469 | print_warning(req, "Hosted collections (perform_request_search): there were no hosted collections results to be printed at this time") |
| 4467 | 4470 | if hosted_colls_timeouts: |
| 4468 | 4471 | if verbose: |
| 4469 | 4472 | for timeout in hosted_colls_timeouts: |
| 4470 | | print_warning(req, "Hosted collections (perform_search_request): %s timed out and will be searched again later" % timeout[0][1].name) |
| | 4473 | print_warning(req, "Hosted collections (perform_request_search): %s timed out and will be searched again later" % timeout[0][1].name) |
| 4471 | 4474 | # we need to know for later use if there were any hosted collections to be searched even if they weren't in the end |
| 4472 | 4475 | elif hosted_colls and ((not (of.startswith("h") or of.startswith("x"))) or p.startswith("recid:")): |
| 4473 | 4476 | (hosted_colls_results, hosted_colls_timeouts) = (None, None) |
| 4474 | 4477 | else: |
| 4475 | 4478 | if verbose: |
| 4476 | | print_warning(req, "Hosted collections (perform_search_request): there were no hosted collections to be searched") |
| | 4479 | print_warning(req, "Hosted collections (perform_request_search): there were no hosted collections to be searched") |
| 4477 | 4480 | |
| 4478 | 4481 | ## let's define some useful boolean variables: |
| 4479 | 4482 | # True means there are actual or potential hosted collections results to be printed |
| … |
… |
def perform_request_search(req=None, cc=CFG_SITE_NAME, c=None, p="", f="", rg=CF |
| 4512 | 4515 | elif op1 == "n": # not |
| 4513 | 4516 | results_in_any_collection.difference_update(results_tmp) |
| 4514 | 4517 | else: |
| 4515 | | if of.startswith("h"): |
| | 4518 | if of.startswith("h") or req is None: |
| 4516 | 4519 | print_warning(req, "Invalid set operation %s." % cgi.escape(op1), "Error") |
| 4517 | 4520 | if len(results_in_any_collection) == 0: |
| 4518 | 4521 | if of.startswith("h"): |
| … |
… |
def perform_request_search(req=None, cc=CFG_SITE_NAME, c=None, p="", f="", rg=CF |
| 4531 | 4534 | elif op2 == "n": # not |
| 4532 | 4535 | results_in_any_collection.difference_update(results_tmp) |
| 4533 | 4536 | else: |
| 4534 | | if of.startswith("h"): |
| | 4537 | if of.startswith("h") or req is None: |
| 4535 | 4538 | print_warning(req, "Invalid set operation %s." % cgi.escape(op2), "Error") |
| 4536 | 4539 | except: |
| 4537 | 4540 | register_exception(req=req, alert_admin=True) |
| … |
… |
def perform_request_search(req=None, cc=CFG_SITE_NAME, c=None, p="", f="", rg=CF |
| 4550 | 4553 | # query is not in the cache already, so reuse it: |
| 4551 | 4554 | query_in_cache = True |
| 4552 | 4555 | results_in_any_collection = search_results_cache.cache[query_representation_in_cache] |
| 4553 | | if verbose and of.startswith("h"): |
| | 4556 | if verbose and (of.startswith("h") or req is None): |
| 4554 | 4557 | print_warning(req, "Search stage 0: query found in cache, reusing cached results.") |
| 4555 | 4558 | else: |
| 4556 | 4559 | try: |
| … |
… |
def perform_request_search(req=None, cc=CFG_SITE_NAME, c=None, p="", f="", rg=CF |
| 4580 | 4583 | if len(search_results_cache.cache) > CFG_WEBSEARCH_SEARCH_CACHE_SIZE: |
| 4581 | 4584 | search_results_cache.clear() |
| 4582 | 4585 | search_results_cache.cache[query_representation_in_cache] = results_in_any_collection |
| 4583 | | if verbose and of.startswith("h"): |
| | 4586 | if verbose and (of.startswith("h") or req is None): |
| 4584 | 4587 | print_warning(req, "Search stage 3: storing query results in cache.") |
| 4585 | 4588 | |
| 4586 | 4589 | # search stage 4: intersection with collection universe: |
| … |
… |
def perform_request_search(req=None, cc=CFG_SITE_NAME, c=None, p="", f="", rg=CF |
| 4610 | 4613 | |
| 4611 | 4614 | # search stage 5: apply search option limits and restrictions: |
| 4612 | 4615 | if datetext1 != "" and results_final != {}: |
| 4613 | | if verbose and of.startswith("h"): |
| | 4616 | if verbose and (of.startswith("h") or req is None): |
| 4614 | 4617 | print_warning(req, "Search stage 5: applying time etc limits, from %s until %s..." % (datetext1, datetext2)) |
| 4615 | 4618 | try: |
| 4616 | 4619 | results_final = intersect_results_with_hitset(req, |
| … |
… |
def perform_request_search(req=None, cc=CFG_SITE_NAME, c=None, p="", f="", rg=CF |
| 4637 | 4640 | |
| 4638 | 4641 | if pl and results_final != {}: |
| 4639 | 4642 | pl = wash_pattern(pl) |
| 4640 | | if verbose and of.startswith("h"): |
| | 4643 | if verbose and (of.startswith("h") or req is None): |
| 4641 | 4644 | print_warning(req, "Search stage 5: applying search pattern limit %s..." % cgi.escape(pl)) |
| 4642 | 4645 | try: |
| 4643 | 4646 | results_final = intersect_results_with_hitset(req, |
| … |
… |
def perform_request_search(req=None, cc=CFG_SITE_NAME, c=None, p="", f="", rg=CF |
| 4706 | 4709 | |
| 4707 | 4710 | # we continue past this point only if there is a hosted collection that has timed out and might offer potential results |
| 4708 | 4711 | if results_final_nb_total ==0 and not hosted_colls_potential_results_p: |
| 4709 | | if of.startswith("h"): |
| | 4712 | if of.startswith("h") or req is None: |
| 4710 | 4713 | print_warning(req, "No match found, please enter different search terms.") |
| 4711 | 4714 | elif of.startswith("x"): |
| 4712 | 4715 | # Print empty, but valid XML |
| … |
… |
def perform_request_search(req=None, cc=CFG_SITE_NAME, c=None, p="", f="", rg=CF |
| 4766 | 4769 | rank_records(rm, 0, results_final[coll], |
| 4767 | 4770 | string.split(p) + string.split(p1) + |
| 4768 | 4771 | string.split(p2) + string.split(p3), verbose) |
| 4769 | | if of.startswith("h"): |
| | 4772 | if of.startswith("h") or req is None: |
| 4770 | 4773 | print_warning(req, results_final_comments) |
| 4771 | 4774 | if results_final_recIDs_ranked: |
| 4772 | 4775 | results_final_recIDs = results_final_recIDs_ranked |