From 8622a48b65a43ac783e56045aa35f53fbf9bfc99 Mon Sep 17 00:00:00 2001 From: frank038 <42263206+frank038@users.noreply.github.com> Date: Mon, 25 Mar 2024 19:52:08 +0100 Subject: [PATCH] Add files via upload --- pyeditor/pyeditor.py | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) diff --git a/pyeditor/pyeditor.py b/pyeditor/pyeditor.py index 2a33019..4832a0a 100644 --- a/pyeditor/pyeditor.py +++ b/pyeditor/pyeditor.py @@ -1,5 +1,5 @@ #!/usr/bin/env python3 -# V 0.9.12 +# V 0.9.13 import sys from PyQt5.QtWidgets import (qApp,QMainWindow,QStyleFactory,QWidget,QFileDialog,QSizePolicy,QFrame,QBoxLayout,QVBoxLayout,QHBoxLayout,QLabel,QPushButton,QApplication,QDialog,QMessageBox,QLineEdit,QComboBox,QCheckBox,QAction,QMenu,QStatusBar,QTabWidget) from PyQt5.QtCore import (Qt,pyqtSignal,QFile,QIODevice,QPoint,QMimeDatabase) @@ -292,9 +292,11 @@ def __init__(self): elif EDITORTYPE == "javascript": self.isargument = 3 use_mimetype = 0 - elif EDITORTYPE == "text" or EDITORTYPE == "": + elif EDITORTYPE == "text": self.isargument = 4 use_mimetype = 0 + elif EDITORTYPE == "": + use_mimetype = 1 # check from the mimetype of the file if use_mimetype: self.isargument = self.set_mimetype(afilename) @@ -324,6 +326,8 @@ def set_mimetype(self, afile): return 3 elif file_type == "text/plain": return 4 + else: + return 4 def on_tab_changed(self, idx): # self.sender().tabText(idx)