computer-use-ootb-internal 0.0.194__py3-none-any.whl → 0.0.196__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/computer_use_demo/gui_agent/gui_parser/simple_parser/gui_capture.py +21 -8
- {computer_use_ootb_internal-0.0.194.dist-info → computer_use_ootb_internal-0.0.196.dist-info}/METADATA +1 -1
- {computer_use_ootb_internal-0.0.194.dist-info → computer_use_ootb_internal-0.0.196.dist-info}/RECORD +6 -6
- {computer_use_ootb_internal-0.0.194.dist-info → computer_use_ootb_internal-0.0.196.dist-info}/WHEEL +0 -0
- {computer_use_ootb_internal-0.0.194.dist-info → computer_use_ootb_internal-0.0.196.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
|
|
computer_use_ootb_internal/computer_use_demo/gui_agent/gui_parser/simple_parser/gui_capture.py
CHANGED
@@ -11,6 +11,7 @@ import time
|
|
11
11
|
import win32gui
|
12
12
|
from typing import List, Tuple, Dict
|
13
13
|
from screeninfo import get_monitors
|
14
|
+
import pyautogui
|
14
15
|
|
15
16
|
|
16
17
|
class Rectangle:
|
@@ -240,15 +241,27 @@ class GUICapture:
|
|
240
241
|
|
241
242
|
# Get monitor dimensions from visibility_checker
|
242
243
|
monitor = self.visibility_checker.monitor
|
243
|
-
# Capture screenshot of the specific monitor
|
244
|
-
# screenshot = auto.GetRootControl().ToBitmap(monitor.left, monitor.top,
|
245
|
-
# monitor.right - monitor.left,
|
246
|
-
# monitor.bottom - monitor.top)
|
247
|
-
bbox=(monitor.left, monitor.top,
|
248
|
-
monitor.right, monitor.bottom)
|
249
|
-
screenshot = ImageGrab.grab(bbox=bbox, all_screens=True)
|
250
244
|
|
251
|
-
|
245
|
+
# Define the bounding box for pyautogui
|
246
|
+
# bbox for ImageGrab is (left, top, right, bottom)
|
247
|
+
# region for pyautogui is (left, top, width, height)
|
248
|
+
pyautogui_region = (
|
249
|
+
monitor.left,
|
250
|
+
monitor.top,
|
251
|
+
monitor.right - monitor.left,
|
252
|
+
monitor.bottom - monitor.top
|
253
|
+
)
|
254
|
+
|
255
|
+
# Capture screenshot of the specific monitor region using pyautogui
|
256
|
+
try:
|
257
|
+
screenshot = pyautogui.screenshot(region=pyautogui_region)
|
258
|
+
except Exception as e:
|
259
|
+
# Add logging or raise a more specific exception if needed
|
260
|
+
print(f"Error during pyautogui.screenshot: {e}")
|
261
|
+
# Fallback or re-raise, depending on desired error handling
|
262
|
+
# For now, let's re-raise to make it clear an error occurred.
|
263
|
+
raise
|
264
|
+
|
252
265
|
screenshot.save(screenshot_path)
|
253
266
|
return screenshot_path
|
254
267
|
|
{computer_use_ootb_internal-0.0.194.dist-info → computer_use_ootb_internal-0.0.196.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
|
@@ -13,7 +13,7 @@ computer_use_ootb_internal/computer_use_demo/animation/icons8-select-cursor-tran
|
|
13
13
|
computer_use_ootb_internal/computer_use_demo/animation/test_animation.py,sha256=2R1u98OLKYalSZ5nt5vvyZ71FL5R5vLv-n8zM8jVdV8,1183
|
14
14
|
computer_use_ootb_internal/computer_use_demo/executor/teachmode_executor.py,sha256=7wG3K4s2HkLznXPRER4jOo20qakFA9Iw_tYMg9d3r9s,16154
|
15
15
|
computer_use_ootb_internal/computer_use_demo/gui_agent/gui_parser/simple_parser/__init__.py,sha256=h2CNeuACklxVpJC65QR8_6AvSybEZLmeO45hY_-lLBs,61
|
16
|
-
computer_use_ootb_internal/computer_use_demo/gui_agent/gui_parser/simple_parser/gui_capture.py,sha256=
|
16
|
+
computer_use_ootb_internal/computer_use_demo/gui_agent/gui_parser/simple_parser/gui_capture.py,sha256=idoCVRKPQ-2MealPrEHULMHSIlVtHzbpX3uwR4nFI8o,14251
|
17
17
|
computer_use_ootb_internal/computer_use_demo/gui_agent/gui_parser/simple_parser/utils.py,sha256=OOVxy4Qlbk5q-X9kXFXqt6AmuOMl6FWWqtH269DvJJA,10005
|
18
18
|
computer_use_ootb_internal/computer_use_demo/gui_agent/gui_parser/uia_tools/__init__.py,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
|
19
19
|
computer_use_ootb_internal/computer_use_demo/gui_agent/gui_parser/uia_tools/screenshot_cli.py,sha256=hrUBH3aeUe9t4EDsMhaUZLPpNLKeEaG4ZvikrFy-bOU,1313
|
@@ -39,7 +39,7 @@ computer_use_ootb_internal/preparation/powerpoint_prepare.py,sha256=eHaDOIJnBJ9Q
|
|
39
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.196.dist-info/METADATA,sha256=p_2H7YTPhMizlvbsR1tuCBD5ChqZ8_Ke8r06j-eJwF0,1048
|
43
|
+
computer_use_ootb_internal-0.0.196.dist-info/WHEEL,sha256=qtCwoSJWgHk21S1Kb4ihdzI2rlJ1ZKaIurTj_ngOhyQ,87
|
44
|
+
computer_use_ootb_internal-0.0.196.dist-info/entry_points.txt,sha256=bXfyAU_qq-G1EiEgAQEioXvgEdRCFxaTooqdDD9Y4OA,258
|
45
|
+
computer_use_ootb_internal-0.0.196.dist-info/RECORD,,
|
{computer_use_ootb_internal-0.0.194.dist-info → computer_use_ootb_internal-0.0.196.dist-info}/WHEEL
RENAMED
File without changes
|
File without changes
|