je-editor 0.0.106__tar.gz → 0.0.108__tar.gz

Sign up to get free protection for your applications and to get access to all the features.
Files changed (74) hide show
  1. {je_editor-0.0.106 → je_editor-0.0.108}/PKG-INFO +1 -1
  2. {je_editor-0.0.106 → je_editor-0.0.108}/je_editor/__init__.py +3 -1
  3. {je_editor-0.0.106 → je_editor-0.0.108}/je_editor/pyside_ui/code_process/code_exec.py +27 -28
  4. {je_editor-0.0.106 → je_editor-0.0.108}/je_editor/pyside_ui/menu/menu_bar/venv_menu/build_venv_menu.py +6 -34
  5. {je_editor-0.0.106 → je_editor-0.0.108}/je_editor/pyside_ui/shell_process/shell_exec.py +32 -3
  6. {je_editor-0.0.106 → je_editor-0.0.108}/je_editor.egg-info/PKG-INFO +1 -1
  7. {je_editor-0.0.106 → je_editor-0.0.108}/pyproject.toml +1 -1
  8. {je_editor-0.0.106 → je_editor-0.0.108}/LICENSE +0 -0
  9. {je_editor-0.0.106 → je_editor-0.0.108}/README.md +0 -0
  10. {je_editor-0.0.106 → je_editor-0.0.108}/je_editor/__main__.py +0 -0
  11. {je_editor-0.0.106 → je_editor-0.0.108}/je_editor/pyside_ui/__init__.py +0 -0
  12. {je_editor-0.0.106 → je_editor-0.0.108}/je_editor/pyside_ui/auto_save/__init__.py +0 -0
  13. {je_editor-0.0.106 → je_editor-0.0.108}/je_editor/pyside_ui/auto_save/auto_save_thread.py +0 -0
  14. {je_editor-0.0.106 → je_editor-0.0.108}/je_editor/pyside_ui/code_editor/__init__.py +0 -0
  15. {je_editor-0.0.106 → je_editor-0.0.108}/je_editor/pyside_ui/code_editor/code_edit_plaintext.py +0 -0
  16. {je_editor-0.0.106 → je_editor-0.0.108}/je_editor/pyside_ui/code_process/__init__.py +0 -0
  17. {je_editor-0.0.106 → je_editor-0.0.108}/je_editor/pyside_ui/code_result/__init__.py +0 -0
  18. {je_editor-0.0.106 → je_editor-0.0.108}/je_editor/pyside_ui/code_result/code_record.py +0 -0
  19. {je_editor-0.0.106 → je_editor-0.0.108}/je_editor/pyside_ui/colors/__init__.py +0 -0
  20. {je_editor-0.0.106 → je_editor-0.0.108}/je_editor/pyside_ui/colors/global_color.py +0 -0
  21. {je_editor-0.0.106 → je_editor-0.0.108}/je_editor/pyside_ui/file_dialog/__init__.py +0 -0
  22. {je_editor-0.0.106 → je_editor-0.0.108}/je_editor/pyside_ui/file_dialog/open_file_dialog.py +0 -0
  23. {je_editor-0.0.106 → je_editor-0.0.108}/je_editor/pyside_ui/file_dialog/save_file_dialog.py +0 -0
  24. {je_editor-0.0.106 → je_editor-0.0.108}/je_editor/pyside_ui/main_ui/__init__.py +0 -0
  25. {je_editor-0.0.106 → je_editor-0.0.108}/je_editor/pyside_ui/main_ui/editor_main_ui/__init__.py +0 -0
  26. {je_editor-0.0.106 → je_editor-0.0.108}/je_editor/pyside_ui/main_ui/editor_main_ui/main_editor.py +0 -0
  27. {je_editor-0.0.106 → je_editor-0.0.108}/je_editor/pyside_ui/main_ui_setting/__init__.py +0 -0
  28. {je_editor-0.0.106 → je_editor-0.0.108}/je_editor/pyside_ui/main_ui_setting/ui_setting.py +0 -0
  29. {je_editor-0.0.106 → je_editor-0.0.108}/je_editor/pyside_ui/menu/__init__.py +0 -0
  30. {je_editor-0.0.106 → je_editor-0.0.108}/je_editor/pyside_ui/menu/menu_bar/__init__.py +0 -0
  31. {je_editor-0.0.106 → je_editor-0.0.108}/je_editor/pyside_ui/menu/menu_bar/check_style_menu/__init__.py +0 -0
  32. {je_editor-0.0.106 → je_editor-0.0.108}/je_editor/pyside_ui/menu/menu_bar/check_style_menu/build_check_style_menu.py +0 -0
  33. {je_editor-0.0.106 → je_editor-0.0.108}/je_editor/pyside_ui/menu/menu_bar/file_menu/__init__.py +0 -0
  34. {je_editor-0.0.106 → je_editor-0.0.108}/je_editor/pyside_ui/menu/menu_bar/file_menu/build_file_menu.py +0 -0
  35. {je_editor-0.0.106 → je_editor-0.0.108}/je_editor/pyside_ui/menu/menu_bar/help_menu/__init__.py +0 -0
  36. {je_editor-0.0.106 → je_editor-0.0.108}/je_editor/pyside_ui/menu/menu_bar/help_menu/build_help_menu.py +0 -0
  37. {je_editor-0.0.106 → je_editor-0.0.108}/je_editor/pyside_ui/menu/menu_bar/run_menu/__init__.py +0 -0
  38. {je_editor-0.0.106 → je_editor-0.0.108}/je_editor/pyside_ui/menu/menu_bar/run_menu/build_run_menu.py +0 -0
  39. {je_editor-0.0.106 → je_editor-0.0.108}/je_editor/pyside_ui/menu/menu_bar/set_menu_bar.py +0 -0
  40. {je_editor-0.0.106 → je_editor-0.0.108}/je_editor/pyside_ui/menu/menu_bar/venv_menu/__init__.py +0 -0
  41. {je_editor-0.0.106 → je_editor-0.0.108}/je_editor/pyside_ui/search_ui/__init__.py +0 -0
  42. {je_editor-0.0.106 → je_editor-0.0.108}/je_editor/pyside_ui/search_ui/search_error_box.py +0 -0
  43. {je_editor-0.0.106 → je_editor-0.0.108}/je_editor/pyside_ui/search_ui/search_text_box.py +0 -0
  44. {je_editor-0.0.106 → je_editor-0.0.108}/je_editor/pyside_ui/shell_process/__init__.py +0 -0
  45. {je_editor-0.0.106 → je_editor-0.0.108}/je_editor/pyside_ui/syntax/__init__.py +0 -0
  46. {je_editor-0.0.106 → je_editor-0.0.108}/je_editor/pyside_ui/syntax/python_syntax.py +0 -0
  47. {je_editor-0.0.106 → je_editor-0.0.108}/je_editor/pyside_ui/treeview/__init__.py +0 -0
  48. {je_editor-0.0.106 → je_editor-0.0.108}/je_editor/pyside_ui/treeview/project_treeview/__init__.py +0 -0
  49. {je_editor-0.0.106 → je_editor-0.0.108}/je_editor/pyside_ui/treeview/project_treeview/set_project_treeview.py +0 -0
  50. {je_editor-0.0.106 → je_editor-0.0.108}/je_editor/pyside_ui/user_setting/__init__.py +0 -0
  51. {je_editor-0.0.106 → je_editor-0.0.108}/je_editor/pyside_ui/user_setting/user_setting_file.py +0 -0
  52. {je_editor-0.0.106 → je_editor-0.0.108}/je_editor/start_editor.py +0 -0
  53. {je_editor-0.0.106 → je_editor-0.0.108}/je_editor/utils/__init__.py +0 -0
  54. {je_editor-0.0.106 → je_editor-0.0.108}/je_editor/utils/encodings/__init__.py +0 -0
  55. {je_editor-0.0.106 → je_editor-0.0.108}/je_editor/utils/encodings/python_encodings.py +0 -0
  56. {je_editor-0.0.106 → je_editor-0.0.108}/je_editor/utils/exception/__init__.py +0 -0
  57. {je_editor-0.0.106 → je_editor-0.0.108}/je_editor/utils/exception/exception_tags.py +0 -0
  58. {je_editor-0.0.106 → je_editor-0.0.108}/je_editor/utils/exception/exceptions.py +0 -0
  59. {je_editor-0.0.106 → je_editor-0.0.108}/je_editor/utils/file/__init__.py +0 -0
  60. {je_editor-0.0.106 → je_editor-0.0.108}/je_editor/utils/file/open/__init__.py +0 -0
  61. {je_editor-0.0.106 → je_editor-0.0.108}/je_editor/utils/file/open/open_file.py +0 -0
  62. {je_editor-0.0.106 → je_editor-0.0.108}/je_editor/utils/file/save/__init__.py +0 -0
  63. {je_editor-0.0.106 → je_editor-0.0.108}/je_editor/utils/file/save/save_file.py +0 -0
  64. {je_editor-0.0.106 → je_editor-0.0.108}/je_editor/utils/json/__init__.py +0 -0
  65. {je_editor-0.0.106 → je_editor-0.0.108}/je_editor/utils/json/json_file.py +0 -0
  66. {je_editor-0.0.106 → je_editor-0.0.108}/je_editor/utils/json_format/__init__.py +0 -0
  67. {je_editor-0.0.106 → je_editor-0.0.108}/je_editor/utils/json_format/json_process.py +0 -0
  68. {je_editor-0.0.106 → je_editor-0.0.108}/je_editor/utils/redirect_manager/__init__.py +0 -0
  69. {je_editor-0.0.106 → je_editor-0.0.108}/je_editor/utils/redirect_manager/redirect_manager_class.py +0 -0
  70. {je_editor-0.0.106 → je_editor-0.0.108}/je_editor.egg-info/SOURCES.txt +0 -0
  71. {je_editor-0.0.106 → je_editor-0.0.108}/je_editor.egg-info/dependency_links.txt +0 -0
  72. {je_editor-0.0.106 → je_editor-0.0.108}/je_editor.egg-info/requires.txt +0 -0
  73. {je_editor-0.0.106 → je_editor-0.0.108}/je_editor.egg-info/top_level.txt +0 -0
  74. {je_editor-0.0.106 → je_editor-0.0.108}/setup.cfg +0 -0
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.1
2
2
  Name: je_editor
