computer-use-ootb-internal 0.0.182__py3-none-any.whl → 0.0.184__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.
- computer_use_ootb_internal/guard_service.py +26 -18
- computer_use_ootb_internal/preparation/excel_prepare.py +16 -13
- computer_use_ootb_internal/preparation/powerpoint_prepare.py +11 -7
- computer_use_ootb_internal/preparation/pr_prepare.py +17 -14
- computer_use_ootb_internal/preparation/word_prepare.py +16 -13
- {computer_use_ootb_internal-0.0.182.dist-info → computer_use_ootb_internal-0.0.184.dist-info}/METADATA +1 -1
- {computer_use_ootb_internal-0.0.182.dist-info → computer_use_ootb_internal-0.0.184.dist-info}/RECORD +9 -9
- {computer_use_ootb_internal-0.0.182.dist-info → computer_use_ootb_internal-0.0.184.dist-info}/WHEEL +0 -0
- {computer_use_ootb_internal-0.0.182.dist-info → computer_use_ootb_internal-0.0.184.dist-info}/entry_points.txt +0 -0
@@ -822,39 +822,47 @@ class GuardService(win32serviceutil.ServiceFramework):
|
|
822
822
|
self.log_error(f"Cannot create task for {username}: sys.executable is not found.")
|
823
823
|
return False
|
824
824
|
|
825
|
-
#
|
826
|
-
python_exe =
|
827
|
-
if
|
828
|
-
|
825
|
+
# Find the correct python.exe/pythonw.exe from the environment
|
826
|
+
python_exe = self._get_python_executable_from_target_exe()
|
827
|
+
if not python_exe:
|
828
|
+
self.log_error(f"Cannot create task for {username}: Failed to find associated python executable via _get_python_executable_from_target_exe.")
|
829
|
+
return False
|
829
830
|
|
830
|
-
|
831
|
-
|
832
|
-
|
831
|
+
# Prepare paths and arguments carefully for PowerShell
|
832
|
+
action_executable_path = python_exe.strip("'\"") # Remove potential existing quotes
|
833
|
+
script_path = self.signal_script_path.strip("'\"")
|
834
|
+
user_arg = username # Assuming username has no special chars needing escape within PS
|
835
|
+
|
833
836
|
# Ensure script path is quoted if needed
|
834
|
-
|
837
|
+
quoted_script_path = f'""{script_path}""' if ' ' in script_path else script_path # Use "" for literal quotes inside PS string
|
835
838
|
# Username might need quoting if it contains spaces, though unlikely
|
836
|
-
|
837
|
-
|
838
|
-
safe_action_executable = action_executable.replace("'", "''") # Escape for PS
|
839
|
-
safe_action_arguments = action_arguments.replace("'", "''") # Escape for PS
|
839
|
+
# Construct the argument string passed TO python.exe: "script_path" username
|
840
|
+
python_arguments = f'{quoted_script_path} {user_arg}'
|
840
841
|
|
841
842
|
# Working directory for the script (likely its own directory)
|
842
843
|
try:
|
843
|
-
script_dir = os.path.dirname(
|
844
|
+
script_dir = os.path.dirname(script_path)
|
844
845
|
if not script_dir: script_dir = "."
|
845
|
-
|
846
|
-
|
846
|
+
# Escape single quotes for PowerShell string literal
|
847
|
+
ps_escaped_working_directory = script_dir.replace("'", "''")
|
848
|
+
working_directory_setting = f"$action.WorkingDirectory = '{ps_escaped_working_directory}'"
|
847
849
|
except Exception as e:
|
848
850
|
self.log_error(f"Error determining working directory for signal script task: {e}. WD will not be set.")
|
849
851
|
working_directory_setting = "# Could not set WorkingDirectory"
|
850
852
|
|
853
|
+
# Escape paths and args for embedding in PowerShell command string
|
854
|
+
ps_escaped_executable = action_executable_path.replace("'", "''")
|
855
|
+
ps_escaped_arguments = python_arguments.replace("'", "''")
|
856
|
+
ps_escaped_username = username.replace("'", "''")
|
857
|
+
task_name = f"OOTB_UserConnect_{username}"
|
858
|
+
|
851
859
|
# PowerShell command construction
|
852
860
|
ps_command = f"""
|
853
|
-
$taskName = "{task_name}"
|
854
|
-
$principal = New-ScheduledTaskPrincipal -UserId
|
861
|
+
$taskName = \"{task_name}\"
|
862
|
+
$principal = New-ScheduledTaskPrincipal -UserId '{ps_escaped_username}' -LogonType Interactive
|
855
863
|
|
856
864
|
# Action: Run python signal script
|
857
|
-
$action = New-ScheduledTaskAction -Execute '{
|
865
|
+
$action = New-ScheduledTaskAction -Execute '{ps_escaped_executable}' -Argument '{ps_escaped_arguments}'
|
858
866
|
{working_directory_setting}
|
859
867
|
|
860
868
|
# Trigger: At Logon for the specified user
|
@@ -75,21 +75,24 @@ def run_preparation(state):
|
|
75
75
|
# --- End of kill process ---
|
76
76
|
|
77
77
|
# Open the file with Excel maximized on Windows
|
78
|
-
log.info(f"Attempting to open {template_file} with Excel maximized on Windows...")
|
79
78
|
try:
|
80
|
-
#
|
81
|
-
|
82
|
-
|
83
|
-
|
84
|
-
|
85
|
-
|
79
|
+
# Check if template exists and construct command accordingly
|
80
|
+
if template_file.exists():
|
81
|
+
log.info(f"Template file found. Attempting to open {template_file} with Excel maximized...")
|
82
|
+
cmd = ['cmd', '/c', 'start', '/max', 'excel', str(template_file)]
|
83
|
+
else:
|
84
|
+
log.info(f"Template file not found. Attempting to launch Excel maximized...")
|
85
|
+
cmd = ['cmd', '/c', 'start', '/max', 'excel']
|
86
|
+
|
87
|
+
log.info(f"Executing command: {' '.join(cmd)}")
|
88
|
+
result = subprocess.run(cmd, check=False, capture_output=True, text=True, creationflags=subprocess.CREATE_NO_WINDOW) # Add CREATE_NO_WINDOW
|
86
89
|
|
87
|
-
|
88
|
-
|
89
|
-
|
90
|
-
|
91
|
-
|
92
|
-
|
90
|
+
if result.returncode == 0:
|
91
|
+
log.info(f"Successfully executed command for Excel.")
|
92
|
+
else:
|
93
|
+
log.error(f"Error opening Excel: {result.stderr.strip()}")
|
94
|
+
if result.stdout:
|
95
|
+
log.error(f"Stdout from start command: {result.stdout.strip()}")
|
93
96
|
except FileNotFoundError:
|
94
97
|
log.error("Error: 'cmd' or 'start' command not found. Ensure system PATH is configured correctly.")
|
95
98
|
except Exception as e:
|
@@ -77,18 +77,22 @@ def run_preparation(state):
|
|
77
77
|
# --- End of kill process ---
|
78
78
|
|
79
79
|
# Open the file with PowerPoint maximized on Windows
|
80
|
-
log.info(f"Attempting to open {template_file} with PowerPoint maximized on Windows...")
|
81
80
|
try:
|
82
|
-
#
|
83
|
-
|
84
|
-
|
81
|
+
# Check if template exists and construct command accordingly
|
82
|
+
if template_file.exists():
|
83
|
+
log.info(f"Template file found. Attempting to open {template_file} with PowerPoint maximized...")
|
84
|
+
cmd = ['cmd', '/c', 'start', '/max', 'powerpnt', str(template_file)]
|
85
|
+
else:
|
86
|
+
log.info(f"Template file not found. Attempting to launch PowerPoint maximized...")
|
87
|
+
cmd = ['cmd', '/c', 'start', '/max', 'powerpnt']
|
88
|
+
|
89
|
+
log.info(f"Executing command: {' '.join(cmd)}")
|
90
|
+
result = subprocess.run(cmd, check=False, capture_output=True, text=True, creationflags=subprocess.CREATE_NO_WINDOW) # Add CREATE_NO_WINDOW
|
85
91
|
|
86
92
|
if result.returncode == 0:
|
87
|
-
log.info(f"Successfully
|
93
|
+
log.info(f"Successfully executed command for PowerPoint.")
|
88
94
|
else:
|
89
|
-
# Log stderr for debugging potential start command issues
|
90
95
|
log.error(f"Error opening PowerPoint: {result.stderr.strip()}")
|
91
|
-
# Also log stdout as start command might output info there
|
92
96
|
if result.stdout:
|
93
97
|
log.error(f"Stdout from start command: {result.stdout.strip()}")
|
94
98
|
except FileNotFoundError:
|
@@ -76,22 +76,25 @@ def run_preparation(state):
|
|
76
76
|
# --- End of kill process ---
|
77
77
|
|
78
78
|
# Open the file with Premiere Pro maximized on Windows
|
79
|
-
log.info(f"Attempting to open {template_file} with Premiere Pro maximized on Windows...")
|
80
79
|
try:
|
81
|
-
#
|
82
|
-
|
83
|
-
|
84
|
-
|
85
|
-
|
86
|
-
|
87
|
-
|
80
|
+
# Check if template exists and construct command accordingly
|
81
|
+
if template_file.exists():
|
82
|
+
log.info(f"Template file found. Attempting to open {template_file} with Premiere Pro maximized...")
|
83
|
+
# Keep quotes around app name if it contains spaces
|
84
|
+
cmd = ['cmd', '/c', 'start', '/max', '"Adobe Premiere Pro 2024"', str(template_file)]
|
85
|
+
else:
|
86
|
+
log.info(f"Template file not found. Attempting to launch Premiere Pro maximized...")
|
87
|
+
cmd = ['cmd', '/c', 'start', '/max', '"Adobe Premiere Pro 2024"']
|
88
|
+
|
89
|
+
log.info(f"Executing command: {' '.join(cmd)}")
|
90
|
+
result = subprocess.run(cmd, check=False, capture_output=True, text=True, creationflags=subprocess.CREATE_NO_WINDOW) # Add CREATE_NO_WINDOW
|
88
91
|
|
89
|
-
|
90
|
-
|
91
|
-
|
92
|
-
|
93
|
-
|
94
|
-
|
92
|
+
if result.returncode == 0:
|
93
|
+
log.info(f"Successfully executed command for Premiere Pro.")
|
94
|
+
else:
|
95
|
+
log.error(f"Error opening Premiere Pro: {result.stderr.strip()}")
|
96
|
+
if result.stdout:
|
97
|
+
log.error(f"Stdout from start command: {result.stdout.strip()}")
|
95
98
|
except FileNotFoundError:
|
96
99
|
log.error("Error: 'cmd' or 'start' command not found. Ensure system PATH is configured correctly.")
|
97
100
|
except Exception as e:
|
@@ -75,21 +75,24 @@ def run_preparation(state):
|
|
75
75
|
# --- End of kill process ---
|
76
76
|
|
77
77
|
# Open the file with Word maximized on Windows
|
78
|
-
log.info(f"Attempting to open {template_file} with Word maximized on Windows...")
|
79
78
|
try:
|
80
|
-
#
|
81
|
-
|
82
|
-
|
83
|
-
|
84
|
-
|
85
|
-
|
79
|
+
# Check if template exists and construct command accordingly
|
80
|
+
if template_file.exists():
|
81
|
+
log.info(f"Template file found. Attempting to open {template_file} with Word maximized...")
|
82
|
+
cmd = ['cmd', '/c', 'start', '/max', 'winword', str(template_file)]
|
83
|
+
else:
|
84
|
+
log.info(f"Template file not found. Attempting to launch Word maximized...")
|
85
|
+
cmd = ['cmd', '/c', 'start', '/max', 'winword']
|
86
|
+
|
87
|
+
log.info(f"Executing command: {' '.join(cmd)}")
|
88
|
+
result = subprocess.run(cmd, check=False, capture_output=True, text=True, creationflags=subprocess.CREATE_NO_WINDOW) # Add CREATE_NO_WINDOW
|
86
89
|
|
87
|
-
|
88
|
-
|
89
|
-
|
90
|
-
|
91
|
-
|
92
|
-
|
90
|
+
if result.returncode == 0:
|
91
|
+
log.info(f"Successfully executed command for Word.")
|
92
|
+
else:
|
93
|
+
log.error(f"Error opening Word: {result.stderr.strip()}")
|
94
|
+
if result.stdout:
|
95
|
+
log.error(f"Stdout from start command: {result.stdout.strip()}")
|
93
96
|
except FileNotFoundError:
|
94
97
|
log.error("Error: 'cmd' or 'start' command not found. Ensure system PATH is configured correctly.")
|
95
98
|
except Exception as e:
|
{computer_use_ootb_internal-0.0.182.dist-info → computer_use_ootb_internal-0.0.184.dist-info}/RECORD
RENAMED
@@ -2,7 +2,7 @@ computer_use_ootb_internal/README.md,sha256=FxpW95lyub2iX73ZDfK6ML7SdEKg060H5I6G
|
|
2
2
|
computer_use_ootb_internal/__init__.py,sha256=Nqnn8clbgv-5l0PgxcTOldg8mkMKrFn4TvPL-rYUUGg,1
|
3
3
|
computer_use_ootb_internal/app_teachmode.py,sha256=zGccyiqOnid8Yntm2F5Yvj6HA5Z2CoE9IqsxRZdieUg,27548
|
4
4
|
computer_use_ootb_internal/dependency_check.py,sha256=y8RMEP6RXQzTgU1MS_1piBLtz4J-Hfn9RjUZg59dyvo,1333
|
5
|
-
computer_use_ootb_internal/guard_service.py,sha256=
|
5
|
+
computer_use_ootb_internal/guard_service.py,sha256=8tJA7MAZgzqfTXHtbiNVwUCQj_dkHg3vDmgisd5TyIM,51642
|
6
6
|
computer_use_ootb_internal/requirements-lite.txt,sha256=5DAHomz4A_P2BmTIXNkNqkHbnIF0AyZ4_1XAlb1LaYs,290
|
7
7
|
computer_use_ootb_internal/run_teachmode_ootb_args.py,sha256=1fLVUDHcZIeHbmbk36GX8ccjSn74riqTEWLfrx0FgKU,8463
|
8
8
|
computer_use_ootb_internal/service_manager.py,sha256=SD8jzfn0VVXBOr_nP6zmBWSC2TzrU_sp2e5JJkSlQFU,9734
|
@@ -34,12 +34,12 @@ computer_use_ootb_internal/computer_use_demo/tools/edit.py,sha256=b0PwUitxckHCQq
|
|
34
34
|
computer_use_ootb_internal/computer_use_demo/tools/run.py,sha256=xhXdnBK1di9muaO44CEirL9hpGy3NmKbjfMpyeVmn8Y,1595
|
35
35
|
computer_use_ootb_internal/computer_use_demo/tools/screen_capture.py,sha256=L8qfvtUkPPQGt92N-2Zfw5ZTDBzLsDps39uMnX3_uSA,6857
|
36
36
|
computer_use_ootb_internal/preparation/__init__.py,sha256=AgtGHcBpiTkxJjF0xwcs3yyQ6SyUvhL3G0vD2XO-zJw,63
|
37
|
-
computer_use_ootb_internal/preparation/excel_prepare.py,sha256=
|
38
|
-
computer_use_ootb_internal/preparation/powerpoint_prepare.py,sha256=
|
39
|
-
computer_use_ootb_internal/preparation/pr_prepare.py,sha256=
|
37
|
+
computer_use_ootb_internal/preparation/excel_prepare.py,sha256=TExvi8NWAxPf--lWPrs7-26A3pu2pUeTu2mZDzslAKI,4713
|
38
|
+
computer_use_ootb_internal/preparation/powerpoint_prepare.py,sha256=WgYyKnBUavazJ7GViUK8DB9cp7RBXUujkVCJ-82HW4o,4962
|
39
|
+
computer_use_ootb_internal/preparation/pr_prepare.py,sha256=F03g75Ym27_azyjMhAcQXW-qbuVePa4HE6RNFXvPtEM,5139
|
40
40
|
computer_use_ootb_internal/preparation/star_rail_prepare.py,sha256=r0b19M_c1sXkN3_MRFjql8w_ThC9nZUe8zbSLYUvKS8,4635
|
41
|
-
computer_use_ootb_internal/preparation/word_prepare.py,sha256=
|
42
|
-
computer_use_ootb_internal-0.0.
|
43
|
-
computer_use_ootb_internal-0.0.
|
44
|
-
computer_use_ootb_internal-0.0.
|
45
|
-
computer_use_ootb_internal-0.0.
|
41
|
+
computer_use_ootb_internal/preparation/word_prepare.py,sha256=i6sFWKMpL6qOMhksZ5eHrsDvBCqcZFazKbE9LdGQxiA,4720
|
42
|
+
computer_use_ootb_internal-0.0.184.dist-info/METADATA,sha256=_x9hXXwmu9fZ07S_sMc3gXmh7ZzvIvolApSQfizMrTU,1048
|
43
|
+
computer_use_ootb_internal-0.0.184.dist-info/WHEEL,sha256=qtCwoSJWgHk21S1Kb4ihdzI2rlJ1ZKaIurTj_ngOhyQ,87
|
44
|
+
computer_use_ootb_internal-0.0.184.dist-info/entry_points.txt,sha256=bXfyAU_qq-G1EiEgAQEioXvgEdRCFxaTooqdDD9Y4OA,258
|
45
|
+
computer_use_ootb_internal-0.0.184.dist-info/RECORD,,
|
{computer_use_ootb_internal-0.0.182.dist-info → computer_use_ootb_internal-0.0.184.dist-info}/WHEEL
RENAMED
File without changes
|
File without changes
|