Changeset 195

Show
Ignore:
Timestamp:
08/22/08 18:12:15 (11 months ago)
Author:
rgrp
Message:

[shakespeare/misc][s]: remove concordance.py and all references and tidy up guide WUI page.

Location:
trunk
Files:
2 removed
5 modified

Legend:

Unmodified
Added
Removed
  • trunk/shakespeare/controllers/site.py

    r188 r195  
    88import shakespeare.index 
    99import shakespeare.format 
    10 import shakespeare.concordance 
    1110import shakespeare.model as model 
    1211 
     
    2625    def guide(self): 
    2726        return render('guide') 
    28  
    29     def concordance(self, word=None): 
    30         # TODO: support concordance/word 
    31         return self.concordance_index() 
    32  
    33     def concordance_index(self): 
    34         stats = shakespeare.concordance.Statistics() 
    35         c.words = stats.keys() 
    36         return render('concordance') 
    37  
    38     def concordance_word(self, word=None): 
    39         # TODO: sort by work etc 
    40         import shakespeare.textutils 
    41         refs = [] 
    42         cc = shakespeare.concordance.Concordance() 
    43         if word is not None: 
    44             refs = list(cc.get(word)) 
    45         newrefs = [] 
    46         for ref in refs: 
    47             # we use the 'plain' format when building the concordance 
    48             ff = ref.text.get_text() 
    49             snippet = shakespeare.textutils.get_snippet(ff, ref.char_index) 
    50             ref.snippet = snippet 
    51         c.word = word 
    52         c.refs = refs 
    53         return render('concordance_by_word') 
    5427 
    5528    # 2008-04-26 (rgrp): none of these annotater related items 
  • trunk/shakespeare/controllers/text.py

    r188 r195  
    88import shakespeare.index 
    99import shakespeare.format 
    10 import shakespeare.concordance 
    1110import shakespeare.model as model 
    1211 
  • trunk/shakespeare/templates/guide.html

    r181 r195  
    1313    </h2> 
    1414    <p> 
    15       The <a href="/index/">index page</a> contains a list of all of the 
    16       material on the system. 
     15      The <a href="${h.url_for(controller='text', action='index')}">text index 
     16        page</a> contains a list of all of the material on the system. 
    1717    </p> 
    1818    <h2> 
     
    2222      You can view works by clicking on the link available from the index page. 
    2323      If you know the 'id' of a text you can view it directly by visiting the 
    24                         url: /view?name={id} (you can work out id names by looking at the link 
    25                         urls on the index page). 
     24      url: ${h.url_for(controller='text', action='view', name='id')} (you can work 
     25      out id names by looking at the link urls on the index page). 
    2626    </p> 
    2727     
     
    3030      You can view a given text in a different format by setting the format 
    3131      argument in the url query string like so: 
    32       /view?name={id}&amp;format={format_name} So to view hamlet with line 
    33       numbers visit: <a 
    34         href="/view?name=hamlet_gut&amp;format=lineno">/view?name=hamlet_gut&amp;format=lineno</a> Available formats are: 
     32    </p> 
     33    <pre> 
     34      ${h.url_for(controller='text', action='view', name='id', format='format_name')} 
     35    </pre> 
     36    <p> 
     37      So to view Hamlet with line numbers shown you would visit: 
     38    </p> 
     39    <blockquote><p> 
     40      <a href="${h.url_for(controller='text', action='view', name='hamlet_gut', format='lineno')}"> 
     41        ${h.url_for(controller='text', action='view', name='hamlet_gut', format='lineno')}</a> 
     42    </p></blockquote> 
     43    <p> 
     44      Available formats are: 
    3545    </p> 
    3646    <ul> 
     
    4555      separated by '+'. For example to see the Gutenberg folio and non-folio 
    4656      Othello side-by-side you would visit: <a 
    47         href="/view?name=othello_gut_f+othello_gut">/view?name=othello_gut_f+othello_gut</a> 
     57        href="${h.url_for(controller='text', action='view', name='othello_gut_f othello_gut')}"> 
     58        ${h.url_for(controller='text', action='view', name='othello_gut_f othello_gut')} 
     59      </a> 
    4860    </p> 
    4961 
    5062    <h2> 
    51       Concordance 
     63      Search 
    5264    </h2> 
    5365    <p> 
    54       The <a href="/concordance/">concordance page</a> provides a concordance of 
    55       Shakespeare's work along with some associated statistics on word 
    56       occurences. 
     66      See the <a href="${h.url_for(controller='search', action='index')}">search section</a>. 
    5767    </p> 
     68 
     69    <h2> 
     70      Search 
     71    </h2> 
     72    <p> 
     73      See the <a href="${h.url_for(controller='stats', action='index')}">stats section</a>. 
     74    </p> 
     75 
    5876 
    5977    <h2>Comments</h2> 
    6078    <p> 
    61       If you wish to comment on this guide (or help improve it!) please visit 
    62       <a href="http://www.openshakespeare.org/">http://www.openshakespeare.org</a> 
     79      If you wish to comment on this guide (or help improve it!) please drop a 
     80      line to the Open Shakespeare team via at info [at] okfn [dot] org. 
    6381    </p> 
    6482  </div> 
  • trunk/shakespeare/tests/functional/test_site.py

    r176 r195  
    1616        res = self.app.get(url) 
    1717        assert 'guide to the features of the Open Shakespeare web' in res 
    18  
    19     def _test_concordance(self): 
    20         url = url_for(controller='site', action='concordance') 
    21         res = self.app.get(url) 
    2218 
    2319    # 2008-04-26 rgrp: not working 
  • trunk/test.ini

    r148 r195  
    2020 
    2121# Add additional test specific configuration options as necessary. 
     22sqlalchemy.url = sqlite:///%(here)s/testshkspr.db