Skip to content

Commit c7ee3ef

Browse files
committed
Merge branch 'release/2.2.1'
2 parents 8fd45b8 + 0546cc7 commit c7ee3ef

9 files changed

+4047
-3950
lines changed

.travis.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -32,7 +32,7 @@ deploy:
3232
provider: releases
3333
api_key:
3434
secure: FbZOk633cPQK70SwNHV29vddB48pQhZYXK6tBi6rNOQFCmtsRltiAZx1mn9cBA89yYcbiEGi8SKNTUKFAOtn8xsftXtRQbh7NLH+1S1rXoFLTKqd/e2K8V+I3qPnSIflXgw4jipkVJEtaTnYjjM39Dd9LYVlOfzTdDS3gePGOGKvLIx+T7nmzNTfPb/jVmBo9d68vlcMvDApMcocURXXHPK2Yoz4cjfGU1s674GOycoPPxE0Ovmdhj/PHLYqnSL0Q78UQ9luL8q6Lv15PeDKynpsi5ajm6p8p7DKp6ilvwWN+iKZA9ged8E8FbA7eLu3DA3pPmghph0dlRpYwbanosccTlbeFrNM6p3s6huxUzHt6Fkdzk5ubtz30FkA0LzvxwxOn6u1W4iTTI1Z1p07SpoyNrRw8wZY/hqcPkD+rDhQX1jmxfzaro8M0QRZ92cOI1nX3N8HRwMTZ2o+vMvaTvmHglfLN1aTpm3z/Pbp2gqj/uxE1aQlXKc3b+V5cGCEmsJKNp3TFhKyRdI7pMNF6E+vWfOLjTjif6h8Vy4nYkCX0C5h8eVmL6y8qfVMS1yATAM8B8K1dXvP3JaDKJoNUvH3VHgH/AxZGYHgycObU7GVUc/XhpCErBuMv1JZmLYE3tEGVFpt93RX2/MVmO8yp7/X6hxeIvfpsFUp2yk1q6k=
35-
file: "pynocchio_2.2.0_amd64.deb"
35+
file: "pynocchio_2.2.1_amd64.deb"
3636
skip_cleanup: true
3737
on:
3838
tags: true

pynocchio/__version__.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@
22

33
__title__ = 'Pynocchio'
44
__description__ = 'Pynocchio is a image viewer specialized in comic reading'
5-
__version__ = '2.2.0'
5+
__version__ = '2.2.1'
66
__url__ = 'https://github.com/pynocchio/pynocchio'
77
__download_url__ = 'https://github.com/pynocchio/pynocchio/releases'
88
__author__ = 'Michell Stuttgart'
Lines changed: 31 additions & 17 deletions
Original file line numberDiff line numberDiff line change
@@ -1,21 +1,21 @@
11
# -*- coding: utf-8 -*-
22

3-
from peewee import OperationalError, IntegrityError
3+
import peewee
4+
import sqlite3
45
from .bookmark import Bookmark, TemporaryBookmark, BookmarkBaseModel, db
56

67
import logging
8+
79
logging.basicConfig(level=logging.INFO)
810
logger = logging.getLogger(__name__)
911

10-
1112
TABLES = {
1213
False: Bookmark,
1314
True: TemporaryBookmark,
1415
}
1516

1617

1718
class BookmarkManager(BookmarkBaseModel):
18-
1919
@staticmethod
2020
def connect():
2121
try:
@@ -24,7 +24,9 @@ def connect():
2424
db.create_tables([Bookmark, TemporaryBookmark], safe=True)
2525
logger.info('Table Bookmark and TemporaryBookmark create/updates '
2626
'successfully!')
27-
except OperationalError as exc:
27+
except peewee.OperationalError as exc:
28+
logger.exception(exc)
29+
except sqlite3.OperationalError as exc:
2830
logger.exception(exc)
2931

3032
@staticmethod
@@ -41,7 +43,7 @@ def add_bookmark(name, path, page, data=None, table=Bookmark):
4143
comic_page=page, page_data=data)
4244
q.execute()
4345
logger.info('%s item inserted.' % table.__class__)
44-
except IntegrityError:
46+
except peewee.IntegrityError:
4547
q = table.update(comic_page=page, page_data=data).where(
4648
table.comic_path == path)
4749
q.execute()
@@ -55,26 +57,38 @@ def remove_bookmark(path, table=Bookmark):
5557
q = table.delete().where(table.comic_path == path)
5658
q.execute()
5759
logger.info('Bookmark deleted.')
58-
except IntegrityError:
60+
except peewee.IntegrityError:
5961
logger.exception('Bookmark not find!')
6062
BookmarkManager.close()
6163

6264
@staticmethod
6365
def get_bookmarks(rows_number, table=Bookmark):
64-
query = table.select().order_by(table.comic_id.desc()).limit(
65-
rows_number)
66-
return list(query)
66+
try:
67+
query = table.select().order_by(table.comic_id.desc()).limit(
68+
rows_number)
69+
return list(query)
70+
except peewee.OperationalError as exc:
71+
logger.exception(exc)
72+
return []
6773

6874
@staticmethod
6975
def get_bookmark_by_path(path, table=Bookmark):
70-
BookmarkManager.connect()
71-
bk_list = table.select().where(table.comic_path == path)
72-
BookmarkManager.close()
73-
return bk_list[0] if bk_list else None
76+
try:
77+
BookmarkManager.connect()
78+
bk_list = table.select().where(table.comic_path == path)
79+
BookmarkManager.close()
80+
return bk_list[0] if bk_list else None
81+
except peewee.OperationalError as exc:
82+
logger.exception(exc)
83+
return None
7484

7585
@staticmethod
7686
def is_bookmark(path, table=Bookmark):
77-
BookmarkManager.connect()
78-
bk_list = table.select().where(table.comic_path == path)
79-
BookmarkManager.close()
80-
return True if bk_list else False
87+
try:
88+
BookmarkManager.connect()
89+
bk_list = table.select().where(table.comic_path == path)
90+
BookmarkManager.close()
91+
return True if bk_list else False
92+
except peewee.OperationalError as exc:
93+
logger.exception(exc)
94+
return False

pynocchio/uic_files/about_dialog_ui.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@
22

33
# Form implementation generated from reading ui file './forms/about_dialog.ui'
44
#
5-
# Created by: PyQt5 UI code generator 5.8.2
5+
# Created by: PyQt5 UI code generator 5.9
66
#
77
# WARNING! All changes made in this file will be lost!
88

pynocchio/uic_files/bookmark_manager_dialog_ui.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@
22

33
# Form implementation generated from reading ui file './forms/bookmark_manager_dialog.ui'
44
#
5-
# Created by: PyQt5 UI code generator 5.8.2
5+
# Created by: PyQt5 UI code generator 5.9
66
#
77
# WARNING! All changes made in this file will be lost!
88

pynocchio/uic_files/go_to_page_dialog_ui.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@
22

33
# Form implementation generated from reading ui file './forms/go_to_page_dialog.ui'
44
#
5-
# Created by: PyQt5 UI code generator 5.8.2
5+
# Created by: PyQt5 UI code generator 5.9
66
#
77
# WARNING! All changes made in this file will be lost!
88

0 commit comments

Comments
 (0)