rem
stringlengths
0
322k
add
stringlengths
0
2.05M
context
stringlengths
8
228k
interval = range(int(recordyear[0]), currentyear+1)
if recordyear == []: recordyear = currentyear else: recordyear = find_year(recordyear[0]) interval = range(int(recordyear), currentyear+1)
def calculate_citation_graphe_x_coordinates(recid): """Return a range of year from the publication year of record RECID until the current year.""" rec_years = [] recordyear = get_field_values(recid, '773__y') if not recordyear: recordyear = get_field_values(recid, '260__c') currentyear = time.localtime()[0] interval = ...
cdslangs.sort()
def perform_modifytranslations(colID, ln=cdslang, sel_type='', trans=[], confirm=-1, callback='yes'): """Modify the translations of a collection""" output = '' subtitle = '' cdslangs = get_languages() cdslangs.sort() if confirm in ["2", 2] and colID: finresult = modify_translations(colID, cdslangs, sel_type, trans, "c...
text = """ <span class="adminlabel">Name type</span> <select name="sel_type" class="admin_w200"> """
def perform_modifytranslations(colID, ln=cdslang, sel_type='', trans=[], confirm=-1, callback='yes'): """Modify the translations of a collection""" output = '' subtitle = '' cdslangs = get_languages() cdslangs.sort() if confirm in ["2", 2] and colID: finresult = modify_translations(colID, cdslangs, sel_type, trans, "c...
for key, value in cdslangs:
for (key, value) in cdslangs:
def perform_modifytranslations(colID, ln=cdslang, sel_type='', trans=[], confirm=-1, callback='yes'): """Modify the translations of a collection""" output = '' subtitle = '' cdslangs = get_languages() cdslangs.sort() if confirm in ["2", 2] and colID: finresult = modify_translations(colID, cdslangs, sel_type, trans, "c...
output += """</dd>""" output += """
output += """</dd>
def perform_modifyrankmethods(colID, ln=cdslang, func='', rnkID='', confirm=0, callback='yes'): """Modify which rank methods is visible to the collection""" output = "" subtitle = "" col_dict = dict(get_current_name('', ln, get_col_mainnametype(), "collection")) rnk_dict = dict(get_current_name('',ln, get_rnk_mainnam...
rnkmethods = get_current_name('',ln, get_rnk_mainnametype(), "rnkMETHOD") rnkmethods2 = dict(get_col_rnk(colID, ln)) rnkmethods = filter(lambda x: not rnkmethods2.has_key(x[0]), rnkmethods) if rnkmethods:
rnk_list = get_current_name('',ln, get_rnk_mainnametype(), "rnkMETHOD") rnk_dict_in_col = dict(get_col_rnk(colID, ln)) rnk_list = filter(lambda x: not rnk_dict_in_col.has_key(x[0]), rnk_list) if rnk_list:
def perform_modifyrankmethods(colID, ln=cdslang, func='', rnkID='', confirm=0, callback='yes'): """Modify which rank methods is visible to the collection""" output = "" subtitle = "" col_dict = dict(get_current_name('', ln, get_col_mainnametype(), "collection")) rnk_dict = dict(get_current_name('',ln, get_rnk_mainnam...
for id, name in rnkmethods:
for (id, name) in rnk_list:
def perform_modifyrankmethods(colID, ln=cdslang, func='', rnkID='', confirm=0, callback='yes'): """Modify which rank methods is visible to the collection""" output = "" subtitle = "" col_dict = dict(get_current_name('', ln, get_col_mainnametype(), "collection")) rnk_dict = dict(get_current_name('',ln, get_rnk_mainnam...
text = "<b>Please confirm to enable rank method '%s' for the collection '%s'</b>" % (dict(rnkmethods)[int(rnkID)], col_dict[colID])
text = "<b>Please confirm to enable rank method '%s' for the collection '%s'</b>" % (dict(rnk_list)[int(rnkID)], col_dict[colID])
def perform_modifyrankmethods(colID, ln=cdslang, func='', rnkID='', confirm=0, callback='yes'): """Modify which rank methods is visible to the collection""" output = "" subtitle = "" col_dict = dict(get_current_name('', ln, get_col_mainnametype(), "collection")) rnk_dict = dict(get_current_name('',ln, get_rnk_mainnam...
coll = get_col_rnk(colID, ln) if coll:
coll_list = get_col_rnk(colID, ln) if coll_list:
def perform_modifyrankmethods(colID, ln=cdslang, func='', rnkID='', confirm=0, callback='yes'): """Modify which rank methods is visible to the collection""" output = "" subtitle = "" col_dict = dict(get_current_name('', ln, get_col_mainnametype(), "collection")) rnk_dict = dict(get_current_name('',ln, get_rnk_mainnam...
for id, name in coll:
for (id, name) in coll_list:
def perform_modifyrankmethods(colID, ln=cdslang, func='', rnkID='', confirm=0, callback='yes'): """Modify which rank methods is visible to the collection""" output = "" subtitle = "" col_dict = dict(get_current_name('', ln, get_col_mainnametype(), "collection")) rnk_dict = dict(get_current_name('',ln, get_rnk_mainnam...
'z. phys.': '0044-3328'} journal_name = bfo.field('210__%')
'z. phys.': '0044-3328', 'z. phys., c': '0170-9739'} journal_name = bfo.field('909C4p')
def format(bfo): """ Returns the ISSN of the record, if known.<br/> Note that you HAVE to pre-generate the correspondances journal->ISSN if you want this element to return something (Run <code>python bfe_issn.py -h</code> to get help). """ issns = { 'acta phys. pol. a': '0587-4246', 'adv. colloid interface sci.': '00...
return issns.get(journal_name, 'def')
return issns.get(journal_name, '')
def format(bfo): """ Returns the ISSN of the record, if known.<br/> Note that you HAVE to pre-generate the correspondances journal->ISSN if you want this element to return something (Run <code>python bfe_issn.py -h</code> to get help). """ issns = { 'acta phys. pol. a': '0587-4246', 'adv. colloid interface sci.': '00...
<input class="admin_w200" type="text" name="title" value="%s" /><br>
<textarea cols="50" rows="1" class="admin_wvar" type="text" name="title">%s</textarea><br>
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 = """...
""" % (title, body)
""" % (cgi.escape(title), cgi.escape(body))
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 = """...
confirm=0)
confirm=1)
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...
if confirm in [0, "0"]: text = """<b>Are you sure you want to delete the portalbox '%s'.</b> """ % pbx_dict[pbxID] output += createhiddenform(action="deleteportalbox text=text, button="Confirm", colID=colID, pbxID=pbxID, ln=ln, confirm=1) elif confirm in [1, "1"]:
if confirm in [1, "1"]:
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...
output += """Portalbox (content) specific values (any changes appears everywhere the portalbox is used.)"""
output += """<br>Portalbox (content) specific values (any changes appears everywhere the portalbox is used.)"""
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...
<input class="admin_w200" type="text" name="title" value="%s" /><br> """ % title
<textarea cols="50" rows="1" class="admin_wvar" type="text" name="title">%s</textarea><br> """ % cgi.escape(title)
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...
""" % body
""" % cgi.escape(body)
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...
<td><b>Menu</b></td> </tr> <tr>
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...
return addadminbox('Overview', body)
return addadminbox('<b>Menu</b>', body)
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...
webtime = time.strptime(collection_web_update_time, "%d %b %Y %H:%M:%S %Z")
try: webtime = time.strptime(collection_web_update_time, "%d %b %Y %H:%M:%S %Z") except ValueError, e: collection_web_update_time[0:string.rfind(collection_web_update_time, " ")] webtime = time.strptime(collection_web_update_time, "%d %b %Y %H:%M:%S")
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 = ""...
<a href="http://cdsdev.cern.ch:8000/DEMODEV/youraccount.py/login">login</a>."""]),
<a href="<WEBURL>/youraccount.py/login">login</a>."""]),
def mustloginpage(req): """show a page asking the user to login.""" navtrail_previous_links = """<a class=navtrail href="<WEBURL>/admin/">Admin Area</a> &gt; <a class=navtrail href="<WEBURL>/admin/webaccess/">WebAccess Admin</a> &gt; """ return page(title='Authorization failure', uid=getUid(req), body=adderrorbox('tr...
users1 = run_sql("""SELECT id, email FROM user WHERE email RLIKE '%s' ORDER BY id LIMIT 26""" % (email_user_pattern, ))
users1 = run_sql("""SELECT id, email FROM user WHERE email RLIKE '%s' ORDER BY email LIMIT %s""" % (email_user_pattern, MAXPAGEUSERS+1))
def perform_userarea(req, email_user_pattern=''): """create area to show info about users. """ if not is_adminuser(req): return mustloginpage(req) subtitle = 'step 1 - search for users' output = """ <p> search for users to display. </p> """ # remove letters not allowed in an email email_user_pattern = cleanstring_e...
output += '<p>found <strong>%s</strong> matching users</p>' % (len(users1), )
output += '<p>found <strong>%s</strong> matching users:</p>' % (len(users1), )
def perform_userarea(req, email_user_pattern=''): """create area to show info about users. """ if not is_adminuser(req): return mustloginpage(req) subtitle = 'step 1 - search for users' output = """ <p> search for users to display. </p> """ # remove letters not allowed in an email email_user_pattern = cleanstring_e...
users1 = run_sql("""SELECT id, email FROM user WHERE email RLIKE '%s' ORDER BY id """ % (email_user_pattern, ))
users1 = run_sql("""SELECT id, email FROM user WHERE email RLIKE '%s' ORDER BY email """ % (email_user_pattern, ))
def perform_delegate_adduserrole(req, id_role=0, email_user_pattern='', id_user=0, confirm=0): """let a lower level web admin add users to a limited set of roles. id_role - the role to connect to a user id_user - the user to connect to a role confirm - make the connection happen """ # finding the allowed roles for ...
ORDER BY u.id """ % (id_role, email_user_pattern))
ORDER BY u.email """ % (id_role, email_user_pattern))
def perform_delegate_adduserrole(req, id_role=0, email_user_pattern='', id_user=0, confirm=0): """let a lower level web admin add users to a limited set of roles. id_role - the role to connect to a user id_user - the user to connect to a role confirm - make the connection happen """ # finding the allowed roles for ...
output += 'no qualified users, try new search'
output += '<p>no qualified users, try new search.</p>' elif len(users1) > MAXSELECTUSERS: output += '<p><strong>%s hits</strong>, to many qualified users, specify more narrow search.</p>' % (len(users1), )
def perform_delegate_adduserrole(req, id_role=0, email_user_pattern='', id_user=0, confirm=0): """let a lower level web admin add users to a limited set of roles. id_role - the role to connect to a user id_user - the user to connect to a role confirm - make the connection happen """ # finding the allowed roles for ...
output = actiondetails(id_action=id_action)
output += actiondetails(id_action=id_action)
def perform_showactiondetails(req, id_action): """show the details of an action. """ if not is_adminuser(req): return mustloginpage(req) if id_action not in [0, '0']: output = actiondetails(id_action=id_action) extra = """ <dl> <dt><a href="addauthorization?id_action=%s&amp;reverse=1">Add new authorization</a></dt> ...
body = ['<p>no details to show</p>']
output += '<p>no details to show</p>' body = [output]
def perform_showactiondetails(req, id_action): """show the details of an action. """ if not is_adminuser(req): return mustloginpage(req) if id_action not in [0, '0']: output = actiondetails(id_action=id_action) extra = """ <dl> <dt><a href="addauthorization?id_action=%s&amp;reverse=1">Add new authorization</a></dt> ...
output = roledetails(id_role=id_role)
output += roledetails(id_role=id_role)
def perform_showroledetails(req, id_role): """show the details of a role.""" if not is_adminuser(req): return mustloginpage(req) if id_role not in [0, '0']: output = roledetails(id_role=id_role) extra = """ <dl> <dt><a href="adduserrole?id_role=%s">Connect user</a></dt> <dd>connect a user to the role.</dd> <dt><a hr...
body = ['<p>no details to show</p>']
output += '<p>no details to show</p>' body = [output]
def perform_showroledetails(req, id_role): """show the details of a role.""" if not is_adminuser(req): return mustloginpage(req) if id_role not in [0, '0']: output = roledetails(id_role=id_role) extra = """ <dl> <dt><a href="adduserrole?id_role=%s">Connect user</a></dt> <dd>connect a user to the role.</dd> <dt><a hr...
users1 = run_sql("""SELECT id, email FROM user WHERE email RLIKE '%s' ORDER BY id """ % (email_user_pattern, ))
users1 = run_sql("""SELECT id, email FROM user WHERE email RLIKE '%s' ORDER BY email """ % (email_user_pattern, ))
def perform_adduserrole(req, id_role='0', email_user_pattern='', id_user='0', confirm=0): """create connection between user and role. id_role - id of the role to add user to email_user_pattern - search for users using this pattern id_user - id of user to add to the role. """ if not is_adminuser(req): return mustlog...
ORDER BY u.id """ % (id_role, email_user_pattern))
ORDER BY u.email """ % (id_role, email_user_pattern))
def perform_adduserrole(req, id_role='0', email_user_pattern='', id_user='0', confirm=0): """create connection between user and role. id_role - id of the role to add user to email_user_pattern - search for users using this pattern id_user - id of user to add to the role. """ if not is_adminuser(req): return mustlog...
output += 'no qualified users, try new search'
output += '<p>no qualified users, try new search.</p>' elif len(users1) > MAXSELECTUSERS: output += '<p><strong>%s hits</strong>, to many qualified users, specify more narrow search.</p>' % (len(users1), )
def perform_adduserrole(req, id_role='0', email_user_pattern='', id_user='0', confirm=0): """create connection between user and role. id_role - id of the role to add user to email_user_pattern - search for users using this pattern id_user - id of user to add to the role. """ if not is_adminuser(req): return mustlog...
users1 = run_sql("""SELECT id, email FROM user WHERE email RLIKE '%s' ORDER BY id """ % (email_user_pattern, ))
users1 = run_sql("""SELECT id, email FROM user WHERE email RLIKE '%s' ORDER BY email """ % (email_user_pattern, ))
def perform_addroleuser(req, email_user_pattern='', id_user='0', id_role='0', confirm=0): """delete connection between role and user. id_role - id of role to disconnect id_user - id of user to disconnect. """ if not is_adminuser(req): return mustloginpage(req) email_out = acca.acc_getUserEmail(id_user=id_user) name...
output += '<p>no qualified users, try new search</p>'
output += '<p>no qualified users, try new search.</p>' elif len(users) > MAXSELECTUSERS: output += '<p><strong>%s hits</strong>, to many qualified users, specify more narrow search.</p>' % (len(users), )
def perform_addroleuser(req, email_user_pattern='', id_user='0', id_role='0', confirm=0): """delete connection between role and user. id_role - id of role to disconnect id_user - id of user to disconnect. """ if not is_adminuser(req): return mustloginpage(req) email_out = acca.acc_getUserEmail(id_user=id_user) name...
ORDER BY id """)
ORDER BY u.email """)
def perform_deleteuserrole(req, id_role='0', id_user='0', reverse=0, confirm=0): """delete connection between role and user. id_role - id of role to disconnect id_user - id of user to disconnect. """ if not is_adminuser(req): return mustloginpage(req) title = 'Delete user from role' email_user = acca.acc_getUserEma...
subtitle = 'step 2 - select the user'
subtitle = 'step 2 - select the role'
def perform_deleteuserrole(req, id_role='0', id_user='0', reverse=0, confirm=0): """delete connection between role and user. id_role - id of role to disconnect id_user - id of user to disconnect. """ if not is_adminuser(req): return mustloginpage(req) title = 'Delete user from role' email_user = acca.acc_getUserEma...
all_roles = run_sql("""SELECT id, name, description FROM accROLE ORDER BY id """)
all_roles = acca.acc_getAllRoles()
def perform_deleteuserrole(req, id_role='0', id_user='0', reverse=0, confirm=0): """delete connection between role and user. id_role - id of role to disconnect id_user - id of user to disconnect. """ if not is_adminuser(req): return mustloginpage(req) title = 'Delete user from role' email_user = acca.acc_getUserEma...
for data in tuple2[0]: output += '<td class="admintd">%s</td>\n' % (data,)
for i in range(len(tuple2[0])): output += '<td class="%s">%s</td>\n' % (align[i], tuple2[0][i])
def modifyauthorizationsmenu(id_role, id_action, tuple=[], header=[], checked=[], reverse=0): """create table with header and checkboxes, used for multiple choice. makes use of tupletotable to add the actual table id_role - selected role, hidden value in the form id_action - selected action, hidden value in the form ...
for data in row: output += '<td class="admintd">%s</td>\n' % (data,)
for i in range(len(row)): output += '<td class="%s">%s</td>\n' % (align[i], row[i])
def modifyauthorizationsmenu(id_role, id_action, tuple=[], header=[], checked=[], reverse=0): """create table with header and checkboxes, used for multiple choice. makes use of tupletotable to add the actual table id_role - selected role, hidden value in the form id_action - selected action, hidden value in the form ...
if len(datalist) == 1: per = 100 else: per = 75
if len(datalist) == 1: per = '100' else: per = '75'
def addadminbox(header='', datalist=[], cls="admin_wvar"): """used to create table around main data on a page, row based. header - header on top of the table datalist - list of the data to be added row by row cls - possible to select wich css-class to format the look of the table.""" if len(datalist) == 1: per = 10...
""" % (per, datalist[0])
""" % (per+'%', datalist[0])
def addadminbox(header='', datalist=[], cls="admin_wvar"): """used to create table around main data on a page, row based. header - header on top of the table datalist - list of the data to be added row by row cls - possible to select wich css-class to format the look of the table.""" if len(datalist) == 1: per = 10...
row = tuple[0] if type(row) not in [int, long, str, dict]: for data in row: extra += '<td class="admintd">%s</td>\n' % (data,)
if type(firstrow) not in [int, long, str, dict]: for i in range(len(firstrow)): extra += '<td class="%s">%s</td>\n' % (align[i], firstrow[i])
def tupletotable(header=[], tuple=[], start='', end='', extracolumn=''): """create html table for a tuple. header - optional header for the columns tuple - create table of this start - text to be added in the beginning, most likely beginning of a form end - text to be added in the end, mot likely end of a form. ex...
extra += ' <td class="admintd">%s</td>\n' % (row, )
extra += ' <td class="%s">%s</td>\n' % (align[0], firstrow)
def tupletotable(header=[], tuple=[], start='', end='', extracolumn=''): """create html table for a tuple. header - optional header for the columns tuple - create table of this start - text to be added in the beginning, most likely beginning of a form end - text to be added in the end, mot likely end of a form. ex...
for data in row: tblstr += '<td class="admintd">%s</td>\n' % (data,)
for i in range(len(row)): tblstr += '<td class="%s">%s</td>\n' % (align[i], row[i])
def tupletotable(header=[], tuple=[], start='', end='', extracolumn=''): """create html table for a tuple. header - optional header for the columns tuple - create table of this start - text to be added in the beginning, most likely beginning of a form end - text to be added in the end, mot likely end of a form. ex...
tblstr += ' <td class="admintd">%s</td>\n' % (row, )
tblstr += ' <td class="%s">%s</td>\n' % (align[0], row)
def tupletotable(header=[], tuple=[], start='', end='', extracolumn=''): """create html table for a tuple. header - optional header for the columns tuple - create table of this start - text to be added in the beginning, most likely beginning of a form end - text to be added in the end, mot likely end of a form. ex...
try:
if 1==1:
def get_current_name(ID, ln, rtype, table): """Returns a list of the names, either with the name in the current language, the default language, or just the name from the given table ln - a language supported by cdsware type - the type of value wanted, like 'ln', 'sn'""" try: res = "" if ID: res = run_sql("SELECT id_%s...
except StandardError, e: raise StandardError
def get_current_name(ID, ln, rtype, table): """Returns a list of the names, either with the name in the current language, the default language, or just the name from the given table ln - a language supported by cdsware type - the type of value wanted, like 'ln', 'sn'""" try: res = "" if ID: res = run_sql("SELECT id_%s...
search = get_argument(args, 'search')
def get_record_ids(argstr, date_from, date_until): args = parse_qs(argstr) p = get_argument(args, 'p') c = get_argument(args, 'c') cc = get_argument(args, 'cc') as = get_argument(args, 'as') f = get_argument(args, 'f') rg = get_argument(args, 'rg') so = get_argument(args, 'so') sp ...
return perform_request_search(of='id', p=p, c=c, cc=cc, f=f, so=so, sp=sp, ot=ot, as=as, p1=p1, f1=f1, m1=m1, op1=op1, p2=p2, f2=f2, m2=m2, op2=op2, p3=p3, f3=f3, m3=m3, sc=sc, search=search, d1y=d1y, d1m=d1m, d1d=d1d, d2y=d2y, d2m=d2m, d2d=d2d)
return perform_request_search(of='id', p=p, c=c, cc=cc, f=f, so=so, sp=sp, ot=ot, as=as, p1=p1, f1=f1, m1=m1, op1=op1, p2=p2, f2=f2, m2=m2, op2=op2, p3=p3, f3=f3, m3=m3, sc=sc, d1y=d1y, d1m=d1m, d1d=d1d, d2y=d2y, d2m=d2m, d2d=d2d)
def get_record_ids(argstr, date_from, date_until): args = parse_qs(argstr) p = get_argument(args, 'p') c = get_argument(args, 'c') cc = get_argument(args, 'cc') as = get_argument(args, 'as') f = get_argument(args, 'f') rg = get_argument(args, 'rg') so = get_argument(args, 'so') sp ...
print alert_queries
def process_alert_queries_for_user(uid): alert_queries = get_alert_queries_for_user(uid) for aq in alert_queries: frequency = aq[2] q = run_query(aq, frequency) alerts = get_alerts(q, frequency) process_alerts(alerts)
process_alert_queries_for_user(60)
process_alert_queries_for_user(2530836)
def run_alerts(uid): process_alert_queries_for_user(uid)
next_runtime = get_datetime(sleeptime) run_sql("INSERT INTO schTASK (proc, user, runtime, sleeptime, arguments, status) "\ " VALUES (%s,%s,%s,%s,%s,'WAITING')", (process, self.currentrow[2], next_runtime,sleeptime, self.currentrow[7]))
new_runtime = get_datetime(sleeptime) new_task_arguments = marshal.loads(self.currentrow[7]) new_task_arguments["runtime"] = new_runtime new_task_id = run_sql("INSERT INTO schTASK (proc,user,runtime,sleeptime,arguments,status)"\ " VALUES (%s,%s,%s,%s,%s,'WAITING')", (process, self.currentrow[2], new_runtime, sleeptime,...
def run(self): task_id = self.currentrow[0] process = self.currentrow[1] status = self.currentrow[5] sleeptime = self.currentrow[4] if self.count_processes('RUNNING') + self.count_processes('CONTINUING') >= 1: self.display_in_footer("a process is already running!") elif status == "STOPPED" or status == "WAITING": if pr...
next_runtime = get_datetime(sleeptime) run_sql("INSERT INTO schTASK (proc, user, runtime, sleeptime, arguments, status) "\ " VALUES (%s,%s,%s,%s,%s,'WAITING')", (proc, user, next_runtime, sleeptime, arguments))
new_runtime = get_datetime(sleeptime) new_task_arguments = marshal.loads(arguments) new_task_arguments["runtime"] = new_runtime new_task_id = run_sql("INSERT INTO schTASK (proc,user,runtime,sleeptime,arguments,status)"\ " VALUES (%s,%s,%s,%s,%s,'WAITING')", (proc, user, new_runtime, sleeptime, arguments)) new_task_argu...
def handle_row( self, row ): task_id, proc, user, runtime, sleeptime, arguments, status = row if status == "SLEEP": if task_id in self.running.keys(): self.set_status( task_id, "SLEEP SENT" ) os.kill( self.running[task_id], signal.SIGUSR1 ) self.sleep_sent[task_id] = self.running[task_id] elif status == "SLEEPING": if ...
collection_table_update_time = str(res[0][11])[0:len(collection_table_update_time) - 3]
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] else: collection_table_update_time = str(res[0][11])[0:len(collection_table_update_time)]
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 = ""...
try: tabletime = time.strptime(collection_table_update_time, "%Y-%m-%d %H:%M:%S") except StandardError, e: tabletime = time.strptime(collection_table_update_time, "%Y-%m-%d %H:%M")
tabletime = time.strptime(collection_table_update_time, "%Y-%m-%d %H:%M:%S")
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 = ""...
parts.append(create_html_link(req.uri, argd, lang_namelong, {'class': "langinfo"}))
args = req.uri + make_canonical_urlargd(argd, {})
def tmpl_language_selection_box(self, req, language=cdslang): """Take URLARGS and LANGUAGE and return textual language selection box for the given page.
parts.append(create_html_link('', {}, lang_namelong, {'class': "langinfo"}))
args = "" parts.append(create_html_link(args, {}, lang_namelong, {'class': "langinfo"}))
def tmpl_language_selection_box(self, req, language=cdslang): """Take URLARGS and LANGUAGE and return textual language selection box for the given page.
def create_GuestUser():
def createGuestUser():
def create_GuestUser(): """Create a guest user , insert into user null values in all fields create_GuestUser() -> GuestUserID """ query_result = run_sql("insert into user (email) values ('')") return query_result
create_GuestUser() -> GuestUserID """ query_result = run_sql("insert into user (email) values ('')") return query_result
createGuestUser() -> GuestUserID """ return run_sql("insert into user (email) values ('')")
def create_GuestUser(): """Create a guest user , insert into user null values in all fields create_GuestUser() -> GuestUserID """ query_result = run_sql("insert into user (email) values ('')") return query_result
s = sm.create_session(request)
def getUid ( request ): """It gives the userId taking it from the cookie of the request,also has the control mechanism for the guest users, inserting in the MySql table when need it, and raise the cookie to the client. getUid(request) -> userId """ sm = session.MPSessionManager(pSession, pSessionMapping()) try : s = s...
idg = create_GuestUser() s.setUid(idg) return idg
s = sm.get_session(request)
def getUid ( request ): """It gives the userId taking it from the cookie of the request,also has the control mechanism for the guest users, inserting in the MySql table when need it, and raise the cookie to the client. getUid(request) -> userId """ sm = session.MPSessionManager(pSession, pSessionMapping()) try : s = s...
if userId == -1: id1 = create_GuestUser() s.setUid(id1) sm.maintain_session(request,s) return userId
if userId == -1: s.setUid(createGuestUser()) sm.maintain_session(request,s)
def getUid ( request ): """It gives the userId taking it from the cookie of the request,also has the control mechanism for the guest users, inserting in the MySql table when need it, and raise the cookie to the client. getUid(request) -> userId """ sm = session.MPSessionManager(pSession, pSessionMapping()) try : s = s...
s = sm.get_session(request)
try: s = sm.get_session(request) except SessionError,e: sm.revoke_session_cookie (request) s = sm.get_session(request)
def setUid(request,uid): """It sets the userId into the session, and raise the cookie to the client. """ sm = session.MPSessionManager(pSession, pSessionMapping()) s = sm.get_session(request) s.setUid(uid) sm.maintain_session(request,s)
query_result = run_sql("insert into user (email, password) values (%s,%s)", (user,passw)) setUid(request,query_result)
setUid(request, run_sql("INSERT INTO user (email, password) VALUES (%s,%s)", (user,passw))
def registerUser(request,user,passw): """It registers the user, inserting into the user table of MySQL database, the email and the pasword of the user. It returns 1 if the insertion is done, 0 if there is any failure with the email and -1 if the user is already on the data base registerUser(request,user,passw) -> int ...
s = sm.get_session(req) id1 = create_GuestUser()
try: s = sm.get_session(request) except SessionError,e: sm.revoke_session_cookie (request) s = sm.get_session(request) id1 = createGuestUser()
def logoutUser(req): """It logout the user of the system, creating a guest user. """ sm = session.MPSessionManager(pSession, pSessionMapping()) s = sm.get_session(req) id1 = create_GuestUser() s.setUid(id1) sm.maintain_session(req,s) return id1
def list_registered_users(): """list all users""" try: return run_sql("""SELECT id,email FROM user where email!=''""") except IndexError: return []
def auth_apache_user_collection_p(user, password, coll): """Check whether user-supplied credentials correspond to valid Apache password data file, and whether this user is authorized to see the given collections. Return 0 in case of failure, 1 in case of success.""" from search_engine import coll_restricted_p, coll_re...
output += """<tr><td>%s</td><td>%s</td><td>%s</td><td>%s</td><td>%s</td><td>%s</td><td>%s</td><td>%s</td><td>%s</td></tr>""" % (idxID, """<a href="%s/admin/bibindex/bibindexadmin.py/editindex?idxID=%s&amp;ln=%s" title="%s">%s</A>""" % (weburl, idxID, ln, idxDESC, idx_dict[idxID]), "%s MB" % nice_number(table_status_for...
output += """<tr><td>%s</td><td>%s</td><td>%s</td><td>%s</td><td>%s</td><td>%s</td><td>%s</td><td>%s</td><td>%s</td></tr>""" % (idxID, """<a href="%s/admin/bibindex/bibindexadmin.py/editindex?idxID=%s&amp;ln=%s" title="%s">%s</A>""" % (weburl, idxID, ln, idxDESC, idx_dict.get(idxID, idxNAME)), "%s MB" % nice_number(tab...
def perform_showindexoverview(ln=cdslang, callback='', confirm=0): subtitle = """<a name="1"></a>1. Overview of indexes""" output = """<table cellpadding="3" border="1">""" output += """<tr><td><strong>%s</strong></td><td><strong>%s</strong></td><td><strong>%s</strong></td><td><strong>%s</strong></td><td><strong>%s</st...
output += """<tr><td>%s</td><td>%s</td><td>%s</td><td>%s</td><td>%s</td><td>%s</td><td>%s</td><td>%s</td><td>%s</td></tr>""" % (idxID, """<a href="%s/admin/bibindex/bibindexadmin.py/editindex?idxID=%s&amp;ln=%s">%s</A>""" % (weburl, idxID, ln, idx_dict[idxID]), "Error", "%s MB" % nice_number(table_status_reverse[0][5] ...
output += """<tr><td>%s</td><td>%s</td><td>%s</td><td>%s</td><td>%s</td><td>%s</td><td>%s</td><td>%s</td><td>%s</td></tr>""" % (idxID, """<a href="%s/admin/bibindex/bibindexadmin.py/editindex?idxID=%s&amp;ln=%s">%s</A>""" % (weburl, idxID, ln, idx_dict.get(idxID, idxNAME)), "Error", "%s MB" % nice_number(table_status_r...
def perform_showindexoverview(ln=cdslang, callback='', confirm=0): subtitle = """<a name="1"></a>1. Overview of indexes""" output = """<table cellpadding="3" border="1">""" output += """<tr><td><strong>%s</strong></td><td><strong>%s</strong></td><td><strong>%s</strong></td><td><strong>%s</strong></td><td><strong>%s</st...
output += """<tr><td>%s</td><td>%s</td><td>%s</td><td>%s</td><td>%s</td><td>%s</td><td>%s</td><td>%s</td><td>%s</td></tr>""" % (idxID, """<a href="%s/admin/bibindex/bibindexadmin.py/editindex?idxID=%s&amp;ln=%s">%s</A>""" % (weburl, idxID, ln, idx_dict[idxID]), "%s MB" % nice_number(table_status_forward[0][5] / 1048576...
output += """<tr><td>%s</td><td>%s</td><td>%s</td><td>%s</td><td>%s</td><td>%s</td><td>%s</td><td>%s</td><td>%s</td></tr>""" % (idxID, """<a href="%s/admin/bibindex/bibindexadmin.py/editindex?idxID=%s&amp;ln=%s">%s</A>""" % (weburl, idxID, ln, idx_dict.get(idxID, idxNAME)), "%s MB" % nice_number(table_status_forward[0]...
def perform_showindexoverview(ln=cdslang, callback='', confirm=0): subtitle = """<a name="1"></a>1. Overview of indexes""" output = """<table cellpadding="3" border="1">""" output += """<tr><td><strong>%s</strong></td><td><strong>%s</strong></td><td><strong>%s</strong></td><td><strong>%s</strong></td><td><strong>%s</st...
if results_final_nb[coll] > 0:
if results_final_nb.has_key(coll) and results_final_nb[coll] > 0:
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 class=\"searchresultsbox\...
for coll in results_final.keys(): if coll not in colls_to_search: colls_to_search.append(coll)
def perform_request_search(req=None, cc=cdsname, c=None, p="", f="", rg="10", sf="", so="d", sp="", of="id", ot="", as="0", p1="", f1="", m1="", op1="", p2="", f2="", m2="", op2="", p3="", f3="", m3="", sc="0", jrec="0", recid="-1", recidb="-1", sysno="", id="-1", idb="-1", sysnb="", action="SEARCH", d1y="0", d1m="0", ...
idactionsstre += (idactionsstr and ',' or '') + '%s' id
idactionsstr += (idactionsstr and ',' or '') + '%s' % id
def acc_garbage_collector(verbose=0): """clean the entire database for unused data""" # keep track of all deleted entries del_entries = [] # user_accROLEs without existing role or user count = 0 # roles have been deleted id_roles = run_sql("""SELECT DISTINCT r.id FROM accROLE r""") idrolesstr = '' for (id, ) in id_r...
out += """<select name="c"><option value="">*** remove this collection ***"""
out += """<select name="c"><option value="">*** any collection ***"""
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, action="SEARCH"): "Create search box for 'search again in the results page' functionality." out = "" # print search box prolog: out += """ <form action="%s/search.py" method...
<option value="0"%s>grouped together
<option value="0"%s>single list
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, action="SEARCH"): "Create search box for 'search again in the results page' functionality." out = "" # print search box prolog: out += """ <form action="%s/search.py" method...
if cc != cdsname or not exclude_root:
if cc != cdsname:
def create_navtrail(cc=cdsname, as=0, header="""<table class="navtrailbox"><tr><td width="15">&nbsp;</td><td class="navtrailboxbody"><small>""", \ prolog="", \ separator="&gt;", \ epilog="", \ footer="&gt; Search Results</td></tr></table><br>", exclude_root=0): """Creates navigation trail, i.e. links to ancestors of th...
* if is equal to 0, then we can wash the colls list down
* if is equal to 1, then we can wash the colls list down
def wash_colls(cc, c, split_colls=0): """Wash collection list by checking whether user has deselected anything under 'Narrow search'. Checks also if cc is a list or not. Return list of cc, colls_to_display, colls_to_search since the list of collections to display is different from that to search in. This is because u...
* if is equal to 1, then we are splitting to the first level
* if is equal to 0, then we are splitting to the first level
def wash_colls(cc, c, split_colls=0): """Wash collection list by checking whether user has deselected anything under 'Narrow search'. Checks also if cc is a list or not. Return list of cc, colls_to_display, colls_to_search since the list of collections to display is different from that to search in. This is because u...
* if it is equal to 9, then we are splitting right to the bottom level.
def wash_colls(cc, c, split_colls=0): """Wash collection list by checking whether user has deselected anything under 'Narrow search'. Checks also if cc is a list or not. Return list of cc, colls_to_display, colls_to_search since the list of collections to display is different from that to search in. This is because u...
def get_coll_sons(coll): "Returns a list of sons (first-level descendants) for collection 'coll'."
def get_coll_sons(coll, type='r'): "Returns a list of sons (first-level descendants) of type 'type' for collection 'coll'."
def get_coll_sons(coll): "Returns a list of sons (first-level descendants) for collection 'coll'." coll_sons = [] query = "SELECT c.name FROM collection AS c "\ "LEFT JOIN collection_collection AS cc ON c.id=cc.id_son "\ "LEFT JOIN collection AS ccc ON ccc.id=cc.id_dad "\ "WHERE ccc.name='%s' ORDER BY cc.score DESC" \ ...
"WHERE ccc.name='%s' ORDER BY cc.score DESC" \ % escape_string(coll)
"WHERE cc.type='%s' AND ccc.name='%s' ORDER BY cc.score DESC" \ % (escape_string(type), escape_string(coll))
def get_coll_sons(coll): "Returns a list of sons (first-level descendants) for collection 'coll'." coll_sons = [] query = "SELECT c.name FROM collection AS c "\ "LEFT JOIN collection_collection AS cc ON c.id=cc.id_son "\ "LEFT JOIN collection AS ccc ON ccc.id=cc.id_dad "\ "WHERE ccc.name='%s' ORDER BY cc.score DESC" \ ...
else: return browse_in_bibxxx(req, colls, p, f, rg)
p_orig = p urlarg_colls = "" for coll in colls: urlarg_colls += "&c=%s" % urllib.quote(coll) browsed_words = browse_in_bibxxx(p, f, rg) while not browsed_words: try: p = p[:-1] browsed_words = browse_in_bibxxx(p, f, rg) except: req.write("<p>No values found.") return browsed_words_in_colls = [] for word,nbhits in b...
def browse_pattern(req, colls, p, f, rg): """Browse either biliographic phrases or words indexes, and display it.""" ## do we search in words indexes? if not f: return browse_in_bibwords(req, p, f) else: return browse_in_bibxxx(req, colls, p, f, rg)
req.write("<p>Words nearest to <strong>%s</strong> " % p)
req.write("<p>Words nearest to <em>%s</em> " % p)
def browse_in_bibwords(req, p, f): """Browse inside words indexes.""" req.write("<p>Words nearest to <strong>%s</strong> " % p) if f: req.write(" inside <strong>%s</strong> " % f) req.write(" are:<br>") url = string.replace(req.args, "search=Browse","search=SEARCH") req.write(create_nearest_words_links(url, p, f)) retu...
req.write(" inside <strong>%s</strong> " % f) req.write(" are:<br>") url = string.replace(req.args, "search=Browse","search=SEARCH") req.write(create_nearest_words_links(url, p, f))
req.write(" inside <em>%s</em> " % f) req.write(" in any collection are:<br>") urlargs = string.replace(req.args, "search=Browse","search=SEARCH") req.write(create_nearest_terms_box(urlargs, p, f))
def browse_in_bibwords(req, p, f): """Browse inside words indexes.""" req.write("<p>Words nearest to <strong>%s</strong> " % p) if f: req.write(" inside <strong>%s</strong> " % f) req.write(" are:<br>") url = string.replace(req.args, "search=Browse","search=SEARCH") req.write(create_nearest_words_links(url, p, f)) retu...
def browse_in_bibxxx(req, colls, p, f, rg):
def browse_in_bibxxx(p, f, rg): """Browse bibliographic phrases for the given pattern in the given field, regardless of collection. Return list of [word1, nbhits1],[word2, nbhits2],...[word_rg,nbhits_rg].""" if string.find(p, ":") > 0: f, p = split(p, ":", 2) p = re_quotes.sub("", p) tl = [] if str(f[0]).isdigit() a...
def browse_in_bibxxx(req, colls, p, f, rg): """Browse bibliographic phrases for the given pattern in the given field.""" ## determine browse field: if string.find(p, ":") > 0: # does 'p' contain ':'? f, p = split(p, ":", 2) ## prepare collection urlargument for later printing: urlarg_colls = "" for coll in colls: urlar...
print_warning(req, "The search type '%s' is not defined." % ti, "Error")
print_warning(req, "Search type '%s' is not defined." % ti, "Error")
def search_pattern(req, p=None, f=None, colls=[], m=None, hit_hints=0): """Searches for pattern 'p' and field 'f' and returns dict of recIDs HitLists per each collection in 'colls'. - Optionally, the function accepts the match type argument 'm'. If it is set (e.g. from advanced search interface), then it performs this ...
text = "Search term <strong>%s</strong>" % pi
text = "Search term <em>%s</em>" % pi
def search_pattern(req, p=None, f=None, colls=[], m=None, hit_hints=0): """Searches for pattern 'p' and field 'f' and returns dict of recIDs HitLists per each collection in 'colls'. - Optionally, the function accepts the match type argument 'm'. If it is set (e.g. from advanced search interface), then it performs this ...
print_warning(req, "%s did not match any record. Nearest terms are: %s" % (text, create_nearest_words_links(req.args, pi, fi)), "")
print_warning(req, "%s did not match any record. Nearest terms in any collection are: %s" % (text, create_nearest_terms_box(req.args, pi, fi)), "")
def search_pattern(req, p=None, f=None, colls=[], m=None, hit_hints=0): """Searches for pattern 'p' and field 'f' and returns dict of recIDs HitLists per each collection in 'colls'. - Optionally, the function accepts the match type argument 'm'. If it is set (e.g. from advanced search interface), then it performs this ...
text += """<br>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<a href="%s/search.py?%s">%s</a> - about %s hits""" % \ (weburl, url_args_new, pi, get_word_nbhits(pi, fi))
text += """<tr><td class="nearesttermsboxbody" align="right">%s</td><td class="nearesttermsboxbody" width="15">&nbsp;</td><td class="nearesttermsboxbody" align="left"><a class="nearestterms" href="%s/search.py?%s">%s</a></td></tr>""" % \ (get_word_nbhits(pi, fi), weburl, url_args_new, pi) text += """</table></blockquot...
def search_pattern(req, p=None, f=None, colls=[], m=None, hit_hints=0): """Searches for pattern 'p' and field 'f' and returns dict of recIDs HitLists per each collection in 'colls'. - Optionally, the function accepts the match type argument 'm'. If it is set (e.g. from advanced search interface), then it performs this ...
<a href="%s/search.py?%s">%d hits</a>.""" %
<a class="nearestterms" href="%s/search.py?%s">%d hits</a>.""" %
def search_pattern(req, p=None, f=None, colls=[], m=None, hit_hints=0): """Searches for pattern 'p' and field 'f' and returns dict of recIDs HitLists per each collection in 'colls'. - Optionally, the function accepts the match type argument 'm'. If it is set (e.g. from advanced search interface), then it performs this ...
text = """No other public collection matched your query. If you were looking for a non-public document, please choose the desired restricted collection first."""
text = """No public collection matched your query. If you were looking for a non-public document, please choose the desired restricted collection first."""
def search_pattern(req, p=None, f=None, colls=[], m=None, hit_hints=0): """Searches for pattern 'p' and field 'f' and returns dict of recIDs HitLists per each collection in 'colls'. - Optionally, the function accepts the match type argument 'm'. If it is set (e.g. from advanced search interface), then it performs this ...
print_warning(req, "No match found, looking for substrings...", "")
print_warning(req, "No exact match found, looking for substrings...", "")
def search_in_bibxxx(req, p, f, type): """Searches for pattern 'p' inside bibxxx tables for field 'f' and returns hitlist of recIDs found. The search type is defined by 'type' (e.g. equals to 'r' for a regexp search).""" p_orig = p # saving for eventual future 'no match' reporting # wash arguments: f = string.replace(f...
def create_nearest_words_links(url, p, f, n=10, prologue="<br>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;", epilogue=""): """Return list of 'n' nearest words to 'p' in the words index list for the field 'f'."""
def create_nearest_terms_box(urlargs, p, f, n=10, p_replace_only="", prologue="<blockquote>", epilogue="</blockquote>"): """Return list of 'n' nearest terms to 'p' in the words index list for the field 'f'. p_replace_only is internally used by create_nearest_terms_box() when it recursively calls itself several times s...
def create_nearest_words_links(url, p, f, n=10, prologue="<br>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;", epilogue=""): """Return list of 'n' nearest words to 'p' in the words index list for the field 'f'.""" out = "" # deduce into which bibwordsX table we will search: bibwordsX = "bibwords%d" % get_wordsindex_id("anyfield"...
for row in res: p_new = row[0] p_new_quoted = urllib.quote(p_new,'') url_new = url if p: p_quoted = urllib.quote(p,'') url_new = string.replace(url, p_quoted, p_new_quoted) else: url_new = url + "&p=%s" % p_new_quoted out += """%s<a href="%s/search.py?%s">%s</a> - about %s hits%s""" % \ (prologue, weburl, url_new, p_ne...
if res: for row in res: p_new = row[0] p_new_quoted = urllib.quote_plus(p_new,'') urlargs_new = urlargs if p_replace_only_quoted: urlargs_new = string.replace(urlargs, p_replace_only_quoted, p_new_quoted) else: urlargs_new = urlargs + "&p=%s" % p_new_quoted out += """<tr><td class="nearesttermsboxbody" align="right">%s...
def create_nearest_words_links(url, p, f, n=10, prologue="<br>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;", epilogue=""): """Return list of 'n' nearest words to 'p' in the words index list for the field 'f'.""" out = "" # deduce into which bibwordsX table we will search: bibwordsX = "bibwords%d" % get_wordsindex_id("anyfield"...
p_quoted = urllib.quote(p,'') p_new_quoted = urllib.quote(p[:-1],'') return create_nearest_words_links(string.replace(url, p_quoted, p_new_quoted), p[:-1], f, n)
return create_nearest_terms_box(urlargs, p[:-1], f, n, p_replace_only)
def create_nearest_words_links(url, p, f, n=10, prologue="<br>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;", epilogue=""): """Return list of 'n' nearest words to 'p' in the words index list for the field 'f'.""" out = "" # deduce into which bibwordsX table we will search: bibwordsX = "bibwords%d" % get_wordsindex_id("anyfield"...
sysnb = wash_url_argument(sysnb, 'int')
sysnb = wash_url_argument(sysnb, 'str')
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...
print_warning(req, "Invalid set operation %s." % op1, "Error")
print_warning(req, "Invalid set operation %s." % op2, "Error")
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 re.search(r'\w[^a-zA-Z0-9]\w',p1) or \ re.search(r'\w[^a-zA-Z0-9]\w',p2) or \ re.search(r'\w[^a-zA-Z0-9]\w',p3):
if re.search(r'\w[^a-zA-Z0-9\s\:]\w',p1) or \ re.search(r'\w[^a-zA-Z0-9\s\:]\w',p2) or \ re.search(r'\w[^a-zA-Z0-9\s\:]\w',p3): p1n, p2n, p3n = p1, p2, p3
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...