Skip to content

Commit

Permalink
Merge pull request #76 from Integration-Automation/dev
Browse files Browse the repository at this point in the history
Fix windows problem and update README
  • Loading branch information
JE-Chen authored Jul 16, 2024
2 parents 894a825 + e8f5480 commit 72be40d
Show file tree
Hide file tree
Showing 5 changed files with 33 additions and 24 deletions.
8 changes: 7 additions & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -14,6 +14,12 @@

[Using this IDE edit tkinter video](https://www.youtube.com/watch?v=VXm8L2qrdSU&ab_channel=JEChen)

---

## Notice
> * If you can't run program and get argument or internal error on windows, Please update your powershell.
> * https://github.com/PowerShell/PowerShell/releases
---
## What is Automation Editor
> Project Kanban \
Expand Down Expand Up @@ -49,4 +55,4 @@
### install
> pip install automation_editor
![Architecture Diagram](architecture_diagram/AutomationEditorArchitectureDiagram.drawio.png)
![Architecture Diagram](architecture_diagram/AutomationEditorArchitectureDiagram.drawio.png)
29 changes: 16 additions & 13 deletions automation_editor/extend/process_executor/task_process_manager.py
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
import json
import queue
import subprocess
import sys
Expand Down Expand Up @@ -53,21 +54,24 @@ def renew_path(self) -> None:

def start_test_process(self, package: str, exec_str: str):
self.renew_path()
args = [
self.compiler_path,
"-m",
package,
"--execute_str",
exec_str
]
if sys.platform not in ["win32", "cygwin", "msys"]:
if sys.platform in ["win32", "cygwin", "msys"]:
exec_str = json.dumps(exec_str)
args = [
self.compiler_path,
"-m",
package,
"--execute_str",
exec_str
]
else:
args = " ".join([f"{self.compiler_path}", f"-m {package}", "--execute_str", f"{exec_str}"])
print(args)
self.process: subprocess.Popen = subprocess.Popen(
args,
stdin=subprocess.PIPE,
stdout=subprocess.PIPE,
stderr=subprocess.PIPE,
shell=True
shell=True,
encoding=self.program_encoding
)
self.still_run_program = True
# program output message queue thread
Expand Down Expand Up @@ -145,16 +149,15 @@ def print_and_clear_queue(self):
def read_program_output_from_process(self):
while self.still_run_program:
self.process: subprocess.Popen
program_output_data = self.process.stdout.read(self.program_buffer_size).decode(self.program_encoding)
program_output_data = self.process.stdout.read(self.program_buffer_size)
if self.process:
self.process.stdout.flush()
if program_output_data.strip() != "":
self.run_output_queue.put(program_output_data)

def read_program_error_output_from_process(self):
while self.still_run_program:
program_error_output_data = self.process.stderr.read(self.program_buffer_size).decode(
self.program_encoding)
program_error_output_data = self.process.stderr.read(self.program_buffer_size)
if self.process:
self.process.stderr.flush()
if program_error_output_data.strip() != "":
Expand Down
4 changes: 2 additions & 2 deletions dev_requirements.txt
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
wheel
build
twine
sphinx
sphinx-rtd-theme
Expand All @@ -8,4 +8,4 @@ je-load-density
je-auto-control
je-web-runner
je-mail-thunder
automation_editor_dev
automation_editor_dev
8 changes: 4 additions & 4 deletions pyproject.toml
Original file line number Diff line number Diff line change
@@ -1,12 +1,12 @@
# Rename to build stable version
# This is stable version
# Rename to dev version
# This is dev version
[build-system]
requires = ["setuptools>=61.0"]
build-backend = "setuptools.build_meta"

[project]
name = "automation_editor"
version = "0.0.33"
name = "automation_editor_dev"
version = "0.0.34"
authors = [
{ name = "JE-Chen", email = "[email protected]" },
]
Expand Down
8 changes: 4 additions & 4 deletions dev.toml → stable.toml
Original file line number Diff line number Diff line change
@@ -1,12 +1,12 @@
# Rename to dev version
# This is dev version
# Rename to build stable version
# This is stable version
[build-system]
requires = ["setuptools>=61.0"]
build-backend = "setuptools.build_meta"

[project]
name = "automation_editor_dev"
version = "0.0.33"
name = "automation_editor"
version = "0.0.34"
authors = [
{ name = "JE-Chen", email = "[email protected]" },
]
Expand Down

0 comments on commit 72be40d

Please sign in to comment.