Commit 2385ac9d authored by mitshel's avatar mitshel
Browse files

write absolute url in modulePath variable (Prefix+gateway module+parameters)...

write absolute url in modulePath variable (Prefix+gateway module+parameters) instead of relative url (gateway module+parameters)
parent 1a3bc973
Loading
Loading
Loading
Loading
+1 −1
Original line number Diff line number Diff line
@@ -151,7 +151,7 @@ scan_interval = 360
# scan_on_start определяет необходимость запуска сканирования при старте sopdsd.py
# если scan_on_start = yes , то при запуске sopdsd.py сразу же запустится сканирование
# по умолчанию scan_on_start = yes
scan_on_start = yes
scan_on_start = no

# Параметр logfile задает имя файла, куда будут складываться логи от SCAND-демона (путь задавать не нужно - логи будут находится в папке logs)
# По умолчанию logfile = sopds-scand.log
+7 −3
Original line number Diff line number Diff line
@@ -53,11 +53,12 @@ class opdsClient():
    def __init__(self,cfg,mode=modeCGI):
        self.cfg=cfg
        if mode==modeWSGI:
           self.modulePath=self.cfg.WSGI_PATH
           self.moduleFile=self.cfg.WSGI_PATH
        elif mode==modeINT:
           self.modulePath=''
           self.moduleFile=''
        else:
           self.modulePath=self.cfg.CGI_PATH
           self.moduleFile=self.cfg.CGI_PATH
        self.modulePath=self.moduleFile
        self.opdsdb=sopdsdb.opdsDatabase(self.cfg.DB_NAME,self.cfg.DB_USER,self.cfg.DB_PASS,self.cfg.DB_HOST,self.cfg.ROOT_LIB)
        self.site_data={'site_title':self.cfg.SITE_TITLE, 'site_subtitle':'Simple OPDS Catalog by www.sopds.ru. Version '+sopdscfg.VERSION,'modulepath':self.modulePath,'site_icon':self.cfg.SITE_ICON,'site_author':self.cfg.SITE_AUTOR,'site_url':self.cfg.SITE_URL,'site_email':self.cfg.SITE_EMAIL, 'charset':'utf-8'}

@@ -100,8 +101,11 @@ class opdsClient():

        if self.cfg.WEB_PREFIX in URI:
           self.Wrapper=self.webWrapper        
           self.modulePath=os.path.join(self.cfg.WEB_PREFIX,self.moduleFile)
        if self.cfg.OPDS_PREFIX in URI:
           self.Wrapper=self.opdsWrapper
           self.modulePath=os.path.join(self.cfg.OPDS_PREFIX,self.moduleFile)
        self.modulePath=os.path.normpath(self.modulePath)

        if 'id' in qs:
           self.id_value=qs.get("id")[0]