Skip to content

Commit

Permalink
1.7.2.0
Browse files Browse the repository at this point in the history
  • Loading branch information
noembryo committed Apr 26, 2023
1 parent f251d7a commit 0fafa68
Show file tree
Hide file tree
Showing 3 changed files with 17 additions and 15 deletions.
3 changes: 1 addition & 2 deletions boot_config.py
Expand Up @@ -44,6 +44,7 @@ def __del__(self):
if my_app.already_running(): # another instance is running
sys.exit(0)
try:
# noinspection PyUnresolvedReferences
portable_arg = sys.argv[1] if not PYTHON2 else sys.argv[1].decode("mbcs")
PORTABLE = portable_arg == "-p"
except IndexError: # no arguments in the call
Expand Down Expand Up @@ -72,8 +73,6 @@ def __del__(self):
os.makedirs(SETTINGS_DIR) if not isdir(SETTINGS_DIR) else None




def except_hook(class_type, value, trace_back):
""" Print the error to a log file
"""
Expand Down
8 changes: 5 additions & 3 deletions main.py
Expand Up @@ -47,7 +47,7 @@


__author__ = "noEmbryo"
__version__ = "1.7.1.0"
__version__ = "1.7.2.0"


# if sys.platform.lower().startswith("win"):
Expand Down Expand Up @@ -2457,7 +2457,7 @@ def pickle(array):
:type array: QByteArray
:param array: The data
"""
return pickle.dumps(bytes(array), protocol=0)
return pickle.dumps(bytes(array), protocol=0) # type: ignore

@staticmethod
def unpickle(key):
Expand Down Expand Up @@ -2738,6 +2738,8 @@ class KOHighlights(QApplication):

def __init__(self, *args, **kwargs):
super(KOHighlights, self).__init__(*args, **kwargs)
if not QT4:
self.setAttribute(Qt.AA_DisableWindowContextHelpButton)
# decode app's arguments
# try:
# sys.argv = [i.decode(sys.getfilesystemencoding()) for i in sys.argv]
Expand All @@ -2746,7 +2748,7 @@ def __init__(self, *args, **kwargs):
argv = self.arguments()
if argv[0].endswith("python.exe") or argv[0].endswith("python3.exe"):
argv = argv[1:]
if argv[1] == "-p":
if len(argv) > 1 and argv[1] == "-p":
del argv[1]
sys.argv = argv
self.parser = argparse.ArgumentParser(prog=APP_NAME,
Expand Down
21 changes: 11 additions & 10 deletions secondary.py
Expand Up @@ -539,7 +539,7 @@ def set_btn_size(self, size):
"""
self.base.toolbar_size = size
button_size = QSize(size, size)
half_size = QSize(size * .5, size * .5)
half_size = QSize(int(size * .5), int(size * .5))

for btn in self.buttons:
btn.setMinimumWidth(size + 10)
Expand Down Expand Up @@ -798,9 +798,9 @@ class Filter(QDialog, Ui_Filter):
def __init__(self, parent=None):
super(Filter, self).__init__(parent)
self.setupUi(self)
# Remove the question mark widget from dialog
self.setWindowFlags(self.windowFlags() ^
Qt.WindowContextHelpButtonHint)
if QT4: # Remove the question mark widget from dialog
# noinspection PyUnresolvedReferences
self.setWindowFlags(self.windowFlags() ^ Qt.WindowContextHelpButtonHint)
self.setWindowTitle(_("Filter").format(APP_NAME))
self.base = parent

Expand Down Expand Up @@ -951,9 +951,9 @@ class About(QDialog, Ui_About):
def __init__(self, parent=None):
super(About, self).__init__(parent)
self.setupUi(self)
# Remove the question mark widget from dialog
self.setWindowFlags(self.windowFlags() ^
Qt.WindowContextHelpButtonHint)
if QT4: # Remove the question mark widget from dialog
# noinspection PyUnresolvedReferences
self.setWindowFlags(self.windowFlags() ^ Qt.WindowContextHelpButtonHint)
self.setWindowTitle(_("About {}").format(APP_NAME))
self.base = parent

Expand Down Expand Up @@ -1002,7 +1002,7 @@ def check_for_updates(self):
def get_online_version():
header = {"User-Agent": "Mozilla/5.0 (Windows NT 5.1; rv:14.0) "
"Gecko/20100101 Firefox/24.0.1",
"Referer": "http://whateveritis.com"}
"Referer": "http://noembryo.com"}
url = "http://www.noembryo.com/apps.php?kohighlights"
try:
html_text = requests.get(url, headers=header).content
Expand Down Expand Up @@ -1072,8 +1072,9 @@ class TextDialog(QDialog, Ui_TextDialog):

def __init__(self, parent=None):
super(TextDialog, self).__init__(parent)
# Remove the question mark widget from dialog
self.setWindowFlags(self.windowFlags() ^ Qt.WindowContextHelpButtonHint)
if QT4: # Remove the question mark widget from dialog
# noinspection PyUnresolvedReferences
self.setWindowFlags(self.windowFlags() ^ Qt.WindowContextHelpButtonHint)
self.setupUi(self)

self.base = parent
Expand Down

0 comments on commit 0fafa68

Please sign in to comment.