Skip to content

Commit

Permalink
1.7.0.0
Browse files Browse the repository at this point in the history
  • Loading branch information
noembryo committed Mar 9, 2023
1 parent f465603 commit fa7d0db
Show file tree
Hide file tree
Showing 11 changed files with 706 additions and 655 deletions.
18 changes: 11 additions & 7 deletions boot_config.py
Original file line number Diff line number Diff line change
Expand Up @@ -58,9 +58,11 @@ def __del__(self):
PYTHON2 = True if sys.version_info < (3, 0) else False
if PYTHON2:
from io import open
from codecs import open as c_open
else:
# noinspection PyShadowingBuiltins
unicode, basestring = str, str
c_open = open


def except_hook(class_type, value, trace_back):
Expand All @@ -69,7 +71,7 @@ def except_hook(class_type, value, trace_back):
name = join(SETTINGS_DIR, "error_log_{}.txt".format(time.strftime(str("%Y-%m-%d"))))
with open(name, "a", encoding="utf8") as log:
log.write("\nCrash@{}\n".format(time.strftime(str("%Y-%m-%d %H:%M:%S"))))
traceback.print_exception(class_type, value, trace_back, file=open(name, "a"))
traceback.print_exception(class_type, value, trace_back, file=c_open(name, str("a")))
sys.__excepthook__(class_type, value, trace_back)


Expand All @@ -93,19 +95,20 @@ def except_hook(class_type, value, trace_back):

BOOKS_VIEW, HIGHLIGHTS_VIEW = range(2) # app views
CHANGE_DB, NEW_DB, RELOAD_DB = range(3) # db change mode
TITLE, AUTHOR, TYPE, PERCENT, RATING, HIGH_COUNT, MODIFIED, PATH = range(8) # file_table columns
(TITLE, AUTHOR, TYPE, PERCENT, RATING,
HIGH_COUNT, MODIFIED, PATH) = range(8) # file_table columns
PAGE, HIGHLIGHT_TEXT, DATE, PAGE_ID, COMMENT = range(5) # high_list item data
(HIGHLIGHT_H, COMMENT_H,
DATE_H, TITLE_H, AUTHOR_H, PAGE_H, PATH_H) = range(7) # high_table columns
(HIGHLIGHT_H, COMMENT_H, DATE_H, TITLE_H,
AUTHOR_H, PAGE_H, CHAPTER_H, PATH_H) = range(8) # high_table columns
(MANY_TEXT, ONE_TEXT, MANY_HTML, ONE_HTML,
MANY_CSV, ONE_CSV, MERGED_HIGH) = range(7) # save_actions
MANY_CSV, ONE_CSV, MANY_MD, ONE_MD) = range(8) # save_actions
DB_MD5, DB_DATE, DB_PATH, DB_DATA = range(4) # db data (columns)
FILTER_ALL, FILTER_HIGH, FILTER_COMM, FILTER_TITLES = range(4) # db data (columns)

