From b94e73786ce3b865af25ccd9cf1b8479a0209c7a Mon Sep 17 00:00:00 2001 From: eric Date: Thu, 3 Sep 2020 14:04:42 -0400 Subject: [PATCH] cleanup --- BaseSearcher.py | 7 +- BibrecPage.py | 25 +------ CherryPyApp.py | 2 +- Formatters.py | 1 - templates/site-layout.mobile | 124 ----------------------------------- 5 files changed, 6 insertions(+), 153 deletions(-) delete mode 100644 templates/site-layout.mobile diff --git a/BaseSearcher.py b/BaseSearcher.py index 993bc25..4f46b2b 100644 --- a/BaseSearcher.py +++ b/BaseSearcher.py @@ -656,16 +656,15 @@ class OpenSearch (object): ua = self.user_agent - self.format = 'html' - self.mediatype = 'text/html' + format_ = 'html' + mediatype = 'text/html' + opensearch_support = 0 # user accessed the mobile site # known OPDS consumers # 'stanza' is the older opds-ish format supported by stanza et al. - opensearch_support = 0 - if ua: if ua.startswith ('Stanza/'): # Stanza/2.1.1 iPhone OS/3.1.3/iPod touch catalog/2.1.1 diff --git a/BibrecPage.py b/BibrecPage.py index bbfc3c4..f21dff9 100644 --- a/BibrecPage.py +++ b/BibrecPage.py @@ -80,7 +80,7 @@ class BibrecPage (Page.Page): )) - if os.format in ('html', 'mobile'): + if os.format == 'html': cat = BaseSearcher.Cat () cat.header = _('Similar Books') cat.title = _('Readers also downloaded…') @@ -101,30 +101,9 @@ class BibrecPage (Page.Page): cat.order = 33 os.entries.append (cat) - if os.format in ('mobile', ): - for author in dc.authors: - cat = BaseSearcher.Cat () - cat.title = _('By {author}').format (author = author.name_and_dates) - cat.rel = 'related' - cat.url = os.url ('author', id = author.id) - cat.class_ += 'navlink grayed' - cat.icon = 'author' - cat.order = 31 - os.entries.append (cat) - - for subject in dc.subjects: - cat = BaseSearcher.Cat () - cat.title = _('On {subject}').format (subject = subject.subject) - cat.rel = 'related' - cat.url = os.url ('subject', id = subject.id) - cat.class_ += 'navlink grayed' - cat.icon = 'subject' - cat.order = 32 - os.entries.append (cat) - os.total_results = 1 - os.template = 'results' if os.format == 'mobile' else 'bibrec' + os.template = 'bibrec' os.page = 'bibrec' os.og_type = 'book' os.finalize () diff --git a/CherryPyApp.py b/CherryPyApp.py index 0cfcb8a..df06ee6 100644 --- a/CherryPyApp.py +++ b/CherryPyApp.py @@ -164,7 +164,7 @@ def main(): cherrypy.config['js_mtime'] = t cherrypy.config['all_hosts'] = ( - cherrypy.config['host'], cherrypy.config['host_mobile'], cherrypy.config['file_host']) + cherrypy.config['host'], cherrypy.config['file_host']) cherrypy.config.update({'error_page.404': error_page_404}) diff --git a/Formatters.py b/Formatters.py index 02cc4e6..fab15f2 100644 --- a/Formatters.py +++ b/Formatters.py @@ -37,7 +37,6 @@ def format (format_, page, os_): formatters = {} formatters['opds'] = OPDSFormatter.OPDSFormatter () formatters['stanza'] = formatters['opds'] -formatters['mobile'] = HTMLFormatter.MobileFormatter () formatters['html'] = HTMLFormatter.HTMLFormatter () formatters['json'] = JSONFormatter.JSONFormatter () # FIXME: only needed to load sitemap.xml templates diff --git a/templates/site-layout.mobile b/templates/site-layout.mobile deleted file mode 100644 index 09ebb14..0000000 --- a/templates/site-layout.mobile +++ /dev/null @@ -1,124 +0,0 @@ - - - - - - - - - - - -