Skip to content

Commit a4438b0

Browse files
committed
seleniumlib: config: Drop pyyaml as requirement, use json instead
1 parent 6b026c3 commit a4438b0

File tree

4 files changed

+31
-28
lines changed

4 files changed

+31
-28
lines changed

config.json

Lines changed: 27 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,27 @@
1+
{
2+
"Browser": {
3+
"chromium_executable_path": null,
4+
"chromium_profile_path": "{{SCRIPT_DIR}}/temp",
5+
"downloads_path": "{{SCRIPT_DIR}}/temp/Downloads",
6+
"session_path": "{{SCRIPT_DIR}}/temp/session.pickle",
7+
"screenshots_path": "{{SCRIPT_DIR}}/temp/Screenshots",
8+
"user_agent": "Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/74.0.3729.169 Safari/537.36",
9+
"global_timeout_sec": 5,
10+
"headless": false,
11+
"sandbox": true,
12+
"start_maximized": false,
13+
"quit_when_done": false,
14+
"debug_on_exception": true,
15+
"disable_selenium_logging": true,
16+
"disable_wdm_logging": true,
17+
"kill_chromium_before_start": false,
18+
"kill_wd_before_start": false
19+
},
20+
"Logging": {
21+
"log_path": "{{SCRIPT_DIR}}/temp/selenium.log",
22+
"level": "INFO",
23+
"log_exceptions": true,
24+
"display_stdout": true,
25+
"mode": "APPEND"
26+
}
27+
}

config.yml

Lines changed: 0 additions & 24 deletions
This file was deleted.

seleniumlib/browser.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@
33
from selenium import webdriver
44
from webdriver_manager.chrome import ChromeDriverManager
55

6-
from .lib_config import get_config
6+
from .config import get_config
77

88
CONFIG = get_config()
99

seleniumlib/config.py

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@
33
import sys
44
from pathlib import Path
55

6-
import yaml
6+
import json
77

88
EXPR = re.compile(r"{{(.*?)}}")
99
os.environ["SCRIPT_DIR"] = str(Path(sys.argv[0]).parent)
@@ -38,8 +38,8 @@ def swap_env_vars(config):
3838

3939
def get_config():
4040
"""Return config after swapping environment variables."""
41-
with open("config.yml") as f:
42-
config = yaml.safe_load(f)
41+
with open("config.json") as f:
42+
config = json.load(f)
4343
return swap_env_vars(config)
4444

4545

0 commit comments

Comments
 (0)