3
- Version: 0.0.106
3
+ Version: 0.0.108
4
4
  Summary: JEditor is basic but powerful editor for python
5
5
  Author-email: JE-Chen <jechenmailman@gmail.com>
6
6
  License: MIT
@@ -16,7 +16,9 @@ from je_editor.pyside_ui.colors.global_color import error_color
16
16
  from je_editor.pyside_ui.colors.global_color import output_color
17
17
  # Exec and shell
18
18
  from je_editor.pyside_ui.code_process.code_exec import exec_manage
19
+ from je_editor.pyside_ui.code_process.code_exec import ExecManager
19
20
  from je_editor.pyside_ui.shell_process.shell_exec import default_shell_manager
21
+ from je_editor.pyside_ui.shell_process.shell_exec import ShellManager
20
22
 
21
23
  __all__ = [
22
24
  "start_editor", "EditorMain",
@@ -25,5 +27,5 @@ __all__ = [
25
27
  "JEditorOpenFileException", "JEditorContentFileException",
26
28
  "JEditorCantFindLanguageException", "JEditorJsonException",
27
29
  "error_color", "output_color",
28
- "exec_manage", "default_shell_manager"
30
+ "exec_manage", "default_shell_manager", "ExecManager", "ShellManager"
29
31
  ]
@@ -11,7 +11,6 @@ from PySide6.QtWidgets import QMainWindow, QTextEdit
11
11
 
12
12
  from je_editor.pyside_ui.colors.global_color import error_color, output_color
13
13
  from je_editor.utils.exception.exception_tags import compiler_not_found_error, je_editor_init_error
14
- from je_editor.utils.exception.exception_tags import file_not_fond_error
15
14
  from je_editor.utils.exception.exceptions import JEditorExecException, JEditorException
16
15
 
17
16
 
@@ -32,6 +31,7 @@ class ExecManager(object):
32
31
  self.read_program_error_output_from_thread = None
33
32
  self.read_program_output_from_thread = None
34
33
  self.main_window: QMainWindow = main_window
34
+ self.compiler_path = None
35
35
  self.code_result: [QTextEdit, None] = None
36
36
  self.timer: [QTimer, None] = None
37
37
  self.still_run_program = True
@@ -41,6 +41,30 @@ class ExecManager(object):
41
41
  self.program_language = program_language
42
42
  self.program_encoding = program_encoding
43
43
  self.program_buffer = program_buffer
44
+ self.renew_path()
45
+
46
+ def renew_path(self):
47
+
48
+ if sys.platform in ["win32", "cygwin", "msys"]:
49
+ venv_path = Path(os.getcwd() + "/venv/Scripts")
50
+ else:
51
+ venv_path = Path(os.getcwd() + "/venv/bin")
52
+ if venv_path.is_dir() and venv_path.exists():
53
+ self.compiler_path = shutil.which(
54
+ cmd="python3",
55
+ path=str(venv_path)
56
+ )
57
+ else:
58
+ self.compiler_path = shutil.which(cmd="python3")
59
+ if self.compiler_path is None:
60
+ self.compiler_path = shutil.which(
61
+ cmd="python",
62
+ path=str(venv_path)
63
+ )
64
+ else:
65
+ self.compiler_path = shutil.which(cmd="python")
66
+ if self.compiler_path is None:
67
+ raise JEditorExecException(compiler_not_found_error)
44
68
 
45
69
  def later_init(self):
46
70
  if self.main_window is not None:
@@ -59,34 +83,9 @@ class ExecManager(object):
59
83
  self.code_result.setPlainText("")
60
84
  reformat_os_file_path = os.path.abspath(exec_file_name)
61
85
  # detect file is exist
62
- try:
63
- if not Path(exec_file_name).exists():
64
- raise JEditorExecException(file_not_fond_error)
65
- except OSError as error:
66
- raise JEditorExecException(error)
67
- if sys.platform in ["win32", "cygwin", "msys"]:
68
- venv_path = Path(os.getcwd() + "/venv/Scripts")
69
- else:
70
- venv_path = Path(os.getcwd() + "/venv/bin")
71
- if venv_path.is_dir() and venv_path.exists():
72
- compiler_path = shutil.which(
73
- cmd="python3",
74
- path=str(venv_path)
75
- )
76
- else:
77
- compiler_path = shutil.which(cmd="python3")
78
- if compiler_path is None:
79
- compiler_path = shutil.which(
80
- cmd="python",
81
- path=str(venv_path)
82
- )
83
- else:
84
- compiler_path = shutil.which(cmd="python")
85
- if compiler_path is None:
86
- raise JEditorExecException(compiler_not_found_error)
87
86
  exec_file = reformat_os_file_path
88
87
  # run program
89
- execute_program_list = [compiler_path, exec_file]
88
+ execute_program_list = [self.compiler_path, exec_file]
90
89
  self.process = subprocess.Popen(
91
90
  execute_program_list,
92
91
  stdout=subprocess.PIPE,
@@ -107,7 +106,7 @@ class ExecManager(object):
107
106
  )
108
107
  self.read_program_error_output_from_thread.start()
109
108
  # show which file execute
110
- self.code_result.append(compiler_path + " " + reformat_os_file_path)
109
+ self.code_result.append(self.compiler_path + " " + reformat_os_file_path)
111
110
  # start tkinter_ui update
112
111
  # start timer
113
112
  self.timer = QTimer(self.main_window)
@@ -1,6 +1,4 @@
1
1
  import os
2
- import shutil
3
- import sys
4
2
  from pathlib import Path
5
3
 
6
4
  from PySide6.QtGui import QAction
@@ -10,12 +8,6 @@ from je_editor.pyside_ui.shell_process.shell_exec import ShellManager
10
8
 
11
9
 
12
10
  def set_venv_menu(ui_we_want_to_set: QMainWindow):
13
- # Install virtualenv
14
- ui_we_want_to_set.venv_menu.install_virtualenv_action = QAction("Install virtualenv")
15
- ui_we_want_to_set.venv_menu.install_virtualenv_action.triggered.connect(
16
- lambda: install_virtualenv(ui_we_want_to_set)
17
- )
18
- ui_we_want_to_set.venv_menu.addAction(ui_we_want_to_set.venv_menu.install_virtualenv_action)
19
11
  # Create an venv
20
12
  ui_we_want_to_set.venv_menu.create_venv_action = QAction("Create Venv")
21
13
  ui_we_want_to_set.venv_menu.create_venv_action.setShortcut(
@@ -36,18 +28,14 @@ def set_venv_menu(ui_we_want_to_set: QMainWindow):
36
28
  ui_we_want_to_set.venv_menu.addAction(ui_we_want_to_set.venv_menu.pip_action)
37
29
 
38
30
 
39
- def install_virtualenv(ui_we_want_to_set: QMainWindow):
40
- install_virtualenv_shell = ShellManager(main_window=ui_we_want_to_set)
41
- install_virtualenv_shell.later_init()
42
- install_virtualenv_shell.exec_shell("python -m pip install virtualenv")
43
-
44
-
45
31
  def create_venv(ui_we_want_to_set: QMainWindow):
46
32
  venv_path = Path(os.getcwd() + "/venv")
47
33
  if not venv_path.exists():
48
34
  create_venv_shell = ShellManager(main_window=ui_we_want_to_set)
49
35
  create_venv_shell.later_init()
50
- create_venv_shell.exec_shell("python -m virtualenv venv")
36
+ create_venv_shell.exec_shell(
37
+ [f"{create_venv_shell.compiler_path}", "-m", "venv", "venv"]
38
+ )
51
39
  print("Creating venv please waiting for shell exit code.")
52
40
  else:
53
41
  message_box = QMessageBox()
@@ -67,24 +55,8 @@ def pip_install_package(ui_we_want_to_set: QMainWindow):
67
55
  ui_we_want_to_set, "Install Package", "What Package you want to install"
68
56
  )
69
57
  if press_ok:
70
- if sys.platform in ["win32", "cygwin", "msys"]:
71
- venv_path = Path(os.getcwd() + "/venv/Scripts")
72
- else:
73
- venv_path = Path(os.getcwd() + "/venv/bin")
74
- if venv_path.is_dir() and venv_path.exists():
75
- compiler_path = shutil.which(
76
- cmd="python3",
77
- path=str(venv_path)
78
- )
79
- else:
80
- compiler_path = shutil.which(cmd="python3")
81
- if compiler_path is None:
82
- compiler_path = shutil.which(
83
- cmd="python",
84
- path=str(venv_path)
85
- )
86
- else:
87
- compiler_path = shutil.which(cmd="python")
88
58
  pip_install_shell = ShellManager(main_window=ui_we_want_to_set)
89
59
  pip_install_shell.later_init()
90
- pip_install_shell.exec_shell(f"{compiler_path} -m pip install {package_text}")
60
+ pip_install_shell.exec_shell(
61
+ [f"{pip_install_shell.compiler_path}", "-m", "pip", "install", f"{package_text}"]
62
+ )
@@ -1,15 +1,18 @@
1
+ import os
1
2
  import queue
2
3
  import shlex
4
+ import shutil
3
5
  import subprocess
4
6
  import sys
7
+ from pathlib import Path
5
8
  from threading import Thread
6
9
 
7
10
  from PySide6.QtCore import QTimer
8
11
  from PySide6.QtWidgets import QMainWindow, QTextEdit
9
12
 
10
13
  from je_editor.pyside_ui.colors.global_color import error_color, output_color
11
- from je_editor.utils.exception.exception_tags import je_editor_init_error
12
- from je_editor.utils.exception.exceptions import JEditorException
14
+ from je_editor.utils.exception.exception_tags import je_editor_init_error, compiler_not_found_error
15
+ from je_editor.utils.exception.exceptions import JEditorException, JEditorExecException
13
16
 
14
17
 
15
18
  class ShellManager(object):
@@ -26,6 +29,7 @@ class ShellManager(object):
26
29
  self.read_program_error_output_from_thread = None
27
30
  self.read_program_output_from_thread = None
28
31
  self.main_window: QMainWindow = main_window
32
+ self.compiler_path = None
29
33
  self.code_result: [QTextEdit, None] = None
30
34
  self.timer: [QTimer, None] = None
31
35
  self.still_run_shell: bool = True
@@ -34,6 +38,30 @@ class ShellManager(object):
34
38
  self.run_error_queue: queue = queue.Queue()
35
39
  self.program_encoding: str = shell_encoding
36
40
  self.program_buffer: int = program_buffer
41
+ self.renew_path()
42
+
43
+ def renew_path(self):
44
+
45
+ if sys.platform in ["win32", "cygwin", "msys"]:
46
+ venv_path = Path(os.getcwd() + "/venv/Scripts")
47
+ else:
48
+ venv_path = Path(os.getcwd() + "/venv/bin")
49
+ if venv_path.is_dir() and venv_path.exists():
50
+ self.compiler_path = shutil.which(
51
+ cmd="python3",
52
+ path=str(venv_path)
53
+ )
54
+ else:
55
+ self.compiler_path = shutil.which(cmd="python3")
56
+ if self.compiler_path is None:
57
+ self.compiler_path = shutil.which(
58
+ cmd="python",
59
+ path=str(venv_path)
60
+ )
61
+ else:
62
+ self.compiler_path = shutil.which(cmd="python")
63
+ if self.compiler_path is None:
64
+ raise JEditorExecException(compiler_not_found_error)
37
65
 
38
66
  def later_init(self):
39
67
  if self.main_window is not None:
@@ -53,8 +81,9 @@ class ShellManager(object):
53
81
  args = shell_command
54
82
  else:
55
83
  args = shlex.split(shell_command)
84
+ print(args)
56
85
  self.process = subprocess.Popen(
57
- args,
86
+ args=args,
58
87
  stdout=subprocess.PIPE,
59
88
  stderr=subprocess.PIPE,
60
89
  shell=True,
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.1
2
2
  Name: je-editor
3
- Version: 0.0.106
3
+ Version: 0.0.108
4
4
  Summary: JEditor is basic but powerful editor for python
5
5
  Author-email: JE-Chen <jechenmailman@gmail.com>
6
6
  License: MIT
@@ -6,7 +6,7 @@ build-backend = "setuptools.build_meta"
6
6
 
7
7
  [project]
8
8
  name = "je_editor"
9
- version = "0.0.106"
9
+ version = "0.0.108"
10
10
  authors = [
11
11
  { name = "JE-Chen", email = "jechenmailman@gmail.com" },
12
12
  ]
File without changes
File without changes
File without changes