je-editor 0.0.184__py3-none-any.whl → 0.0.186__py3-none-any.whl

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -12,6 +12,7 @@ from frontengine import FrontEngineMainUI
12
12
  from frontengine import RedirectManager
13
13
  from qt_material import QtStyleTools
14
14
 
15
+ from je_editor.utils.logging.loggin_instance import jeditor_logger
15
16
  from je_editor.pyside_ui.browser.browser_widget import BrowserWidget
16
17
  from je_editor.pyside_ui.code.auto_save.auto_save_manager import init_new_auto_save_thread, file_is_open_manager_dict
17
18
  from je_editor.pyside_ui.main_ui.editor.editor_widget import EditorWidget
@@ -22,7 +23,6 @@ from je_editor.pyside_ui.main_ui.save_settings.user_setting_file import user_set
22
23
  write_user_setting
23
24
  from je_editor.pyside_ui.main_ui.system_tray.extend_system_tray import ExtendSystemTray
24
25
  from je_editor.utils.file.open.open_file import read_file
25
- from je_editor.utils.logging.loggin_instance import jeditor_logger
26
26
  from je_editor.utils.multi_language.multi_language_wrapper import language_wrapper
27
27
  from je_editor.utils.redirect_manager.redirect_manager_class import redirect_manager_instance
28
28
 
@@ -97,7 +97,7 @@ class EditorMain(QMainWindow, QtStyleTools):
97
97
  self.system_tray.show()
98
98
  self.system_tray.setToolTip(language_wrapper.language_word_dict.get("application_name"))
99
99
  # Put Redirect on last to trace exception
100
- RedirectManager.restore_std()
100
+ redirect_manager_instance.restore_std()
101
101
  redirect_manager_instance.set_redirect()
102
102
  # Timer to redirect error or message
103
103
  self.redirect_timer = QTimer(self)
@@ -204,7 +204,7 @@ class EditorMain(QMainWindow, QtStyleTools):
204
204
  self.tab_widget.setCurrentWidget(widget)
205
205
 
206
206
  def closeEvent(self, event) -> None:
207
- jeditor_logger.info(f"EditorMain closeEvent")
207
+ jeditor_logger.info("EditorMain closeEvent")
208
208
  write_user_setting()
209
209
  write_user_color_setting()
210
210
  super().closeEvent(event)
@@ -5,9 +5,23 @@ logging.root.setLevel(logging.DEBUG)
5
5
  jeditor_logger = logging.getLogger("JEditor")
6
6
  formatter = logging.Formatter('%(asctime)s | %(name)s | %(levelname)s | %(message)s')
7
7
 
8
- # Rotating File Handler
9
- rotating_file_handler = RotatingFileHandler(filename="JEditor.log", mode="w",maxBytes=1073741824)
10
- rotating_file_handler.setFormatter(formatter)
11
- jeditor_logger.addHandler(rotating_file_handler)
8
+
9
+ class JEditorLoggingHandler(RotatingFileHandler):
10
+
11
+ # redirect logging stderr output to queue
12
+
13
+ def __init__(self, filename: str = "JEditor.log", mode="w",
14
+ maxBytes:int=1073741824, backupCount:int=0):
15
+ super().__init__(filename=filename, mode=mode, maxBytes=maxBytes, backupCount=backupCount)
16
+ self.formatter = formatter
17
+ self.setLevel(logging.DEBUG)
18
+
19
+ def emit(self, record: logging.LogRecord) -> None:
20
+ super().emit(record)
21
+
22
+
23
+ # File handler
24
+ file_handler = JEditorLoggingHandler()
25
+ jeditor_logger.addHandler(file_handler)
12
26
 
13
27
 
@@ -10,15 +10,12 @@ class RedirectStdOut(logging.Handler):
10
10
  # redirect logging std output to queue
11
11
 
12
12
  def __init__(self):
13
- jeditor_logger.info("Init RedirectStdOut")
14
13
  super().__init__()
15
14
 
16
15
  def write(self, content_to_write) -> None:
17
- jeditor_logger.info(f"RedirectStdOut write content_to_write: {content_to_write}")
18
16
  redirect_manager_instance.std_out_queue.put(content_to_write)
19
17
 
20
18
  def emit(self, record: logging.LogRecord) -> None:
21
- jeditor_logger.info(f"RedirectStdOut emit record: {record}")
22
19
  redirect_manager_instance.std_out_queue.put(self.format(record))
23
20
 
24
21
 
@@ -27,15 +24,12 @@ class RedirectStdErr(logging.Handler):
27
24
  # redirect logging stderr output to queue
28
25
 
29
26
  def __init__(self):
30
- jeditor_logger.info("Init RedirectStdErr")
31
27
  super().__init__()
32
28
 
33
29
  def write(self, content_to_write) -> None:
34
- jeditor_logger.info(f"RedirectStdErr write content_to_write: {content_to_write}")
35
30
  redirect_manager_instance.std_err_queue.put(content_to_write)
36
31
 
37
32
  def emit(self, record: logging.LogRecord) -> None:
38
- jeditor_logger.info(f"RedirectStdErr emit record: {record}")
39
33
  redirect_manager_instance.std_err_queue.put(self.format(record))
40
34
 
41
35
 
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.1
2
2
  Name: je_editor
3
- Version: 0.0.184
3
+ Version: 0.0.186
4
4
  Summary: JEditor is basic but powerful editor include GPT
