kscale 0.1.4__tar.gz → 0.1.5__tar.gz
Sign up to get free protection for your applications and to get access to all the features.
- {kscale-0.1.4/kscale.egg-info → kscale-0.1.5}/PKG-INFO +1 -1
- {kscale-0.1.4 → kscale-0.1.5}/kscale/__init__.py +1 -1
- {kscale-0.1.4 → kscale-0.1.5}/kscale/conf.py +1 -1
- {kscale-0.1.4 → kscale-0.1.5}/kscale/web/clients/base.py +12 -0
- {kscale-0.1.4 → kscale-0.1.5}/kscale/web/utils.py +1 -1
- {kscale-0.1.4 → kscale-0.1.5/kscale.egg-info}/PKG-INFO +1 -1
- {kscale-0.1.4 → kscale-0.1.5}/LICENSE +0 -0
- {kscale-0.1.4 → kscale-0.1.5}/MANIFEST.in +0 -0
- {kscale-0.1.4 → kscale-0.1.5}/README.md +0 -0
- {kscale-0.1.4 → kscale-0.1.5}/kscale/api.py +0 -0
- {kscale-0.1.4 → kscale-0.1.5}/kscale/artifacts/__init__.py +0 -0
- {kscale-0.1.4 → kscale-0.1.5}/kscale/artifacts/plane.obj +0 -0
- {kscale-0.1.4 → kscale-0.1.5}/kscale/artifacts/plane.urdf +0 -0
- {kscale-0.1.4 → kscale-0.1.5}/kscale/cli.py +0 -0
- {kscale-0.1.4 → kscale-0.1.5}/kscale/py.typed +0 -0
- {kscale-0.1.4 → kscale-0.1.5}/kscale/requirements-dev.txt +0 -0
- {kscale-0.1.4 → kscale-0.1.5}/kscale/requirements.txt +0 -0
- {kscale-0.1.4 → kscale-0.1.5}/kscale/utils/__init__.py +0 -0
- {kscale-0.1.4 → kscale-0.1.5}/kscale/utils/api_base.py +0 -0
- {kscale-0.1.4 → kscale-0.1.5}/kscale/utils/checksum.py +0 -0
- {kscale-0.1.4 → kscale-0.1.5}/kscale/utils/cli.py +0 -0
- {kscale-0.1.4 → kscale-0.1.5}/kscale/web/__init__.py +0 -0
- {kscale-0.1.4 → kscale-0.1.5}/kscale/web/api.py +0 -0
- {kscale-0.1.4 → kscale-0.1.5}/kscale/web/cli/__init__.py +0 -0
- {kscale-0.1.4 → kscale-0.1.5}/kscale/web/cli/robot.py +0 -0
- {kscale-0.1.4 → kscale-0.1.5}/kscale/web/cli/robot_class.py +0 -0
- {kscale-0.1.4 → kscale-0.1.5}/kscale/web/cli/token.py +0 -0
- {kscale-0.1.4 → kscale-0.1.5}/kscale/web/cli/user.py +0 -0
- {kscale-0.1.4 → kscale-0.1.5}/kscale/web/clients/__init__.py +0 -0
- {kscale-0.1.4 → kscale-0.1.5}/kscale/web/clients/client.py +0 -0
- {kscale-0.1.4 → kscale-0.1.5}/kscale/web/clients/robot.py +0 -0
- {kscale-0.1.4 → kscale-0.1.5}/kscale/web/clients/robot_class.py +0 -0
- {kscale-0.1.4 → kscale-0.1.5}/kscale/web/clients/user.py +0 -0
- {kscale-0.1.4 → kscale-0.1.5}/kscale/web/gen/__init__.py +0 -0
- {kscale-0.1.4 → kscale-0.1.5}/kscale/web/gen/api.py +0 -0
- {kscale-0.1.4 → kscale-0.1.5}/kscale.egg-info/SOURCES.txt +0 -0
- {kscale-0.1.4 → kscale-0.1.5}/kscale.egg-info/dependency_links.txt +0 -0
- {kscale-0.1.4 → kscale-0.1.5}/kscale.egg-info/entry_points.txt +0 -0
- {kscale-0.1.4 → kscale-0.1.5}/kscale.egg-info/not-zip-safe +0 -0
- {kscale-0.1.4 → kscale-0.1.5}/kscale.egg-info/requires.txt +0 -0
- {kscale-0.1.4 → kscale-0.1.5}/kscale.egg-info/top_level.txt +0 -0
- {kscale-0.1.4 → kscale-0.1.5}/pyproject.toml +0 -0
- {kscale-0.1.4 → kscale-0.1.5}/setup.cfg +0 -0
- {kscale-0.1.4 → kscale-0.1.5}/setup.py +0 -0
- {kscale-0.1.4 → kscale-0.1.5}/tests/test_dummy.py +0 -0
@@ -21,7 +21,7 @@ def get_path() -> Path:
|
|
21
21
|
@dataclass
|
22
22
|
class WWWSettings:
|
23
23
|
api_root: str = field(default=DEFAULT_API_ROOT)
|
24
|
-
|
24
|
+
base_dir: str = field(default=II("oc.env:KSCALE_DIR,'~/.kscale/'"))
|
25
25
|
refresh_interval_minutes: int = field(default=60 * 24)
|
26
26
|
|
27
27
|
|
@@ -206,6 +206,18 @@ class BaseClient:
|
|
206
206
|
Returns:
|
207
207
|
A bearer token to use with the K-Scale WWW API.
|
208
208
|
"""
|
209
|
+
# Check if we are in a headless environment.
|
210
|
+
error_message = (
|
211
|
+
"Cannot perform browser-based authentication in a headless environment. "
|
212
|
+
"Please use 'kscale user key' to generate an API key locally and set "
|
213
|
+
"the KSCALE_API_KEY environment variable instead."
|
214
|
+
)
|
215
|
+
try:
|
216
|
+
if not webbrowser.get().name != "null":
|
217
|
+
raise RuntimeError(error_message)
|
218
|
+
except webbrowser.Error:
|
219
|
+
raise RuntimeError(error_message)
|
220
|
+
|
209
221
|
oicd_info = await self._get_oicd_info()
|
210
222
|
metadata = await self._get_oicd_metadata()
|
211
223
|
auth_endpoint = metadata["authorization_endpoint"]
|
@@ -15,7 +15,7 @@ DEFAULT_UPLOAD_TIMEOUT = 300.0 # 5 minutes
|
|
15
15
|
@functools.lru_cache
|
16
16
|
def get_kscale_dir() -> Path:
|
17
17
|
"""Returns the cache directory for artifacts."""
|
18
|
-
return Path(Settings.load().www.
|
18
|
+
return Path(Settings.load().www.base_dir).expanduser().resolve()
|
19
19
|
|
20
20
|
|
21
21
|
def get_auth_dir() -> Path:
|
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
|