rem stringlengths 0 322k | add stringlengths 0 2.05M | context stringlengths 8 228k |
|---|---|---|
<td colspan="3" height="3"> </td> | <th class="searchboxheader"> Added since: </th> <th class="searchboxheader"> until: </th> | def create_search_box(cc, colls, p, f, rg, sf, so, sp, of, ot, as, p1, f1, m1, op1, p2, f2, m2, op2, p3, f3, m3, sc, d1y, d1m, d1d, d2y, d2m, d2d): "Create search box for 'search again in the results page' functionality." out = "" # print search box prolog: out += """ <form action="%s/search.py" method="get"> <strong c... |
<td>%s</td> <td>%s</td> | <td class="searchboxbody">%s</td> <td class="searchboxbody">%s</td> | def create_search_box(cc, colls, p, f, rg, sf, so, sp, of, ot, as, p1, f1, m1, op1, p2, f2, m2, op2, p3, f3, m3, sc, d1y, d1m, d1d, d2y, d2m, d2d): "Create search box for 'search again in the results page' functionality." out = "" # print search box prolog: out += """ <form action="%s/search.py" method="get"> <strong c... |
</table>""" % \ | </tbody> </table>""" % \ | def create_search_box(cc, colls, p, f, rg, sf, so, sp, of, ot, as, p1, f1, m1, op1, p2, f2, m2, op2, p3, f3, m3, sc, d1y, d1m, d1d, d2y, d2m, d2d): "Create search box for 'search again in the results page' functionality." out = "" # print search box prolog: out += """ <form action="%s/search.py" method="get"> <strong c... |
cell_1_left = """<small><strong>Sort by:</strong></small><br> | cell_1_left = """ | def create_search_box(cc, colls, p, f, rg, sf, so, sp, of, ot, as, p1, f1, m1, op1, p2, f2, m2, op2, p3, f3, m3, sc, d1y, d1m, d1d, d2y, d2m, d2d): "Create search box for 'search again in the results page' functionality." out = "" # print search box prolog: out += """ <form action="%s/search.py" method="get"> <strong c... |
cell_1_right = """<small><strong>Output format:</strong></small><br> | cell_1_right = """ | def create_search_box(cc, colls, p, f, rg, sf, so, sp, of, ot, as, p1, f1, m1, op1, p2, f2, m2, op2, p3, f3, m3, sc, d1y, d1m, d1d, d2y, d2m, d2d): "Create search box for 'search again in the results page' functionality." out = "" # print search box prolog: out += """ <form action="%s/search.py" method="get"> <strong c... |
cell_1_middle = """<small><strong>Display results:</strong></small><br> | cell_1_middle = """ | def create_search_box(cc, colls, p, f, rg, sf, so, sp, of, ot, as, p1, f1, m1, op1, p2, f2, m2, op2, p3, f3, m3, sc, d1y, d1m, d1d, d2y, d2m, d2d): "Create search box for 'search again in the results page' functionality." out = "" # print search box prolog: out += """ <form action="%s/search.py" method="get"> <strong c... |
<tr> <td valign="top"> <table><tr valign="top"><td>%s</td><td>%s</td><td>%s</td></tr></table> </td> </tr>""" % (cell_1_left, cell_1_middle, cell_1_right) | <table class="searchbox"> <thead> <tr> <th class="searchboxheader"> Sort by: </th> <th class="searchboxheader"> Display results: </th> <th class="searchboxheader"> Output format: </th> </tr> </thead> <tbody> <tr valign="bottom"> <td valign="top" class="searchboxbody">%s</td> <td valign="top" class="searchboxbody">%s</t... | def create_search_box(cc, colls, p, f, rg, sf, so, sp, of, ot, as, p1, f1, m1, op1, p2, f2, m2, op2, p3, f3, m3, sc, d1y, d1m, d1d, d2y, d2m, d2d): "Create search box for 'search again in the results page' functionality." out = "" # print search box prolog: out += """ <form action="%s/search.py" method="get"> <strong c... |
header="""<table width="100%" border="0" cellspacing="0" cellpadding="0"><tr class="pageboxlefttop"><td><small>""", \ | header="""<table class="navtrailbox"><tr><td width="15"> </td><td class="navtrailboxbody"><small>""", \ | def create_navtrail(cc=cdsname, as=0, header="""<table width="100%" border="0" cellspacing="0" cellpadding="0"><tr class="pageboxlefttop"><td><small>""", \ prolog="", \ separator=">", \ epilog="", \ footer="> Search Results</small></td></tr></table>", exclude_root=0): """Creates navigation trail, i.e. links to an... |
footer="> Search Results</small></td></tr></table>", | footer="> Search Results</td></tr></table><br>", | def create_navtrail(cc=cdsname, as=0, header="""<table width="100%" border="0" cellspacing="0" cellpadding="0"><tr class="pageboxlefttop"><td><small>""", \ prolog="", \ separator=">", \ epilog="", \ footer="> Search Results</small></td></tr></table>", exclude_root=0): """Creates navigation trail, i.e. links to an... |
prolog="""<table border=0 cellpadding=0 cellspacing=0><tr><td width="30"></td><td class="pageboxrighttopadd"><small><strong>Try your search on:</strong><br> """, | prolog="""<table align="right" class="googlebox"><tr><th class="googleboxheader">Try your search on:</th></tr><tr><td class="googleboxbody">""", | def create_google_box(p, f, p1, p2, p3, prolog="""<table border=0 cellpadding=0 cellspacing=0><tr><td width="30"></td><td class="pageboxrighttopadd"><small><strong>Try your search on:</strong><br> """, separator= """<br>""", epilog="""</small></td></tr></table>"""): "Creates the box that proposes links to other useful ... |
epilog="""</small></td></tr></table>"""): | epilog="""</td></tr></table>"""): | def create_google_box(p, f, p1, p2, p3, prolog="""<table border=0 cellpadding=0 cellspacing=0><tr><td width="30"></td><td class="pageboxrighttopadd"><small><strong>Try your search on:</strong><br> """, separator= """<br>""", epilog="""</small></td></tr></table>"""): "Creates the box that proposes links to other useful ... |
def browse(req, colls, p, f, rg): """Browse either biliographic phrases or words indexes.""" | def browse_pattern(req, colls, p, f, rg): """Browse either biliographic phrases or words indexes, and display it.""" if not f: return browse_in_bibwords(req, p, f) browsed_words_hits = browse_in_bibxxx(colls, p, f, rg) while not browsed_words_hits: try: p = p[:-1] browsed_words_hits = browse_in_bibxxx(colls, p, f, r... | def browse(req, colls, p, f, rg): """Browse either biliographic phrases or words indexes.""" return |
def browse_in_bibwords(p, f): """Browse inside words indexes.""" return def browse_in_bibxxx(req, colls, p, f, rg): | def browse_in_bibxxx(colls, p, f, rg): | def browse_in_bibwords(p, f): """Browse inside words indexes.""" return |
print_warning(req, "The browse functionality is about to be expanded and prettyfied.", "Warning") | def browse_in_bibxxx(req, colls, p, f, rg): """Browse bibliographic phrases for the given pattern in the given field.""" print_warning(req, "The browse functionality is about to be expanded and prettyfied.", "Warning") ## determine browse field: if string.find(p, ":") > 0: # does 'p' contain ':'? f, p = split(p, ":", 2... | |
if not f: print_warning(req, "Sorry, cannot browse within any field. Please choose a field to browse in (e.g. <em>within title</em>).", "Error") return 1 | def browse_in_bibxxx(req, colls, p, f, rg): """Browse bibliographic phrases for the given pattern in the given field.""" print_warning(req, "The browse functionality is about to be expanded and prettyfied.", "Warning") ## determine browse field: if string.find(p, ":") > 0: # does 'p' contain ':'? f, p = split(p, ":", 2... | |
if not tl: tl = get_field_tags("author") print_warning(req, "The browse does not work in this field. Choosing author index instead.", "Warning") | browsed_words_hits = {} | def browse_in_bibxxx(req, colls, p, f, rg): """Browse bibliographic phrases for the given pattern in the given field.""" print_warning(req, "The browse functionality is about to be expanded and prettyfied.", "Warning") ## determine browse field: if string.find(p, ":") > 0: # does 'p' contain ':'? f, p = split(p, ":", 2... |
req.write("<p><strong>Browsing in '%s' field:</strong>" % t) | def browse_in_bibxxx(req, colls, p, f, rg): """Browse bibliographic phrases for the given pattern in the given field.""" print_warning(req, "The browse functionality is about to be expanded and prettyfied.", "Warning") ## determine browse field: if string.find(p, ":") > 0: # does 'p' contain ':'? f, p = split(p, ":", 2... | |
hits = "%d record" % query_bis_hits if query_bis_hits > 1: hits = hits + "s" req.write("""<br> %s ... <a href="%s/search.py?p=%s&f=%s">%s</a>""" % (bx_val, weburl, bx_val, t, hits)) return | try: browsed_words_hits[bx_val] += query_bis_hits except: browsed_words_hits[bx_val] = query_bis_hits return browsed_words_hits | def browse_in_bibxxx(req, colls, p, f, rg): """Browse bibliographic phrases for the given pattern in the given field.""" print_warning(req, "The browse functionality is about to be expanded and prettyfied.", "Warning") ## determine browse field: if string.find(p, ":") > 0: # does 'p' contain ':'? f, p = split(p, ":", 2... |
"\n<table width=\"100%%\" cellpadding=2 cellspacing=0 border=0><tr class=\"results\"><td align=\"left\">" \ "<strong><big><img align=\"left\" src=\"%s/img/okay.gif\" width=20 height=20 alt=\"*\">"\ | "\n<table width=\"100%%\" class=\"searchresultsbox\"><tr><td class=\"searchresultsboxheader\" align=\"left\">" \ "<strong><big>" \ | def print_search_info(p, f, sf, so, sp, of, ot, collection=cdsname, nb_found=-1, jrec=1, rg=10, as=0, p1="", p2="", p3="", f1="", f2="", f3="", m1="", m2="", m3="", op1="", op2="", d1y="", d1m="", d1d="", d2y="", d2m="", d2d="", cpu_time=-1, middle_only=0): """Prints stripe with the information on 'collection' and 'nb_... |
(collection, weburl, weburl, weburl, urllib.quote_plus(collection), as, collection) | (collection, weburl, weburl, urllib.quote_plus(collection), as, collection) | def print_search_info(p, f, sf, so, sp, of, ot, collection=cdsname, nb_found=-1, jrec=1, rg=10, as=0, p1="", p2="", p3="", f1="", f2="", f3="", m1="", m2="", m3="", op1="", op2="", d1y="", d1m="", d1d="", d2y="", d2m="", d2d="", cpu_time=-1, middle_only=0): """Prints stripe with the information on 'collection' and 'nb_... |
out += "<td align=\"center\">\n" | out += "<td class=\"searchresultsboxheader\" align=\"center\">\n" | def print_search_info(p, f, sf, so, sp, of, ot, collection=cdsname, nb_found=-1, jrec=1, rg=10, as=0, p1="", p2="", p3="", f1="", f2="", f3="", m1="", m2="", m3="", op1="", op2="", d1y="", d1m="", d1d="", d2y="", d2m="", d2d="", cpu_time=-1, middle_only=0): """Prints stripe with the information on 'collection' and 'nb_... |
out +="<td align=\"right\"><small>Search took %.2f sec.</small> </td>" % cpu_time | out +="<td class=\"searchresultsboxheader\" align=\"right\"><small>Search took %.2f sec.</small> </td>" % cpu_time | def print_search_info(p, f, sf, so, sp, of, ot, collection=cdsname, nb_found=-1, jrec=1, rg=10, as=0, p1="", p2="", p3="", f1="", f2="", f3="", m1="", m2="", m3="", op1="", op2="", d1y="", d1m="", d1d="", d2y="", d2m="", d2d="", cpu_time=-1, middle_only=0): """Prints stripe with the information on 'collection' and 'nb_... |
out += "<p><table width=\"100%%\" border=0 cellspacing=0 cellpadding=2>" \ "<tr><td class=\"results\"><strong>Results overview:</strong> Found <strong>%s</strong> records in %.2f seconds.</td></tr>" % \ | out += "<p><table class=\"searchresultsbox\" width=\"100%%\">" \ "<thead><tr><th class=\"searchresultsboxheader\"><strong>Results overview:</strong> Found <strong>%s</strong> records in %.2f seconds.</th></tr></thead>" % \ | def print_results_overview(colls, results_final_nb_total, results_final_nb, cpu_time): "Prints results overview box with links to particular collections below." out = "" if len(colls) == 1: # if one collection only, print nothing: return out # first find total number of hits: out += "<p><table width=\"100%%\" border=0 ... |
out += "<tr><td class=\"resultsbis\">" | out += "<tbody><tr><td class=\"searchresultsboxbody\">" | def print_results_overview(colls, results_final_nb_total, results_final_nb, cpu_time): "Prints results overview box with links to particular collections below." out = "" if len(colls) == 1: # if one collection only, print nothing: return out # first find total number of hits: out += "<p><table width=\"100%%\" border=0 ... |
out += "In <strong><a href=\" | out += "<strong><a href=\" | def print_results_overview(colls, results_final_nb_total, results_final_nb, cpu_time): "Prints results overview box with links to particular collections below." out = "" if len(colls) == 1: # if one collection only, print nothing: return out # first find total number of hits: out += "<p><table width=\"100%%\" border=0 ... |
out += "</td></tr></table>\n" | out += "</td></tr></tbody></table>\n" | def print_results_overview(colls, results_final_nb_total, results_final_nb, cpu_time): "Prints results overview box with links to particular collections below." out = "" if len(colls) == 1: # if one collection only, print nothing: return out # first find total number of hits: out += "<p><table width=\"100%%\" border=0 ... |
req.write("""<br><input type="submit" name="action" value="ADD TO BASKET">""") | req.write("""<br><input class="formbutton" type="submit" name="action" value="ADD TO BASKET">""") | def print_records(req, recIDs, jrec=1, rg=10, format='hb', ot='', decompress=zlib.decompress): """Prints list of records 'recIDs' formatted accoding to 'format' in groups of 'rg' starting from 'jrec'. Assumes that the input list 'recIDs' is sorted in reverse order, so it counts records from tail to head. A value of 'rg... |
url = string.replace(req.args, "search=Browse","search=SEARCH") | def perform_request_search(req=None, cc=cdsname, c=None, p="", f="", rg="10", sf="", so="d", sp="", of="hb", ot="", as="0", p1="", f1="", m1="", op1="", p2="", f2="", m2="", op2="", p3="", f3="", m3="", sc="0", jrec="0", id="-1", idb="-1", sysnb="", search="SEARCH", d1y="", d1m="", d1d="", d2y="", d2m="", d2d=""): """P... | |
if p1: req.write("<p>Words nearest to <strong>%s</strong> inside <strong>%s</strong> are:<br>" % (p1, f1)) req.write(create_nearest_words_links(url, p1, f1)) if p2: req.write("<p>Words nearest to <strong>%s</strong> inside <strong>%s</strong> are:<br>" % (p2, f2)) req.write(create_nearest_words_links(url, p2, f2)) if p... | browse_pattern(req, colls_to_search, p1, f1, rg) browse_pattern(req, colls_to_search, p2, f2, rg) browse_pattern(req, colls_to_search, p3, f3, rg) else: | def perform_request_search(req=None, cc=cdsname, c=None, p="", f="", rg="10", sf="", so="d", sp="", of="hb", ot="", as="0", p1="", f1="", m1="", op1="", p2="", f2="", m2="", op2="", p3="", f3="", m3="", sc="0", jrec="0", id="-1", idb="-1", sysnb="", search="SEARCH", d1y="", d1m="", d1d="", d2y="", d2m="", d2d=""): """P... |
def makeCataloguesTable(ln): | def makeCataloguesTable(ln=cdslang): | def makeCataloguesTable(ln): text = "" catalogues = [] queryResult = run_sql("SELECT id_son FROM sbmCOLLECTION_sbmCOLLECTION WHERE id_father=0 ORDER BY catalogue_order"); if len(queryResult) != 0: # Query has executed successfully, so we can proceed to display all # catalogues in the EDS system... for row in queryResul... |
def Propose_Next_Action (doctype, action_score, access, currentlevel, indir): | def Propose_Next_Action (doctype, action_score, access, currentlevel, indir, ln=cdslang): | def Propose_Next_Action (doctype, action_score, access, currentlevel, indir): global machine, storage, act, rn t="" res = run_sql("SELECT * FROM sbmIMPLEMENT WHERE docname=%s and level!='0' and level=%s and score>%s ORDER BY score", (doctype, currentlevel, action_score,)) if len(res) > 0: actions = [] first_score = res... |
self.id = run_sql("insert into bibdoc (status,docname,creation_date,modification_date) values(str(self.status),%s,NOW(),NOW())", (docname,)) | self.id = run_sql("insert into bibdoc (status,docname,creation_date,modification_date) values(%s,%s,NOW(),NOW())", (str(self.status), docname,)) | def __init__ (self,bibdocid="",recid="",docname="file",type="Main"): # bibdocid is known, the document already exists if bibdocid != "": if recid == "": res = run_sql("select id_bibrec,type from bibrec_bibdoc where id_bibdoc=%s",(bibdocid,)) if len(res) > 0: recid = res[0][0] self.type = res[0][1] else: recid = None se... |
On set represents a curve in the graph. | One set represents a curve in the graph. | def write_coordinates_in_tmp_file(lists_coordinates): """write the graph coordinates in a temporary file for reading it later by the create_temporary_image method lists_coordinates is a list of list of this form: [[(1,3),(2,4),(3,5)],[(1,5),(2,5),(3,6)] This file is organized into one or more sets of 2 columns. Each se... |
plot_text = plot_commend(1, data_file, (0, 0), "", "steps", color_line_list[0], 3) | plot_text = plot_command(1, data_file, (0, 0), "", "steps", color_line_list[0], 3) | def create_temporary_image(recid, kind_of_graphe, data_file, x_label, y_label, origin_tuple, y_max, docid_list, graphe_titles, intervals): """From a temporary file, draw a gnuplot graph The arguments are as follows: recid - reccord ID kind_of_graph - takes one of these values : "citation" ,"download_history",... |
plot_text = plot_commend(1, data_file, (0, 0), graphe_titles[0], "linespoints", color_line_list[0], 1, "pt 26", "ps 0.5") | plot_text = plot_command(1, data_file, (0, 0), graphe_titles[0], "linespoints", color_line_list[0], 1, "pt 26", "ps 0.5") | def create_temporary_image(recid, kind_of_graphe, data_file, x_label, y_label, origin_tuple, y_max, docid_list, graphe_titles, intervals): """From a temporary file, draw a gnuplot graph The arguments are as follows: recid - reccord ID kind_of_graph - takes one of these values : "citation" ,"download_history",... |
plot_text += plot_commend(0, data_file, (d, d) , graphe_titles[d], "linespoints", color_line_list[d], 1, "pt 26", "ps 0.5") plot_text += plot_commend(0, data_file, (len_docid_list, len_docid_list), "", "impulses", 0, 2 ) plot_text += plot_commend(0, data_file, (len_docid_list, len_docid_list), "TOTAL", "lines", 0, 5) | plot_text += plot_command(0, data_file, (d, d) , graphe_titles[d], "linespoints", color_line_list[d], 1, "pt 26", "ps 0.5") plot_text += plot_command(0, data_file, (len_docid_list, len_docid_list), "", "impulses", 0, 2 ) plot_text += plot_command(0, data_file, (len_docid_list, len_docid_list), "TOTAL", "lines", 0, 5) | def create_temporary_image(recid, kind_of_graphe, data_file, x_label, y_label, origin_tuple, y_max, docid_list, graphe_titles, intervals): """From a temporary file, draw a gnuplot graph The arguments are as follows: recid - reccord ID kind_of_graph - takes one of these values : "citation" ,"download_history",... |
rg = get_argument(argd, 'rg') | def get_record_ids(argstr, date_from, date_until): argd = wash_urlargd(parse_qs(argstr), websearch_templates.search_results_default_urlargd) p = get_argument(argd, 'p') c = get_argument(argd, 'c') cc = get_argument(argd, 'cc') as = get_argument(argd, 'as') f = get_argument(argd, 'f') rg ... | |
'name' : father.name, | 'name' : cgi.escape(father.name, 1), | def tmpl_narrowsearch(self, as, ln, weburl, title, type, father, has_grandchildren, instant_browse, sons, display_grandsons, grandsons): """ Creates list of collection descendants of type *type* under title *title*. If as==1, then links to Advanced Search interfaces; otherwise Simple Search. Suitable for 'Narrow search... |
'cc' : cc, | 'cc' : cgi.escape(cc, 1), | def tmpl_search_box(self, ln, weburl, as, cc, cc_intl, ot, sp, action, fieldslist, f1, f2, f3, m1, m2, m3, p1, p2, p3, op1, op2, rm, p, f, coll_selects, d1y, d2y, d1m, d2m, d1d, d2d, sort_formats, sf, so, ranks, sc, rg, formats, of, pl): """ Displays the *Nearest search terms* box |
'name' : name, 'value' : value, | 'name' : cgi.escape(str(name), 1), 'value' : cgi.escape(str(value), 1), | def tmpl_input_hidden(self, name, value): "Produces the HTML code for a hidden field " return """<input type="hidden" name="%(name)s" value="%(value)s">""" % { 'name' : name, 'value' : value, } |
out += self.tmpl_input_hidden(name = cgi.escape(fieldcode), value = cgi.escape(val)) | out += self.tmpl_input_hidden(name = fieldcode, value = val) | def tmpl_print_search_info(self, ln, weburl, middle_only, collection, collection_name, as, sf, so, rm, rg, nb_found, of, ot, p, f, f1, f2, f3, m1, m2, m3, op1, op2, p1, p2, p3, d1y, d1m, d1d, d2y, d2m, d2d, all_fieldcodes, cpu_time, pl_in_url, jrec, sc, sp): """Prints stripe with the information on 'collection' and 'nb... |
cbd = init_cited_by_dictionary() rld = init_reference_list_dictionary() def get_cited_by_dictionary(): """return citation list dictionary from rnkCITATIONDATA """ global cbd return cbd def get_reference_list_dictionary(): """return reference list dictionary from rnkCITATIONDATA """ global rld return rld | cache_cited_by_dictionary = init_cited_by_dictionary() cache_reference_list_dictionary = init_reference_list_dictionary() | def init_reference_list_dictionary(): """return reference list dictionary from rnkCITATIONDATA """ query = "select citation_data_reversed from rnkCITATIONDATA" compressed_ref_dic = run_sql(query) ref_dic = None if compressed_ref_dic and compressed_ref_dic[0]: ref_dic = loads(decompress(compressed_ref_dic[0][0])) return... |
try: citation_list = get_cited_by_dictionary().get(record_id, []) except TypeError: pass | if cache_cited_by_dictionary: citation_list = cache_cited_by_dictionary.get(record_id, []) | def get_cited_by_list(record_id): """return citation list dictionary of record_id """ citation_list = [] try: citation_list = get_cited_by_dictionary().get(record_id, []) except TypeError: pass return citation_list |
try: body = [output, extra] except NameError: body = [output] | body = [output] | def perform_modifytranslations(colID, ln, sel_type='', trans=[], confirm=-1, callback='yes'): """Modify the translations of a collection sel_type - the nametype to modify trans - the translations in the same order as the languages from get_languages()""" output = '' subtitle = '' cdslangs = get_languages() if confirm ... |
try: body = [output, extra] except NameError: body = [output] | body = [output] | def perform_modifyrankmethods(colID, ln, func='', rnkID='', confirm=0, callback='yes'): """Modify which rank methods is visible to the collection func - remove or add rank method rnkID - the id of the rank method.""" output = "" subtitle = "" col_dict = dict(get_def_name('', "collection")) rnk_dict = dict(get_def_nam... |
try: body = [output, extra] except NameError: body = [output] | body = [output] | def perform_addcollectiontotree(colID, ln, add_dad='', add_son='', rtype='', mtype='', callback='yes', confirm=-1): """Form to add a collection to the tree. add_dad - the dad to add the collection to add_son - the collection to add rtype - add it as a regular or virtual mtype - add it to the regular or virtual tree."""... |
try: body = [output, extra] except NameError: body = [output] | body = [output] | def perform_addcollection(colID, ln, colNAME='', dbquery='', rest='', callback="yes", confirm=-1): """form to add a new collection. colNAME - the name of the new collection dbquery - the dbquery of the new collection rest - the group allowed to access the new collection""" output = "" subtitle = """Create new collecti... |
try: body = [output, extra] except NameError: body = [output] | body = [output] | def perform_modifydbquery(colID, ln, dbquery='', callback='yes', confirm=-1): """form to modify the dbquery of the collection. dbquery - the dbquery of the collection.""" subtitle = '' output = "" col_dict = dict(get_def_name('', "collection")) if colID and col_dict.has_key(int(colID)): colID = int(colID) subtitle =... |
try: body = [output, extra] except NameError: body = [output] | body = [output] | def perform_modifyrestricted(colID, ln, rest='', callback='yes', confirm=-1): """modify which apache group is allowed to access the collection. rest - the groupname""" subtitle = '' output = "" col_dict = dict(get_def_name('', "collection")) if colID and col_dict.has_key(int(colID)): colID = int(colID) subtitle = ""... |
try: body = [output, extra] except NameError: body = [output] | body = [output] | def perform_modifycollectiontree(colID, ln, move_up='', move_down='', move_from='', move_to='', delete='', rtype='', callback='yes', confirm=0): """to modify the collection tree: move a collection up and down, delete a collection, or change the father of the collection. colID - the main collection of the tree, the root... |
try: body = [output, extra] except NameError: body = [output] | body = [output] | def perform_showtree(colID, ln): """create collection tree/hiarchy""" col_dict = dict(get_def_name('', "collection")) subtitle = "Collection tree: %s" % col_dict[int(colID)] output = """<table border ="0" width="100%"> <tr><td width="50%"> <b>Narrow by collection:</b> </td><td width="50%"> <b>Focus on...:</b> </td></t... |
try: body = [output, extra] except NameError: body = [output] | body = [output] | def perform_addportalbox(colID, ln, title='', body='', callback='yes', confirm=-1): """form to add a new portalbox title - the title of the portalbox body - the body of the portalbox""" col_dict = dict(get_def_name('', "collection")) colID = int(colID) subtitle = """<a name="5.1"></a>Create new portalbox""" text = """... |
try: body = [output, extra] except NameError: body = [output] | body = [output] | def perform_addexistingportalbox(colID, ln, pbxID=-1, score=0, position='', sel_ln='', callback='yes', confirm=-1): """form to add an existing portalbox to a collection. colID - the collection to add the portalbox to pbxID - the portalbox to add score - the importance of the portalbox. position - the position of the po... |
try: body = [output, extra] except NameError: body = [output] | body = [output] | def perform_deleteportalbox(colID, ln, pbxID=-1, callback='yes', confirm=-1): """form to delete a portalbox which is not in use. colID - the current collection. pbxID - the id of the portalbox""" subtitle = """<a name="5.3"></a>Delete an unused portalbox""" output = "" colID = int(colID) if pbxID not in [-1, "-1"] a... |
try: body = [output, extra] except NameError: body = [output] | body = [output] | def perform_modifyportalbox(colID, ln, pbxID=-1, score='', position='', sel_ln='', title='', body='', callback='yes', confirm=-1): """form to modify a portalbox in a collection, or change the portalbox itself. colID - the id of the collection. pbxID - the portalbox to change score - the score of the portalbox connected... |
output = "" | def perform_switchpbxscore(colID, id_1, id_2, sel_ln, ln): """Switch the score of id_1 and id_2 in collection_portalbox. colID - the current collection id_1/id_2 - the id's to change the score for. sel_ln - the language of the portalbox""" res = get_pbx() pbx_dict = dict(map(lambda x: (x[0], x[1]), res)) res = switch_... | |
try: body = [output, extra] except NameError: body = [output] | body = [output] | def perform_showportalboxes(colID, ln, callback='yes', content='', confirm=-1): """show the portalboxes of this collection. colID - the portalboxes to show the collection for.""" colID = int(colID) col_dict = dict(get_def_name('', "collection")) subtitle = """<a name="5">5. Modify portalboxes for collection '%s'</a>&... |
try: body = [output, extra] except NameError: body = [output] | body = [output] | def perform_removeportalbox(colID, ln, pbxID='', sel_ln='', callback='yes', confirm=0): """form to remove a portalbox from a collection. colID - the current collection, remove the portalbox from this collection. sel_ln - remove the portalbox with this language pbxID - remove the portalbox with this id""" subtitle = ""... |
try: body = [output, extra] except NameError: body = [output] | body = [output] | def perform_addnewfieldvalue(colID, fldID, ln, name='', value='', callback="yes", confirm=-1): """form to add a new fieldvalue. name - the name of the new fieldvalue value - the value of the new fieldvalue """ output = "" subtitle = """<a name="7.4"></a>Add new value""" text = """ <span class="adminlabel">Display name... |
try: body = [output, extra] except NameError: body = [output] | body = [output] | def perform_modifyfieldvalue(colID, fldID, fldvID, ln, name='', value='', callback="yes", confirm=-1): """form to modify a fieldvalue. name - the name of the fieldvalue value - the value of the fieldvalue """ if confirm in [-1, "-1"]: res = get_fld_value(fldvID) (id, name, value) = res[0] output = "" subtitle = """<a ... |
try: body = [output, extra] except NameError: body = [output] | body = [output] | def perform_removefield(colID, ln, fldID='', fldvID='', fmeth='', callback='yes', confirm=0): """form to remove a field from a collection. colID - the current collection, remove the field from this collection. sel_ln - remove the field with this language fldID - remove the field with this id""" if fmeth == "soo": fiel... |
try: body = [output, extra] except NameError: body = [output] | body = [output] | def perform_removefieldvalue(colID, ln, fldID='', fldvID='', fmeth='', callback='yes', confirm=0): """form to remove a field from a collection. colID - the current collection, remove the field from this collection. sel_ln - remove the field with this language fldID - remove the field with this id""" subtitle = """<a n... |
try: body = [output, extra] except NameError: body = [output] | body = [output] | def perform_rearrangefieldvalue(colID, fldID, ln, callback='yes', confirm=-1): """rearrang the fieldvalues alphabetically colID - the collection fldID - the field to rearrange the fieldvalue for """ subtitle = "Order values alphabetically" output = "" col_fldv = get_col_fld(colID, 'seo', fldID) col_fldv = dict(map(la... |
try: body = [output, extra] except NameError: body = [output] | body = [output] | def perform_rearrangefield(colID, ln, fmeth, callback='yes', confirm=-1): """rearrang the fields alphabetically colID - the collection """ subtitle = "Order fields alphabetically" output = "" col_fld = dict(map(lambda x: (x[0], x[1]), get_col_fld(colID, fmeth))) fld_names = get_def_name('', "field") if len(col_fld)... |
try: body = [output, extra] except NameError: body = [output] | body = [output] | def perform_addexistingfieldvalue(colID, fldID, fldvID=-1, ln=cdslang, callback='yes', confirm=-1): """form to add an existing fieldvalue to a field. colID - the collection fldID - the field to add the fieldvalue to fldvID - the fieldvalue to add""" subtitle = """</a><a name="7.4"></a>Add existing value to search opti... |
try: body = [output, extra] except NameError: body = [output] | body = [output] | def perform_addexistingfield(colID, ln, fldID=-1, fldvID=-1, fmeth='', callback='yes', confirm=-1): """form to add an existing field to a collection. colID - the collection to add the field to fldID - the field to add sel_ln - the language of the field""" subtitle = """<a name="6.2"></a><a name="7.2"></a><a name="8.2"... |
try: body = [output, extra] except NameError: body = [output] | body = [output] | def perform_showsortoptions(colID, ln, callback='yes', content='', confirm=-1): """show the sort fields of this collection..""" colID = int(colID) col_dict = dict(get_def_name('', "collection")) fld_dict = dict(get_def_name('', "field")) fld_type = get_sort_nametypes() subtitle = """<a name="8">8. Modify sort options... |
try: body = [output, extra] except NameError: body = [output] | body = [output] | def perform_showsearchfields(colID, ln, callback='yes', content='', confirm=-1): """show the search fields of this collection..""" colID = int(colID) col_dict = dict(get_def_name('', "collection")) fld_dict = dict(get_def_name('', "field")) fld_type = get_sort_nametypes() subtitle = """<a name="6">6. Modify search fi... |
try: body = [output, extra] except NameError: body = [output] | body = [output] | def perform_showsearchoptions(colID, ln, callback='yes', content='', confirm=-1): """show the sort and search options of this collection..""" colID = int(colID) col_dict = dict(get_def_name('', "collection")) fld_dict = dict(get_def_name('', "field")) fld_type = get_sort_nametypes() subtitle = """<a name="7">7. Modif... |
try: body = [output, extra] except NameError: body = [output] | body = [output] | def perform_modifyfield(colID, fldID, fldvID='', ln=cdslang, content='', callback='yes', confirm=0): """Modify the fieldvalues for a field""" colID = int(colID) col_dict = dict(get_def_name('', "collection")) fld_dict = dict(get_def_name('', "field")) fld_type = get_sort_nametypes() fldID = int(fldID) subtitle = """<... |
try: body = [output, extra] except NameError: body = [output] | body = [output] | def perform_showoutputformats(colID, ln, callback='yes', content='', confirm=-1): """shows the outputformats of the current collection colID - the collection id.""" colID = int(colID) col_dict = dict(get_def_name('', "collection")) subtitle = """<a name="10">10. Modify output formats for collection '%s'</a> &nbs... |
try: body = [output, extra] except NameError: body = [output] | body = [output] | def perform_addexistingoutputformat(colID, ln, fmtID=-1, callback='yes', confirm=-1): """form to add an existing output format to a collection. colID - the collection the format should be added to fmtID - the format to add.""" subtitle = """<a name="10.2"></a>Add existing output format to collection""" output = "" i... |
try: body = [output, extra] except NameError: body = [output] | body = [output] | def perform_deleteoutputformat(colID, ln, fmtID=-1, callback='yes', confirm=-1): """form to delete an output format not in use. colID - the collection id of the current collection. fmtID - the format id to delete.""" subtitle = """<a name="10.3"></a>Delete an unused output format""" output = """ <dl> <dd>Deleting an ... |
try: body = [output, extra] except NameError: body = [output] | body = [output] | def perform_removeoutputformat(colID, ln, fmtID='', callback='yes', confirm=0): """form to remove an output format from a collection. colID - the collection id of the current collection. fmtID - the format id. """ subtitle = """<a name="10.5"></a>Remove output format""" output = "" col_dict = dict(get_def_name('', "... |
try: body = [fin_output, extra] except NameError: body = [fin_output] | body = [fin_output] | def perform_index(colID=1, ln=cdslang, mtype='', content='', confirm=0): """The index method, calling methods to show the collection tree, create new collections and add collections to tree. """ subtitle = "Overview" colID = int(colID) col_dict = dict(get_def_name('', "collection")) output = "" fin_output = "" if not... |
raise StandardException | raise Exception | def perform_deletecollection(colID, ln, confirm=-1, callback='yes'): """form to delete a collection colID - id of collection """ subtitle ='' output = """ <span class="warning"> <strong> <dl> <dt>WARNING:</dt> <dd>When deleting a collection, you also deletes all data related to the collection like translations, relat... |
try: body = [output, extra] except NameError: body = [output] | body = [output] | def perform_deletecollection(colID, ln, confirm=-1, callback='yes'): """form to delete a collection colID - id of collection """ subtitle ='' output = """ <span class="warning"> <strong> <dl> <dt>WARNING:</dt> <dd>When deleting a collection, you also deletes all data related to the collection like translations, relat... |
try: body = [output, extra] except NameError: body = [output] | body = [output] | def perform_checkwebcollstatus(colID, ln, confirm=0, callback='yes'): """Check status of the collection tables with respect to the webcoll cache.""" subtitle = """<a name="11"></a>Webcoll Status   [<a href="%s/admin/websearch/guide.html#4">?</a>]""" % weburl output = "" colID = int(colID) col_dict = di... |
try: body = [output, extra] except NameError: body = [output] | body = [output] | def perform_checkcollectionstatus(colID, ln, confirm=0, callback='yes'): """Check the configuration of the collections.""" subtitle = """<a name="11"></a>Collections Status   [<a href="%s/admin/websearch/guide.html#5">?</a>]""" % weburl output = "" colID = int(colID) col_dict = dict(get_def_name('', "c... |
try: body = [output, extra] except NameError: body = [output] | body = [output] | def perform_modifycollection(rnkID='', ln=cdslang, func='', colID='', confirm=0): """Modify which collections the rank method is visible to""" output = "" subtitle = "" if rnkID: rnkNAME = get_def_name(rnkID, "rnkMETHOD")[0][1] if func in ["0", 0] and confirm in ["1", 1]: finresult = attach_col_rnk(rnkID, colID) eli... |
try: body = [output, extra] except NameError: body = [output] | body = [output] | def perform_modifytranslations(rnkID, ln, sel_type, trans, confirm, callback='yes'): """Modify the translations of a rank method""" output = '' subtitle = '' cdslangs = get_languages() cdslangs.sort() if confirm in ["2", 2] and rnkID: finresult = modify_translations(rnkID, cdslangs, sel_type, trans, "rnkMETHOD") rnk... |
try: body = [output, extra] except NameError: body = [output] | body = [output] | def perform_addrankarea(rnkcode='', ln=cdslang, template='', confirm=-1): """form to add a new rank method with these values:""" subtitle = 'Step 1 - Create new rank method' output = """ <dl> <dt>BibRank code:</dt> <dd>A unique code that identifies a rank method, is used when running the bibrank daemon and used to na... |
try: body = [output, extra] except NameError: body = [output] | body = [output] | def perform_deleterank(rnkID, ln=cdslang, confirm=0): """form to delete a rank method """ subtitle ='' output = """ <span class="warning"> <strong> <dl> <dt>WARNING:</dt> <dd>When deleting a rank method, you also deletes all data related to the rank method, like translations, which collections it was attached to and t... |
if DEBUGLEVEL > 0: | if cfg_webalert_debug_level > 0: | def add_records_to_basket(record_ids, basket_id): nrec = len(record_ids) if nrec > 0: vals = '(%s,%s)' % (basket_id, record_ids[0]) if nrec > 1: for i in record_ids[1:]: vals += ',(%s, %s)' % (basket_id, i) if DEBUGLEVEL > 0: print "-> adding %s records into basket %s: %s" % (nrec, basket_id, vals) try: if DEBUGLEVEL ... |
if DEBUGLEVEL < 4: | if cfg_webalert_debug_level < 4: | def add_records_to_basket(record_ids, basket_id): nrec = len(record_ids) if nrec > 0: vals = '(%s,%s)' % (basket_id, record_ids[0]) if nrec > 1: for i in record_ids[1:]: vals += ',(%s, %s)' % (basket_id, i) if DEBUGLEVEL > 0: print "-> adding %s records into basket %s: %s" % (nrec, basket_id, vals) try: if DEBUGLEVEL ... |
if DEBUGLEVEL > 2: | if cfg_webalert_debug_level > 2: | def send_email(fromaddr, toaddr, body, attempt=0): if attempt > 2: log('error sending email to %s: SMTP error; gave up after 3 attempts' % toaddr) return try: server = smtplib.SMTP('localhost') if DEBUGLEVEL > 2: server.set_debuglevel(1) else: server.set_debuglevel(0) server.sendmail(fromaddr, toaddr, body) server.q... |
if (DEBUGLEVEL > 1): | if (cfg_webalert_debug_level > 1): | def send_email(fromaddr, toaddr, body, attempt=0): if attempt > 2: log('error sending email to %s: SMTP error; gave up after 3 attempts' % toaddr) return try: server = smtplib.SMTP('localhost') if DEBUGLEVEL > 2: server.set_debuglevel(1) else: server.set_debuglevel(0) server.sendmail(fromaddr, toaddr, body) server.q... |
if DEBUGLEVEL > 0: | if cfg_webalert_debug_level > 0: | def email_notify(alert, records, argstr): if len(records) == 0: return msg = "" if DEBUGLEVEL > 0: msg = "*** THIS MESSAGE WAS SENT IN DEBUG MODE ***\n\n" url = weburl + "/search?" + argstr # Extract the pattern and catalogue list from the formatted query query = parse_qs(argstr) pattern = query.get('p', [''])[0] ... |
if DEBUGLEVEL < 2: | if cfg_webalert_debug_level < 2: | def email_notify(alert, records, argstr): if len(records) == 0: return msg = "" if DEBUGLEVEL > 0: msg = "*** THIS MESSAGE WAS SENT IN DEBUG MODE ***\n\n" url = weburl + "/search?" + argstr # Extract the pattern and catalogue list from the formatted query query = parse_qs(argstr) pattern = query.get('p', [''])[0] ... |
if DEBUGLEVEL == 4: for a in DEVELOPERADDR: send_email(sender, a, body) | if cfg_webalert_debug_level == 4: send_email(sender, supportemail, body) | def email_notify(alert, records, argstr): if len(records) == 0: return msg = "" if DEBUGLEVEL > 0: msg = "*** THIS MESSAGE WAS SENT IN DEBUG MODE ***\n\n" url = weburl + "/search?" + argstr # Extract the pattern and catalogue list from the formatted query query = parse_qs(argstr) pattern = query.get('p', [''])[0] ... |
if DEBUGLEVEL > 2: | if cfg_webalert_debug_level > 2: | def run_query(query, frequency, date_until): """Return a dictionary containing the information of the performed query. The information contains the id of the query, the arguments as a string, and the list of found records.""" if frequency == 'day': date_from = date_until - datetime.timedelta(days=1) elif frequency =... |
if str(res[0][11])[len(collection_table_update_time) - 3:] == ".00": collection_table_update_time = str(res[0][11])[0:len(collection_table_update_time) - 3] | if str(res[0][11])[-3:] == ".00": collection_table_update_time = str(res[0][11])[:-3] | def perform_runwebcoll(colID, ln, confirm=0, callback='yes'): """Status of the collection tables / indexes""" subtitle = """<a name="11"></a>Webcoll Status""" output = "" colID = int(colID) col_dict = dict(get_def_name('', "collection")) output += """<br><b>Last updates:</b><br>""" collection_table_update_time = ""... |
collection_table_update_time = str(res[0][11])[0:len(collection_table_update_time)] | collection_table_update_time = str(res[0][11]) | def perform_runwebcoll(colID, ln, confirm=0, callback='yes'): """Status of the collection tables / indexes""" subtitle = """<a name="11"></a>Webcoll Status""" output = "" colID = int(colID) col_dict = dict(get_def_name('', "collection")) output += """<br><b>Last updates:</b><br>""" collection_table_update_time = ""... |
query1 = "SELECT email, nickname, last_login FROM user WHERE id=%s" | query1 = """SELECT email, nickname, DATE_FORMAT(last_login, '%%Y-%%m-%%d %%H:%%i:%%s') FROM user WHERE id=%s""" | def query_get_user_contact_info(uid): """ Get the user contact information @return tuple (nickname, email, last_login), if none found return () Note: for the moment, if no nickname, will return email address up to the '@' """ query1 = "SELECT email, nickname, last_login FROM user WHERE id=%s" params1 = (uid,) res1 = ru... |
date_creation, | DATE_FORMAT(date_creation, '%%Y-%%m-%%d %%H:%%i:%%s'), | def query_get_comment(comID): """ Get all fields of a comment @param comID: comment id @return tuple (comID, id_bibrec, id_user, body, date_creation, star_score, nb_votes_yes, nb_votes_total, title, nb_abuse_reports) if none found return () """ query1 = """SELECT id, id_bibrec, id_user, body, date_creation, star_score,... |
cmt.date_creation, | DATE_FORMAT(cmt.date_creation, '%%Y-%%m-%%d %%H:%%i:%%s'), | def query_retrieve_comments_or_remarks (recID, display_order='od', display_since='0000-00-00 00:00:00', ranking=0): """ Private function Retrieve tuple of comments or remarks from the database @param recID: record id @param display_order: hh = highest helpful score lh = lowest helpful score hs = highest star score ls... |
query = "INSERT INTO cmtRECORDCOMMENT (id_bibrec, id_user, body, date_creation, star_score, nb_votes_total, title) " \ "VALUES (%s, %s, %s, %s, %s, %s, %s)" | query = """INSERT INTO cmtRECORDCOMMENT (id_bibrec, id_user, body, date_creation, star_score, nb_votes_total, title) VALUES (%s, %s, %s, %s, %s, %s, %s)""" | def query_add_comment_or_remark(reviews=0, recID=0, uid=-1, msg="", note="", score=0, priority=0, client_ip_address=''): """ Private function Insert a comment/review or remarkinto the database @param recID: record id @param uid: user id @param msg: comment body @param note: comment title @param score: review star score... |
sql = "select session_object from %s where session_key='%s'"%(cls.__tableName, sessionId) | sql = "select session_object from %s where session_key='%s'" % \ (cls.__tableName, sessionId) | def retrieve( cls, sessionId ): """method for retrieving a session from the DB for the given id. If the id has no corresponding session an exception is raised """ sql = "select session_object from %s where session_key='%s'"%(cls.__tableName, sessionId) try: res = run_sql(sql) except OperationalError: raise SessionNotIn... |
raise SessionNotInDb("Session %s doesn't exist"%sessionId) | raise SessionNotInDb("Session %s doesn't exist" % \ sessionId) | def retrieve( cls, sessionId ): """method for retrieving a session from the DB for the given id. If the id has no corresponding session an exception is raised """ sql = "select session_object from %s where session_key='%s'"%(cls.__tableName, sessionId) try: res = run_sql(sql) except OperationalError: raise SessionNotIn... |
repr = self.__getRepr().replace("'", "\\\'") repr = repr.replace('"', '\\\"') | sessrepr = self.__getRepr().replace("'", "\\\'") sessrepr = sessrepr.replace('"', '\\\"') | def save( self ): """method that tries to insert the session as NEW in the DB. If this fails (giving an integrity error) it means the session already exists there and it must be updated, so it performs the corresponding SQL update """ repr = self.__getRepr().replace("'", "\\\'") repr = repr.replace('"', '\\\"') try: s... |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.