rem stringlengths 0 322k | add stringlengths 0 2.05M | context stringlengths 8 228k |
|---|---|---|
write_message('generated ' + marc_name) | write_message('generated %s' % (marc_name,)) | def process_single(tarball, sdir = CFG_TMPDIR, xtract_text = False, \ upload_plots = False, force = False, squash = "", \ yes_i_know = False, refno_url = "", \ clean = False): """ Processes one tarball end-to-end. @param: tarball (string): the absolute location of the tarball we wish to process @param: sdir (string): ... |
write_message('work complete on ' + os.path.split(tarball)[-1]) | write_message('work complete on %s' % (os.path.split(tarball)[-1],)) | def process_single(tarball, sdir = CFG_TMPDIR, xtract_text = False, \ upload_plots = False, force = False, squash = "", \ yes_i_know = False, refno_url = "", \ clean = False): """ Processes one tarball end-to-end. @param: tarball (string): the absolute location of the tarball we wish to process @param: sdir (string): ... |
email = mail_cookie_check_pw_reset(args['k']) | title = _('Reset password') | def resetpassword(self, req, form): args = wash_urlargd(form, { 'k' : (str, ''), 'reset' : (int, 0), 'password' : (str, ''), 'password2' : (str, '') }) |
title = _('Reset password') | try: email = mail_cookie_check_pw_reset(reset_key) except InvenioWebAccessMailCookieDeletedError: return page(title=title, req=req, body=_("This request for resetting a password has already been used."), uid=webuser.getUid(req), navmenuid='youraccount', language=args['ln']) except InvenioWebAccessMailCookieError: retur... | def resetpassword(self, req, form): args = wash_urlargd(form, { 'k' : (str, ''), 'reset' : (int, 0), 'password' : (str, ''), 'password2' : (str, '') }) |
bibdoc = BibRecDocs(recid).get_bibdoc(docname) if description: bibdoc.set_description(description[0], format) if comment: bibdoc.set_comment(comment[0], format) | try: bibdoc = BibRecDocs(recid).get_bibdoc(docname) if description: bibdoc.set_description(description[0], format) if comment: bibdoc.set_comment(comment[0], format) except InvenioWebSubmitFileError: write_message("WARNING: docname %s does not seem to exist for record %s. Has it been renamed outside FFT?" % (docname,... | def merge_marc_into_bibdocfile(field): """Given the 8564 tag it retrieve the corresponding bibdoc and merge the $y and $z subfields.""" url = field_get_subfield_values(field, 'u')[:1] description = field_get_subfield_values(field, 'y')[:1] comment = field_get_subfield_values(field, 'z')[:1] if url: recid, docname, form... |
<form name="request_form" action="%s/record/%s/holdings/send" method="get" > | <form name="request_form" action="%s/record/%s/holdings/send" method="post" > | def tmpl_new_request(self, uid, recid, barcode, ln=CFG_SITE_LANG): """ This template is used when an user want to request a book. Here it is possible to define the 'period of interest' |
<form name="request_form" action="%s/record/%s/holdings/send" method="get" > | <form name="request_form" action="%s/record/%s/holdings/send" method="post" > | def tmpl_new_request2(self, recid, barcode, ln=CFG_SITE_LANG): """ This template is used when an user want to request a book. Here it is possible to define the 'period of interest' |
<form name="step3_form" action="%s/admin2/bibcirculation/loan_on_desk_step4" method="get" > | <form name="step3_form" action="%s/admin2/bibcirculation/loan_on_desk_step4" method="post" > | def tmpl_loan_on_desk_step3(self, user_id, list_of_books, infos, ln=CFG_SITE_LANG): """ @param ln: language of the page """ |
<form name="return_form" action="%s/admin2/bibcirculation/register_new_loan" method="get" > | <form name="return_form" action="%s/admin2/bibcirculation/register_new_loan" method="post" > | def tmpl_loan_on_desk_confirm(self, barcode, borrower, infos, ln=CFG_SITE_LANG): """ @param ln: language of the page0 """ |
method="get" > | method="post" > | def tmpl_associate_barcode(self, request_id, recid, borrower, infos, ln=CFG_SITE_LANG): |
<form name="add_new_borrower_step2_form" action="%s/admin2/bibcirculation/add_new_borrower_step3" method="get" > | <form name="add_new_borrower_step2_form" action="%s/admin2/bibcirculation/add_new_borrower_step3" method="post" > | def tmpl_add_new_borrower_step2(self, tup_infos, infos, ln=CFG_SITE_LANG): |
<form name="create_new_loan_form1" action="%s/admin2/bibcirculation/create_new_loan_step2" method="get" > | <form name="create_new_loan_form1" action="%s/admin2/bibcirculation/create_new_loan_step2" method="post" > | def tmpl_create_new_loan_step1(self, borrower, infos, ln=CFG_SITE_LANG): """ Display the borrower's information and a form where it is possible to search for an item. |
<form name="request_form" action="%s/admin2/bibcirculation/create_new_request_step4" method="get" > | <form name="request_form" action="%s/admin2/bibcirculation/create_new_request_step4" method="post" > | def tmpl_create_new_request_step3(self, borrower_id, barcode, recid, ln=CFG_SITE_LANG): """ @param borrower_id: identify the borrower. Primary key of crcBORROWER. @type borrower_id: int |
<form name="step2_form" action="%s/admin2/bibcirculation/place_new_request_step3" method="get" > | <form name="step2_form" action="%s/admin2/bibcirculation/place_new_request_step3" method="post" > | def tmpl_place_new_request_step2(self, barcode, recid, user_info, infos, ln=CFG_SITE_LANG): """ @param barcode: identify the item. Primary key of crcITEM. @type barcode: string |
<form name="step2_form" action="%s/admin2/bibcirculation/place_new_loan_step3" method="get" > | <form name="step2_form" action="%s/admin2/bibcirculation/place_new_loan_step3" method="post" > | def tmpl_place_new_loan_step2(self, barcode, recid, user_info, ln=CFG_SITE_LANG): """ @param barcode: identify the item. Primary key of crcITEM. @type barcode: string |
<form name="step1_form1" action="%s/admin2/bibcirculation/register_ill_request_step3" method="get" > | <form name="step1_form1" action="%s/admin2/bibcirculation/register_ill_request_step3" method="post" > | def tmpl_register_ill_request_step2(self, user_info, request_info, ln=CFG_SITE_LANG): """ @param user_info: user's informations @type user_info: tuple |
<form name="update_item_info_step4_form" action="%s/record/%s/holdings/ill_register_request_with_recid" method="get" > | <form name="update_item_info_step4_form" action="%s/record/%s/holdings/ill_register_request_with_recid" method="post" > | def tmpl_ill_request_with_recid(self, recid, infos, ln=CFG_SITE_LANG): """ @param recid: identify the record. Primary key of bibrec. @type recid: int |
<form name="step3_form1" action="%s" method="get" > | <form name="step3_form1" action="%s" method="post" > | def tmpl_register_ill_request_with_no_recid_step3(self, book_info, user_info, request_details, admin=True, ln=CFG_SITE_LANG): """ @param book_info: book's informations @type book_info: tuple |
<form name="display_ill_form" action="%s" method="get"> | <form name="display_ill_form" action="%s" method="%s"> """ % (form_url, method) out += """ | def tmpl_register_ill_article_request_step1(self, infos, admin=True, ln=CFG_SITE_LANG): """ @param infos: informations @type infos: list """ |
""" % (form_url, _("Article details"), | """ % (_("Article details"), | def tmpl_register_ill_article_request_step1(self, infos, admin=True, ln=CFG_SITE_LANG): """ @param infos: informations @type infos: list """ |
$(" | $(" showOn: 'button', buttonImage: "%s/img/calendar.gif", buttonImageOnly: true}); | def tmpl_register_ill_article_request_step1(self, infos, admin=True, ln=CFG_SITE_LANG): """ @param infos: informations @type infos: list """ |
<td><textarea name='additional_comments' rows="6" cols="30" style='border: 1px solid | <td> <textarea name='additional_comments' rows="6" cols="30" style='border: 1px solid </td> | def tmpl_register_ill_article_request_step1(self, infos, admin=True, ln=CFG_SITE_LANG): """ @param infos: informations @type infos: list """ |
<form name="step1_form2" action="%s/admin2/bibcirculation/register_ill_article_request_step3" method="get" > | <form name="step1_form2" action="%s/admin2/bibcirculation/register_ill_article_request_step3" method="post" > | def tmpl_register_ill_article_request_step2(self, article_info, request_details, result, key, string, infos, ln): """ @param article_info: information about article @type article_info: tuple |
def index(self, req): | def index(self, req, form): | def index(self, req): """ The function called by default """ redirect_to_url(req, "%s/yourloans/display?%s" % (CFG_SITE_URL, req.args)) |
def index(self, req): | def index(self, req, form): | def index(self, req): """ The function called by default """ redirect_to_url(req, "%s/ill/display?%s" % (CFG_SITE_URL, req.args)) |
record_revision, record = get_cache_file_contents(recid, uid)[1:] | record = get_cache_file_contents(recid, uid)[2] | def perform_request_autocomplete(request_type, recid, uid, data): """ Perfrom an AJAX request associated with the retrieval of autocomplete data. Arguments: request_type: Type of the currently served request recid: the identifer of the record uid: The identifier of the user being currently logged in data: The request ... |
return _check_result(req, module_globals[possible_handler](req, **dict(req.form))) | return _check_result(req, module_globals[possible_handler](req, **form)) | def mp_legacy_publisher(req, possible_module, possible_handler): """ mod_python legacy publisher minimum implementation. """ the_module = open(possible_module).read() module_globals = {} exec(the_module, module_globals) if possible_handler in module_globals and callable(module_globals[possible_handler]): from invenio.w... |
cleaned_form[arg] = req.form.get(arg, None) | cleaned_form[arg] = form.get(arg, None) | def mp_legacy_publisher(req, possible_module, possible_handler): """ mod_python legacy publisher minimum implementation. """ the_module = open(possible_module).read() module_globals = {} exec(the_module, module_globals) if possible_handler in module_globals and callable(module_globals[possible_handler]): from invenio.w... |
for datafield in record[field[0:3]]: | for datafield in record.get(field[0:3], None): | def marcxml_filter_out_tags(recid, fields): """ Returns the fields of record 'recid' that share the same tag and indicators as those specified in 'fields', but for which the subfield is different. This is nice to emulate a bibupload -c that corrects only specific subfields. Parameters: recid - *int* the id of the reco... |
def tmpl_create_useractivities_menu(self, req, ln, selected, url_referer, guest, username, submitter, referee, admin, usebaskets, usemessages, usealerts, usegroups, useloans, usestats): | def tmpl_create_useractivities_menu(self, ln, selected, url_referer, guest, username, submitter, referee, admin, usebaskets, usemessages, usealerts, usegroups, useloans, usestats): | def tmpl_create_useractivities_menu(self, req, ln, selected, url_referer, guest, username, submitter, referee, admin, usebaskets, usemessages, usealerts, usegroups, useloans, usestats): """ Returns the main navigation menu with actions based on user's priviledges |
def tmpl_create_adminactivities_menu(self, req, ln, selected, url_referer, guest, username, submitter, referee, admin, usebaskets, usemessages, usealerts, usegroups, useloans, usestats, activities): | def tmpl_create_adminactivities_menu(self, ln, selected, url_referer, guest, username, submitter, referee, admin, usebaskets, usemessages, usealerts, usegroups, useloans, usestats, activities): | def tmpl_create_adminactivities_menu(self, req, ln, selected, url_referer, guest, username, submitter, referee, admin, usebaskets, usemessages, usealerts, usegroups, useloans, usestats, activities): """ Returns the main navigation menu with actions based on user's priviledges |
_DATE_UPDATED_FIELD = 'dateupdated:' | _DATE_UPDATED_FIELD = 'datemodified:' | def parse(self, token_list, variable_substitution_dict=None): """Make token_list consumable by search_engine. |
email_text = "\n%s\n%s" % (get_pretty_notification_info(exc_name, filename, line_no), email_text) | email_text = "\n%s\n%s" % (pretty_notification_info, email_text) | def register_exception(force_stack=False, stream='error', req=None, prefix='', suffix='', alert_admin=False, subject=''): """ Log error exception to invenio.err and warning exception to invenio.log. Errors will be logged together with client information (if req is given). Note: For sanity reasons, dynamic params suc... |
try: rn except NameError: rn = "" | def endaction(req, c=CFG_SITE_NAME, ln=CFG_SITE_LANG, doctype="", act="", startPg=1, access="", mainmenu="", fromdir="", nextPg="", nbPg="", curpage=1, step=1, mode="U"): """Having filled-in the WebSubmit form created for metadata by the interface function, the user clicks a button to either "finish the submission" or ... | |
(function_content, last_step, action_score) = print_function_calls( req=req, | (function_content, last_step, action_score, rn) = \ print_function_calls(req=req, | def endaction(req, c=CFG_SITE_NAME, ln=CFG_SITE_LANG, doctype="", act="", startPg=1, access="", mainmenu="", fromdir="", nextPg="", nbPg="", curpage=1, step=1, mode="U"): """Having filled-in the WebSubmit form created for metadata by the interface function, the user clicks a button to either "finish the submission" or ... |
if uid_email != "" and uid_email != "guest" and rn != "": | if uid_email != "" and uid_email != "guest": | def endaction(req, c=CFG_SITE_NAME, ln=CFG_SITE_LANG, doctype="", act="", startPg=1, access="", mainmenu="", fromdir="", nextPg="", nbPg="", curpage=1, step=1, mode="U"): """Having filled-in the WebSubmit form created for metadata by the interface function, the user clicks a button to either "finish the submission" or ... |
def print_function_calls (req, doctype, action, step, form, start_time, access, curdir, dismode, rn, last_step, action_score, ln=CFG_SITE_LANG): | def print_function_calls(req, doctype, action, step, form, start_time, access, curdir, dismode, rn, last_step, action_score, ln=CFG_SITE_LANG): """ Calls the functions required by an 'action' action on a 'doctype' document In supervisor mode, a table of the function calls is produced @return: (function_output_string, ... | def print_function_calls (req, doctype, action, step, form, start_time, access, curdir, dismode, rn, last_step, action_score, ln=CFG_SITE_LANG): # Calls the functions required by an "action" action on a "doctype" document # In supervisor mode, a table of the function calls is produced user_info = collect_user_info(req)... |
return (t, the_globals['last_step'], the_globals['action_score']) | return (t, the_globals['last_step'], the_globals['action_score'], the_globals['rn']) | def print_function_calls (req, doctype, action, step, form, start_time, access, curdir, dismode, rn, last_step, action_score, ln=CFG_SITE_LANG): # Calls the functions required by an "action" action on a "doctype" document # In supervisor mode, a table of the function calls is produced user_info = collect_user_info(req)... |
return obj._traverse(req, path) | if hasattr(obj, '_traverse'): return obj._traverse(req, path) else: raise apache.SERVER_RETURN, apache.HTTP_NOT_FOUND | def _traverse(self, req, path): """ Locate the handler of an URI by traversing the elements of the path.""" |
I think you might be interested in joining the group "%s". You can join by clicking here: %s. | I think you might be interested in joining the group "%(x_name)s". You can join by clicking here: %(x_url)s. | def tmpl_display_manage_member(self, grpID, group_name, members, pending_members, infos=[], warnings=[], ln=CFG_SITE_LANG): """Display current members and waiting members of a group. |
""") % (group_name, create_html_link("%s/yourgroups/join" % CFG_SITE_URL, { 'grpID' : grpID, 'join_button' : "1", }, link_label=group_name, escape_urlargd=True, escape_linkattrd=True))}) | """) % {'x_name': group_name, 'x_url': create_html_link("%s/yourgroups/join" % CFG_SITE_URL, { 'grpID' : grpID, 'join_button' : "1", }, link_label=group_name, escape_urlargd=True, escape_linkattrd=True)}}) | def tmpl_display_manage_member(self, grpID, group_name, members, pending_members, infos=[], warnings=[], ln=CFG_SITE_LANG): """Display current members and waiting members of a group. |
signal.signal(signal.SIGUSR2, _task_sig_ping) | signal.signal(signal.SIGUSR2, signal.SIG_IGN) | def _task_run(task_run_fnc): """Runs the task by fetching arguments from the BibSched task queue. This is what BibSched will be invoking via daemon call. The task prints Fibonacci numbers for up to NUM on the stdout, and some messages on stderr. @param task_run_fnc will be called as the main core function. Must return ... |
def _task_sig_ping(sig, frame): """Signal handler for the 'ping' signal sent by BibSched.""" write_message("task_sig_ping(), got signal %s frame %s" % (sig, frame), verbose=9) | def _task_sig_ping(sig, frame): """Signal handler for the 'ping' signal sent by BibSched.""" write_message("task_sig_ping(), got signal %s frame %s" % (sig, frame), verbose=9) | |
if req.is_https() and self._force_https: if not req.is_https(): original_parts = urlparse.urlparse(req.unparsed_uri) plain_prefix_parts = urlparse.urlparse(CFG_SITE_URL) secure_prefix_parts = urlparse.urlparse(CFG_SITE_SECURE_URL) plain_path = original_parts[2] plain_path = secure_prefix_parts[2] + plain_path[len(p... | if CFG_HAS_HTTPS_SUPPORT and self._force_https and not req.is_https(): original_parts = urlparse.urlparse(req.unparsed_uri) plain_prefix_parts = urlparse.urlparse(CFG_SITE_URL) secure_prefix_parts = urlparse.urlparse(CFG_SITE_SECURE_URL) plain_path = original_parts[2] plain_path = secure_prefix_parts[2] + \ plain_p... | def _traverse(self, req, path, do_head=False, guest_p=True): """ Locate the handler of an URI by traversing the elements of the path.""" |
(iden, p_un, p_pw, msgcode) = loginUser(req, '', '', CFG_EXTERNAL_AUTH_USING_SSO) | (iden, p_un, dummy, dummy) = loginUser(req, '', '', CFG_EXTERNAL_AUTH_USING_SSO) | def _traverse(self, req, path, do_head=False, guest_p=True): """ Locate the handler of an URI by traversing the elements of the path.""" |
uid = update_Uid(req, p_un) | update_Uid(req, p_un) | def _traverse(self, req, path, do_head=False, guest_p=True): """ Locate the handler of an URI by traversing the elements of the path.""" |
if not form.has_key('ln') and \ req.uri not in no_lang_recognition_uris: | if 'ln' not in form and \ req.uri not in CFG_NO_LANG_RECOGNITION_URIS: | def _traverse(self, req, path, do_head=False, guest_p=True): """ Locate the handler of an URI by traversing the elements of the path.""" |
util.redirect(req, req.uri + "/", permanent=True) | redirect_to_url(req, req.uri + "/", apache.HTTP_MOVED_PERMANENTLY) | def __call__(self, req, form): """ Maybe resolve the final / of a directory """ |
re_slashes = re.compile('/+') re_special_uri = re.compile('^/record/\d+|^/collection/.+') | def __call__(self, req, form): """ Maybe resolve the final / of a directory """ | |
import hotshot, hotshot.stats | import hotshot import hotshot.stats | def _profiler(req): """ This handler wrap the default handler with a profiler. Profiling data is written into CFG_TMPDIR/invenio-profile-stats-datetime.raw, and is displayed at the bottom of the webpage. To use add profile=1 to your url. To change sorting algorithm you can provide profile=algorithm_name. You can add mo... |
uri = re_slashes.sub('/', uri) | uri = RE_SLASHES.sub('/', uri) | def _handler(req): """ This handler is invoked by mod_python with the apache request.""" try: allowed_methods = ("GET", "POST", "HEAD", "OPTIONS") req.allow_methods(allowed_methods, 1) if req.method not in allowed_methods: raise apache.SERVER_RETURN, apache.HTTP_METHOD_NOT_ALLOWED |
if req.header_only and not re_special_uri.match(req.uri): | if req.header_only and not RE_SPECIAL_URI.match(req.uri): | def _handler(req): """ This handler is invoked by mod_python with the apache request.""" try: allowed_methods = ("GET", "POST", "HEAD", "OPTIONS") req.allow_methods(allowed_methods, 1) if req.method not in allowed_methods: raise apache.SERVER_RETURN, apache.HTTP_METHOD_NOT_ALLOWED |
affus = [] author_aff_pubs = {} | author_aff_pubs = {} | def get_institute_pub_dict(self, recids): #return a dictionary consisting of institute -> list of publications affus = [] #list of insts from the record author_aff_pubs = {} #the disct to be build for recid in recids: #iterate all so that we get first author's intitute #if this the first author OR #"his" institute if h... |
dict_string = dict_string.strip(" {}") | try: evaluated_dict = eval(dict_string, {"__builtins__": {}}, {}) except: evaluated_dict = {} | def get_dictionary_from_string(dict_string): """Given a string version of a "dictionary", split the string into a python dictionary. For example, given the following string: {'TITLE' : 'EX_TITLE', 'AUTHOR' : 'EX_AUTHOR', 'REPORTNUMBER' : 'EX_RN'} A dictionary in the following format will be returned: { 'TITLE' :... |
key_vals = re.split(r'(?<!\\),', dict_string) final_dictionary = {} for key_value_string in key_vals: key_value_pair = re.split(r'(?<!\\):', key_value_string, 1) if len(key_value_pair) != 2: continue key_term = key_value_pair[0].strip(" '\"") value_term = key_value_pair[1].strip(" '\"") if len(key_term) ... | if type(evaluated_dict) is dict: return evaluated_dict else: return {} | def get_dictionary_from_string(dict_string): """Given a string version of a "dictionary", split the string into a python dictionary. For example, given the following string: {'TITLE' : 'EX_TITLE', 'AUTHOR' : 'EX_AUTHOR', 'REPORTNUMBER' : 'EX_RN'} A dictionary in the following format will be returned: { 'TITLE' :... |
out += '<record>\n' out += '\t<controlfield tag="001">%i</controlfield>\n' % recid | def ffts_to_xml(ffts): """Transform a dictionary: recid -> ffts where ffts is a list of fft dictionary into xml. """ out = '' for recid, ffts in ffts.iteritems(): if ffts: out += '<record>\n' out += '\t<controlfield tag="001">%i</controlfield>\n' % recid for fft in ffts: out += _xml_fft_creator(fft) out += '</record>\n... | |
out += '</record>\n' | else: out += '<datafield tag="FFT" ind1=" " ind2=" "></datafield>\n' out += '</record>\n' | def ffts_to_xml(ffts): """Transform a dictionary: recid -> ffts where ffts is a list of fft dictionary into xml. """ out = '' for recid, ffts in ffts.iteritems(): if ffts: out += '<record>\n' out += '\t<controlfield tag="001">%i</controlfield>\n' % recid for fft in ffts: out += _xml_fft_creator(fft) out += '</record>\n... |
images_and_captions = [('img1', 'caption1', 'label1'), ('img2', 'caption2', 'label1')] | images_and_captions = [('img1', 'caption1', 'label1', 'FIXME1'), ('img2', 'caption2', 'label1', 'FIXME1')] | def test_no_dups(self): images_and_captions = [('img1', 'caption1', 'label1'), ('img2', 'caption2', 'label1')] |
images_and_captions = [('img1', 'caption1', 'label1'), ('img1', 'caption2', 'label1')] | images_and_captions = [('img1', 'caption1', 'label1', 'FIXME1'), ('img1', 'caption2', 'label1', 'FIXME1')] | def test_dup_images(self): images_and_captions = [('img1', 'caption1', 'label1'), ('img1', 'caption2', 'label1')] |
self.assertTrue(pared_images_and_captions == [('img1', 'caption1 : caption2', 'label1')], \ | self.assertTrue(pared_images_and_captions == [('img1', 'caption1 : caption2', 'label1', 'FIXME1')], \ | def test_dup_images(self): images_and_captions = [('img1', 'caption1', 'label1'), ('img1', 'caption2', 'label1')] |
images_and_captions = [('img1', 'caption1', 'label1'), ('img1', 'caption1', 'label1'), \ ('img1', 'caption2', 'label1')] | images_and_captions = [('img1', 'caption1', 'label1', 'FIXME1'), ('img1', 'caption1', 'label1', 'FIXME1'), \ ('img1', 'caption2', 'label1', 'FIXME1')] | def test_dup_captions(self): images_and_captions = [('img1', 'caption1', 'label1'), ('img1', 'caption1', 'label1'), \ ('img1', 'caption2', 'label1')] |
self.assertTrue(pared_images_and_captions == [('img1', 'caption1 : caption2', 'label1')], \ | self.assertTrue(pared_images_and_captions == [('img1', 'caption1 : caption2', 'label1', 'FIXME1')], \ | def test_dup_captions(self): images_and_captions = [('img1', 'caption1', 'label1'), ('img1', 'caption1', 'label1'), \ ('img1', 'caption2', 'label1')] |
def _replace_word_case_insensitive(self, str, old_word, new_word): """Returns a copy of string str where all occurrences of old_word | def _replace_word_case_insensitive(self, input_string, old_word, new_word): """Returns a copy of string input_string where all occurrences of old_word | def _replace_word_case_insensitive(self, str, old_word, new_word): """Returns a copy of string str where all occurrences of old_word are replaced by new_word""" |
result = regular_expression.sub(new_word, str) | result = regular_expression.sub(new_word, input_string) | def _replace_word_case_insensitive(self, str, old_word, new_word): """Returns a copy of string str where all occurrences of old_word are replaced by new_word""" |
return result | def create_replacement_pattern(match): result = '' search_term = match.group('search_term') combine_operator = match.group('combine_operator') search_content = match.group('search_content').strip() | |
if not bibrecdocs.has_docname_p(original_bibdoc_name) and filepath: | if not bibrecdocs.has_docname_p(original_bibdoc_name) and file_path: | def revise(file_path, bibdoc_name, rename, doctype, description, comment, file_restriction, iconsize, create_icon_doctypes, keep_previous_versions, recid, curdir, pending_bibdocs, bibrecdocs, forceFileRevision): """ Revises the given bibdoc with a new file """ try: if os.path.exists(file_path) or not file_path: # Perf... |
url_params_dict = dict([part.split('=') for part in params.split('&')]) | url_params_dict = dict([part.split('=') for part in params.split('&') \ if len(part) == 2]) | def get_files(bfo): """ Returns the files available for the given record. Returned structure is a tuple (parsed_urls, old_versions, additionals): - parsed_urls: contains categorized URLS (see details below) - old_versions: set to True if we can have access to old versions - additionals: set to True if we have other doc... |
result[recid] += 1 citation_list[recid].append(rec_id) | result[thisrecid] += 1 citation_list[thisrecid].append(rec_id) | def ref_analyzer(citation_informations, initialresult, initial_citationlist, initial_referencelist,config, updated_rec_list ): """Analyze the citation informations and calculate the citation weight and cited by list dictionary. """ function = "" try: function = config.get("rank_method", "function") except: register_exc... |
if m == 'a' or m == 'r': | if f == 'datecreated': set = search_unit_in_bibrec(p, p, 'c') elif f == 'datemodified': set = search_unit_in_bibrec(p, p, 'm') elif m == 'a' or m == 'r': | def search_unit(p, f=None, m=None): """Search for basic search unit defined by pattern 'p' and field 'f' and matching type 'm'. Return hitset of recIDs. All the parameters are assumed to have been previously washed. 'p' is assumed to be already a ``basic search unit'' so that it is searched as such and is not broken ... |
res = run_sql("SELECT id FROM bibrec WHERE %s>=%%s AND %s<=%%s" % (type, type), (datetext1, datetext2)) | if datetext1 == datetext2: res = run_sql("SELECT id FROM bibrec WHERE %s LIKE %%s" % (type,), (datetext1 + '%',)) else: res = run_sql("SELECT id FROM bibrec WHERE %s>=%%s AND %s<=%%s" % (type, type), (datetext1, datetext2)) | def search_unit_in_bibrec(datetext1, datetext2, type='c'): """ Return hitset of recIDs found that were either created or modified (according to 'type' arg being 'c' or 'm') from datetext1 until datetext2, inclusive. Does not pay attention to pattern, collection, anything. Useful to intersect later on with the 'real' q... |
to_str(dt.replace(year=dt.year-1,month=(dt.month+1) % 12, day=1)), to_str(dt.replace(month=(dt.month+1) % 12, day=1)), | to_str((dt - datetime.timedelta(days=365)).replace(day=1)), to_str((dt + datetime.timedelta(days=31)).replace(day=1)), | def _get_timespans(dt=None): """ Helper function that generates possible time spans to be put in the drop-down in the generation box. Computes possible years, and also some pre-defined simpler values. Some items in the list returned also tweaks the output graph, if any, since such values are closely related to the natu... |
to_str(dt.replace(year=dt.year-2, month=(dt.month+1) % 12)), to_str(dt.replace(month=(dt.month+1) % 12)), | to_str((dt - datetime.timedelta(days=365*2)).replace(day=1)), to_str((dt + datetime.timedelta(days=31)).replace(day=1)), | def _get_timespans(dt=None): """ Helper function that generates possible time spans to be put in the drop-down in the generation box. Computes possible years, and also some pre-defined simpler values. Some items in the list returned also tweaks the output graph, if any, since such values are closely related to the natu... |
to_str(dt.replace(year=dt.year-5,month=1)), to_str(dt.replace(month=(dt.month+1) % 12)), | to_str((dt - datetime.timedelta(days=365*5)).replace(day=1)), to_str((dt + datetime.timedelta(days=31)).replace(day=1)), | def _get_timespans(dt=None): """ Helper function that generates possible time spans to be put in the drop-down in the generation box. Computes possible years, and also some pre-defined simpler values. Some items in the list returned also tweaks the output graph, if any, since such values are closely related to the natu... |
to_str(dt.replace(year=dt.year-10,month=1)), to_str(dt.replace(month=(dt.month+1) % 12)), | to_str((dt - datetime.timedelta(days=365*10)).replace(day=1)), to_str((dt + datetime.timedelta(days=31)).replace(day=1)), | def _get_timespans(dt=None): """ Helper function that generates possible time spans to be put in the drop-down in the generation box. Computes possible years, and also some pre-defined simpler values. Some items in the list returned also tweaks the output graph, if any, since such values are closely related to the natu... |
err_logger = logging.handlers.RotatingFileHandler(os.path.join(CFG_LOGDIR, 'bibsched_task_%d.err' % _task_params['task_id']), 'a', 1*1024*1024, 10) log_logger = logging.handlers.RotatingFileHandler(os.path.join(CFG_LOGDIR, 'bibsched_task_%d.log' % _task_params['task_id']), 'a', 1*1024*1024, 10) | err_logger = logging.handlers.RotatingFileHandler(os.path.join(CFG_LOGDIR, 'bibsched_task_%d.err' % _TASK_PARAMS['task_id']), 'a', 1*1024*1024, 10) log_logger = logging.handlers.RotatingFileHandler(os.path.join(CFG_LOGDIR, 'bibsched_task_%d.log' % _TASK_PARAMS['task_id']), 'a', 1*1024*1024, 10) | def setup_loggers(task_id=None): """Sets up the logging system.""" logger = logging.getLogger() for handler in logger.handlers: ## Let's clean the handlers in case some piece of code has already ## fired any write_message, i.e. any call to debug, info, etc. ## which triggered a call to logging.basicConfig() logger.remo... |
global _task_params, _options _task_params = { | global _TASK_PARAMS, _OPTIONS _TASK_PARAMS = { | def task_init( authorization_action="", authorization_msg="", description="", help_specific_usage="", version=__revision__, specific_params=("", []), task_stop_helper_fnc=None, task_submit_elaborate_specific_parameter_fnc=None, task_submit_check_options_fnc=None, task_run_fnc=None): """ Initialize a BibTask. @param aut... |
_task_params['task_id'] = int(sys.argv[1]) argv = _task_get_options(_task_params['task_id'], _task_params['task_name']) | _TASK_PARAMS['task_id'] = int(sys.argv[1]) argv = _task_get_options(_TASK_PARAMS['task_id'], _TASK_PARAMS['task_name']) | def task_init( authorization_action="", authorization_msg="", description="", help_specific_usage="", version=__revision__, specific_params=("", []), task_stop_helper_fnc=None, task_submit_elaborate_specific_parameter_fnc=None, task_submit_check_options_fnc=None, task_run_fnc=None): """ Initialize a BibTask. @param aut... |
setup_loggers(_task_params.get('task_id')) | setup_loggers(_TASK_PARAMS.get('task_id')) | def task_init( authorization_action="", authorization_msg="", description="", help_specific_usage="", version=__revision__, specific_params=("", []), task_stop_helper_fnc=None, task_submit_elaborate_specific_parameter_fnc=None, task_submit_check_options_fnc=None, task_run_fnc=None): """ Initialize a BibTask. @param aut... |
_options = argv | _OPTIONS = argv | def task_init( authorization_action="", authorization_msg="", description="", help_specific_usage="", version=__revision__, specific_params=("", []), task_stop_helper_fnc=None, task_submit_elaborate_specific_parameter_fnc=None, task_submit_check_options_fnc=None, task_run_fnc=None): """ Initialize a BibTask. @param aut... |
_task_build_params(_task_params['task_name'], argv, description, | _task_build_params(_TASK_PARAMS['task_name'], argv, description, | def task_init( authorization_action="", authorization_msg="", description="", help_specific_usage="", version=__revision__, specific_params=("", []), task_stop_helper_fnc=None, task_submit_elaborate_specific_parameter_fnc=None, task_submit_check_options_fnc=None, task_run_fnc=None): """ Initialize a BibTask. @param aut... |
write_message('_options=%s' % (_options, ), verbose=9) write_message('_task_params=%s' % (_task_params, ), verbose=9) | write_message('_OPTIONS=%s' % (_OPTIONS, ), verbose=9) write_message('_TASK_PARAMS=%s' % (_TASK_PARAMS, ), verbose=9) | def task_init( authorization_action="", authorization_msg="", description="", help_specific_usage="", version=__revision__, specific_params=("", []), task_stop_helper_fnc=None, task_submit_elaborate_specific_parameter_fnc=None, task_submit_check_options_fnc=None, task_run_fnc=None): """ Initialize a BibTask. @param aut... |
filename = os.path.join(CFG_TMPDIR, 'bibsched_task_%s.pyprof' % _task_params['task_id']) | filename = os.path.join(CFG_TMPDIR, 'bibsched_task_%s.pyprof' % _TASK_PARAMS['task_id']) | def task_init( authorization_action="", authorization_msg="", description="", help_specific_usage="", version=__revision__, specific_params=("", []), task_stop_helper_fnc=None, task_submit_elaborate_specific_parameter_fnc=None, task_submit_check_options_fnc=None, task_run_fnc=None): """ Initialize a BibTask. @param aut... |
open(os.path.join(CFG_LOGDIR, 'bibsched_task_%d.log' % _task_params['task_id']), 'a').write("%s" % profile_dump) | open(os.path.join(CFG_LOGDIR, 'bibsched_task_%d.log' % _TASK_PARAMS['task_id']), 'a').write("%s" % profile_dump) | def task_init( authorization_action="", authorization_msg="", description="", help_specific_usage="", version=__revision__, specific_params=("", []), task_stop_helper_fnc=None, task_submit_elaborate_specific_parameter_fnc=None, task_submit_check_options_fnc=None, task_run_fnc=None): """ Initialize a BibTask. @param aut... |
global _task_params, _options _options = {} | global _OPTIONS _OPTIONS = {} | def _task_build_params( task_name, argv, description="", help_specific_usage="", version=__revision__, specific_params=("", []), task_submit_elaborate_specific_parameter_fnc=None, task_submit_check_options_fnc=None): """ Build the BibTask params. @param argv: a list of string as in sys.argv @param description: is the g... |
_options.update(CFG_BIBTASK_DEFAULT_TASK_SETTINGS[task_name]) | _OPTIONS.update(CFG_BIBTASK_DEFAULT_TASK_SETTINGS[task_name]) | def _task_build_params( task_name, argv, description="", help_specific_usage="", version=__revision__, specific_params=("", []), task_submit_elaborate_specific_parameter_fnc=None, task_submit_check_options_fnc=None): """ Build the BibTask params. @param argv: a list of string as in sys.argv @param description: is the g... |
print _task_params["version"] | print _TASK_PARAMS["version"] | def _task_build_params( task_name, argv, description="", help_specific_usage="", version=__revision__, specific_params=("", []), task_submit_elaborate_specific_parameter_fnc=None, task_submit_check_options_fnc=None): """ Build the BibTask params. @param argv: a list of string as in sys.argv @param description: is the g... |
_task_params["user"] = opt[1] | _TASK_PARAMS["user"] = opt[1] | def _task_build_params( task_name, argv, description="", help_specific_usage="", version=__revision__, specific_params=("", []), task_submit_elaborate_specific_parameter_fnc=None, task_submit_check_options_fnc=None): """ Build the BibTask params. @param argv: a list of string as in sys.argv @param description: is the g... |
_task_params["verbose"] = int(opt[1]) | _TASK_PARAMS["verbose"] = int(opt[1]) | def _task_build_params( task_name, argv, description="", help_specific_usage="", version=__revision__, specific_params=("", []), task_submit_elaborate_specific_parameter_fnc=None, task_submit_check_options_fnc=None): """ Build the BibTask params. @param argv: a list of string as in sys.argv @param description: is the g... |
_task_params["sleeptime"] = opt[1] | _TASK_PARAMS["sleeptime"] = opt[1] | def _task_build_params( task_name, argv, description="", help_specific_usage="", version=__revision__, specific_params=("", []), task_submit_elaborate_specific_parameter_fnc=None, task_submit_check_options_fnc=None): """ Build the BibTask params. @param argv: a list of string as in sys.argv @param description: is the g... |
_task_params["runtime"] = get_datetime(opt[1]) | _TASK_PARAMS["runtime"] = get_datetime(opt[1]) | def _task_build_params( task_name, argv, description="", help_specific_usage="", version=__revision__, specific_params=("", []), task_submit_elaborate_specific_parameter_fnc=None, task_submit_check_options_fnc=None): """ Build the BibTask params. @param argv: a list of string as in sys.argv @param description: is the g... |
_task_params["priority"] = int(opt[1]) | _TASK_PARAMS["priority"] = int(opt[1]) | def _task_build_params( task_name, argv, description="", help_specific_usage="", version=__revision__, specific_params=("", []), task_submit_elaborate_specific_parameter_fnc=None, task_submit_check_options_fnc=None): """ Build the BibTask params. @param argv: a list of string as in sys.argv @param description: is the g... |
_task_params["task_specific_name"] = opt[1] | _TASK_PARAMS["task_specific_name"] = opt[1] | def _task_build_params( task_name, argv, description="", help_specific_usage="", version=__revision__, specific_params=("", []), task_submit_elaborate_specific_parameter_fnc=None, task_submit_check_options_fnc=None): """ Build the BibTask params. @param argv: a list of string as in sys.argv @param description: is the g... |
_task_params["runtime_limit"] = parse_runtime_limit(opt[1]) | _TASK_PARAMS["runtime_limit"] = parse_runtime_limit(opt[1]) | def _task_build_params( task_name, argv, description="", help_specific_usage="", version=__revision__, specific_params=("", []), task_submit_elaborate_specific_parameter_fnc=None, task_submit_check_options_fnc=None): """ Build the BibTask params. @param argv: a list of string as in sys.argv @param description: is the g... |
_task_params["profile"] += opt[1].split(',') | _TASK_PARAMS["profile"] += opt[1].split(',') | def _task_build_params( task_name, argv, description="", help_specific_usage="", version=__revision__, specific_params=("", []), task_submit_elaborate_specific_parameter_fnc=None, task_submit_check_options_fnc=None): """ Build the BibTask params. @param argv: a list of string as in sys.argv @param description: is the g... |
global _options try: _options[key] = value | global _OPTIONS try: _OPTIONS[key] = value | def task_set_option(key, value): """Set an value to key in the option dictionary of the task""" global _options try: _options[key] = value except NameError: _options = {key : value} |
_options = {key : value} | _OPTIONS = {key : value} | def task_set_option(key, value): """Set an value to key in the option dictionary of the task""" global _options try: _options[key] = value except NameError: _options = {key : value} |
return _options.get(key, default) | return _OPTIONS.get(key, default) | def task_get_option(key, default=None): """Returns the value corresponding to key in the option dictionary of the task""" try: return _options.get(key, default) except NameError: return default |
try: return _options.has_key(key) | try: return _OPTIONS.has_key(key) | def task_has_option(key): """Map the has_key query to _options""" try: return _options.has_key(key) except NameError: return False |
return _task_params.get(key, default) | return _TASK_PARAMS.get(key, default) | def task_get_task_param(key, default=None): """Returns the value corresponding to the particular task param""" try: return _task_params.get(key, default) except NameError: return default |
global _task_params try: _task_params[key] = value | global _TASK_PARAMS try: _TASK_PARAMS[key] = value | def task_set_task_param(key, value): """Set the value corresponding to the particular task param""" global _task_params try: _task_params[key] = value except NameError: _task_params = {key : value} |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.