5
5
  Author-email: JE-Chen <jechenmailman@gmail.com>
6
6
  License: MIT
@@ -34,7 +34,7 @@ je_editor/pyside_ui/dialog/search_ui/__init__.py,sha256=47DEQpj8HBSa-_TImW-5JCeu
34
34
  je_editor/pyside_ui/dialog/search_ui/search_error_box.py,sha256=GzMXMnIL1k8ZwG3A2a_oMgiUiXXqd7HKW45YlVlL_eo,1168
35
35
  je_editor/pyside_ui/dialog/search_ui/search_text_box.py,sha256=H2MbC-RGpKg9TzjV4MZj7Bw7qs9a9E4cjA4GI5zsv4U,1154
36
36
  je_editor/pyside_ui/main_ui/__init__.py,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
37
- je_editor/pyside_ui/main_ui/main_editor.py,sha256=c2mniaNh-ngyNzA38Wsx8xZJqAc07aUTg2XN4P6IDJ4,10953
37
+ je_editor/pyside_ui/main_ui/main_editor.py,sha256=SIqi7krbejbHix8fAe4VGJo_snzZqDEjd-tNRcQw7Sg,10962
38
38
  je_editor/pyside_ui/main_ui/dock/__init__.py,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
39
39
  je_editor/pyside_ui/main_ui/dock/destroy_dock.py,sha256=MTN45BykNm6FA4gMW7gI4Kr9orTdcxVTm7mch3DUhaw,604
40
40
  je_editor/pyside_ui/main_ui/editor/__init__.py,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
@@ -92,17 +92,17 @@ je_editor/utils/json/json_file.py,sha256=zTzQp-VFlaXg7puxC3EgEECURuuDmfJ8I9emX0E
92
92
  je_editor/utils/json_format/__init__.py,sha256=frcCV1k9oG9oKj3dpUqdJg1PxRT2RSN_XKdLCPjaYaY,2
93
93
  je_editor/utils/json_format/json_process.py,sha256=tszo48OnVivVkuuPrl-FtGaaq-1YOJLKT2o2A3qQi3M,1250
94
94
  je_editor/utils/logging/__init__.py,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
95
- je_editor/utils/logging/loggin_instance.py,sha256=yZMkHMvStMtkI-IqhwPnDXnh8uvBmhDpr-HMkLVxsCI,467
95
+ je_editor/utils/logging/loggin_instance.py,sha256=OFdWgra201B4f1vDM35M9L-47DK-8j-5HQEAq_ySSKM,841
96
96
  je_editor/utils/multi_language/__init__.py,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
97
97
  je_editor/utils/multi_language/english.py,sha256=Wbku1oGVoxDRpUb3JKy1Qlj8BByDNB60PvH4TEQwGgw,5778
98
98
  je_editor/utils/multi_language/multi_language_wrapper.py,sha256=_MtYrE51poQ1p_iWvT2eg_604uj6IsiBgGpifWpYLGc,1050
99
99
  je_editor/utils/multi_language/traditional_chinese.py,sha256=tWs9_yhuNoehpYFCv37a6eVYphkzN9Jb_9Pbj267Mcc,5812
100
100
  je_editor/utils/redirect_manager/__init__.py,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
101
- je_editor/utils/redirect_manager/redirect_manager_class.py,sha256=QtuK9z3auc2lnBdTVxS-ENpBMt5pRsEuKVVOmRkd-Kw,2521
101
+ je_editor/utils/redirect_manager/redirect_manager_class.py,sha256=lQfhfpHbhhFGMRETLCPsf9TSqFRwoarelRMR1Rz2wtk,2095
102
102
  je_editor/utils/venv_check/__init__.py,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
103
103
  je_editor/utils/venv_check/check_venv.py,sha256=oCrMdue4NYUUGrVifh_iHFwIgxVx9azYN4jz3Xiulgg,999
104
- je_editor-0.0.184.dist-info/LICENSE,sha256=KMhUHh6pnIUvmXDW-49L_Sz63bqkOlPDqsecaqKiitU,1091
105
- je_editor-0.0.184.dist-info/METADATA,sha256=4sWldT_Gn7Erq3OIbIPZ-fsoUR70sTBgE-KpUOPjbgk,3338
106
- je_editor-0.0.184.dist-info/WHEEL,sha256=PZUExdf71Ui_so67QXpySuHtCi3-J3wvF4ORK6k_S8U,91
107
- je_editor-0.0.184.dist-info/top_level.txt,sha256=_9YA7BgxpkmdLs-5V_UQILxClcMRgPyG1a3qaE-Bkcs,10
108
- je_editor-0.0.184.dist-info/RECORD,,
104
+ je_editor-0.0.186.dist-info/LICENSE,sha256=KMhUHh6pnIUvmXDW-49L_Sz63bqkOlPDqsecaqKiitU,1091
105
+ je_editor-0.0.186.dist-info/METADATA,sha256=vswKw1PvKm_lGoH1xiBMNnI8nK8EHewCg5CGm8tfmz4,3338
106
+ je_editor-0.0.186.dist-info/WHEEL,sha256=PZUExdf71Ui_so67QXpySuHtCi3-J3wvF4ORK6k_S8U,91
107
+ je_editor-0.0.186.dist-info/top_level.txt,sha256=_9YA7BgxpkmdLs-5V_UQILxClcMRgPyG1a3qaE-Bkcs,10
108
+ je_editor-0.0.186.dist-info/RECORD,,