forked from dtecho/windsurf-project
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathtest_container_config.py
61 lines (51 loc) · 2.28 KB
/
test_container_config.py
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
import logging
from browser_interface import DeepTreeEchoBrowser
# Set up logging
logging.basicConfig(
level=logging.INFO,
format='%(asctime)s - %(name)s - %(levelname)s - %(message)s'
)
def main():
"""Test container configuration for Deep Tree Echo's browser"""
browser = DeepTreeEchoBrowser()
try:
# Initialize browser
if not browser.init():
logging.error("Failed to initialize browser")
return
# Configure each container
containers = ['Personal', 'Development', 'Work', 'Social']
for container in containers:
# Add custom settings for Development container
if container == 'Development':
custom_settings = {
'bookmarks': [
{'name': 'GitHub', 'url': 'https://github.com'},
{'name': 'Stack Overflow', 'url': 'https://stackoverflow.com'},
{'name': 'ChatGPT', 'url': 'https://chat.openai.com'},
{'name': 'CodePen', 'url': 'https://codepen.io'},
{'name': 'Dev.to', 'url': 'https://dev.to'}
]
}
success = browser.configure_container(container, custom_settings)
else:
success = browser.configure_container(container)
if success:
logging.info(f"Successfully configured {container} container")
# Get and display current settings
settings = browser.get_container_settings(container)
if settings:
logging.info(f"{container} container settings:")
logging.info(f"Homepage: {settings['homepage']}")
if settings.get('bookmarks'):
logging.info("Bookmarks:")
for bookmark in settings['bookmarks']:
logging.info(f" - {bookmark['name']}: {bookmark['url']}")
else:
logging.error(f"Failed to configure {container} container")
# Keep browser open for interaction
input("Press Enter to close browser...")
finally:
browser.close()
if __name__ == "__main__":
main()