DB_VERSION = 0
DATE_FORMAT = "%Y-%m-%d %H:%M:%S"
CSV_HEAD = "Title\tAuthors\tPage\tDate\tHighlight\tComment\n"
CSV_KEYS = ["title", "authors", "page", "date", "text", "comment"]
CSV_HEAD = "Title\tAuthors\tPage\tDate\tChapter\tHighlight\tComment\n"
CSV_KEYS = ["title", "authors", "page", "date", "chapter", "text", "comment"]
HTML_HEAD = """<!DOCTYPE html>
<html lang="en">
<head>
Expand Down Expand Up @@ -143,6 +146,7 @@ def except_hook(class_type, value, trace_back):
<p style="text-align:left;float:left;padding:1px; margin:0;">%(page)s</p>
<p style="text-align:right;float:right;padding:1px; margin:0;">%(date)s</p>
<hr style="clear:both;"/>
<h4>%(chapter)s</h4>
<p>%(highlight)s</p>
<p>%(comment)s</p>
</div>
Expand Down
13 changes: 8 additions & 5 deletions gui_main.py
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@

# Form implementation generated from reading ui file 'D:\Apps\DEV\PROJECTS\KoHighlights\gui_main.ui'
#
# Created: Wed Oct 20 12:47:43 2021
# Created: Thu Mar 9 14:39:40 2023
# by: pyside-uic 0.2.15 running on PySide 1.2.4
#
# WARNING! All changes made in this file will be lost!
Expand All @@ -12,7 +12,7 @@
class Ui_Base(object):
def setupUi(self, Base):
Base.setObjectName("Base")
Base.resize(624, 412)
Base.resize(640, 512)
icon = QtGui.QIcon()
icon.addPixmap(QtGui.QPixmap(":/stuff/logo64.png"), QtGui.QIcon.Normal, QtGui.QIcon.Off)
Base.setWindowIcon(icon)
Expand Down Expand Up @@ -196,9 +196,9 @@ def setupUi(self, Base):
self.high_table.setHorizontalScrollMode(QtGui.QAbstractItemView.ScrollPerPixel)
self.high_table.setWordWrap(False)
self.high_table.setCornerButtonEnabled(False)
self.high_table.setColumnCount(7)
self.high_table.setColumnCount(8)
self.high_table.setObjectName("high_table")
self.high_table.setColumnCount(7)
self.high_table.setColumnCount(8)
self.high_table.setRowCount(0)
item = QtGui.QTableWidgetItem()
self.high_table.setHorizontalHeaderItem(0, item)
Expand All @@ -214,6 +214,8 @@ def setupUi(self, Base):
self.high_table.setHorizontalHeaderItem(5, item)
item = QtGui.QTableWidgetItem()
self.high_table.setHorizontalHeaderItem(6, item)
item = QtGui.QTableWidgetItem()
self.high_table.setHorizontalHeaderItem(7, item)
self.high_table.horizontalHeader().setHighlightSections(False)
self.high_table.horizontalHeader().setMinimumSectionSize(22)
self.high_table.horizontalHeader().setSortIndicatorShown(True)
Expand Down Expand Up @@ -281,7 +283,8 @@ def retranslateUi(self, Base):
self.high_table.horizontalHeaderItem(3).setText(QtGui.QApplication.translate("Base", "Title", None, QtGui.QApplication.UnicodeUTF8))
self.high_table.horizontalHeaderItem(4).setText(QtGui.QApplication.translate("Base", "Author", None, QtGui.QApplication.UnicodeUTF8))
self.high_table.horizontalHeaderItem(5).setText(QtGui.QApplication.translate("Base", "Page", None, QtGui.QApplication.UnicodeUTF8))
self.high_table.horizontalHeaderItem(6).setText(QtGui.QApplication.translate("Base", "Book path", None, QtGui.QApplication.UnicodeUTF8))
self.high_table.horizontalHeaderItem(6).setText(QtGui.QApplication.translate("Base", "Chapter", None, QtGui.QApplication.UnicodeUTF8))
self.high_table.horizontalHeaderItem(7).setText(QtGui.QApplication.translate("Base", "Book path", None, QtGui.QApplication.UnicodeUTF8))
self.act_english.setText(QtGui.QApplication.translate("Base", "English", None, QtGui.QApplication.UnicodeUTF8))
self.act_greek.setText(QtGui.QApplication.translate("Base", "Greek", None, QtGui.QApplication.UnicodeUTF8))
self.act_view_book.setText(QtGui.QApplication.translate("Base", "View Book", None, QtGui.QApplication.UnicodeUTF8))
Expand Down
11 changes: 8 additions & 3 deletions gui_main.ui
Original file line number Diff line number Diff line change
Expand Up @@ -6,8 +6,8 @@
<rect>
<x>0</x>
<y>0</y>
<width>624</width>
<height>412</height>
<width>640</width>
<height>512</height>
</rect>
</property>
<property name="windowIcon">
Expand Down Expand Up @@ -417,7 +417,7 @@
<bool>false</bool>
</property>
<property name="columnCount">
<number>7</number>
<number>8</number>
</property>
<attribute name="horizontalHeaderHighlightSections">
<bool>false</bool>
Expand Down Expand Up @@ -470,6 +470,11 @@
<string>Page</string>
</property>
</column>
<column>
<property name="text">
<string>Chapter</string>
</property>
</column>
<column>
<property name="text">
<string>Book path</string>
Expand Down
7 changes: 6 additions & 1 deletion gui_status.py
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@

# Form implementation generated from reading ui file 'D:\Apps\DEV\PROJECTS\KoHighlights\gui_status.ui'
#
# Created: Sat Mar 30 00:34:32 2019
# Created: Thu Mar 9 14:39:35 2023
# by: pyside-uic 0.2.15 running on PySide 1.2.4
#
# WARNING! All changes made in this file will be lost!
Expand Down Expand Up @@ -52,6 +52,9 @@ def setupUi(self, Status):
self.act_comment = QtGui.QAction(Status)
self.act_comment.setCheckable(True)
self.act_comment.setObjectName("act_comment")
self.act_chapter = QtGui.QAction(Status)
self.act_chapter.setCheckable(True)
self.act_chapter.setObjectName("act_chapter")

self.retranslateUi(Status)
QtCore.QMetaObject.connectSlotsByName(Status)
Expand All @@ -65,5 +68,7 @@ def retranslateUi(self, Status):
self.act_date.setText(QtGui.QApplication.translate("Status", "Date", None, QtGui.QApplication.UnicodeUTF8))
self.act_text.setText(QtGui.QApplication.translate("Status", "Highlight", None, QtGui.QApplication.UnicodeUTF8))
self.act_comment.setText(QtGui.QApplication.translate("Status", "Comment", None, QtGui.QApplication.UnicodeUTF8))
self.act_chapter.setText(QtGui.QApplication.translate("Status", "Chapter", None, QtGui.QApplication.UnicodeUTF8))
self.act_chapter.setToolTip(QtGui.QApplication.translate("Status", "Chapter", None, QtGui.QApplication.UnicodeUTF8))

import images_rc
11 changes: 11 additions & 0 deletions gui_status.ui
Original file line number Diff line number Diff line change
Expand Up @@ -108,6 +108,17 @@ what will be saved to the text/html files.</string>
<string>Comment</string>
</property>
</action>
<action name="act_chapter">
<property name="checkable">
<bool>true</bool>
</property>
<property name="text">
<string>Chapter</string>
</property>
<property name="toolTip">
<string>Chapter</string>
</property>
</action>
</widget>
<resources>
<include location="images.qrc"/>
Expand Down
10 changes: 5 additions & 5 deletions gui_toolbar.py
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@

# Form implementation generated from reading ui file 'D:\Apps\DEV\PROJECTS\KoHighlights\gui_toolbar.ui'
#
# Created: Thu Nov 24 15:53:16 2022
# Created: Thu Mar 9 14:39:30 2023
# by: pyside-uic 0.2.15 running on PySide 1.2.4
#
# WARNING! All changes made in this file will be lost!
Expand Down Expand Up @@ -290,11 +290,11 @@ def retranslateUi(self, ToolBar):
self.loaded_btn.setStatusTip(QtGui.QApplication.translate("ToolBar", "Show the loaded files", None, QtGui.QApplication.UnicodeUTF8))
self.loaded_btn.setText(QtGui.QApplication.translate("ToolBar", "Loaded", None, QtGui.QApplication.UnicodeUTF8))
self.db_btn.setToolTip(QtGui.QApplication.translate("ToolBar", "Show the archived files in the database\n"
"(Right click to change the database file)", None, QtGui.QApplication.UnicodeUTF8))
self.db_btn.setStatusTip(QtGui.QApplication.translate("ToolBar", "Show the archived files in the database (Right click to change the database file)", None, QtGui.QApplication.UnicodeUTF8))
"(Right click for database actions menu)", None, QtGui.QApplication.UnicodeUTF8))
self.db_btn.setStatusTip(QtGui.QApplication.translate("ToolBar", "Show the archived files in the database (Right click for database actions menu)", None, QtGui.QApplication.UnicodeUTF8))
self.db_btn.setText(QtGui.QApplication.translate("ToolBar", "Archived", None, QtGui.QApplication.UnicodeUTF8))
self.about_btn.setToolTip(QtGui.QApplication.translate("ToolBar", "Info about the KoHighlights", None, QtGui.QApplication.UnicodeUTF8))
self.about_btn.setStatusTip(QtGui.QApplication.translate("ToolBar", "Info about the KoHighlights", None, QtGui.QApplication.UnicodeUTF8))
self.about_btn.setToolTip(QtGui.QApplication.translate("ToolBar", "Info about the KoHighlights (Ctrl+I)", None, QtGui.QApplication.UnicodeUTF8))
self.about_btn.setStatusTip(QtGui.QApplication.translate("ToolBar", "Info about the KoHighlights (Ctrl+I)", None, QtGui.QApplication.UnicodeUTF8))
self.about_btn.setText(QtGui.QApplication.translate("ToolBar", "About", None, QtGui.QApplication.UnicodeUTF8))

from secondary import XToolButton
Expand Down
10 changes: 5 additions & 5 deletions gui_toolbar.ui
Original file line number Diff line number Diff line change
Expand Up @@ -560,10 +560,10 @@ Activated only if two entries of the same book are selected.</string>
</property>
<property name="toolTip">
<string>Show the archived files in the database
(Right click to change the database file)</string>
(Right click for database actions menu)</string>
</property>
<property name="statusTip">
<string>Show the archived files in the database (Right click to change the database file)</string>
<string>Show the archived files in the database (Right click for database actions menu)</string>
</property>
<property name="text">
<string>Archived</string>
Expand Down Expand Up @@ -613,10 +613,10 @@ Activated only if two entries of the same book are selected.</string>
</size>
</property>
<property name="toolTip">
<string>Info about the KoHighlights</string>
<string>Info about the KoHighlights (Ctrl+I)</string>
</property>
<property name="statusTip">
<string>Info about the KoHighlights</string>
<string>Info about the KoHighlights (Ctrl+I)</string>
</property>
<property name="text">
<string>About</string>
Expand Down Expand Up @@ -652,7 +652,7 @@ Activated only if two entries of the same book are selected.</string>
</customwidget>
</customwidgets>
<resources>
<include location="images.qrc"/>
<include location="images.qrc"/>
</resources>
<connections/>
</ui>
Loading

0 comments on commit fa7d0db

Please sign in to comment.