computer-use-ootb-internal 0.0.193__py3-none-any.whl → 0.0.195__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/app_teachmode.py +34 -21
- computer_use_ootb_internal/preparation/pr_prepare.py +13 -13
- {computer_use_ootb_internal-0.0.193.dist-info → computer_use_ootb_internal-0.0.195.dist-info}/METADATA +1 -1
- {computer_use_ootb_internal-0.0.193.dist-info → computer_use_ootb_internal-0.0.195.dist-info}/RECORD +6 -6
- {computer_use_ootb_internal-0.0.193.dist-info → computer_use_ootb_internal-0.0.195.dist-info}/WHEEL +0 -0
- {computer_use_ootb_internal-0.0.193.dist-info → computer_use_ootb_internal-0.0.195.dist-info}/entry_points.txt +0 -0
@@ -26,48 +26,61 @@ import asyncio
|
|
26
26
|
|
27
27
|
# --- App Logging Setup ---
|
28
28
|
try:
|
29
|
-
# Log to
|
30
|
-
|
31
|
-
|
32
|
-
|
29
|
+
# NEW: Log to a subdirectory under ProgramData/OOTBGuardService, specific to the current user
|
30
|
+
program_data_dir = os.environ.get('PROGRAMDATA', 'C:/ProgramData') # Use C:/ProgramData as a fallback
|
31
|
+
guard_service_log_base_dir = os.path.join(program_data_dir, 'OOTBGuardService')
|
32
|
+
|
33
|
+
current_username = os.getenv('USERNAME', 'unknown_user_app') # Get current username, fallback
|
34
|
+
app_logs_subfolder = "UserSessionLogs" # Subfolder for these app logs
|
35
|
+
|
36
|
+
log_dir = os.path.join(guard_service_log_base_dir, app_logs_subfolder, current_username)
|
37
|
+
|
38
|
+
os.makedirs(log_dir, exist_ok=True) # Create user-specific log directory
|
33
39
|
log_file = os.path.join(log_dir, 'ootb_app.log')
|
34
40
|
|
35
41
|
log_format = '%(asctime)s - %(levelname)s - %(process)d - %(threadName)s - %(message)s'
|
36
42
|
log_level = logging.INFO # Or logging.DEBUG for more detail
|
37
43
|
|
38
|
-
#
|
39
|
-
|
40
|
-
|
44
|
+
# Setup the rotating file handler
|
45
|
+
rotating_file_handler = RotatingFileHandler(log_file, maxBytes=5*1024*1024, backupCount=2, encoding='utf-8')
|
46
|
+
rotating_file_handler.setFormatter(logging.Formatter(log_format))
|
41
47
|
|
42
|
-
#
|
43
|
-
logging.
|
44
|
-
|
45
|
-
# Add stream handler to see logs if running interactively (optional)
|
46
|
-
# logging.getLogger().addHandler(logging.StreamHandler(sys.stdout))
|
48
|
+
# Setup the console handler
|
49
|
+
console_handler_for_basic_config = logging.StreamHandler(sys.stdout)
|
50
|
+
console_handler_for_basic_config.setFormatter(logging.Formatter(log_format))
|
47
51
|
|
52
|
+
# Configure root logger with both file and console handlers
|
53
|
+
# This replaces the old basicConfig and the subsequent addHandler calls for file and console
|
54
|
+
logging.basicConfig(level=log_level, handlers=[rotating_file_handler, console_handler_for_basic_config])
|
55
|
+
|
48
56
|
logging.info("="*20 + " OOTB App Starting " + "="*20)
|
57
|
+
logging.info(f"Logging to file: {log_file}") # Explicitly log the path
|
49
58
|
logging.info(f"Running with args: {sys.argv}")
|
50
59
|
logging.info(f"Python Executable: {sys.executable}")
|
51
60
|
logging.info(f"Working Directory: {os.getcwd()}")
|
52
|
-
logging.info(f"User: {
|
61
|
+
logging.info(f"User: {current_username}") # Log the username being used for the path
|
53
62
|
|
54
63
|
except Exception as log_setup_e:
|
55
64
|
print(f"FATAL: Failed to set up logging: {log_setup_e}")
|
56
|
-
#
|
65
|
+
traceback.print_exc() # Print traceback for debugging log setup failure
|
57
66
|
|
58
67
|
# --- Get the root logger ---
|
68
|
+
# The root logger is now fully configured by basicConfig above.
|
69
|
+
# The following sections for re-adding file handler and console handler are no longer needed.
|
59
70
|
root_logger = logging.getLogger()
|
60
|
-
root_logger.setLevel(log_level) #
|
71
|
+
# root_logger.setLevel(log_level) # This was redundant as basicConfig sets the level.
|
61
72
|
|
62
73
|
# --- File Handler (as before) ---
|
63
|
-
|
64
|
-
file_handler
|
65
|
-
|
74
|
+
# REMOVED - This was redundant as rotating_file_handler is now passed to basicConfig.
|
75
|
+
# file_handler = RotatingFileHandler(log_file, maxBytes=5*1024*1024, backupCount=2, encoding='utf-8')
|
76
|
+
# file_handler.setFormatter(logging.Formatter(log_format))
|
77
|
+
# root_logger.addHandler(file_handler)
|
66
78
|
|
67
79
|
# --- Console Handler (New) ---
|
68
|
-
|
69
|
-
console_handler.
|
70
|
-
|
80
|
+
# REMOVED - This was redundant as console_handler_for_basic_config is now passed to basicConfig.
|
81
|
+
# console_handler = logging.StreamHandler(sys.stdout) # Log to standard output
|
82
|
+
# console_handler.setFormatter(logging.Formatter(log_format))
|
83
|
+
# root_logger.addHandler(console_handler)
|
71
84
|
|
72
85
|
# --- End App Logging Setup ---
|
73
86
|
|
@@ -93,21 +93,21 @@ def run_preparation(state):
|
|
93
93
|
log.info(f"Executing command string with shell=True: {cmd_string}")
|
94
94
|
print(f"[DEBUG] Attempting command string in pr_prepare: {cmd_string}")
|
95
95
|
|
96
|
-
#
|
97
|
-
|
96
|
+
# Use Popen with shell=True to launch and detach
|
97
|
+
try:
|
98
|
+
process = subprocess.Popen(cmd_string, shell=True,
|
99
|
+
creationflags=subprocess.CREATE_NEW_PROCESS_GROUP | subprocess.DETACHED_PROCESS,
|
100
|
+
stdout=subprocess.DEVNULL, # Suppress any potential stdout/stderr locking
|
101
|
+
stderr=subprocess.DEVNULL)
|
102
|
+
print(f"[DEBUG] Launched process via Popen, PID (may be cmd.exe): {process.pid}")
|
103
|
+
# Assume success if Popen doesn't throw immediately
|
104
|
+
log.info(f"Successfully dispatched command for Premiere Pro via Popen.")
|
105
|
+
except Exception as popen_err:
|
106
|
+
print(f"[DEBUG] Error launching with Popen: {popen_err}")
|
107
|
+
log.error(f"Error launching Premiere Pro with Popen: {popen_err}", exc_info=True)
|
98
108
|
|
99
|
-
#
|
100
|
-
print(f"[DEBUG] pr_prepare command result:")
|
101
|
-
print(f"[DEBUG] Return Code: {result.returncode}")
|
102
|
-
print(f"[DEBUG] Stdout: {result.stdout.strip() if result.stdout else ''}")
|
103
|
-
print(f"[DEBUG] Stderr: {result.stderr.strip() if result.stderr else ''}")
|
109
|
+
# No reliable return code check with Popen+start, assume dispatch success if no exception
|
104
110
|
|
105
|
-
if result.returncode == 0:
|
106
|
-
log.info(f"Successfully executed command for Premiere Pro.")
|
107
|
-
else:
|
108
|
-
log.error(f"Error executing command for Premiere Pro: {result.stderr.strip() if result else 'Command not run'}")
|
109
|
-
if result and result.stdout:
|
110
|
-
log.error(f"Stdout from start command: {result.stdout.strip()}")
|
111
111
|
except FileNotFoundError:
|
112
112
|
log.error("Error: 'cmd' or 'start' command not found. Ensure system PATH is configured correctly.")
|
113
113
|
except Exception as e:
|
{computer_use_ootb_internal-0.0.193.dist-info → computer_use_ootb_internal-0.0.195.dist-info}/RECORD
RENAMED
@@ -1,6 +1,6 @@
|
|
1
1
|
computer_use_ootb_internal/README.md,sha256=FxpW95lyub2iX73ZDfK6ML7SdEKg060H5I6Grub7li4,31
|
2
2
|
computer_use_ootb_internal/__init__.py,sha256=Nqnn8clbgv-5l0PgxcTOldg8mkMKrFn4TvPL-rYUUGg,1
|
3
|
-
computer_use_ootb_internal/app_teachmode.py,sha256=
|
3
|
+
computer_use_ootb_internal/app_teachmode.py,sha256=GV6Bi2TGDSMRmf6AA_UDFvc66iaryQDXhXbLlVj4bvk,29449
|
4
4
|
computer_use_ootb_internal/dependency_check.py,sha256=y8RMEP6RXQzTgU1MS_1piBLtz4J-Hfn9RjUZg59dyvo,1333
|
5
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
|
@@ -36,10 +36,10 @@ computer_use_ootb_internal/computer_use_demo/tools/screen_capture.py,sha256=L8qf
|
|
36
36
|
computer_use_ootb_internal/preparation/__init__.py,sha256=AgtGHcBpiTkxJjF0xwcs3yyQ6SyUvhL3G0vD2XO-zJw,63
|
37
37
|
computer_use_ootb_internal/preparation/excel_prepare.py,sha256=cKJ035tBaDM6Yyk9eriNvvuE64GmRjaCPCcVKMdzaKY,5180
|
38
38
|
computer_use_ootb_internal/preparation/powerpoint_prepare.py,sha256=eHaDOIJnBJ9QpRPZTmFiaLwa9ZWMJaEXsM0HktkjuOo,5433
|
39
|
-
computer_use_ootb_internal/preparation/pr_prepare.py,sha256=
|
39
|
+
computer_use_ootb_internal/preparation/pr_prepare.py,sha256=_4wHv0-q7D_kY6_niggulWxahZqIafQHGyWxcFSPzcc,6136
|
40
40
|
computer_use_ootb_internal/preparation/star_rail_prepare.py,sha256=r0b19M_c1sXkN3_MRFjql8w_ThC9nZUe8zbSLYUvKS8,4635
|
41
41
|
computer_use_ootb_internal/preparation/word_prepare.py,sha256=-SKbzckosEcOI5v2M5Pg7iFw9jTS5INJ6EoT5cHIqko,5172
|
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.
|
42
|
+
computer_use_ootb_internal-0.0.195.dist-info/METADATA,sha256=5KUvgwz9SsPDmBfiDlUjEIERW3uhi0GwKtpX-LnSyVA,1048
|
43
|
+
computer_use_ootb_internal-0.0.195.dist-info/WHEEL,sha256=qtCwoSJWgHk21S1Kb4ihdzI2rlJ1ZKaIurTj_ngOhyQ,87
|
44
|
+
computer_use_ootb_internal-0.0.195.dist-info/entry_points.txt,sha256=bXfyAU_qq-G1EiEgAQEioXvgEdRCFxaTooqdDD9Y4OA,258
|
45
|
+
computer_use_ootb_internal-0.0.195.dist-info/RECORD,,
|
{computer_use_ootb_internal-0.0.193.dist-info → computer_use_ootb_internal-0.0.195.dist-info}/WHEEL
RENAMED
File without changes
|
File without changes
|