rem stringlengths 0 322k | add stringlengths 0 2.05M | context stringlengths 8 228k |
|---|---|---|
regex_string = r'\b((?<=find)|(?<=and)|(?<=or)|(?<=not))\s*' + old_keyword | regex_string = r'\b(?P<operator>(find|and|or|not)\b[\s\(]*)' + \ old_keyword + r'(?P<end>[\s\(]+|$)' | def _replace_keyword(self, query, old_keyword, new_keyword): """Replaces old keyword in the query with a new keyword""" |
result = regular_expression.sub(new_keyword, query) | result = regular_expression.sub(r'\g<operator>' + new_keyword + r'\g<end>', query) result = result.replace(": ",":") | def _replace_keyword(self, query, old_keyword, new_keyword): """Replaces old keyword in the query with a new keyword""" |
_do_log(curdir, "Icon could not be created to %s:" % (filepath, e)) | _do_log(curdir, "Icon could not be created to %s: %s" % (filepath, e)) | def Move_Photos_to_Storage(parameters, curdir, form, user_info=None): """ The function moves files received from the submission's form through the PHOTO_MANAGER element and its asynchronous uploads at CFG_SITE_URL/submit/uploadfile. The PHOTO_MANAGER elements builds the following file organization in the directory cur... |
except: | except Exception, e: _do_log(curdir, 'Could not read %s: %s' % (param, e)) | def read_param_file(curdir, param, split_lines=False): "Helper function to access files in submission dir" param_value = "" path = os.path.join(curdir, param) try: if os.path.abspath(path).startswith(curdir): fd = file(path) if split_lines: param_value = [line.strip() for line in fd.readlines()] else: param_value = fd.... |
output = output[:-5] + ' <input class="adminbutton" type="submit" value="create authorization -->" />\n' | output = output[:-8] + ' <input class="adminbutton" type="submit" value="create authorization -->" />\n' | def perform_addauthorization(req, id_role="0", id_action="0", optional=0, reverse="0", confirm=0, **keywords): """ form to add new connection between user and role: id_role - role to connect id_action - action to connect reverse - role or action first? """ (auth_code, auth_message) = is_adminuser(req) if auth_code ... |
basket_name_sort_img = """<img src="http://pcuds36.cern.ch/img/wb-sort-asc.gif" />""" | basket_name_sort_img = """<img src="%s/img/wb-sort-asc.gif" />""" % (CFG_SITE_URL,) | def tmpl_display_list_public_baskets(self, all_public_baskets, limit, number_of_all_public_baskets, sort, asc, nb_views_show_p=False, ln=CFG_SITE_LANG): """Template for the list of public baskets. @param all_public_baskets: tuple (bskid, basket_name, owner_id, nickname, date_modification, nb_views, nb_items) @param lim... |
basket_name_sort_img = """<img src="http://pcuds36.cern.ch/img/wb-sort-desc.gif" />""" else: basket_name_sort_img = """<img src="http://pcuds36.cern.ch/img/wb-sort-none.gif" />""" | basket_name_sort_img = """<img src="%s/img/wb-sort-desc.gif" />""" % (CFG_SITE_URL,) else: basket_name_sort_img = """<img src="%s/img/wb-sort-none.gif" />""" % (CFG_SITE_URL,) | def tmpl_display_list_public_baskets(self, all_public_baskets, limit, number_of_all_public_baskets, sort, asc, nb_views_show_p=False, ln=CFG_SITE_LANG): """Template for the list of public baskets. @param all_public_baskets: tuple (bskid, basket_name, owner_id, nickname, date_modification, nb_views, nb_items) @param lim... |
owner_sort_img = """<img src="http://pcuds36.cern.ch/img/wb-sort-asc.gif" />""" | owner_sort_img = """<img src="%s/img/wb-sort-asc.gif" />""" % (CFG_SITE_URL,) | def tmpl_display_list_public_baskets(self, all_public_baskets, limit, number_of_all_public_baskets, sort, asc, nb_views_show_p=False, ln=CFG_SITE_LANG): """Template for the list of public baskets. @param all_public_baskets: tuple (bskid, basket_name, owner_id, nickname, date_modification, nb_views, nb_items) @param lim... |
owner_sort_img = """<img src="http://pcuds36.cern.ch/img/wb-sort-desc.gif" />""" else: owner_sort_img = """<img src="http://pcuds36.cern.ch/img/wb-sort-none.gif" />""" | owner_sort_img = """<img src="%s/img/wb-sort-desc.gif" />""" % (CFG_SITE_URL,) else: owner_sort_img = """<img src="%s/img/wb-sort-none.gif" />""" % (CFG_SITE_URL,) | def tmpl_display_list_public_baskets(self, all_public_baskets, limit, number_of_all_public_baskets, sort, asc, nb_views_show_p=False, ln=CFG_SITE_LANG): """Template for the list of public baskets. @param all_public_baskets: tuple (bskid, basket_name, owner_id, nickname, date_modification, nb_views, nb_items) @param lim... |
date_modification_sort_img = """<img src="http://pcuds36.cern.ch/img/wb-sort-asc.gif" />""" | date_modification_sort_img = """<img src="%s/img/wb-sort-asc.gif" />""" % (CFG_SITE_URL,) | def tmpl_display_list_public_baskets(self, all_public_baskets, limit, number_of_all_public_baskets, sort, asc, nb_views_show_p=False, ln=CFG_SITE_LANG): """Template for the list of public baskets. @param all_public_baskets: tuple (bskid, basket_name, owner_id, nickname, date_modification, nb_views, nb_items) @param lim... |
date_modification_sort_img = """<img src="http://pcuds36.cern.ch/img/wb-sort-desc.gif" />""" else: date_modification_sort_img = """<img src="http://pcuds36.cern.ch/img/wb-sort-none.gif" />""" | date_modification_sort_img = """<img src="%s/img/wb-sort-desc.gif" />""" % (CFG_SITE_URL,) else: date_modification_sort_img = """<img src="%s/img/wb-sort-none.gif" />""" % (CFG_SITE_URL,) | def tmpl_display_list_public_baskets(self, all_public_baskets, limit, number_of_all_public_baskets, sort, asc, nb_views_show_p=False, ln=CFG_SITE_LANG): """Template for the list of public baskets. @param all_public_baskets: tuple (bskid, basket_name, owner_id, nickname, date_modification, nb_views, nb_items) @param lim... |
nb_items_sort_img = """<img src="http://pcuds36.cern.ch/img/wb-sort-asc.gif" />""" | nb_items_sort_img = """<img src="%s/img/wb-sort-asc.gif" />""" % (CFG_SITE_URL,) | def tmpl_display_list_public_baskets(self, all_public_baskets, limit, number_of_all_public_baskets, sort, asc, nb_views_show_p=False, ln=CFG_SITE_LANG): """Template for the list of public baskets. @param all_public_baskets: tuple (bskid, basket_name, owner_id, nickname, date_modification, nb_views, nb_items) @param lim... |
nb_items_sort_img = """<img src="http://pcuds36.cern.ch/img/wb-sort-desc.gif" />""" else: nb_items_sort_img = """<img src="http://pcuds36.cern.ch/img/wb-sort-none.gif" />""" | nb_items_sort_img = """<img src="%s/img/wb-sort-desc.gif" />""" % (CFG_SITE_URL,) else: nb_items_sort_img = """<img src="%s/img/wb-sort-none.gif" />""" % (CFG_SITE_URL,) | def tmpl_display_list_public_baskets(self, all_public_baskets, limit, number_of_all_public_baskets, sort, asc, nb_views_show_p=False, ln=CFG_SITE_LANG): """Template for the list of public baskets. @param all_public_baskets: tuple (bskid, basket_name, owner_id, nickname, date_modification, nb_views, nb_items) @param lim... |
nb_views_sort_img = """<img src="http://pcuds36.cern.ch/img/wb-sort-asc.gif" />""" | nb_views_sort_img = """<img src="%s/img/wb-sort-asc.gif" />""" % (CFG_SITE_URL,) | def tmpl_display_list_public_baskets(self, all_public_baskets, limit, number_of_all_public_baskets, sort, asc, nb_views_show_p=False, ln=CFG_SITE_LANG): """Template for the list of public baskets. @param all_public_baskets: tuple (bskid, basket_name, owner_id, nickname, date_modification, nb_views, nb_items) @param lim... |
nb_views_sort_img = """<img src="http://pcuds36.cern.ch/img/wb-sort-desc.gif" />""" else: nb_views_sort_img = """<img src="http://pcuds36.cern.ch/img/wb-sort-none.gif" />""" | nb_views_sort_img = """<img src="%s/img/wb-sort-desc.gif" />""" % (CFG_SITE_URL,) else: nb_views_sort_img = """<img src="%s/img/wb-sort-none.gif" />""" % (CFG_SITE_URL,) | def tmpl_display_list_public_baskets(self, all_public_baskets, limit, number_of_all_public_baskets, sort, asc, nb_views_show_p=False, ln=CFG_SITE_LANG): """Template for the list of public baskets. @param all_public_baskets: tuple (bskid, basket_name, owner_id, nickname, date_modification, nb_views, nb_items) @param lim... |
edit_basket_logo = """<img src="http://pcuds36.cern.ch/img/wb-edit-basket.png" />""" | edit_basket_logo = """<img src="%s/img/wb-edit-basket.png" />""" % (CFG_SITE_URL,) | def tmpl_basket_header(self, bskid, name, nb_items, nb_subscribers, date_modification, (user_can_view_content, user_can_edit_basket, user_can_view_notes), selected_category, nb_comments, selected_topic, share_level, ln=CFG_SITE_LANG): """Template for basket header display.""" |
delete_basket_logo = """<img src="http://pcuds36.cern.ch/img/wb-delete-basket.png" />""" | delete_basket_logo = """<img src="%s/img/wb-delete-basket.png" />""" % (CFG_SITE_URL,) | def tmpl_basket_header(self, bskid, name, nb_items, nb_subscribers, date_modification, (user_can_view_content, user_can_edit_basket, user_can_view_notes), selected_category, nb_comments, selected_topic, share_level, ln=CFG_SITE_LANG): """Template for basket header display.""" |
unsubscribe_logo = """<img src="http://pcuds36.cern.ch/img/wb-unsubscribe.png" />""" | unsubscribe_logo = """<img src="%s/img/wb-unsubscribe.png" />""" % (CFG_SITE_URL,) | def tmpl_basket_header(self, bskid, name, nb_items, nb_subscribers, date_modification, (user_can_view_content, user_can_edit_basket, user_can_view_notes), selected_category, nb_comments, selected_topic, share_level, ln=CFG_SITE_LANG): """Template for basket header display.""" |
edit_basket_logo = """<img src="http://pcuds36.cern.ch/img/wb-edit-basket.png" />""" | edit_basket_logo = """<img src="%s/img/wb-edit-basket.png" />""" % (CFG_SITE_URL,) | def tmpl_basket_footer(self, bskid, nb_items, (user_can_view_content, user_can_edit_basket), selected_category, selected_topic, share_level=None, ln=CFG_SITE_LANG): """Template for basket footer display.""" |
delete_basket_logo = """<img src="http://pcuds36.cern.ch/img/wb-delete-basket.png" />""" | delete_basket_logo = """<img src="%s/img/wb-delete-basket.png" />""" % (CFG_SITE_URL,) | def tmpl_basket_footer(self, bskid, nb_items, (user_can_view_content, user_can_edit_basket), selected_category, selected_topic, share_level=None, ln=CFG_SITE_LANG): """Template for basket footer display.""" |
unsubscribe_logo = """<img src="http://pcuds36.cern.ch/img/wb-unsubscribe.png" />""" | unsubscribe_logo = """<img src="%s/img/wb-unsubscribe.png" />""" % (CFG_SITE_URL,) | def tmpl_basket_footer(self, bskid, nb_items, (user_can_view_content, user_can_edit_basket), selected_category, selected_topic, share_level=None, ln=CFG_SITE_LANG): """Template for basket footer display.""" |
previous_item_logo = """<img src="http://pcuds36.cern.ch/img/wb-previous-item.png" />""" | previous_item_logo = """<img src="%s/img/wb-previous-item.png" />""" % (CFG_SITE_URL,) | def tmpl_basket_single_item_header(self, bskid, name, nb_items, selected_category, selected_topic, selected_group, previous_item_recid, next_item_recid, item_index, ln=CFG_SITE_LANG): """Template for basket's single item header display.""" |
previous_item_logo = """<img src="http://pcuds36.cern.ch/img/wb-previous-item-disabled.png" />""" | previous_item_logo = """<img src="%s/img/wb-previous-item-disabled.png" />""" % (CFG_SITE_URL,) | def tmpl_basket_single_item_header(self, bskid, name, nb_items, selected_category, selected_topic, selected_group, previous_item_recid, next_item_recid, item_index, ln=CFG_SITE_LANG): """Template for basket's single item header display.""" |
next_item_logo = """<img src="http://pcuds36.cern.ch/img/wb-next-item.png" />""" | next_item_logo = """<img src="%s/img/wb-next-item.png" />""" % (CFG_SITE_URL,) | def tmpl_basket_single_item_header(self, bskid, name, nb_items, selected_category, selected_topic, selected_group, previous_item_recid, next_item_recid, item_index, ln=CFG_SITE_LANG): """Template for basket's single item header display.""" |
next_item_logo = """<img src="http://pcuds36.cern.ch/img/wb-next-item-disabled.png" />""" | next_item_logo = """<img src="%s/img/wb-next-item-disabled.png" />""" % (CFG_SITE_URL,) | def tmpl_basket_single_item_header(self, bskid, name, nb_items, selected_category, selected_topic, selected_group, previous_item_recid, next_item_recid, item_index, ln=CFG_SITE_LANG): """Template for basket's single item header display.""" |
go_back_logo = """<img src="http://pcuds36.cern.ch/img/wb-go-back.png" />""" | go_back_logo = """<img src="%s/img/wb-go-back.png" />""" % (CFG_SITE_URL,) | def tmpl_basket_single_item_header(self, bskid, name, nb_items, selected_category, selected_topic, selected_group, previous_item_recid, next_item_recid, item_index, ln=CFG_SITE_LANG): """Template for basket's single item header display.""" |
previous_item_logo = """<img src="http://pcuds36.cern.ch/img/wb-previous-item.png" />""" | previous_item_logo = """<img src="%s/img/wb-previous-item.png" />""" % (CFG_SITE_URL,) | def tmpl_basket_single_item_footer(self, bskid, selected_category, selected_topic, selected_group, previous_item_recid, next_item_recid, ln=CFG_SITE_LANG): """Template for basket's single item footer display.""" |
previous_item_logo = """<img src="http://pcuds36.cern.ch/img/wb-previous-item-disabled.png" />""" | previous_item_logo = """<img src="%s/img/wb-previous-item-disabled.png" />""" % (CFG_SITE_URL,) | def tmpl_basket_single_item_footer(self, bskid, selected_category, selected_topic, selected_group, previous_item_recid, next_item_recid, ln=CFG_SITE_LANG): """Template for basket's single item footer display.""" |
next_item_logo = """<img src="http://pcuds36.cern.ch/img/wb-next-item.png" />""" | next_item_logo = """<img src="%s/img/wb-next-item.png" />""" % (CFG_SITE_URL,) | def tmpl_basket_single_item_footer(self, bskid, selected_category, selected_topic, selected_group, previous_item_recid, next_item_recid, ln=CFG_SITE_LANG): """Template for basket's single item footer display.""" |
next_item_logo = """<img src="http://pcuds36.cern.ch/img/wb-next-item-disabled.png" />""" | next_item_logo = """<img src="%s/img/wb-next-item-disabled.png" />""" % (CFG_SITE_URL,) | def tmpl_basket_single_item_footer(self, bskid, selected_category, selected_topic, selected_group, previous_item_recid, next_item_recid, ln=CFG_SITE_LANG): """Template for basket's single item footer display.""" |
go_back_logo = """<img src="http://pcuds36.cern.ch/img/wb-go-back.png" />""" | go_back_logo = """<img src="%s/img/wb-go-back.png" />""" % (CFG_SITE_URL,) | def tmpl_basket_single_item_footer(self, bskid, selected_category, selected_topic, selected_group, previous_item_recid, next_item_recid, ln=CFG_SITE_LANG): """Template for basket's single item footer display.""" |
add_note_logo = """<img src="http://pcuds36.cern.ch/img/wb-add-note.png" />""" | add_note_logo = """<img src="%s/img/wb-add-note.png" />""" % (CFG_SITE_URL,) | def __tmpl_display_notes(self, recid, bskid, (user_can_add_notes, user_can_delete_notes), selected_category, selected_topic, selected_group, notes, optional_params, ln=CFG_SITE_LANG): """Template for basket's single item notes display.""" |
subscribe_logo = """<img src="http://pcuds36.cern.ch/img/wb-subscribe.png" />""" | subscribe_logo = """<img src="%s/img/wb-subscribe.png" />""" % (CFG_SITE_URL,) | def tmpl_public_basket_header(self, bskid, name, nb_items, date_modification, (user_can_view_comments,), nb_comments, subscription_status, ln=CFG_SITE_LANG): """Template for public basket header display.""" |
unsubscribe_logo = """<img src="http://pcuds36.cern.ch/img/wb-unsubscribe.png" />""" | unsubscribe_logo = """<img src="%s/img/wb-unsubscribe.png" />""" % (CFG_SITE_URL,) | def tmpl_public_basket_header(self, bskid, name, nb_items, date_modification, (user_can_view_comments,), nb_comments, subscription_status, ln=CFG_SITE_LANG): """Template for public basket header display.""" |
subscribe_logo = """<img src="http://pcuds36.cern.ch/img/wb-subscribe.png" />""" | subscribe_logo = """<img src="%s/img/wb-subscribe.png" />""" % (CFG_SITE_URL,) | def tmpl_public_basket_footer(self, bskid, nb_items, id_owner, subscription_status, ln=CFG_SITE_LANG): """Template for public basket footer display.""" |
unsubscribe_logo = """<img src="http://pcuds36.cern.ch/img/wb-unsubscribe.png" />""" | unsubscribe_logo = """<img src="%s/img/wb-unsubscribe.png" />""" % (CFG_SITE_URL,) | def tmpl_public_basket_footer(self, bskid, nb_items, id_owner, subscription_status, ln=CFG_SITE_LANG): """Template for public basket footer display.""" |
previous_item_logo = """<img src="http://pcuds36.cern.ch/img/wb-previous-item.png" />""" | previous_item_logo = """<img src="%s/img/wb-previous-item.png" />""" % (CFG_SITE_URL,) | def tmpl_public_basket_single_item_header(self, bskid, name, nb_items, previous_item_recid, next_item_recid, item_index, ln=CFG_SITE_LANG): """Template for public basket's single item header display.""" |
previous_item_logo = """<img src="http://pcuds36.cern.ch/img/wb-previous-item-disabled.png" />""" | previous_item_logo = """<img src="%s/img/wb-previous-item-disabled.png" />""" % (CFG_SITE_URL,) | def tmpl_public_basket_single_item_header(self, bskid, name, nb_items, previous_item_recid, next_item_recid, item_index, ln=CFG_SITE_LANG): """Template for public basket's single item header display.""" |
next_item_logo = """<img src="http://pcuds36.cern.ch/img/wb-next-item.png" />""" | next_item_logo = """<img src="%s/img/wb-next-item.png" />""" % (CFG_SITE_URL,) | def tmpl_public_basket_single_item_header(self, bskid, name, nb_items, previous_item_recid, next_item_recid, item_index, ln=CFG_SITE_LANG): """Template for public basket's single item header display.""" |
next_item_logo = """<img src="http://pcuds36.cern.ch/img/wb-next-item-disabled.png" />""" | next_item_logo = """<img src="%s/img/wb-next-item-disabled.png" />""" % (CFG_SITE_URL,) | def tmpl_public_basket_single_item_header(self, bskid, name, nb_items, previous_item_recid, next_item_recid, item_index, ln=CFG_SITE_LANG): """Template for public basket's single item header display.""" |
go_back_logo = """<img src="http://pcuds36.cern.ch/img/wb-go-back.png" />""" | go_back_logo = """<img src="%s/img/wb-go-back.png" />""" % (CFG_SITE_URL,) | def tmpl_public_basket_single_item_header(self, bskid, name, nb_items, previous_item_recid, next_item_recid, item_index, ln=CFG_SITE_LANG): """Template for public basket's single item header display.""" |
previous_item_logo = """<img src="http://pcuds36.cern.ch/img/wb-previous-item.png" />""" | previous_item_logo = """<img src="%s/img/wb-previous-item.png" />""" % (CFG_SITE_URL,) | def tmpl_public_basket_single_item_footer(self, bskid, previous_item_recid, next_item_recid, ln=CFG_SITE_LANG): """Template for public basket's single item footer display.""" |
previous_item_logo = """<img src="http://pcuds36.cern.ch/img/wb-previous-item-disabled.png" />""" | previous_item_logo = """<img src="%s/img/wb-previous-item-disabled.png" />""" % (CFG_SITE_URL,) | def tmpl_public_basket_single_item_footer(self, bskid, previous_item_recid, next_item_recid, ln=CFG_SITE_LANG): """Template for public basket's single item footer display.""" |
next_item_logo = """<img src="http://pcuds36.cern.ch/img/wb-next-item.png" />""" | next_item_logo = """<img src="%s/img/wb-next-item.png" />""" % (CFG_SITE_URL,) | def tmpl_public_basket_single_item_footer(self, bskid, previous_item_recid, next_item_recid, ln=CFG_SITE_LANG): """Template for public basket's single item footer display.""" |
next_item_logo = """<img src="http://pcuds36.cern.ch/img/wb-next-item-disabled.png" />""" | next_item_logo = """<img src="%s/img/wb-next-item-disabled.png" />""" % (CFG_SITE_URL,) | def tmpl_public_basket_single_item_footer(self, bskid, previous_item_recid, next_item_recid, ln=CFG_SITE_LANG): """Template for public basket's single item footer display.""" |
go_back_logo = """<img src="http://pcuds36.cern.ch/img/wb-go-back.png" />""" | go_back_logo = """<img src="%s/img/wb-go-back.png" />""" % (CFG_SITE_URL,) | def tmpl_public_basket_single_item_footer(self, bskid, previous_item_recid, next_item_recid, ln=CFG_SITE_LANG): """Template for public basket's single item footer display.""" |
add_note_logo = """<img src="http://pcuds36.cern.ch/img/wb-add-note.png" />""" | add_note_logo = """<img src="%s/img/wb-add-note.png" />""" % (CFG_SITE_URL,) | def __tmpl_display_public_notes(self, recid, bskid, (user_can_add_notes,), notes, optional_params, ln=CFG_SITE_LANG): """Template for public basket's single item notes display.""" |
execute_command('sudo', '-u', CFG_OPENOFFICE_USER, CFG_PATH_OPENOFFICE_PYTHON, 'import os; open(os.path.join(%s, "test"), "w").write(%s)' % (repr(CFG_OPENOFFICE_TMPDIR), repr(now))) | execute_command('sudo', '-u', CFG_OPENOFFICE_USER, CFG_PATH_OPENOFFICE_PYTHON, '-c', 'import os; open(os.path.join(%s, "test"), "w").write(%s)' % (repr(CFG_OPENOFFICE_TMPDIR), repr(now))) | def check_openoffice_tmpdir(): """Return True if OpenOffice tmpdir do exists and OpenOffice can successfully create file there.""" if not os.path.exists(CFG_OPENOFFICE_TMPDIR): raise InvenioWebSubmitFileConverterError('%s does not exists' % CFG_OPENOFFICE_TMPDIR) if not os.path.isdir(CFG_OPENOFFICE_TMPDIR): raise Inven... |
test_str = """</html></body></div></pre>""" | test_str = """</html></body></pre>""" | def test_forbidden_formatting_tags(self): """htmlutils - washing of tags altering formatting of a page (e.g. </html>)""" test_str = """</html></body></div></pre>""" self.assertEqual(self.washer.wash(html_buffer=test_str), '') self.assertEqual(self.washer.wash(html_buffer=test_str, render_unallowed_tags=True), '</htm... |
'</html></body></div></pre>') | '</html></body></pre>') | def test_forbidden_formatting_tags(self): """htmlutils - washing of tags altering formatting of a page (e.g. </html>)""" test_str = """</html></body></div></pre>""" self.assertEqual(self.washer.wash(html_buffer=test_str), '') self.assertEqual(self.washer.wash(html_buffer=test_str, render_unallowed_tags=True), '</htm... |
if ext[0] == '.': | if ext.startswith('.'): | def get_words_from_fulltext(url_direct_or_indirect, stemming_language=None): """Returns all the words contained in the document specified by URL_DIRECT_OR_INDIRECT with the words being split by various SRE_SEPARATORS regexp set earlier. If FORCE_FILE_EXTENSION is set (e.g. to "pdf", then treat URL_DIRECT_OR_INDIRECT a... |
def tmpl_create_useractivities_menu(req, 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): | def tmpl_create_useractivities_menu(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(req, 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): | def tmpl_create_adminactivities_menu(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 |
'100', '242', '245', '246', '250', '260', '269', '270', '300', '340', '490', '500', '502', '520', '590', '595', '650', '653', '690', '694', '695', '700', '710', '720', '773', '856', '859', '901', '909', '916', '960', '961', '962', '963', '964', '970', '980', '999', 'FFT'] | '100', '242', '245', '246', '250', '260', '269', '270', '300', '340', '490', '500', '502', '506', '520', '590', '595', '650', '653', '690', '694', '695', '700', '710', '720', '773', '856', '859', '901', '909', '916', '960', '961', '962', '963', '964', '970', '980', '999', 'FFT'] | def test_tags_created(self): """ bibrecord - demo file which tags are created """ ## check if the tags are correct |
fields = [14, 14, 8, 11, 11, 12, 11, 15, 10, 18, 14, 16, 10, 9, 15, 10, | fields = [14, 14, 8, 11, 11, 13, 11, 15, 10, 18, 14, 16, 10, 9, 15, 10, | def test_fields_created(self): """bibrecord - demo file how many fields are created""" ## check if the number of fields for each record is correct |
9, 14, 13, 14, 14, 15, 12, 12, 12, 15, 14, 12, 16, 16, 15, | 9, 14, 13, 14, 14, 15, 12, 13, 12, 15, 14, 12, 16, 16, 15, | def test_fields_created(self): """bibrecord - demo file how many fields are created""" ## check if the number of fields for each record is correct |
g('set xtics rotate %s'% str(tuple(intervals))) | g('set xtics rotate') | 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 - record ID kind_of_graph - takes one of these values : "citation" ,"download_history", ... |
revising_options.add_option("--delete", action='store_const', const='delete', dest='action', help='soft-delete the matched documents (applies to all revisions and formats)') revising_options.add_option("--hard-delete", action='store_const', const='hard_delete', dest='action', help='hard-delete the matched documents (ap... | revising_options.add_option("--delete", action='store_const', const='delete', dest='action', help='soft-delete the matched documents') revising_options.add_option("--hard-delete", action='store_const', const='hard-delete', dest='action', help='hard-delete the single matched document with a specific format and a specifi... | def _date_range_callback(option, opt, value, parser): """Callback for optparse to parse a range of dates in the form [date1],[date2]. Both date1 and date2 could be optional. the date can be expressed absolutely ("%Y-%m-%d %H:%M:%S") or relatively (([-\+]{0,1})([\d]+)([dhms])) to the current time.""" try: value = _parse... |
elif getattr(options, 'action', None) == 'delete-file': | elif getattr(options, 'action', None) == 'hard-delete': | def main(): parser = prepare_option_parser() (options, args) = parser.parse_args() if getattr(options, 'debug', None): getLogger().setLevel(DEBUG) debug('test') debug('options: %s, args: %s' % (options, args)) try: if not getattr(options, 'action', None) and \ not getattr(options, 'append_path', None) and \ not getattr... |
except StandardError, e: | except Exception, e: | def main(): parser = prepare_option_parser() (options, args) = parser.parse_args() if getattr(options, 'debug', None): getLogger().setLevel(DEBUG) debug('test') debug('options: %s, args: %s' % (options, args)) try: if not getattr(options, 'action', None) and \ not getattr(options, 'append_path', None) and \ not getattr... |
<!-- WebDoc-Page-Revision: $Id$ --> | <!-- WebDoc-Page-Revision: $Id: help-central.webdoc,v 1.5 2008/05/26 12:52:41 jerome Exp $ --> | def test_parts(self): """webdoc - retrieving parts of webdoc file (title, navtrail, etc.)""" if 'en' not in CFG_SITE_LANGS: self.fail("SKIPPED: English language not configured, test skipped.") |
self.assert_(result[0][5].replace('-', '/') in \ '$Id$ -->') | self.assertEqual(result[0][5], '2008-05-26 12:52:41') | def test_parts(self): """webdoc - retrieving parts of webdoc file (title, navtrail, etc.)""" if 'en' not in CFG_SITE_LANGS: self.fail("SKIPPED: English language not configured, test skipped.") |
body = create_error_box(req, title=title, verbose=0, ln=ln), | body = create_error_box(req, title=str(title), verbose=0, ln=ln), | def errorMsg(title, req, c=None, ln=CFG_SITE_LANG): # load the right message language _ = gettext_set_language(ln) if c is None: c = CFG_SITE_NAME_INTL.get(ln, CFG_SITE_NAME) return page(title = _("Error"), body = create_error_box(req, title=title, verbose=0, ln=ln), description="%s - Internal Error" % c, keywords="%... |
link_url += ' ' + quote(colldef) | link_url += '%20AND%20' + quote(colldef) | for coll, colldef in l_colls: link_url = CFG_SITE_URL + '/search?p=' if searchpattern: p = searchpattern if searchfield: if " " in searchpattern: p = searchfield + ':"' + searchpattern + '"' else: p = searchfield + ':' + searchpattern link_url += quote(p) if colldef: link_url += ' ' + quote(colldef) link_url += '&r... |
link_url += quote(p) + ' ' | link_url += quote(p) + '%20AND%20' | for coll, colldef in l_colls: link_url = CFG_SITE_URL + '/search?p=' if searchpattern: p = searchpattern if searchfield: if " " in searchpattern: p = searchfield + ':"' + searchpattern + '"' else: p = searchfield + ':' + searchpattern link_url += quote(p) + ' ' if colldef: link_url += quote(colldef) + ' ' if low == 0 a... |
link_url += quote(colldef) + ' ' | link_url += quote(colldef) + '%20AND%20' | for coll, colldef in l_colls: link_url = CFG_SITE_URL + '/search?p=' if searchpattern: p = searchpattern if searchfield: if " " in searchpattern: p = searchfield + ':"' + searchpattern + '"' else: p = searchfield + ':' + searchpattern link_url += quote(p) + ' ' if colldef: link_url += quote(colldef) + ' ' if low == 0 a... |
print "Already downloaded track %d" % track_id | print "Already downloaded track %s" % trackfile | def download_artist(self, artist): global running_threads |
newnode.append(contnode) else: newnode.append(contnode.__class__(dispname, dispname)) | dispname = target newnode.append(contnode.__class__(dispname, dispname)) | def missing_reference(app, env, node, contnode): """Attempt to resolve a missing reference via intersphinx references.""" domain = node.get('refdomain') if not domain: # only objects in domains are in the inventory return target = node['reftarget'] objtypes = env.domains[domain].objtypes_for_role(node['reftype']) if no... |
write_file(dir / 'conf.py', u'\n\nproject = u"Jägermeister"\n', 'utf-8') | write_file(dir / 'conf.py', u' u'project = u"Jägermeister"\n', 'utf-8') | def test_errors_warnings(dir): # test the error for syntax errors in the config file write_file(dir / 'conf.py', u'project = \n', 'ascii') raises_msg(ConfigError, 'conf.py', Config, dir, 'conf.py', {}, None) # test the automatic conversion of 2.x only code in configs write_file(dir / 'conf.py', u'\n\nproject = u"Jäger... |
node['refuri'] = m.group(1) + m.group(2).replace(':', '-') | node['refuri'] = self.fix_fragment(m) | def fix_ids(self, tree): """Replace colons with hyphens in href and id attributes. Some readers crash because they interpret the part as a transport protocol specification. """ for node in tree.traverse(nodes.reference): if 'refuri' in node: m = _refuri_re.match(node['refuri']) if m: node['refuri'] = m.group(1) + m.gro... |
links[i] = m.group(1) + m.group(2).replace(':', '-') | links[i] = self.fix_fragment(m) | def fix_genindex(self, tree): """Fix href attributes for genindex pages. """ # XXX: modifies tree inline # Logic modeled from themes/basic/genindex.html for key, columns in tree: for entryname, (links, subitems) in columns: for (i, link) in enumerate(links): m = _refuri_re.match(link) if m: links[i] = m.group(1) + m.gr... |
subentrylinks[i] = \ m.group(1) + m.group(2).replace(':', '-') | subentrylinks[i] = self.fix_fragment(m) | def fix_genindex(self, tree): """Fix href attributes for genindex pages. """ # XXX: modifies tree inline # Logic modeled from themes/basic/genindex.html for key, columns in tree: for entryname, (links, subitems) in columns: for (i, link) in enumerate(links): m = _refuri_re.match(link) if m: links[i] = m.group(1) + m.gr... |
sections.append(' '*4*4 + item) sections = '\n'.join(sections) | sections.append((' ' * 4 * 4 + item).encode('utf-8')) new_sections = [] for section in sections: if isinstance(section, unicode): new_sections.append(section.encode('utf-8')) else: new_sections.append(section) sections = u'\n'.encode('utf-8').join(new_sections) | def build_qhp(self, outdir, outname): self.info('writing project file...') |
print 'XXXYYY' | def run(self): env = self.state.document.settings.env if not env.app._oldcmarkup_warned: print 'XXXYYY' env.warn(env.docname, WARNING_MSG, self.lineno) env.app._oldcmarkup_warned = True newname = 'c:' + self.name[1:] newdir = env.lookup_domain_element('directive', newname)[0] return newdir(newname, self.arguments, self... | |
f = codecs.open(path.join(srcdir, 'conf.py'), 'w', encoding='utf-8') | f = open(path.join(srcdir, 'conf.py'), 'w', encoding='utf-8') | def inner_main(args): d = {} texescape.init() if not color_terminal(): nocolor() print bold('Welcome to the Sphinx %s quickstart utility.') % __version__ print ''' |
f = codecs.open(masterfile, 'w', encoding='utf-8') | f = open(masterfile, 'w', encoding='utf-8') | def inner_main(args): d = {} texescape.init() if not color_terminal(): nocolor() print bold('Welcome to the Sphinx %s quickstart utility.') % __version__ print ''' |
f = codecs.open(path.join(d['path'], 'Makefile'), 'wb', encoding='utf-8') | f = open(path.join(d['path'], 'Makefile'), 'wb', encoding='utf-8') | def inner_main(args): d = {} texescape.init() if not color_terminal(): nocolor() print bold('Welcome to the Sphinx %s quickstart utility.') % __version__ print ''' |
f = codecs.open(path.join(d['path'], 'make.bat'), 'w', encoding='utf-8') | f = open(path.join(d['path'], 'make.bat'), 'w', encoding='utf-8') | def inner_main(args): d = {} texescape.init() if not color_terminal(): nocolor() print bold('Welcome to the Sphinx %s quickstart utility.') % __version__ print ''' |
self.body.append(r'\pysiglinewithargs{') | self.body.append(r'\pysiglinewithargsret{') | def visit_desc_signature(self, node): if node.parent['objtype'] != 'describe' and node['ids']: hyper = self.hypertarget(node['ids'][0]) else: hyper = '' self.body.append(hyper) for child in node: if isinstance(child, addnodes.desc_parameterlist): self.body.append(r'\pysiglinewithargs{') break else: self.body.append(r'\... |
self.body.append('}') | self.body.append('}{}') | def depart_desc_signature(self, node): self.body.append('}') |
self.body.append(r' $\rightarrow$ ') | self.body.append(r'}{ $\rightarrow$ ') | def visit_desc_returns(self, node): self.body.append(r' $\rightarrow$ ') |
signode += addnodes.desc_addname(nameprefix, nameprefix) | if nameprefix: signode += addnodes.desc_addname(nameprefix, nameprefix) | def handle_signature(self, sig, signode): match = js_sig_re.match(sig) if match is None: raise ValueError() nameprefix, name, arglist = match.groups() |
u'\\caption{%s}\n' % self.table.caption) | u'\\capstart\\caption{%s}\n' % self.table.caption) | def depart_table(self, node): if self.table.rowcount > 30: self.table.longtable = True self.body = self._body if not self.table.longtable and self.table.caption is not None: self.body.append(u'\n\\begin{threeparttable}\n' u'\\caption{%s}\n' % self.table.caption) if self.table.longtable: self.body.append('\n\\begin{long... |
self.body.append(u'\\caption{%s} \\\\\n' % self.table.caption) | self.body.append(u'\\capstart\\caption{%s} \\\\\n' % self.table.caption) | def depart_table(self, node): if self.table.rowcount > 30: self.table.longtable = True self.body = self._body if not self.table.longtable and self.table.caption is not None: self.body.append(u'\n\\begin{threeparttable}\n' u'\\caption{%s}\n' % self.table.caption) if self.table.longtable: self.body.append('\n\\begin{long... |
refuri_pat = re.compile("([^ refid_pat = re.compile("([^:]*):(.*)") | refuri_pat = re.compile("([^ | def fix_ids(self, tree): """Replace colons with hyphens in href and id attributes. Some readers crash because they interpret the part as a transport protocol specification. """ refuri_pat = re.compile("([^#:]*)#([^:]*):(.*)") refid_pat = re.compile("([^:]*):(.*)") |
node['refuri'] = refuri_pat.sub("\\1 | m = refuri_pat.match(node['refuri']) if m: node['refuri'] = m.group(1) + m.group(2).replace(':', '-') | def fix_ids(self, tree): """Replace colons with hyphens in href and id attributes. Some readers crash because they interpret the part as a transport protocol specification. """ refuri_pat = re.compile("([^#:]*)#([^:]*):(.*)") refid_pat = re.compile("([^:]*):(.*)") |
node['refid'] = refid_pat.sub("\\1-\\2", node['refid']) | node['refid'] = node['refid'].replace(':', '-') | def fix_ids(self, tree): """Replace colons with hyphens in href and id attributes. Some readers crash because they interpret the part as a transport protocol specification. """ refuri_pat = re.compile("([^#:]*)#([^:]*):(.*)") refid_pat = re.compile("([^:]*):(.*)") |
id = refid_pat.sub("\\1-\\2", id) newids.append(id) | newids.append(id.replace(':', '-')) | def fix_ids(self, tree): """Replace colons with hyphens in href and id attributes. Some readers crash because they interpret the part as a transport protocol specification. """ refuri_pat = re.compile("([^#:]*)#([^:]*):(.*)") refid_pat = re.compile("([^:]*):(.*)") |
import pdb; pdb.set_trace() | def handle_signature(self, sig, signode): import pdb; pdb.set_trace() sig = sig.strip() if '(' in sig and sig[-1:] == ')': prefix, arglist = sig.split('(', 1) arglist = arglist[:-1].strip() else: prefix = sig arglist = None if '.' in prefix: nameprefix, name = prefix.rsplit('.', 1) else: nameprefix = None name = prefix | |
fullname = '' | fullname = name | def handle_signature(self, sig, signode): sig = sig.strip() if '(' in sig and sig[-1:] == ')': prefix, arglist = sig.split('(', 1) arglist = arglist[:-1].strip() else: prefix = sig arglist = None if '.' in prefix: nameprefix, name = prefix.rsplit('.', 1) else: nameprefix = None name = prefix |
return make_refnode(builder, fromdocname, objects[typ, target][0], | return make_refnode(builder, fromdocname, objects[typ, target], | def resolve_xref(self, env, fromdocname, builder, typ, target, node, contnode): objects = self.data['objects'] |
'unsigned': set(('char', 'int', 'long')), 'signed': set(('char', 'int', 'long')), 'short': set(('int', 'short')), | 'unsigned': set(('char', 'short', 'int', 'long')), 'signed': set(('char', 'short', 'int', 'long')), 'short': set(('int',)), | def __unicode__(self): buf = self.get_modifiers() buf.append(unicode(self.name)) return u' '.join(buf) |
self.body.append('\n{\\raggedright{}') self.literal_whitespace += 1 | if isinstance(node.parent, nodes.line_block): self.body.append('\\item[]\n' '\\begin{DUlineblock}{\\DUlineblockindent}\n') else: self.body.append('\n\\begin{DUlineblock}{0em}\n') | def visit_line_block(self, node): """line-block: * whitespace (including linebreaks) is significant * inline markup is supported. * serif typeface """ self.body.append('\n{\\raggedright{}') self.literal_whitespace += 1 |
self.literal_whitespace -= 1 del self.body[-1] self.body.append('}\n') def visit_line(self, node): self._line_start = len(self.body) def depart_line(self, node): if self._line_start == len(self.body): self.body.append('~') if self.table is not None: self.body.append('\\newline\n') else: self.body.append('\\\\\n') | self.body.append('\\end{DUlineblock}\n') | def depart_line_block(self, node): self.literal_whitespace -= 1 # remove the last \\ del self.body[-1] self.body.append('}\n') |
if isinstance(latex, unicode): latex = latex.encode('utf-8') | def render_math(self, math): """ Render the LaTeX math expression *math* using latex and dvipng. Return the filename relative to the built document and the "depth", that is, the distance of image bottom and baseline in pixels, if the option to use preview_latex is switched on. Error handling may seem strange, but fol... | |
tf = open(path.join(tempdir, 'math.tex'), 'w') | tf = codecs.open(path.join(tempdir, 'math.tex'), 'w', 'utf-8') | def render_math(self, math): """ Render the LaTeX math expression *math* using latex and dvipng. Return the filename relative to the built document and the "depth", that is, the distance of image bottom and baseline in pixels, if the option to use preview_latex is switched on. Error handling may seem strange, but fol... |
sm = nodes.system_message(str(exc), type='WARNING', level=2, | msg = unicode(str(exc), 'utf-8', 'replace') sm = nodes.system_message(msg, type='WARNING', level=2, | def html_visit_math(self, node): try: fname, depth = render_math(self, '$'+node['latex']+'$') except MathExtError, exc: sm = nodes.system_message(str(exc), type='WARNING', level=2, backrefs=[], source=node['latex']) sm.walkabout(self) self.builder.warn('display latex %r: ' % node['latex'] + str(exc)) raise nodes.SkipNo... |
if isinstance(doctree, nodes.reference): | if isinstance(doctree, nodes.reference) and hasattr(doctree, 'refuri'): | def get_refnodes(self, doctree, result): """Collect section titles, their depth in the toc and the refuri.""" # XXX: is there a better way than checking the attribute # toctree-l[1-8] on the parent node? if isinstance(doctree, nodes.reference): refuri = doctree['refuri'] if refuri.startswith('http://') or refuri.starts... |
if isinstance(obj, clstypes) and issubclass(obj, Directive): | if isinstance(obj, (types.FunctionType, types.MethodType)): obj.content = content obj.arguments = arguments or (0, 0, False) obj.options = options return convert_directive_function(obj) else: | def _directive_helper(self, obj, content=None, arguments=None, **options): if isinstance(obj, clstypes) and issubclass(obj, Directive): if content or arguments or options: raise ExtensionError('when adding directive classes, no ' 'additional arguments may be given') return obj else: obj.content = content obj.arguments ... |
else: obj.content = content obj.arguments = arguments or (0, 0, False) obj.options = options return convert_directive_function(obj) | def _directive_helper(self, obj, content=None, arguments=None, **options): if isinstance(obj, clstypes) and issubclass(obj, Directive): if content or arguments or options: raise ExtensionError('when adding directive classes, no ' 'additional arguments may be given') return obj else: obj.content = content obj.arguments ... |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.