Loading py/__pycache__/sopdscfg.cpython-33.pyc −6 B (7.62 KiB) File changed.No diff preview for this file type. View original file View changed file py/sopdscan.py +5 −1 Original line number Diff line number Diff line Loading @@ -160,7 +160,11 @@ class opdsScanner: docdate=self.fb2parser.docdate.getvalue()[0].strip(); if self.fb2parser.parse_error!=0: self.logger.warning(rel_path+' - '+name+' fb2 parse warning ['+self.fb2parser.parse_errormsg+']') if isinstance(self.fb2parser.parse_errormsg,str): errormsg=self.fb2parser.parse_errormsg else: errormsg='Unknown error message (convert error).' self.logger.warning(rel_path+' - '+name+' fb2 parse warning ['+errormsg+']') if title=='': title=n Loading py/sopdscfg.py +1 −1 Original line number Diff line number Diff line Loading @@ -8,7 +8,7 @@ import logging ########################################################################## # Глобальные переменные # VERSION="0.22-1-www" VERSION="0.23" PY_PATH=os.path.dirname(os.path.abspath(__file__)) (ROOT_PATH,tmp)=os.path.split(PY_PATH) CFG_FILENAME='sopds.conf' Loading py/sopdscli.py +0 −27 Original line number Diff line number Diff line Loading @@ -83,9 +83,6 @@ class opdsClient(): self.searchTerm='' self.user=None self.method=0 # self.response_status='200 Ok' # self.response_headers=[] # self.response_body=[] self.opdsWrapper.resetParams() self.webWrapper.resetParams() self.Wrapper=self.opdsWrapper Loading Loading @@ -441,33 +438,9 @@ class opdsClient(): self.new_menu() self.footer(page_data) # def response_search_type(self): # """ Выбор типа поиска по автору или наименованию или серии """ # page_data={'page_id':'id:search:%s'%self.searchTerm,'page_title':'Поиск %s'%self.searchTerm, 'page_updated':time.strftime("%Y-%m-%dT%H:%M:%SZ")} # self.header(page_data) # self.add_response_body('<link href="'+self.modulePath+'?id=09" rel="search" type="application/opensearchdescription+xml" />') # self.add_response_body('<link href="'+self.modulePath+'?searchTerm={searchTerms}" rel="search" type="application/atom+xml" />') # self.entry_start() # self.entry_head('Поиск книг',None,'71') # self.entry_content('Поиск книги по ее наименованию') # self.add_response_body('<link type="application/atom+xml;profile=opds-catalog" href="'+self.modulePath+'?searchType=books&searchTerm='+parse.quote(self.searchTerm)+'" />') # self.entry_finish() # self.entry_start() # self.entry_head('Поиск авторов',None,'72') # self.entry_content('Поиск авторов по имени') # self.add_response_body('<link type="application/atom+xml;profile=opds-catalog" href="'+self.modulePath+'?searchType=authors&searchTerm='+parse.quote(self.searchTerm)+'" />') # self.entry_finish() # self.entry_start() # self.entry_head('Поиск серий',None,'73') # self.entry_content('Поиск серий книг') # self.add_response_body('<link type="application/atom+xml;profile=opds-catalog" href="'+self.modulePath+'?searchType=series&searchTerm='+parse.quote(self.searchTerm)+'" />') # self.entry_finish() # self.footer(page_data) def response_search_type(self): page_data={'page_id':'id:search:%s'%self.searchTerm,'page_title':'Поиск %s'%self.searchTerm, 'page_updated':time.strftime("%Y-%m-%dT%H:%M:%SZ"),'searchterm':parse.quote(self.searchTerm)} self.header(page_data) # self.opensearch_links(page_data) self.opensearch_forms(page_data) self.footer(page_data) Loading py/sopdstempl.py +4 −33 Original line number Diff line number Diff line Loading @@ -17,8 +17,6 @@ class opdsTemplate(): '<OutputEncoding>UTF-8</OutputEncoding>' '<InputEncoding>UTF-8</InputEncoding>' '</OpenSearchDescription>') # self.opensearch_links=('<link href="%(modulepath)s?id=09" rel="search" type="application/opensearchdescription+xml" />' # '<link href="%(modulepath)s?searchTerm={searchTerms}" rel="search" type="application/atom+xml" />') self.opensearch_forms=('<entry><title>Поиск книг</title><id>id:search:71</id><content type="text">Поиск книги по ее наименованию</content>' '<link type="application/atom+xml;profile=opds-catalog" href="%(modulepath)s?searchType=books&searchTerm=%(searchterm)s" />' '</entry>' Loading @@ -45,7 +43,6 @@ class opdsTemplate(): '<updated>%(page_updated)s</updated>' '<icon>%(site_icon)s</icon>' '<author><name>%(site_author)s</name><uri>%(site_url)s</uri><email>%(site_email)s</email></author>') # '<link type="application/atom+xml" rel="start" href="%(modulepath)s?id=00"/>') self.document_footer='</feed>' self.page_top_start='' Loading Loading @@ -200,19 +197,15 @@ class webTemplate(opdsTemplate): def __init__(self,charset='utf-8'): self.response_header=('Content-Type','text/html; charset='+charset) ################################################################################################################################### # # Шаблоны для Агрегации внутри Acquisition Entry # # self.opensearch='' # self.opensearch_links='<a href="%(modulepath)s?id=07">Поиск</a>' self.opensearch_forms=('Поиск книг<form><input name=searchType value="books" type=hidden required><input name=searchTerm value="" type=required required><button type=submit title="Поиск книги по наименованию">Искать</button></form>' 'Поиск авторов<form><input name=searchType value="authors" type=hidden required><input name=searchTerm value="" type=required required><button type=submit title="Поиск книги по наименованию">Искать</button></form>' 'Поиск серий<form><input name=searchType value="series" type=hidden required><input name=searchTerm value="" type=required required><button type=submit title="Поиск книги по наименованию">Искать</button></form>') ################################################################################################################################### # Шаблоны для Агрегации внутри Acquisition Entry # self.agregate_authors=('%(last_name)s %(first_name)s, ') self.agregate_authors_link=('<a href="%(modulepath)s?id=22%(author_id)s">%(last_name)s %(first_name)s, </a>' ) Loading Loading @@ -304,16 +297,6 @@ class webTemplate(opdsTemplate): ) self.document_page_control_finish='</div>' ############################################################################################################################### # # Navigation Entry. # # В Каждый элемент передаются следующие параметры: # # nav_data={'link_id':id,'item_id':item_id,'e_date':reg_date,'e_title':websym(item_title),'e_id':'item:%s'%(item_id),'e_nav_info':'', # 'nl':self.nl} self.document_entry_nav_start='<div class=navigation_entry>\n' self.document_entry_nav_title='' self.document_entry_nav_link=('<h2><a href="%(modulepath)s?id=%(link_id)s%(nl)s">%(e_title)s</a></h2>' Loading @@ -321,18 +304,6 @@ class webTemplate(opdsTemplate): self.document_entry_nav_info=('<i> %(e_nav_info)s</i>') self.document_entry_nav_finish='</div>' ############################################################################################################################### # # Acquisition Entry. # # В Каждый элемент передаются следующие параметры: # # acq_data={'link_id':id,'item_id':item_id,'filename':item_name,'e_date':reg_date,'e_title':websym(item_title),'e_id':'item:%s'%(item_id), # 'annotation':websym(annotation), 'docdate':docdate, 'format':format,'cover':cover,'cover_type':cover_type,'filesize':fsize//1024, # 'authors':websym(authors),'genres':websym(genres),'series':websym(series),'authors_link':authors_link,'genres_link':genres_link, 'series_link':series_link, # 'nl':self.nl} self.document_entry_acq_start='<br><div class=acquisition_entry>\n' self.document_entry_acq_link_start='<div class=acq_link>' Loading Loading
py/__pycache__/sopdscfg.cpython-33.pyc −6 B (7.62 KiB) File changed.No diff preview for this file type. View original file View changed file
py/sopdscan.py +5 −1 Original line number Diff line number Diff line Loading @@ -160,7 +160,11 @@ class opdsScanner: docdate=self.fb2parser.docdate.getvalue()[0].strip(); if self.fb2parser.parse_error!=0: self.logger.warning(rel_path+' - '+name+' fb2 parse warning ['+self.fb2parser.parse_errormsg+']') if isinstance(self.fb2parser.parse_errormsg,str): errormsg=self.fb2parser.parse_errormsg else: errormsg='Unknown error message (convert error).' self.logger.warning(rel_path+' - '+name+' fb2 parse warning ['+errormsg+']') if title=='': title=n Loading
py/sopdscfg.py +1 −1 Original line number Diff line number Diff line Loading @@ -8,7 +8,7 @@ import logging ########################################################################## # Глобальные переменные # VERSION="0.22-1-www" VERSION="0.23" PY_PATH=os.path.dirname(os.path.abspath(__file__)) (ROOT_PATH,tmp)=os.path.split(PY_PATH) CFG_FILENAME='sopds.conf' Loading
py/sopdscli.py +0 −27 Original line number Diff line number Diff line Loading @@ -83,9 +83,6 @@ class opdsClient(): self.searchTerm='' self.user=None self.method=0 # self.response_status='200 Ok' # self.response_headers=[] # self.response_body=[] self.opdsWrapper.resetParams() self.webWrapper.resetParams() self.Wrapper=self.opdsWrapper Loading Loading @@ -441,33 +438,9 @@ class opdsClient(): self.new_menu() self.footer(page_data) # def response_search_type(self): # """ Выбор типа поиска по автору или наименованию или серии """ # page_data={'page_id':'id:search:%s'%self.searchTerm,'page_title':'Поиск %s'%self.searchTerm, 'page_updated':time.strftime("%Y-%m-%dT%H:%M:%SZ")} # self.header(page_data) # self.add_response_body('<link href="'+self.modulePath+'?id=09" rel="search" type="application/opensearchdescription+xml" />') # self.add_response_body('<link href="'+self.modulePath+'?searchTerm={searchTerms}" rel="search" type="application/atom+xml" />') # self.entry_start() # self.entry_head('Поиск книг',None,'71') # self.entry_content('Поиск книги по ее наименованию') # self.add_response_body('<link type="application/atom+xml;profile=opds-catalog" href="'+self.modulePath+'?searchType=books&searchTerm='+parse.quote(self.searchTerm)+'" />') # self.entry_finish() # self.entry_start() # self.entry_head('Поиск авторов',None,'72') # self.entry_content('Поиск авторов по имени') # self.add_response_body('<link type="application/atom+xml;profile=opds-catalog" href="'+self.modulePath+'?searchType=authors&searchTerm='+parse.quote(self.searchTerm)+'" />') # self.entry_finish() # self.entry_start() # self.entry_head('Поиск серий',None,'73') # self.entry_content('Поиск серий книг') # self.add_response_body('<link type="application/atom+xml;profile=opds-catalog" href="'+self.modulePath+'?searchType=series&searchTerm='+parse.quote(self.searchTerm)+'" />') # self.entry_finish() # self.footer(page_data) def response_search_type(self): page_data={'page_id':'id:search:%s'%self.searchTerm,'page_title':'Поиск %s'%self.searchTerm, 'page_updated':time.strftime("%Y-%m-%dT%H:%M:%SZ"),'searchterm':parse.quote(self.searchTerm)} self.header(page_data) # self.opensearch_links(page_data) self.opensearch_forms(page_data) self.footer(page_data) Loading
py/sopdstempl.py +4 −33 Original line number Diff line number Diff line Loading @@ -17,8 +17,6 @@ class opdsTemplate(): '<OutputEncoding>UTF-8</OutputEncoding>' '<InputEncoding>UTF-8</InputEncoding>' '</OpenSearchDescription>') # self.opensearch_links=('<link href="%(modulepath)s?id=09" rel="search" type="application/opensearchdescription+xml" />' # '<link href="%(modulepath)s?searchTerm={searchTerms}" rel="search" type="application/atom+xml" />') self.opensearch_forms=('<entry><title>Поиск книг</title><id>id:search:71</id><content type="text">Поиск книги по ее наименованию</content>' '<link type="application/atom+xml;profile=opds-catalog" href="%(modulepath)s?searchType=books&searchTerm=%(searchterm)s" />' '</entry>' Loading @@ -45,7 +43,6 @@ class opdsTemplate(): '<updated>%(page_updated)s</updated>' '<icon>%(site_icon)s</icon>' '<author><name>%(site_author)s</name><uri>%(site_url)s</uri><email>%(site_email)s</email></author>') # '<link type="application/atom+xml" rel="start" href="%(modulepath)s?id=00"/>') self.document_footer='</feed>' self.page_top_start='' Loading Loading @@ -200,19 +197,15 @@ class webTemplate(opdsTemplate): def __init__(self,charset='utf-8'): self.response_header=('Content-Type','text/html; charset='+charset) ################################################################################################################################### # # Шаблоны для Агрегации внутри Acquisition Entry # # self.opensearch='' # self.opensearch_links='<a href="%(modulepath)s?id=07">Поиск</a>' self.opensearch_forms=('Поиск книг<form><input name=searchType value="books" type=hidden required><input name=searchTerm value="" type=required required><button type=submit title="Поиск книги по наименованию">Искать</button></form>' 'Поиск авторов<form><input name=searchType value="authors" type=hidden required><input name=searchTerm value="" type=required required><button type=submit title="Поиск книги по наименованию">Искать</button></form>' 'Поиск серий<form><input name=searchType value="series" type=hidden required><input name=searchTerm value="" type=required required><button type=submit title="Поиск книги по наименованию">Искать</button></form>') ################################################################################################################################### # Шаблоны для Агрегации внутри Acquisition Entry # self.agregate_authors=('%(last_name)s %(first_name)s, ') self.agregate_authors_link=('<a href="%(modulepath)s?id=22%(author_id)s">%(last_name)s %(first_name)s, </a>' ) Loading Loading @@ -304,16 +297,6 @@ class webTemplate(opdsTemplate): ) self.document_page_control_finish='</div>' ############################################################################################################################### # # Navigation Entry. # # В Каждый элемент передаются следующие параметры: # # nav_data={'link_id':id,'item_id':item_id,'e_date':reg_date,'e_title':websym(item_title),'e_id':'item:%s'%(item_id),'e_nav_info':'', # 'nl':self.nl} self.document_entry_nav_start='<div class=navigation_entry>\n' self.document_entry_nav_title='' self.document_entry_nav_link=('<h2><a href="%(modulepath)s?id=%(link_id)s%(nl)s">%(e_title)s</a></h2>' Loading @@ -321,18 +304,6 @@ class webTemplate(opdsTemplate): self.document_entry_nav_info=('<i> %(e_nav_info)s</i>') self.document_entry_nav_finish='</div>' ############################################################################################################################### # # Acquisition Entry. # # В Каждый элемент передаются следующие параметры: # # acq_data={'link_id':id,'item_id':item_id,'filename':item_name,'e_date':reg_date,'e_title':websym(item_title),'e_id':'item:%s'%(item_id), # 'annotation':websym(annotation), 'docdate':docdate, 'format':format,'cover':cover,'cover_type':cover_type,'filesize':fsize//1024, # 'authors':websym(authors),'genres':websym(genres),'series':websym(series),'authors_link':authors_link,'genres_link':genres_link, 'series_link':series_link, # 'nl':self.nl} self.document_entry_acq_start='<br><div class=acquisition_entry>\n' self.document_entry_acq_link_start='<div class=acq_link>' Loading