diff --git a/cps/helper.py b/cps/helper.py
index f9251147..beee00c7 100755
--- a/cps/helper.py
+++ b/cps/helper.py
@@ -222,14 +222,14 @@ def get_valid_filename(value, replace_whitespace=True):
if use_unidecode:
value=(unidecode.unidecode(value)).strip()
else:
- value=value.replace('§','SS')
- value=value.replace('ß','ss')
+ value=value.replace(u'§',u'SS')
+ value=value.replace(u'ß',u'ss')
value = unicodedata.normalize('NFKD', value)
re_slugify = re.compile('[\W\s-]', re.UNICODE)
value = unicode(re_slugify.sub('', value).strip())
if replace_whitespace:
#*+:\"/<>? werden durch _ ersetzt
- value = re.sub('[\*\+:\\\"/<>\?]+', '_', value, flags=re.U)
+ value = re.sub('[\*\+:\\\"/<>\?]+', u'_', value, flags=re.U)
value = value[:128]
return value
@@ -263,7 +263,7 @@ def update_dir_stucture(book_id, calibrepath):
if authordir != new_authordir:
new_author_path = os.path.join(os.path.join(calibrepath, new_authordir), os.path.basename(path))
- os.rename(path, new_author_path)
+ os.renames(path, new_author_path)
book.path = new_authordir + '/' + book.path.split('/')[1]
db.session.commit()
diff --git a/cps/static/css/style.css b/cps/static/css/style.css
index 071980b3..5e6ea314 100644
--- a/cps/static/css/style.css
+++ b/cps/static/css/style.css
@@ -36,6 +36,8 @@ span.glyphicon.glyphicon-tags {padding-right: 5px;color: #999;vertical-align: te
-moz-box-shadow: 0 5px 8px -6px #777;
box-shadow: 0 5px 8px -6px #777;
}
+.navbar-default .navbar-toggle .icon-bar {background-color: #000;}
+.navbar-default .navbar-toggle {border-color: #000;}
.btn-file {position: relative; overflow: hidden;}
.btn-file input[type=file] {position: absolute; top: 0; right: 0; min-width: 100%; min-height: 100%; font-size: 100px; text-align: right; filter: alpha(opacity=0); opacity: 0; outline: none; background: white; cursor: inherit; display: block;}
diff --git a/cps/templates/layout.html b/cps/templates/layout.html
index 7e63b93b..71bd7941 100644
--- a/cps/templates/layout.html
+++ b/cps/templates/layout.html
@@ -52,17 +52,19 @@
Calibre Web
+ {% if g.user.is_authenticated or g.user.is_anonymous() %}
+
{% if g.user.is_authenticated or g.user.is_anonymous() %}
{% endif %}
@@ -80,11 +82,11 @@
{% endif %}
{% endif %}
{% if g.user.role_admin() %}
-
{{_('Admin')}}
+
{{_('Admin')}}
{% endif %}
-
{{g.user.nickname}}
+
{{g.user.nickname}}
{% if not g.user.is_anonymous() %}
-
{{_('Logout')}}
+
{{_('Logout')}}
{% endif %}
{% endif %}
{% if g.allow_registration and not g.user.is_authenticated %}
diff --git a/cps/web.py b/cps/web.py
index 2734a5c8..4bf67dbd 100755
--- a/cps/web.py
+++ b/cps/web.py
@@ -284,7 +284,7 @@ def mimetype_filter(val):
@app.template_filter('formatdate')
def formatdate(val):
conformed_timestamp = re.sub(r"[:]|([-](?!((\d{2}[:]\d{2})|(\d{4}))$))", '', val)
- formatdate = datetime.datetime.strptime(conformed_timestamp[:-5], "%Y%m%d %H%M%S")
+ formatdate = datetime.datetime.strptime(conformed_timestamp[:15], "%Y%m%d %H%M%S")
return format_date(formatdate, format='medium',locale=get_locale())
diff --git a/vendor/wand/api.py b/vendor/wand/api.py
index 19cf6d2e..2c18513d 100644
--- a/vendor/wand/api.py
+++ b/vendor/wand/api.py
@@ -180,8 +180,8 @@ try:
libraries = load_library()
except (OSError, IOError):
msg = 'http://docs.wand-py.org/en/latest/guide/install.html'
- if sys.platform.startswith('freebsd'):
- msg = 'pkg_add -r'
+ if sys.platform.startswith(('dragonfly', 'freebsd')):
+ msg = 'pkg install'
elif sys.platform == 'win32':
msg += '#install-imagemagick-on-windows'
elif sys.platform == 'darwin':
@@ -1397,7 +1397,7 @@ try:
library.MagickAutoOrientImage.argtypes = [ctypes.c_void_p]
except AttributeError:
# MagickAutoOrientImage was added in 6.8.9+, we have a fallback function
- # so we pass silently if we cant import it
+ # so we pass silently if we cannot import it
pass
@@ -1418,7 +1418,7 @@ else:
except OSError:
# In case of El Capitan SIP
libc = ctypes.cdll.LoadLibrary('/usr/lib/libc.dylib')
- elif platform.system() == 'FreeBSD':
+ elif sys.platform.startswith(('dragonfly', 'freebsd')):
libc = ctypes.cdll.LoadLibrary(ctypes.util.find_library('c'))
else:
libc = ctypes.cdll.LoadLibrary('libc.so.6')
diff --git a/vendor/wand/drawing.py b/vendor/wand/drawing.py
index 4581dd86..0b5663e6 100644
--- a/vendor/wand/drawing.py
+++ b/vendor/wand/drawing.py
@@ -1573,7 +1573,7 @@ class Drawing(Resource):
def rectangle(self, left=None, top=None, right=None, bottom=None,
width=None, height=None, radius=None, xradius=None,
yradius=None):
- """Draws a rectangle using the current :attr:`stoke_color`,
+ """Draws a rectangle using the current :attr:`stroke_color`,
:attr:`stroke_width`, and :attr:`fill_color`.
.. sourcecode:: text
diff --git a/vendor/wand/exceptions.py b/vendor/wand/exceptions.py
index ff241460..185414e4 100644
--- a/vendor/wand/exceptions.py
+++ b/vendor/wand/exceptions.py
@@ -18,16 +18,28 @@ class WandException(Exception):
"""All Wand-related exceptions are derived from this class."""
-class WandWarning(WandException, Warning):
- """Base class for Wand-related warnings."""
+class BaseWarning(WandException, Warning):
+ """Base class for Wand-related warnings.
+
+ .. versionadded:: 0.4.4
+
+ """
-class WandError(WandException):
- """Base class for Wand-related errors."""
+class BaseError(WandException):
+ """Base class for Wand-related errors.
+
+ .. versionadded:: 0.4.4
+
+ """
-class WandFatalError(WandException):
- """Base class for Wand-related fatal errors."""
+class BaseFatalError(WandException):
+ """Base class for Wand-related fatal errors.
+
+ .. versionadded:: 0.4.4
+
+ """
class WandLibraryVersionError(WandException):
@@ -91,9 +103,9 @@ DOMAIN_MAP = [
#: (:class:`list`) The list of (base_class, suffix) pairs (for each code).
#: It would be zipped with :const:`DOMAIN_MAP` pairs' last element.
CODE_MAP = [
- (WandWarning, 'Warning'),
- (WandError, 'Error'),
- (WandFatalError, 'FatalError')
+ (BaseWarning, 'Warning'),
+ (BaseError, 'Error'),
+ (BaseFatalError, 'FatalError')
]
diff --git a/vendor/wand/image.py b/vendor/wand/image.py
index f94b2212..f73f8e3a 100644
--- a/vendor/wand/image.py
+++ b/vendor/wand/image.py
@@ -2757,6 +2757,17 @@ class Image(BaseImage):
self.sequence = Sequence(self)
self.raise_exception()
+ def destroy(self):
+ """Manually remove :class:`~.sequence.SingleImage`'s in
+ the :class:`~.sequence.Sequence`, allowing it to
+ be properly garbage collected after using a ``with Image()`` context
+ manager.
+
+ """
+ for i in range(0, len(self.sequence)):
+ self.sequence.pop()
+ super(Image, self).destroy()
+
def read(self, file=None, filename=None, blob=None, resolution=None):
"""Read new image into Image() object.
diff --git a/vendor/wand/version.py b/vendor/wand/version.py
index baf34fa0..4d918136 100644
--- a/vendor/wand/version.py
+++ b/vendor/wand/version.py
@@ -57,7 +57,7 @@ __all__ = ('VERSION', 'VERSION_INFO', 'MAGICK_VERSION',
#:
#: .. versionchanged:: 0.1.9
#: Becomes :class:`tuple`. (It was string before.)
-VERSION_INFO = (0, 4, 3)
+VERSION_INFO = (0, 4, 4)
#: (:class:`basestring`) The version string e.g. ``'0.1.2'``.
#:
@@ -94,20 +94,20 @@ if libmagick:
#: .. versionadded:: 0.2.1
MAGICK_VERSION_INFO = tuple(int(v or 0) for v in _match.groups())
- #: (:class:`datetime.date`) The release date of the linked ImageMagick
- #: library. The same to the result of :c:func:`GetMagickReleaseDate`
- #: function.
- #:
- #: .. versionadded:: 0.2.1
- MAGICK_RELEASE_DATE_STRING = text(libmagick.GetMagickReleaseDate())
-
#: (:class:`basestring`) The date string e.g. ``'2012-06-03'`` of
#: :const:`MAGICK_RELEASE_DATE_STRING`. This value is the exactly same
#: string to the result of :c:func:`GetMagickReleaseDate` function.
#:
#: .. versionadded:: 0.2.1
- MAGICK_RELEASE_DATE = datetime.date(
- *map(int, MAGICK_RELEASE_DATE_STRING.split('-')))
+ MAGICK_RELEASE_DATE_STRING = text(libmagick.GetMagickReleaseDate())
+
+ _match = re.match(r'^(\d{4})-?(\d\d)-?(\d\d)$', MAGICK_RELEASE_DATE_STRING)
+ #: (:class:`datetime.date`) The release date of the linked ImageMagick
+ #: library. Equivalent to the result of :c:func:`GetMagickReleaseDate`
+ #: function.
+ #:
+ #: .. versionadded:: 0.2.1
+ MAGICK_RELEASE_DATE = datetime.date(*map(int, _match.groups()))
c_quantum_depth = ctypes.c_size_t()
libmagick.GetMagickQuantumDepth(ctypes.byref(c_quantum_depth))