materials-commons-cli 2.3.0b10__tar.gz → 2.3.0b11__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.
- {materials_commons_cli-2.3.0b10 → materials_commons_cli-2.3.0b11}/PKG-INFO +25 -4
- materials_commons_cli-2.3.0b11/materials_commons/cli/__init__.py +1 -0
- {materials_commons_cli-2.3.0b10 → materials_commons_cli-2.3.0b11}/materials_commons/cli/reconcile3.py +2 -1
- {materials_commons_cli-2.3.0b10 → materials_commons_cli-2.3.0b11}/materials_commons/cli/server/downloader/file_downloader.py +2 -1
- {materials_commons_cli-2.3.0b10 → materials_commons_cli-2.3.0b11}/materials_commons/cli/server/uploader/file_uploader.py +5 -2
- materials_commons_cli-2.3.0b11/materials_commons/cli/terminal_progress.py +107 -0
- {materials_commons_cli-2.3.0b10 → materials_commons_cli-2.3.0b11}/materials_commons_cli.egg-info/PKG-INFO +26 -5
- {materials_commons_cli-2.3.0b10 → materials_commons_cli-2.3.0b11}/materials_commons_cli.egg-info/SOURCES.txt +3 -1
- {materials_commons_cli-2.3.0b10 → materials_commons_cli-2.3.0b11}/materials_commons_cli.egg-info/requires.txt +0 -1
- {materials_commons_cli-2.3.0b10 → materials_commons_cli-2.3.0b11}/setup.py +0 -1
- materials_commons_cli-2.3.0b11/tests/test_file_uploader.py +714 -0
- materials_commons_cli-2.3.0b11/tests/test_reconcile3.py +125 -0
- materials_commons_cli-2.3.0b10/materials_commons/cli/__init__.py +0 -1
- materials_commons_cli-2.3.0b10/materials_commons/cli/terminal_progress.py +0 -45
- {materials_commons_cli-2.3.0b10 → materials_commons_cli-2.3.0b11}/LICENSE +0 -0
- {materials_commons_cli-2.3.0b10 → materials_commons_cli-2.3.0b11}/README.md +0 -0
- {materials_commons_cli-2.3.0b10 → materials_commons_cli-2.3.0b11}/materials_commons/cli/LICENSE.txt +0 -0
- {materials_commons_cli-2.3.0b10 → materials_commons_cli-2.3.0b11}/materials_commons/cli/async_reconciler.py +0 -0
- {materials_commons_cli-2.3.0b10 → materials_commons_cli-2.3.0b11}/materials_commons/cli/config.py +0 -0
- {materials_commons_cli-2.3.0b10 → materials_commons_cli-2.3.0b11}/materials_commons/cli/downloader.py +0 -0
- {materials_commons_cli-2.3.0b10 → materials_commons_cli-2.3.0b11}/materials_commons/cli/filedb.py +0 -0
- {materials_commons_cli-2.3.0b10 → materials_commons_cli-2.3.0b11}/materials_commons/cli/local_project.py +0 -0
- {materials_commons_cli-2.3.0b10 → materials_commons_cli-2.3.0b11}/materials_commons/cli/models.py +0 -0
- {materials_commons_cli-2.3.0b10 → materials_commons_cli-2.3.0b11}/materials_commons/cli/old/__init__.py +0 -0
- {materials_commons_cli-2.3.0b10 → materials_commons_cli-2.3.0b11}/materials_commons/cli/old/cloned_project.py +0 -0
- {materials_commons_cli-2.3.0b10 → materials_commons_cli-2.3.0b11}/materials_commons/cli/old/exceptions.py +0 -0
- {materials_commons_cli-2.3.0b10 → materials_commons_cli-2.3.0b11}/materials_commons/cli/old/file_functions.py +0 -0
- {materials_commons_cli-2.3.0b10 → materials_commons_cli-2.3.0b11}/materials_commons/cli/old/functions.py +0 -0
- {materials_commons_cli-2.3.0b10 → materials_commons_cli-2.3.0b11}/materials_commons/cli/old/globus.py +0 -0
- {materials_commons_cli-2.3.0b10 → materials_commons_cli-2.3.0b11}/materials_commons/cli/old/list_objects.py +0 -0
- {materials_commons_cli-2.3.0b10 → materials_commons_cli-2.3.0b11}/materials_commons/cli/old/print_formatter.py +0 -0
- {materials_commons_cli-2.3.0b10 → materials_commons_cli-2.3.0b11}/materials_commons/cli/old/sqltable.py +0 -0
- {materials_commons_cli-2.3.0b10 → materials_commons_cli-2.3.0b11}/materials_commons/cli/old/tmp_functions.py +0 -0
- {materials_commons_cli-2.3.0b10 → materials_commons_cli-2.3.0b11}/materials_commons/cli/old/tree_functions.py +0 -0
- {materials_commons_cli-2.3.0b10 → materials_commons_cli-2.3.0b11}/materials_commons/cli/old/treedb.py +0 -0
- {materials_commons_cli-2.3.0b10 → materials_commons_cli-2.3.0b11}/materials_commons/cli/old/user_config.py +0 -0
- {materials_commons_cli-2.3.0b10 → materials_commons_cli-2.3.0b11}/materials_commons/cli/parser.py +0 -0
- {materials_commons_cli-2.3.0b10 → materials_commons_cli-2.3.0b11}/materials_commons/cli/reconcile2.py +0 -0
- {materials_commons_cli-2.3.0b10 → materials_commons_cli-2.3.0b11}/materials_commons/cli/requests.py +0 -0
- {materials_commons_cli-2.3.0b10 → materials_commons_cli-2.3.0b11}/materials_commons/cli/run.py +0 -0
- {materials_commons_cli-2.3.0b10 → materials_commons_cli-2.3.0b11}/materials_commons/cli/server/__init__.py +0 -0
- {materials_commons_cli-2.3.0b10 → materials_commons_cli-2.3.0b11}/materials_commons/cli/server/command_handlers/__init__.py +0 -0
- {materials_commons_cli-2.3.0b10 → materials_commons_cli-2.3.0b11}/materials_commons/cli/server/command_handlers/admin_handler_lookup.py +0 -0
- {materials_commons_cli-2.3.0b10 → materials_commons_cli-2.3.0b11}/materials_commons/cli/server/command_handlers/download_handler_lookup.py +0 -0
- {materials_commons_cli-2.3.0b10 → materials_commons_cli-2.3.0b11}/materials_commons/cli/server/command_handlers/list_handler_lookup.py +0 -0
- {materials_commons_cli-2.3.0b10 → materials_commons_cli-2.3.0b11}/materials_commons/cli/server/command_handlers/multi_handler_lookup.py +0 -0
- {materials_commons_cli-2.3.0b10 → materials_commons_cli-2.3.0b11}/materials_commons/cli/server/command_handlers/protocol.py +0 -0
- {materials_commons_cli-2.3.0b10 → materials_commons_cli-2.3.0b11}/materials_commons/cli/server/command_handlers/search_find_handler_lookup.py +0 -0
- {materials_commons_cli-2.3.0b10 → materials_commons_cli-2.3.0b11}/materials_commons/cli/server/command_handlers/upload_handler_lookup.py +0 -0
- {materials_commons_cli-2.3.0b10 → materials_commons_cli-2.3.0b11}/materials_commons/cli/server/db/__init__.py +0 -0
- {materials_commons_cli-2.3.0b10 → materials_commons_cli-2.3.0b11}/materials_commons/cli/server/db/db_manager.py +0 -0
- {materials_commons_cli-2.3.0b10 → materials_commons_cli-2.3.0b11}/materials_commons/cli/server/downloader/__init__.py +0 -0
- {materials_commons_cli-2.3.0b10 → materials_commons_cli-2.3.0b11}/materials_commons/cli/server/downloader/file_download_manager.py +0 -0
- {materials_commons_cli-2.3.0b10 → materials_commons_cli-2.3.0b11}/materials_commons/cli/server/indexer/__init__.py +0 -0
- {materials_commons_cli-2.3.0b10 → materials_commons_cli-2.3.0b11}/materials_commons/cli/server/indexer/file_index_manager.py +0 -0
- {materials_commons_cli-2.3.0b10 → materials_commons_cli-2.3.0b11}/materials_commons/cli/server/local_rest_server.py +0 -0
- {materials_commons_cli-2.3.0b10 → materials_commons_cli-2.3.0b11}/materials_commons/cli/server/ocommand_handlers.py +0 -0
- {materials_commons_cli-2.3.0b10 → materials_commons_cli-2.3.0b11}/materials_commons/cli/server/project_filedbs.py +0 -0
- {materials_commons_cli-2.3.0b10 → materials_commons_cli-2.3.0b11}/materials_commons/cli/server/projects.py +0 -0
- {materials_commons_cli-2.3.0b10 → materials_commons_cli-2.3.0b11}/materials_commons/cli/server/service_container.py +0 -0
- {materials_commons_cli-2.3.0b10 → materials_commons_cli-2.3.0b11}/materials_commons/cli/server/service_runtime.py +0 -0
- {materials_commons_cli-2.3.0b10 → materials_commons_cli-2.3.0b11}/materials_commons/cli/server/uploader/__init__.py +0 -0
- {materials_commons_cli-2.3.0b10 → materials_commons_cli-2.3.0b11}/materials_commons/cli/server/uploader/client_api.py +0 -0
- {materials_commons_cli-2.3.0b10 → materials_commons_cli-2.3.0b11}/materials_commons/cli/server/uploader/file_upload_manager.py +0 -0
- {materials_commons_cli-2.3.0b10 → materials_commons_cli-2.3.0b11}/materials_commons/cli/server/websocket_server.py +0 -0
- {materials_commons_cli-2.3.0b10 → materials_commons_cli-2.3.0b11}/materials_commons/cli/subcommands/__init__.py +0 -0
- {materials_commons_cli-2.3.0b10 → materials_commons_cli-2.3.0b11}/materials_commons/cli/subcommands/clone.py +0 -0
- {materials_commons_cli-2.3.0b10 → materials_commons_cli-2.3.0b11}/materials_commons/cli/subcommands/config.py +0 -0
- {materials_commons_cli-2.3.0b10 → materials_commons_cli-2.3.0b11}/materials_commons/cli/subcommands/dataset.py +0 -0
- {materials_commons_cli-2.3.0b10 → materials_commons_cli-2.3.0b11}/materials_commons/cli/subcommands/down.py +0 -0
- {materials_commons_cli-2.3.0b10 → materials_commons_cli-2.3.0b11}/materials_commons/cli/subcommands/down2.py +0 -0
- {materials_commons_cli-2.3.0b10 → materials_commons_cli-2.3.0b11}/materials_commons/cli/subcommands/expt.py +0 -0
- {materials_commons_cli-2.3.0b10 → materials_commons_cli-2.3.0b11}/materials_commons/cli/subcommands/fetch.py +0 -0
- {materials_commons_cli-2.3.0b10 → materials_commons_cli-2.3.0b11}/materials_commons/cli/subcommands/globus.py +0 -0
- {materials_commons_cli-2.3.0b10 → materials_commons_cli-2.3.0b11}/materials_commons/cli/subcommands/init.py +0 -0
- {materials_commons_cli-2.3.0b10 → materials_commons_cli-2.3.0b11}/materials_commons/cli/subcommands/ls.py +0 -0
- {materials_commons_cli-2.3.0b10 → materials_commons_cli-2.3.0b11}/materials_commons/cli/subcommands/ls2.py +0 -0
- {materials_commons_cli-2.3.0b10 → materials_commons_cli-2.3.0b11}/materials_commons/cli/subcommands/mcp.py +0 -0
- {materials_commons_cli-2.3.0b10 → materials_commons_cli-2.3.0b11}/materials_commons/cli/subcommands/mkdir.py +0 -0
- {materials_commons_cli-2.3.0b10 → materials_commons_cli-2.3.0b11}/materials_commons/cli/subcommands/mv.py +0 -0
- {materials_commons_cli-2.3.0b10 → materials_commons_cli-2.3.0b11}/materials_commons/cli/subcommands/proj.py +0 -0
- {materials_commons_cli-2.3.0b10 → materials_commons_cli-2.3.0b11}/materials_commons/cli/subcommands/remote.py +0 -0
- {materials_commons_cli-2.3.0b10 → materials_commons_cli-2.3.0b11}/materials_commons/cli/subcommands/rm.py +0 -0
- {materials_commons_cli-2.3.0b10 → materials_commons_cli-2.3.0b11}/materials_commons/cli/subcommands/runners/__init__.py +0 -0
- {materials_commons_cli-2.3.0b10 → materials_commons_cli-2.3.0b11}/materials_commons/cli/subcommands/runners/download_globus_runner.py +0 -0
- {materials_commons_cli-2.3.0b10 → materials_commons_cli-2.3.0b11}/materials_commons/cli/subcommands/runners/download_v1_runner.py +0 -0
- {materials_commons_cli-2.3.0b10 → materials_commons_cli-2.3.0b11}/materials_commons/cli/subcommands/scan.py +0 -0
- {materials_commons_cli-2.3.0b10 → materials_commons_cli-2.3.0b11}/materials_commons/cli/subcommands/server.py +0 -0
- {materials_commons_cli-2.3.0b10 → materials_commons_cli-2.3.0b11}/materials_commons/cli/subcommands/up.py +0 -0
- {materials_commons_cli-2.3.0b10 → materials_commons_cli-2.3.0b11}/materials_commons/cli/subcommands/versions.py +0 -0
- {materials_commons_cli-2.3.0b10 → materials_commons_cli-2.3.0b11}/materials_commons/cli/walk.py +0 -0
- {materials_commons_cli-2.3.0b10 → materials_commons_cli-2.3.0b11}/materials_commons_cli.egg-info/dependency_links.txt +0 -0
- {materials_commons_cli-2.3.0b10 → materials_commons_cli-2.3.0b11}/materials_commons_cli.egg-info/entry_points.txt +0 -0
- {materials_commons_cli-2.3.0b10 → materials_commons_cli-2.3.0b11}/materials_commons_cli.egg-info/not-zip-safe +0 -0
- {materials_commons_cli-2.3.0b10 → materials_commons_cli-2.3.0b11}/materials_commons_cli.egg-info/top_level.txt +0 -0
- {materials_commons_cli-2.3.0b10 → materials_commons_cli-2.3.0b11}/setup.cfg +0 -0
- {materials_commons_cli-2.3.0b10 → materials_commons_cli-2.3.0b11}/test/test_api.py +0 -0
- {materials_commons_cli-2.3.0b10 → materials_commons_cli-2.3.0b11}/test/test_functions.py +0 -0
- {materials_commons_cli-2.3.0b10 → materials_commons_cli-2.3.0b11}/test/test_mc_dataset.py +0 -0
- {materials_commons_cli-2.3.0b10 → materials_commons_cli-2.3.0b11}/test/test_mc_down.py +0 -0
- {materials_commons_cli-2.3.0b10 → materials_commons_cli-2.3.0b11}/test/test_mc_mkdir.py +0 -0
- {materials_commons_cli-2.3.0b10 → materials_commons_cli-2.3.0b11}/test/test_mc_mv.py +0 -0
- {materials_commons_cli-2.3.0b10 → materials_commons_cli-2.3.0b11}/test/test_mc_proj.py +0 -0
- {materials_commons_cli-2.3.0b10 → materials_commons_cli-2.3.0b11}/test/test_mc_rm.py +0 -0
- {materials_commons_cli-2.3.0b10 → materials_commons_cli-2.3.0b11}/test/test_mc_up.py +0 -0
- {materials_commons_cli-2.3.0b10 → materials_commons_cli-2.3.0b11}/test/test_treecompare_no_cache.py +0 -0
- {materials_commons_cli-2.3.0b10 → materials_commons_cli-2.3.0b11}/test/test_treecompare_with_cache.py +0 -0
- {materials_commons_cli-2.3.0b10 → materials_commons_cli-2.3.0b11}/test/test_treedb.py +0 -0
- {materials_commons_cli-2.3.0b10 → materials_commons_cli-2.3.0b11}/test/test_user_config.py +0 -0
|
@@ -1,13 +1,12 @@
|
|
|
1
|
-
Metadata-Version: 2.
|
|
1
|
+
Metadata-Version: 2.4
|
|
2
2
|
Name: materials_commons_cli
|
|
3
|
-
Version: 2.3.
|
|
3
|
+
Version: 2.3.0b11
|
|
4
4
|
Summary: Materials Commons CLI
|
|
5
5
|
Home-page: https://materials-commons.github.io/materials-commons-cli/html/index.html
|
|
6
6
|
Author: Materials Commons development team
|
|
7
7
|
Author-email: materials-commons-help@umich.edu
|
|
8
8
|
License: MIT
|
|
9
9
|
Keywords: materials science mc materials-commons prisms
|
|
10
|
-
Platform: UNKNOWN
|
|
11
10
|
Classifier: Development Status :: 4 - Beta
|
|
12
11
|
Classifier: Intended Audience :: Developers
|
|
13
12
|
Classifier: Intended Audience :: Science/Research
|
|
@@ -16,10 +15,32 @@ Classifier: License :: OSI Approved :: MIT License
|
|
|
16
15
|
Classifier: Programming Language :: Python :: 3
|
|
17
16
|
Classifier: Programming Language :: Python :: 3.8
|
|
18
17
|
License-File: LICENSE
|
|
18
|
+
Requires-Dist: websockets~=16.0
|
|
19
|
+
Requires-Dist: aiofiles~=25.1
|
|
20
|
+
Requires-Dist: globus-cli~=3.9
|
|
21
|
+
Requires-Dist: globus-sdk~=3.13
|
|
22
|
+
Requires-Dist: igittigitt==2.1
|
|
23
|
+
Requires-Dist: materials-commons-api>=2.0.1
|
|
24
|
+
Requires-Dist: python-dateutil~=2.8
|
|
25
|
+
Requires-Dist: pyyaml~=6.0
|
|
26
|
+
Requires-Dist: requests~=2.28
|
|
27
|
+
Requires-Dist: sortedcontainers~=2.4
|
|
28
|
+
Requires-Dist: tabulate~=0.9
|
|
29
|
+
Requires-Dist: aiosqlite~=0.22
|
|
30
|
+
Requires-Dist: fastmcp~=3.4
|
|
31
|
+
Dynamic: author
|
|
32
|
+
Dynamic: author-email
|
|
33
|
+
Dynamic: classifier
|
|
34
|
+
Dynamic: description
|
|
35
|
+
Dynamic: home-page
|
|
36
|
+
Dynamic: keywords
|
|
37
|
+
Dynamic: license
|
|
38
|
+
Dynamic: license-file
|
|
39
|
+
Dynamic: requires-dist
|
|
40
|
+
Dynamic: summary
|
|
19
41
|
|
|
20
42
|
This package contains the materials_commons.cli module. This module is an interface
|
|
21
43
|
to the Materials Commons project. We assume you have used (or are otherwise familiar with) the Materials
|
|
22
44
|
Commons web site, https://materialscommons.org/, or a similar site based on the
|
|
23
45
|
Materials Commons code (https://github.com/materials-commons/materialscommons), and intend to use these
|
|
24
46
|
tools in that context.
|
|
25
|
-
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
__version__ = '2.3.0b11'
|
|
@@ -472,5 +472,6 @@ class SingleFileReconciler:
|
|
|
472
472
|
|
|
473
473
|
result = await asyncio.to_thread(checksum, path.as_posix(), 1024 * 1024, progress_callback)
|
|
474
474
|
|
|
475
|
-
await TerminalProgress.render(progress_id, make_line(total_bytes, "checksum complete")
|
|
475
|
+
await TerminalProgress.render(progress_id, make_line(total_bytes, "checksum complete"),
|
|
476
|
+
done=True)
|
|
476
477
|
return result
|
|
@@ -74,7 +74,7 @@ class FileUploader:
|
|
|
74
74
|
"""
|
|
75
75
|
try:
|
|
76
76
|
if self.file_size == 0:
|
|
77
|
-
|
|
77
|
+
await TerminalProgress.write_line(f"Skipping {self.file_path.as_posix()} (empty file)...")
|
|
78
78
|
return True
|
|
79
79
|
|
|
80
80
|
await self._render_progress(status="starting")
|
|
@@ -522,7 +522,10 @@ class FileUploader:
|
|
|
522
522
|
f"{status}"
|
|
523
523
|
)
|
|
524
524
|
|
|
525
|
-
|
|
525
|
+
# Anything other than an in-flight status is terminal for this file, so
|
|
526
|
+
# the row is retired rather than held open for the rest of the run.
|
|
527
|
+
await TerminalProgress.render(self.transfer_id, line,
|
|
528
|
+
done=status not in ("uploading", "starting"))
|
|
526
529
|
|
|
527
530
|
def _calculate_md5(self, chunk_size=8192) -> str:
|
|
528
531
|
"""Calculate md5 hash of file"""
|
|
@@ -0,0 +1,107 @@
|
|
|
1
|
+
import asyncio
|
|
2
|
+
import shutil
|
|
3
|
+
import sys
|
|
4
|
+
from collections import OrderedDict
|
|
5
|
+
from typing import Iterable, Optional
|
|
6
|
+
|
|
7
|
+
def format_bytes(value: float) -> str:
|
|
8
|
+
"""Format bytes as a human-readable value."""
|
|
9
|
+
units = ("B", "KB", "MB", "GB", "TB")
|
|
10
|
+
size = float(value)
|
|
11
|
+
|
|
12
|
+
for unit in units:
|
|
13
|
+
if size < 1024.0 or unit == units[-1]:
|
|
14
|
+
return f"{size:.1f} {unit}"
|
|
15
|
+
size /= 1024.0
|
|
16
|
+
|
|
17
|
+
return f"{size:.1f} TB"
|
|
18
|
+
|
|
19
|
+
class TerminalProgress:
|
|
20
|
+
"""Renders in-progress transfers as a block of lines pinned to the bottom of
|
|
21
|
+
the terminal.
|
|
22
|
+
|
|
23
|
+
The block is repainted in its entirety on every update, using only cursor
|
|
24
|
+
movements relative to the line just below the block. Absolute row addressing
|
|
25
|
+
is deliberately avoided: it breaks as soon as the terminal scrolls, the
|
|
26
|
+
window is resized, or more transfers are tracked than the screen has rows.
|
|
27
|
+
"""
|
|
28
|
+
|
|
29
|
+
_lock: Optional[asyncio.Lock] = None
|
|
30
|
+
_active: "OrderedDict[str, str]" = OrderedDict()
|
|
31
|
+
|
|
32
|
+
# Number of terminal rows the live block currently occupies. The cursor is
|
|
33
|
+
# always left at column 0 of the row immediately below the block.
|
|
34
|
+
_painted = 0
|
|
35
|
+
|
|
36
|
+
@classmethod
|
|
37
|
+
def _get_lock(cls) -> asyncio.Lock:
|
|
38
|
+
# Created lazily so the lock binds to the running loop, not to whatever
|
|
39
|
+
# loop happened to exist at import time.
|
|
40
|
+
if cls._lock is None:
|
|
41
|
+
cls._lock = asyncio.Lock()
|
|
42
|
+
return cls._lock
|
|
43
|
+
|
|
44
|
+
@staticmethod
|
|
45
|
+
def _fit(line: str, width: int) -> str:
|
|
46
|
+
# Stay one column short of the edge; writing into the last column
|
|
47
|
+
# triggers deferred wrapping on most terminals, which would make the
|
|
48
|
+
# line occupy two rows and throw off the repaint arithmetic.
|
|
49
|
+
limit = max(width - 1, 8)
|
|
50
|
+
if len(line) <= limit:
|
|
51
|
+
return line
|
|
52
|
+
return line[:limit - 3] + "..."
|
|
53
|
+
|
|
54
|
+
@classmethod
|
|
55
|
+
def _repaint(cls, permanent_lines: Iterable[str] = ()) -> None:
|
|
56
|
+
size = shutil.get_terminal_size(fallback=(80, 24))
|
|
57
|
+
max_rows = max(size.lines - 1, 1)
|
|
58
|
+
|
|
59
|
+
out = []
|
|
60
|
+
if cls._painted:
|
|
61
|
+
out.append(f"\033[{cls._painted}A")
|
|
62
|
+
out.append("\r")
|
|
63
|
+
|
|
64
|
+
# Lines that are done scroll away into the terminal's scrollback.
|
|
65
|
+
for text in permanent_lines:
|
|
66
|
+
out.append("\033[2K" + cls._fit(text, size.columns) + "\n")
|
|
67
|
+
|
|
68
|
+
# Only as many rows as fit on screen; anything above the top would be
|
|
69
|
+
# clamped by the terminal and repaint over itself.
|
|
70
|
+
visible = list(cls._active.values())[-max_rows:]
|
|
71
|
+
for text in visible:
|
|
72
|
+
out.append("\033[2K" + cls._fit(text, size.columns) + "\n")
|
|
73
|
+
|
|
74
|
+
# Clear whatever the previous, taller block left behind.
|
|
75
|
+
out.append("\033[J")
|
|
76
|
+
|
|
77
|
+
cls._painted = len(visible)
|
|
78
|
+
sys.stdout.write("".join(out))
|
|
79
|
+
sys.stdout.flush()
|
|
80
|
+
|
|
81
|
+
@classmethod
|
|
82
|
+
async def render(cls, progress_id: str, line: str, done: bool = False):
|
|
83
|
+
"""Update the row for ``progress_id``.
|
|
84
|
+
|
|
85
|
+
When ``done`` is set the row is retired: it is written out as permanent
|
|
86
|
+
output above the live block and no longer takes up a row.
|
|
87
|
+
"""
|
|
88
|
+
if not sys.stdout.isatty():
|
|
89
|
+
return
|
|
90
|
+
|
|
91
|
+
async with cls._get_lock():
|
|
92
|
+
if done:
|
|
93
|
+
cls._active.pop(progress_id, None)
|
|
94
|
+
cls._repaint([line])
|
|
95
|
+
else:
|
|
96
|
+
cls._active[progress_id] = line
|
|
97
|
+
cls._repaint()
|
|
98
|
+
|
|
99
|
+
@classmethod
|
|
100
|
+
async def write_line(cls, line: str):
|
|
101
|
+
"""Emit a normal output line without corrupting the progress block."""
|
|
102
|
+
if not sys.stdout.isatty():
|
|
103
|
+
print(line)
|
|
104
|
+
return
|
|
105
|
+
|
|
106
|
+
async with cls._get_lock():
|
|
107
|
+
cls._repaint([line])
|
|
@@ -1,13 +1,12 @@
|
|
|
1
|
-
Metadata-Version: 2.
|
|
2
|
-
Name:
|
|
3
|
-
Version: 2.3.
|
|
1
|
+
Metadata-Version: 2.4
|
|
2
|
+
Name: materials_commons_cli
|
|
3
|
+
Version: 2.3.0b11
|
|
4
4
|
Summary: Materials Commons CLI
|
|
5
5
|
Home-page: https://materials-commons.github.io/materials-commons-cli/html/index.html
|
|
6
6
|
Author: Materials Commons development team
|
|
7
7
|
Author-email: materials-commons-help@umich.edu
|
|
8
8
|
License: MIT
|
|
9
9
|
Keywords: materials science mc materials-commons prisms
|
|
10
|
-
Platform: UNKNOWN
|
|
11
10
|
Classifier: Development Status :: 4 - Beta
|
|
12
11
|
Classifier: Intended Audience :: Developers
|
|
13
12
|
Classifier: Intended Audience :: Science/Research
|
|
@@ -16,10 +15,32 @@ Classifier: License :: OSI Approved :: MIT License
|
|
|
16
15
|
Classifier: Programming Language :: Python :: 3
|
|
17
16
|
Classifier: Programming Language :: Python :: 3.8
|
|
18
17
|
License-File: LICENSE
|
|
18
|
+
Requires-Dist: websockets~=16.0
|
|
19
|
+
Requires-Dist: aiofiles~=25.1
|
|
20
|
+
Requires-Dist: globus-cli~=3.9
|
|
21
|
+
Requires-Dist: globus-sdk~=3.13
|
|
22
|
+
Requires-Dist: igittigitt==2.1
|
|
23
|
+
Requires-Dist: materials-commons-api>=2.0.1
|
|
24
|
+
Requires-Dist: python-dateutil~=2.8
|
|
25
|
+
Requires-Dist: pyyaml~=6.0
|
|
26
|
+
Requires-Dist: requests~=2.28
|
|
27
|
+
Requires-Dist: sortedcontainers~=2.4
|
|
28
|
+
Requires-Dist: tabulate~=0.9
|
|
29
|
+
Requires-Dist: aiosqlite~=0.22
|
|
30
|
+
Requires-Dist: fastmcp~=3.4
|
|
31
|
+
Dynamic: author
|
|
32
|
+
Dynamic: author-email
|
|
33
|
+
Dynamic: classifier
|
|
34
|
+
Dynamic: description
|
|
35
|
+
Dynamic: home-page
|
|
36
|
+
Dynamic: keywords
|
|
37
|
+
Dynamic: license
|
|
38
|
+
Dynamic: license-file
|
|
39
|
+
Dynamic: requires-dist
|
|
40
|
+
Dynamic: summary
|
|
19
41
|
|
|
20
42
|
This package contains the materials_commons.cli module. This module is an interface
|
|
21
43
|
to the Materials Commons project. We assume you have used (or are otherwise familiar with) the Materials
|
|
22
44
|
Commons web site, https://materialscommons.org/, or a similar site based on the
|
|
23
45
|
Materials Commons code (https://github.com/materials-commons/materialscommons), and intend to use these
|
|
24
46
|
tools in that context.
|
|
25
|
-
|