diff --git a/BaseSearcher.py b/BaseSearcher.py index d1ffc41..d04451e 100644 --- a/BaseSearcher.py +++ b/BaseSearcher.py @@ -189,6 +189,8 @@ class SQLStatement(object): @classmethod def sub(cls, regex_, replace, query): """ Like re.sub but also compile and cache the regex. """ + if not isinstance(query, str): + query = query[0] if isinstance(query, list) and len(query) > 0 else '' cregex = cls.regex_cache.setdefault( regex_, regex.compile(regex_, regex.UNICODE | regex.VERSION1)) diff --git a/ConnectionPool.py b/ConnectionPool.py index cdbdd95..8ead47d 100644 --- a/ConnectionPool.py +++ b/ConnectionPool.py @@ -59,8 +59,7 @@ class ConnectionPool (plugins.SimplePlugin): pool_size = pool_size, max_overflow = max_overflow, timeout = timeout, - recycle = recycle, - use_threadlocal = True) + recycle = recycle) def connect (self): diff --git a/HTMLFormatter.py b/HTMLFormatter.py index 548766b..92dc727 100644 --- a/HTMLFormatter.py +++ b/HTMLFormatter.py @@ -66,12 +66,13 @@ class XMLishFormatter (BaseFormatter.BaseFormatter): if file_.filetype and file_.filetype.endswith('images'): dedupable[file_.filetype] = file_ do_dedupe = False - for ft in ['epub', 'kindle', 'pdf']: + for ft in ['epub', 'kindle', 'pdf', 'html']: if ft + '.images' in dedupable and ft + '.noimages' in dedupable: - if dedupable[ft + '.images'].extent == dedupable[ft + '.noimages'].extent: + # because of timestamps, identical files may vary by a bit or 2 + if abs (dedupable[ft + '.images'].extent - dedupable[ft + '.noimages'].extent) < 3: do_dedupe = True if do_dedupe: - for ft in ['epub', 'kindle', 'pdf']: + for ft in ['epub', 'kindle', 'pdf', 'html']: if ft + '.images' in dedupable and ft + '.noimages' in dedupable: dc.files.remove(dedupable[ft + '.images']) diff --git a/autocat3.service b/autocat3.service index b544c2d..5296b2f 100644 --- a/autocat3.service +++ b/autocat3.service @@ -9,6 +9,8 @@ RuntimeDirectory=autocat WorkingDirectory=/var/lib/autocat/autocat3 ExecStartPre=-/usr/bin/mkdir -p /var/run/autocat ExecStart=/usr/local/bin/pipenv run python CherryPyApp.py +LimitNOFILE=infinity + [Install] WantedBy=multi-user.target diff --git a/templates/bibrec.html b/templates/bibrec.html index acb8350..418a3f7 100644 --- a/templates/bibrec.html +++ b/templates/bibrec.html @@ -379,10 +379,9 @@ ${site_top()} height="32" alt="RDF/XML Metadata" /> --> - + ${site_footer()} -