hcs-core 0.1.309__tar.gz → 0.1.311__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.
- {hcs_core-0.1.309 → hcs_core-0.1.311}/PKG-INFO +1 -1
- hcs_core-0.1.311/hcs_core/__init__.py +1 -0
- {hcs_core-0.1.309 → hcs_core-0.1.311}/hcs_core/ctxp/util.py +5 -1
- {hcs_core-0.1.309 → hcs_core-0.1.311}/hcs_core/sglib/login_support.py +13 -3
- {hcs_core-0.1.309 → hcs_core-0.1.311}/hcs_core/util/job_view.py +18 -2
- hcs_core-0.1.309/hcs_core/__init__.py +0 -1
- {hcs_core-0.1.309 → hcs_core-0.1.311}/.gitignore +0 -0
- {hcs_core-0.1.309 → hcs_core-0.1.311}/README.md +0 -0
- {hcs_core-0.1.309 → hcs_core-0.1.311}/hcs_core/ctxp/__init__.py +0 -0
- {hcs_core-0.1.309 → hcs_core-0.1.311}/hcs_core/ctxp/_init.py +0 -0
- {hcs_core-0.1.309 → hcs_core-0.1.311}/hcs_core/ctxp/built_in_cmds/__init__.py +0 -0
- {hcs_core-0.1.309 → hcs_core-0.1.311}/hcs_core/ctxp/built_in_cmds/_ut.py +0 -0
- {hcs_core-0.1.309 → hcs_core-0.1.311}/hcs_core/ctxp/built_in_cmds/context.py +0 -0
- {hcs_core-0.1.309 → hcs_core-0.1.311}/hcs_core/ctxp/built_in_cmds/profile.py +0 -0
- {hcs_core-0.1.309 → hcs_core-0.1.311}/hcs_core/ctxp/cli_options.py +0 -0
- {hcs_core-0.1.309 → hcs_core-0.1.311}/hcs_core/ctxp/cli_processor.py +0 -0
- {hcs_core-0.1.309 → hcs_core-0.1.311}/hcs_core/ctxp/cmd_util.py +0 -0
- {hcs_core-0.1.309 → hcs_core-0.1.311}/hcs_core/ctxp/config.py +0 -0
- {hcs_core-0.1.309 → hcs_core-0.1.311}/hcs_core/ctxp/context.py +0 -0
- {hcs_core-0.1.309 → hcs_core-0.1.311}/hcs_core/ctxp/data_util.py +0 -0
- {hcs_core-0.1.309 → hcs_core-0.1.311}/hcs_core/ctxp/dispatcher.py +0 -0
- {hcs_core-0.1.309 → hcs_core-0.1.311}/hcs_core/ctxp/duration.py +0 -0
- {hcs_core-0.1.309 → hcs_core-0.1.311}/hcs_core/ctxp/extension.py +0 -0
- {hcs_core-0.1.309 → hcs_core-0.1.311}/hcs_core/ctxp/fn_util.py +0 -0
- {hcs_core-0.1.309 → hcs_core-0.1.311}/hcs_core/ctxp/fstore.py +0 -0
- {hcs_core-0.1.309 → hcs_core-0.1.311}/hcs_core/ctxp/jsondot.py +0 -0
- {hcs_core-0.1.309 → hcs_core-0.1.311}/hcs_core/ctxp/logger.py +0 -0
- {hcs_core-0.1.309 → hcs_core-0.1.311}/hcs_core/ctxp/profile.py +0 -0
- {hcs_core-0.1.309 → hcs_core-0.1.311}/hcs_core/ctxp/profile_store.py +0 -0
- {hcs_core-0.1.309 → hcs_core-0.1.311}/hcs_core/ctxp/recent.py +0 -0
- {hcs_core-0.1.309 → hcs_core-0.1.311}/hcs_core/ctxp/state.py +0 -0
- {hcs_core-0.1.309 → hcs_core-0.1.311}/hcs_core/ctxp/task_schd.py +0 -0
- {hcs_core-0.1.309 → hcs_core-0.1.311}/hcs_core/ctxp/telemetry.py +0 -0
- {hcs_core-0.1.309 → hcs_core-0.1.311}/hcs_core/ctxp/template_util.py +0 -0
- {hcs_core-0.1.309 → hcs_core-0.1.311}/hcs_core/ctxp/timeutil.py +0 -0
- {hcs_core-0.1.309 → hcs_core-0.1.311}/hcs_core/ctxp/var_template.py +0 -0
- {hcs_core-0.1.309 → hcs_core-0.1.311}/hcs_core/plan/__init__.py +0 -0
- {hcs_core-0.1.309 → hcs_core-0.1.311}/hcs_core/plan/actions.py +0 -0
- {hcs_core-0.1.309 → hcs_core-0.1.311}/hcs_core/plan/base_provider.py +0 -0
- {hcs_core-0.1.309 → hcs_core-0.1.311}/hcs_core/plan/context.py +0 -0
- {hcs_core-0.1.309 → hcs_core-0.1.311}/hcs_core/plan/core.py +0 -0
- {hcs_core-0.1.309 → hcs_core-0.1.311}/hcs_core/plan/dag.py +0 -0
- {hcs_core-0.1.309 → hcs_core-0.1.311}/hcs_core/plan/helper.py +0 -0
- {hcs_core-0.1.309 → hcs_core-0.1.311}/hcs_core/plan/kop.py +0 -0
- {hcs_core-0.1.309 → hcs_core-0.1.311}/hcs_core/plan/provider/__init__.py +0 -0
- {hcs_core-0.1.309 → hcs_core-0.1.311}/hcs_core/plan/provider/dev/__init__.py +0 -0
- {hcs_core-0.1.309 → hcs_core-0.1.311}/hcs_core/plan/provider/dev/_prepare.py +0 -0
- {hcs_core-0.1.309 → hcs_core-0.1.311}/hcs_core/plan/provider/dev/dummy.py +0 -0
- {hcs_core-0.1.309 → hcs_core-0.1.311}/hcs_core/plan/provider/dev/fibonacci.py +0 -0
- {hcs_core-0.1.309 → hcs_core-0.1.311}/hcs_core/sglib/__init__.py +0 -0
- {hcs_core-0.1.309 → hcs_core-0.1.311}/hcs_core/sglib/auth.py +0 -0
- {hcs_core-0.1.309 → hcs_core-0.1.311}/hcs_core/sglib/cli_options.py +0 -0
- {hcs_core-0.1.309 → hcs_core-0.1.311}/hcs_core/sglib/client_util.py +0 -0
- {hcs_core-0.1.309 → hcs_core-0.1.311}/hcs_core/sglib/csp.py +0 -0
- {hcs_core-0.1.309 → hcs_core-0.1.311}/hcs_core/sglib/ez_client.py +0 -0
- {hcs_core-0.1.309 → hcs_core-0.1.311}/hcs_core/sglib/hcs_client.py +0 -0
- {hcs_core-0.1.309 → hcs_core-0.1.311}/hcs_core/sglib/init.py +0 -0
- {hcs_core-0.1.309 → hcs_core-0.1.311}/hcs_core/sglib/payload_util.py +0 -0
- {hcs_core-0.1.309 → hcs_core-0.1.311}/hcs_core/sglib/requtil.py +0 -0
- {hcs_core-0.1.309 → hcs_core-0.1.311}/hcs_core/sglib/utils.py +0 -0
- {hcs_core-0.1.309 → hcs_core-0.1.311}/hcs_core/util/__init__.py +0 -0
- {hcs_core-0.1.309 → hcs_core-0.1.311}/hcs_core/util/check_license.py +0 -0
- {hcs_core-0.1.309 → hcs_core-0.1.311}/hcs_core/util/duration.py +0 -0
- {hcs_core-0.1.309 → hcs_core-0.1.311}/hcs_core/util/exit.py +0 -0
- {hcs_core-0.1.309 → hcs_core-0.1.311}/hcs_core/util/hcs_constants.py +0 -0
- {hcs_core-0.1.309 → hcs_core-0.1.311}/hcs_core/util/pki_util.py +0 -0
- {hcs_core-0.1.309 → hcs_core-0.1.311}/hcs_core/util/query_util.py +0 -0
- {hcs_core-0.1.309 → hcs_core-0.1.311}/hcs_core/util/scheduler.py +0 -0
- {hcs_core-0.1.309 → hcs_core-0.1.311}/hcs_core/util/ssl_util.py +0 -0
- {hcs_core-0.1.309 → hcs_core-0.1.311}/hcs_core/util/versions.py +0 -0
- {hcs_core-0.1.309 → hcs_core-0.1.311}/pyproject.toml +0 -0
|
@@ -0,0 +1 @@
|
|
|
1
|
+
__version__ = "0.1.311"
|
|
@@ -456,5 +456,9 @@ def default_table_formatter(data: Any, mapping: dict = None):
|
|
|
456
456
|
)
|
|
457
457
|
_restrict_readable_length(d, "name", 60)
|
|
458
458
|
if mapping:
|
|
459
|
-
|
|
459
|
+
for k, v in mapping.items():
|
|
460
|
+
if v is None:
|
|
461
|
+
field_mapping.pop(k, None)
|
|
462
|
+
else:
|
|
463
|
+
field_mapping[k] = v
|
|
460
464
|
return format_table(data, fields_mapping=field_mapping)
|
|
@@ -17,6 +17,7 @@ limitations under the License.
|
|
|
17
17
|
# PKCE with authlib: https://docs.authlib.org/en/latest/specs/rfc7636.html
|
|
18
18
|
|
|
19
19
|
import logging
|
|
20
|
+
import platform
|
|
20
21
|
import secrets
|
|
21
22
|
import threading
|
|
22
23
|
import webbrowser
|
|
@@ -166,9 +167,18 @@ def do_oauth2_pkce(csp_url: str, client_id: str, org_id: str):
|
|
|
166
167
|
webbrowser.open(authorization_url, new=0, autoraise=True)
|
|
167
168
|
|
|
168
169
|
try:
|
|
169
|
-
|
|
170
|
-
|
|
171
|
-
|
|
170
|
+
# On Windows, wait() without timeout doesn't respond to CTRL+C properly
|
|
171
|
+
# Use a polling loop with timeout to allow KeyboardInterrupt to be caught
|
|
172
|
+
if platform.system() == "Windows":
|
|
173
|
+
while not _auth_code_event.wait(timeout=0.5):
|
|
174
|
+
pass # Keep waiting until the event is set
|
|
175
|
+
else:
|
|
176
|
+
_auth_code_event.wait()
|
|
177
|
+
except KeyboardInterrupt:
|
|
178
|
+
log.info("Aborted by user")
|
|
179
|
+
return
|
|
180
|
+
except Exception as e:
|
|
181
|
+
log.error(f"Login error: {e}")
|
|
172
182
|
return
|
|
173
183
|
# Once the user is redirected back to your app with an authorization code, exchange it for an access token
|
|
174
184
|
authorization_code = _auth_code_event.value
|
|
@@ -19,7 +19,7 @@ import threading
|
|
|
19
19
|
from time import monotonic, sleep
|
|
20
20
|
from typing import Optional
|
|
21
21
|
|
|
22
|
-
from rich.console import RenderableType
|
|
22
|
+
from rich.console import Console, RenderableType
|
|
23
23
|
from rich.live import Live
|
|
24
24
|
from rich.progress import Progress, ProgressBar, ProgressColumn, SpinnerColumn, Task, TextColumn, TimeRemainingColumn
|
|
25
25
|
from rich.table import Column
|
|
@@ -27,6 +27,9 @@ from rich.text import Text
|
|
|
27
27
|
|
|
28
28
|
import hcs_core.util.duration as duration
|
|
29
29
|
|
|
30
|
+
# Detect if we're running on Windows
|
|
31
|
+
_IS_WINDOWS = os.name == "nt"
|
|
32
|
+
|
|
30
33
|
|
|
31
34
|
def _shorten_package_name(package_name, max_length):
|
|
32
35
|
if len(package_name) <= max_length:
|
|
@@ -117,6 +120,13 @@ class _MyTimeRemainingColumn(ProgressColumn):
|
|
|
117
120
|
|
|
118
121
|
|
|
119
122
|
class _MySpinnerColumn(SpinnerColumn):
|
|
123
|
+
def __init__(self, *args, **kwargs):
|
|
124
|
+
# Use ASCII spinner for Windows terminals
|
|
125
|
+
if _IS_WINDOWS and "spinner_name" not in kwargs:
|
|
126
|
+
# Use a simple ASCII spinner: | / - \
|
|
127
|
+
kwargs["spinner_name"] = "line"
|
|
128
|
+
super().__init__(*args, **kwargs)
|
|
129
|
+
|
|
120
130
|
def render(self, task: "Task") -> RenderableType:
|
|
121
131
|
if task.finished:
|
|
122
132
|
text = self.finished_text
|
|
@@ -148,6 +158,11 @@ class JobView:
|
|
|
148
158
|
|
|
149
159
|
w, h = os.get_terminal_size()
|
|
150
160
|
msg_width = w - _NAME_WIDTH - 1 - 1 - 1 - 10 - 1 - 5 - 1 - 1
|
|
161
|
+
|
|
162
|
+
# Create a console with ASCII-only mode for Windows to avoid rendering issues
|
|
163
|
+
# We need to store it and pass it to Live as well
|
|
164
|
+
self._console = Console(legacy_windows=True) if _IS_WINDOWS else None
|
|
165
|
+
|
|
151
166
|
self._job_ctl = Progress(
|
|
152
167
|
TextColumn("{task.description}", table_column=Column(max_width=_NAME_WIDTH, min_width=10)),
|
|
153
168
|
# SpinnerColumn(table_column=Column(min_width=1)),
|
|
@@ -158,6 +173,7 @@ class JobView:
|
|
|
158
173
|
# TaskProgressColumn(show_speed=True),
|
|
159
174
|
TimeRemainingColumn(compact=True, elapsed_when_finished=True, table_column=Column(style="white", min_width=5)),
|
|
160
175
|
TextColumn("{task.fields[details]}", table_column=Column(max_width=msg_width, no_wrap=True)),
|
|
176
|
+
console=self._console,
|
|
161
177
|
get_time=monotonic,
|
|
162
178
|
)
|
|
163
179
|
|
|
@@ -232,7 +248,7 @@ class JobView:
|
|
|
232
248
|
|
|
233
249
|
def show(self) -> None:
|
|
234
250
|
try:
|
|
235
|
-
with Live(self._job_ctl, refresh_per_second=10):
|
|
251
|
+
with Live(self._job_ctl, refresh_per_second=10, console=self._console):
|
|
236
252
|
self._view_started.set()
|
|
237
253
|
while True:
|
|
238
254
|
self.refresh()
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
__version__ = "0.1.309"
|
|
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
|
|
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
|