qlever 0.5.31__tar.gz → 0.5.33__tar.gz
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.
Potentially problematic release.
This version of qlever might be problematic. Click here for more details.
- {qlever-0.5.31/src/qlever.egg-info → qlever-0.5.33}/PKG-INFO +1 -1
- {qlever-0.5.31 → qlever-0.5.33}/pyproject.toml +1 -1
- qlever-0.5.33/src/qlever/commands/settings.py +115 -0
- {qlever-0.5.31 → qlever-0.5.33}/src/qlever/commands/start.py +24 -4
- {qlever-0.5.31 → qlever-0.5.33}/src/qlever/qleverfile.py +29 -0
- {qlever-0.5.31 → qlever-0.5.33}/src/qlever/util.py +2 -1
- {qlever-0.5.31 → qlever-0.5.33/src/qlever.egg-info}/PKG-INFO +1 -1
- qlever-0.5.31/src/qlever/commands/settings.py +0 -121
- {qlever-0.5.31 → qlever-0.5.33}/LICENSE +0 -0
- {qlever-0.5.31 → qlever-0.5.33}/README.md +0 -0
- {qlever-0.5.31 → qlever-0.5.33}/setup.cfg +0 -0
- {qlever-0.5.31 → qlever-0.5.33}/src/qlever/Qleverfiles/Qleverfile.dblp +0 -0
- {qlever-0.5.31 → qlever-0.5.33}/src/qlever/Qleverfiles/Qleverfile.dblp-plus +0 -0
- {qlever-0.5.31 → qlever-0.5.33}/src/qlever/Qleverfiles/Qleverfile.dbpedia +0 -0
- {qlever-0.5.31 → qlever-0.5.33}/src/qlever/Qleverfiles/Qleverfile.default +0 -0
- {qlever-0.5.31 → qlever-0.5.33}/src/qlever/Qleverfiles/Qleverfile.dnb +0 -0
- {qlever-0.5.31 → qlever-0.5.33}/src/qlever/Qleverfiles/Qleverfile.fbeasy +0 -0
- {qlever-0.5.31 → qlever-0.5.33}/src/qlever/Qleverfiles/Qleverfile.freebase +0 -0
- {qlever-0.5.31 → qlever-0.5.33}/src/qlever/Qleverfiles/Qleverfile.imdb +0 -0
- {qlever-0.5.31 → qlever-0.5.33}/src/qlever/Qleverfiles/Qleverfile.ohm-planet +0 -0
- {qlever-0.5.31 → qlever-0.5.33}/src/qlever/Qleverfiles/Qleverfile.olympics +0 -0
- {qlever-0.5.31 → qlever-0.5.33}/src/qlever/Qleverfiles/Qleverfile.orkg +0 -0
- {qlever-0.5.31 → qlever-0.5.33}/src/qlever/Qleverfiles/Qleverfile.osm-country +0 -0
- {qlever-0.5.31 → qlever-0.5.33}/src/qlever/Qleverfiles/Qleverfile.osm-planet +0 -0
- {qlever-0.5.31 → qlever-0.5.33}/src/qlever/Qleverfiles/Qleverfile.osm-planet-from-pbf +0 -0
- {qlever-0.5.31 → qlever-0.5.33}/src/qlever/Qleverfiles/Qleverfile.pubchem +0 -0
- {qlever-0.5.31 → qlever-0.5.33}/src/qlever/Qleverfiles/Qleverfile.scientists +0 -0
- {qlever-0.5.31 → qlever-0.5.33}/src/qlever/Qleverfiles/Qleverfile.uniprot +0 -0
- {qlever-0.5.31 → qlever-0.5.33}/src/qlever/Qleverfiles/Qleverfile.vvz +0 -0
- {qlever-0.5.31 → qlever-0.5.33}/src/qlever/Qleverfiles/Qleverfile.wikidata +0 -0
- {qlever-0.5.31 → qlever-0.5.33}/src/qlever/Qleverfiles/Qleverfile.wikipathways +0 -0
- {qlever-0.5.31 → qlever-0.5.33}/src/qlever/Qleverfiles/Qleverfile.yago-4 +0 -0
- {qlever-0.5.31 → qlever-0.5.33}/src/qlever/__init__.py +0 -0
- {qlever-0.5.31 → qlever-0.5.33}/src/qlever/command.py +0 -0
- {qlever-0.5.31 → qlever-0.5.33}/src/qlever/commands/__init__.py +0 -0
- {qlever-0.5.31 → qlever-0.5.33}/src/qlever/commands/add_text_index.py +0 -0
- {qlever-0.5.31 → qlever-0.5.33}/src/qlever/commands/benchmark_queries.py +0 -0
- {qlever-0.5.31 → qlever-0.5.33}/src/qlever/commands/cache_stats.py +0 -0
- {qlever-0.5.31 → qlever-0.5.33}/src/qlever/commands/clear_cache.py +0 -0
- {qlever-0.5.31 → qlever-0.5.33}/src/qlever/commands/extract_queries.py +0 -0
- {qlever-0.5.31 → qlever-0.5.33}/src/qlever/commands/get_data.py +0 -0
- {qlever-0.5.31 → qlever-0.5.33}/src/qlever/commands/index.py +0 -0
- {qlever-0.5.31 → qlever-0.5.33}/src/qlever/commands/index_stats.py +0 -0
- {qlever-0.5.31 → qlever-0.5.33}/src/qlever/commands/log.py +0 -0
- {qlever-0.5.31 → qlever-0.5.33}/src/qlever/commands/query.py +0 -0
- {qlever-0.5.31 → qlever-0.5.33}/src/qlever/commands/setup_config.py +0 -0
- {qlever-0.5.31 → qlever-0.5.33}/src/qlever/commands/status.py +0 -0
- {qlever-0.5.31 → qlever-0.5.33}/src/qlever/commands/stop.py +0 -0
- {qlever-0.5.31 → qlever-0.5.33}/src/qlever/commands/system_info.py +0 -0
- {qlever-0.5.31 → qlever-0.5.33}/src/qlever/commands/ui.py +0 -0
- {qlever-0.5.31 → qlever-0.5.33}/src/qlever/commands/update_wikidata.py +0 -0
- {qlever-0.5.31 → qlever-0.5.33}/src/qlever/commands/warmup.py +0 -0
- {qlever-0.5.31 → qlever-0.5.33}/src/qlever/config.py +0 -0
- {qlever-0.5.31 → qlever-0.5.33}/src/qlever/containerize.py +0 -0
- {qlever-0.5.31 → qlever-0.5.33}/src/qlever/log.py +0 -0
- {qlever-0.5.31 → qlever-0.5.33}/src/qlever/qlever_main.py +0 -0
- {qlever-0.5.31 → qlever-0.5.33}/src/qlever.egg-info/SOURCES.txt +0 -0
- {qlever-0.5.31 → qlever-0.5.33}/src/qlever.egg-info/dependency_links.txt +0 -0
- {qlever-0.5.31 → qlever-0.5.33}/src/qlever.egg-info/entry_points.txt +0 -0
- {qlever-0.5.31 → qlever-0.5.33}/src/qlever.egg-info/requires.txt +0 -0
- {qlever-0.5.31 → qlever-0.5.33}/src/qlever.egg-info/top_level.txt +0 -0
|
@@ -0,0 +1,115 @@
|
|
|
1
|
+
from __future__ import annotations
|
|
2
|
+
|
|
3
|
+
import json
|
|
4
|
+
|
|
5
|
+
from termcolor import colored
|
|
6
|
+
|
|
7
|
+
from qlever.command import QleverCommand
|
|
8
|
+
from qlever.log import log
|
|
9
|
+
from qlever.qleverfile import Qleverfile
|
|
10
|
+
from qlever.util import run_command
|
|
11
|
+
|
|
12
|
+
|
|
13
|
+
class SettingsCommand(QleverCommand):
|
|
14
|
+
"""
|
|
15
|
+
Class for executing the `settings` command.
|
|
16
|
+
"""
|
|
17
|
+
|
|
18
|
+
def __init__(self):
|
|
19
|
+
pass
|
|
20
|
+
|
|
21
|
+
def description(self) -> str:
|
|
22
|
+
return "Show or set server settings (after `qlever start`)"
|
|
23
|
+
|
|
24
|
+
def should_have_qleverfile(self) -> bool:
|
|
25
|
+
return True
|
|
26
|
+
|
|
27
|
+
def relevant_qleverfile_arguments(self) -> dict[str : list[str]]:
|
|
28
|
+
return {"server": ["port", "host_name", "access_token"]}
|
|
29
|
+
|
|
30
|
+
def additional_arguments(self, subparser) -> None:
|
|
31
|
+
subparser.add_argument(
|
|
32
|
+
"runtime_parameters",
|
|
33
|
+
nargs="*",
|
|
34
|
+
help="Space-separated list of runtime parameters to set "
|
|
35
|
+
"in the form `key=value`; afterwards shows all settings, "
|
|
36
|
+
"with the changed ones highlighted",
|
|
37
|
+
).completer = lambda **kwargs: [
|
|
38
|
+
f"{key}=" for key in Qleverfile.SERVER_RUNTIME_PARAMETERS
|
|
39
|
+
]
|
|
40
|
+
subparser.add_argument(
|
|
41
|
+
"--endpoint_url",
|
|
42
|
+
type=str,
|
|
43
|
+
help="An arbitrary endpoint URL "
|
|
44
|
+
"(overriding the one in the Qleverfile)",
|
|
45
|
+
)
|
|
46
|
+
|
|
47
|
+
def execute(self, args) -> bool:
|
|
48
|
+
# Get endpoint URL from command line or Qleverfile.
|
|
49
|
+
if args.endpoint_url:
|
|
50
|
+
endpoint_url = args.endpoint_url
|
|
51
|
+
else:
|
|
52
|
+
endpoint_url = f"http://{args.host_name}:{args.port}"
|
|
53
|
+
|
|
54
|
+
# Construct the `curl` commands for setting and getting.
|
|
55
|
+
curl_cmds_setting = []
|
|
56
|
+
keys_set = set()
|
|
57
|
+
if args.runtime_parameters:
|
|
58
|
+
for key_value_pair in args.runtime_parameters:
|
|
59
|
+
try:
|
|
60
|
+
key, value = key_value_pair.split("=")
|
|
61
|
+
except ValueError:
|
|
62
|
+
log.error("Runtime parameter must be given as `key=value`")
|
|
63
|
+
return False
|
|
64
|
+
curl_cmds_setting.append(
|
|
65
|
+
f"curl -s {endpoint_url} -w %{{http_code}}"
|
|
66
|
+
f' --data-urlencode "{key}={value}"'
|
|
67
|
+
f' --data-urlencode "access-token={args.access_token}"'
|
|
68
|
+
)
|
|
69
|
+
keys_set.add(key)
|
|
70
|
+
curl_cmd_getting = (
|
|
71
|
+
f"curl -s {endpoint_url} -w %{{http_code}}"
|
|
72
|
+
f" --data-urlencode cmd=get-settings"
|
|
73
|
+
)
|
|
74
|
+
self.show(
|
|
75
|
+
"\n".join(curl_cmds_setting + [curl_cmd_getting]),
|
|
76
|
+
only_show=args.show,
|
|
77
|
+
)
|
|
78
|
+
if args.show:
|
|
79
|
+
return True
|
|
80
|
+
|
|
81
|
+
# Execute the `curl` commands for setting the key-value pairs if any.
|
|
82
|
+
for curl_cmd in curl_cmds_setting:
|
|
83
|
+
try:
|
|
84
|
+
curl_result = run_command(curl_cmd, return_output=True)
|
|
85
|
+
body, http_code = curl_result[:-3], curl_result[-3:]
|
|
86
|
+
if http_code != "200":
|
|
87
|
+
raise Exception(body)
|
|
88
|
+
except Exception as e:
|
|
89
|
+
log.error(
|
|
90
|
+
f"curl command for setting key-value pair failed: {e}"
|
|
91
|
+
)
|
|
92
|
+
return False
|
|
93
|
+
|
|
94
|
+
# Execute the `curl` commands for getting the settings.
|
|
95
|
+
try:
|
|
96
|
+
curl_result = run_command(curl_cmd_getting, return_output=True)
|
|
97
|
+
body, http_code = curl_result[:-3], curl_result[-3:]
|
|
98
|
+
if http_code != "200":
|
|
99
|
+
raise Exception(body)
|
|
100
|
+
settings_dict = json.loads(body)
|
|
101
|
+
if isinstance(settings_dict, list):
|
|
102
|
+
settings_dict = settings_dict[0]
|
|
103
|
+
except Exception as e:
|
|
104
|
+
log.error(f"curl command for getting settings failed: {e}")
|
|
105
|
+
return False
|
|
106
|
+
for key, value in settings_dict.items():
|
|
107
|
+
print(
|
|
108
|
+
colored(
|
|
109
|
+
f"{key:<45}: {value}",
|
|
110
|
+
"blue" if key in keys_set else None,
|
|
111
|
+
)
|
|
112
|
+
)
|
|
113
|
+
|
|
114
|
+
# That's it.
|
|
115
|
+
return True
|
|
@@ -5,11 +5,13 @@ import time
|
|
|
5
5
|
|
|
6
6
|
from qlever.command import QleverCommand
|
|
7
7
|
from qlever.commands.cache_stats import CacheStatsCommand
|
|
8
|
+
from qlever.commands.settings import SettingsCommand
|
|
8
9
|
from qlever.commands.status import StatusCommand
|
|
9
10
|
from qlever.commands.stop import StopCommand
|
|
10
11
|
from qlever.commands.warmup import WarmupCommand
|
|
11
12
|
from qlever.containerize import Containerize
|
|
12
13
|
from qlever.log import log
|
|
14
|
+
from qlever.qleverfile import Qleverfile
|
|
13
15
|
from qlever.util import binary_exists, is_qlever_server_alive, run_command
|
|
14
16
|
|
|
15
17
|
|
|
@@ -165,8 +167,19 @@ class StartCommand(QleverCommand):
|
|
|
165
167
|
help="Run the server in the foreground "
|
|
166
168
|
"(default: run in the background with `nohup`)",
|
|
167
169
|
)
|
|
170
|
+
subparser.add_argument(
|
|
171
|
+
"runtime_parameters",
|
|
172
|
+
nargs="*",
|
|
173
|
+
help="Space-separated list of runtime parameters to set "
|
|
174
|
+
"(in the form `key=value`) once the server is running",
|
|
175
|
+
).completer = lambda **kwargs: [
|
|
176
|
+
f"{key}=" for key in Qleverfile.SERVER_RUNTIME_PARAMETERS
|
|
177
|
+
]
|
|
168
178
|
|
|
169
179
|
def execute(self, args) -> bool:
|
|
180
|
+
# Set the endpoint URL.
|
|
181
|
+
args.endpoint_url = f"http://{args.host_name}:{args.port}"
|
|
182
|
+
|
|
170
183
|
# Kill existing server with the same name if so desired.
|
|
171
184
|
#
|
|
172
185
|
# TODO: This is currently disabled because I never used it once over
|
|
@@ -200,6 +213,9 @@ class StartCommand(QleverCommand):
|
|
|
200
213
|
# Show the command line.
|
|
201
214
|
self.show(start_cmd, only_show=args.show)
|
|
202
215
|
if args.show:
|
|
216
|
+
if args.runtime_parameters:
|
|
217
|
+
log.info("")
|
|
218
|
+
SettingsCommand().execute(args)
|
|
203
219
|
return True
|
|
204
220
|
|
|
205
221
|
# When running natively, check if the binary exists and works.
|
|
@@ -208,9 +224,8 @@ class StartCommand(QleverCommand):
|
|
|
208
224
|
return False
|
|
209
225
|
|
|
210
226
|
# Check if a QLever server is already running on this port.
|
|
211
|
-
|
|
212
|
-
|
|
213
|
-
log.error(f"QLever server already running on {endpoint_url}")
|
|
227
|
+
if is_qlever_server_alive(args.endpoint_url):
|
|
228
|
+
log.error(f"QLever server already running on {args.endpoint_url}")
|
|
214
229
|
log.info("")
|
|
215
230
|
log.info(
|
|
216
231
|
"To kill the existing server, use `qlever stop` "
|
|
@@ -269,7 +284,7 @@ class StartCommand(QleverCommand):
|
|
|
269
284
|
log.info("")
|
|
270
285
|
tail_cmd = f"exec tail -f {args.name}.server-log.txt"
|
|
271
286
|
tail_proc = subprocess.Popen(tail_cmd, shell=True)
|
|
272
|
-
while not is_qlever_server_alive(endpoint_url):
|
|
287
|
+
while not is_qlever_server_alive(args.endpoint_url):
|
|
273
288
|
time.sleep(1)
|
|
274
289
|
|
|
275
290
|
# Set the description for the index and text.
|
|
@@ -305,6 +320,11 @@ class StartCommand(QleverCommand):
|
|
|
305
320
|
args.server_url = None
|
|
306
321
|
CacheStatsCommand().execute(args)
|
|
307
322
|
|
|
323
|
+
# Apply settings if any.
|
|
324
|
+
if args.runtime_parameters:
|
|
325
|
+
log.info("")
|
|
326
|
+
SettingsCommand().execute(args)
|
|
327
|
+
|
|
308
328
|
# With `--run-in-foreground`, wait until the server is stopped.
|
|
309
329
|
if args.run_in_foreground:
|
|
310
330
|
try:
|
|
@@ -21,6 +21,35 @@ class Qleverfile:
|
|
|
21
21
|
Qleverfile + functions for parsing.
|
|
22
22
|
"""
|
|
23
23
|
|
|
24
|
+
# Runtime parameters (for `settings` and `start` commands).
|
|
25
|
+
SERVER_RUNTIME_PARAMETERS = [
|
|
26
|
+
"always-multiply-unions",
|
|
27
|
+
"cache-max-num-entries",
|
|
28
|
+
"cache-max-size",
|
|
29
|
+
"cache-max-size-single-entry",
|
|
30
|
+
"cache-service-results",
|
|
31
|
+
"default-query-timeout",
|
|
32
|
+
"division-by-zero-is-undef",
|
|
33
|
+
"enable-prefilter-on-index-scans",
|
|
34
|
+
"group-by-disable-index-scan-optimizations",
|
|
35
|
+
"group-by-hash-map-enabled",
|
|
36
|
+
"lazy-index-scan-max-size-materialization",
|
|
37
|
+
"lazy-index-scan-num-threads",
|
|
38
|
+
"lazy-index-scan-queue-size",
|
|
39
|
+
"lazy-result-max-cache-size",
|
|
40
|
+
"query-planning-budget",
|
|
41
|
+
"request-body-limit",
|
|
42
|
+
"service-max-redirects",
|
|
43
|
+
"service-max-value-rows",
|
|
44
|
+
"sort-estimate-cancellation-factor",
|
|
45
|
+
"spatial-join-prefilter-max-size",
|
|
46
|
+
"spatial-join-max-num-threads",
|
|
47
|
+
"syntax-test-mode",
|
|
48
|
+
"throw-on-unbound-variables",
|
|
49
|
+
"treat-default-graph-as-named-graph",
|
|
50
|
+
"use-binsearch-transitive-path",
|
|
51
|
+
]
|
|
52
|
+
|
|
24
53
|
@staticmethod
|
|
25
54
|
def all_arguments():
|
|
26
55
|
"""
|
|
@@ -287,8 +287,9 @@ def stop_process_with_regex(cmdline_regex: str) -> list[bool] | None:
|
|
|
287
287
|
)
|
|
288
288
|
cmdline = " ".join(pinfo["cmdline"])
|
|
289
289
|
except Exception as e:
|
|
290
|
+
# For some processes (e.g., zombies), getting info may fail.
|
|
290
291
|
log.debug(f"Error getting process info: {e}")
|
|
291
|
-
|
|
292
|
+
continue
|
|
292
293
|
if re.search(cmdline_regex, cmdline):
|
|
293
294
|
log.info(
|
|
294
295
|
f"Found process {pinfo['pid']} from user "
|
|
@@ -1,121 +0,0 @@
|
|
|
1
|
-
from __future__ import annotations
|
|
2
|
-
|
|
3
|
-
import json
|
|
4
|
-
|
|
5
|
-
from termcolor import colored
|
|
6
|
-
|
|
7
|
-
from qlever.command import QleverCommand
|
|
8
|
-
from qlever.log import log
|
|
9
|
-
from qlever.util import run_command
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
class SettingsCommand(QleverCommand):
|
|
13
|
-
"""
|
|
14
|
-
Class for executing the `settings` command.
|
|
15
|
-
"""
|
|
16
|
-
|
|
17
|
-
def __init__(self):
|
|
18
|
-
pass
|
|
19
|
-
|
|
20
|
-
def description(self) -> str:
|
|
21
|
-
return "Show or set server settings (after `qlever start`)"
|
|
22
|
-
|
|
23
|
-
def should_have_qleverfile(self) -> bool:
|
|
24
|
-
return True
|
|
25
|
-
|
|
26
|
-
def relevant_qleverfile_arguments(self) -> dict[str : list[str]]:
|
|
27
|
-
return {"server": ["port", "host_name", "access_token"]}
|
|
28
|
-
|
|
29
|
-
def additional_arguments(self, subparser) -> None:
|
|
30
|
-
all_keys = [
|
|
31
|
-
"always-multiply-unions",
|
|
32
|
-
"cache-max-num-entries",
|
|
33
|
-
"cache-max-size",
|
|
34
|
-
"cache-max-size-single-entry",
|
|
35
|
-
"cache-service-results",
|
|
36
|
-
"default-query-timeout",
|
|
37
|
-
"division-by-zero-is-undef",
|
|
38
|
-
"enable-prefilter-on-index-scans",
|
|
39
|
-
"group-by-disable-index-scan-optimizations",
|
|
40
|
-
"group-by-hash-map-enabled",
|
|
41
|
-
"lazy-index-scan-max-size-materialization",
|
|
42
|
-
"lazy-index-scan-num-threads",
|
|
43
|
-
"lazy-index-scan-queue-size",
|
|
44
|
-
"lazy-result-max-cache-size",
|
|
45
|
-
"query-planning-budget",
|
|
46
|
-
"request-body-limit",
|
|
47
|
-
"service-max-redirects",
|
|
48
|
-
"service-max-value-rows",
|
|
49
|
-
"sort-estimate-cancellation-factor",
|
|
50
|
-
"spatial-join-prefilter-max-size",
|
|
51
|
-
"spatial-join-max-num-threads",
|
|
52
|
-
"syntax-test-mode",
|
|
53
|
-
"throw-on-unbound-variables",
|
|
54
|
-
"treat-default-graph-as-named-graph",
|
|
55
|
-
"use-binsearch-transitive-path",
|
|
56
|
-
]
|
|
57
|
-
subparser.add_argument(
|
|
58
|
-
"runtime_parameter",
|
|
59
|
-
nargs="?",
|
|
60
|
-
help="Set the given runtime parameter (key=value)"
|
|
61
|
-
"; if no argument is given, show all settings",
|
|
62
|
-
).completer = lambda **kwargs: [f"{key}=" for key in all_keys]
|
|
63
|
-
subparser.add_argument(
|
|
64
|
-
"--endpoint_url",
|
|
65
|
-
type=str,
|
|
66
|
-
help="An arbitrary endpoint URL "
|
|
67
|
-
"(overriding the one in the Qleverfile)",
|
|
68
|
-
)
|
|
69
|
-
|
|
70
|
-
def execute(self, args) -> bool:
|
|
71
|
-
# Get endpoint URL from command line or Qleverfile.
|
|
72
|
-
if args.endpoint_url:
|
|
73
|
-
endpoint_url = args.endpoint_url
|
|
74
|
-
else:
|
|
75
|
-
endpoint_url = f"http://{args.host_name}:{args.port}"
|
|
76
|
-
|
|
77
|
-
# Construct the `curl` command for getting or setting.
|
|
78
|
-
if args.runtime_parameter:
|
|
79
|
-
try:
|
|
80
|
-
parameter_key, parameter_value = args.runtime_parameter.split(
|
|
81
|
-
"="
|
|
82
|
-
)
|
|
83
|
-
except ValueError:
|
|
84
|
-
log.error("Runtime parameter must be given as `key=value`")
|
|
85
|
-
return False
|
|
86
|
-
|
|
87
|
-
curl_cmd = (
|
|
88
|
-
f"curl -s {endpoint_url}"
|
|
89
|
-
f' --data-urlencode "{parameter_key}={parameter_value}"'
|
|
90
|
-
f' --data-urlencode "access-token={args.access_token}"'
|
|
91
|
-
)
|
|
92
|
-
else:
|
|
93
|
-
curl_cmd = (
|
|
94
|
-
f"curl -s {endpoint_url}" f" --data-urlencode cmd=get-settings"
|
|
95
|
-
)
|
|
96
|
-
parameter_key, parameter_value = None, None
|
|
97
|
-
self.show(curl_cmd, only_show=args.show)
|
|
98
|
-
if args.show:
|
|
99
|
-
return True
|
|
100
|
-
|
|
101
|
-
# Execute the `curl` command. Note that the `get-settings` command
|
|
102
|
-
# returns all settings in both scencarios (that is, also when setting a
|
|
103
|
-
# parameter).
|
|
104
|
-
try:
|
|
105
|
-
settings_json = run_command(curl_cmd, return_output=True)
|
|
106
|
-
settings_dict = json.loads(settings_json)
|
|
107
|
-
if isinstance(settings_dict, list):
|
|
108
|
-
settings_dict = settings_dict[0]
|
|
109
|
-
except Exception as e:
|
|
110
|
-
log.error(f"setting command failed: {e}")
|
|
111
|
-
return False
|
|
112
|
-
for key, value in settings_dict.items():
|
|
113
|
-
print(
|
|
114
|
-
colored(
|
|
115
|
-
f"{key:<45}: {value}",
|
|
116
|
-
"blue"
|
|
117
|
-
if parameter_key and key == parameter_key
|
|
118
|
-
else None,
|
|
119
|
-
)
|
|
120
|
-
)
|
|
121
|
-
return True
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|