Ticket #7376: trac_7376-search_by_username_v2.patch

File trac_7376-search_by_username_v2.patch, 985 bytes (added by mpatel, 10 years ago)

Alternate version: Search by owner and publisher. Apply only this patch to sagenb repo.

  • sagenb/notebook/worksheet.py

    # HG changeset patch
    # User Mitesh Patel <qed777@gmail.com>
    # Date 1258040899 28800
    # Node ID f73505e976ba30e542c2be21ff23b04bb3c6ab0d
    # Parent  ff64332e66b9b48659d454b8791518fe518b1b77
    #7376/notebook: Search published worksheets by owner & publisher
    
    diff --git a/sagenb/notebook/worksheet.py b/sagenb/notebook/worksheet.py
    a b class Worksheet(object): 
    19731973        """
    19741974        # Load the worksheet data file from disk.
    19751975        filename = self.worksheet_html_filename()
    1976         r = (self.owner().lower() + ' ' + self.name().lower() + ' '
    1977              + open(filename).read().lower())
     1976        r = (self.owner().lower() + ' ' + self.publisher().lower() + ' '
     1977             + self.name().lower() + ' ' + open(filename).read().lower())
    19781978        # Check that every single word is in the file from disk.
    19791979        for W in split_search_string_into_keywords(search):
    19801980            if W.lower() not in r: