powercli 0.1.2__tar.gz → 0.2.0__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.
- {powercli-0.1.2/src/powercli.egg-info → powercli-0.2.0}/PKG-INFO +2 -2
- {powercli-0.1.2 → powercli-0.2.0}/README.md +1 -1
- {powercli-0.1.2 → powercli-0.2.0}/pyproject.toml +1 -1
- {powercli-0.1.2 → powercli-0.2.0}/src/cli/cli/entry_point.py +1 -1
- {powercli-0.1.2 → powercli-0.2.0}/src/cli/commands/commands.py +4 -4
- {powercli-0.1.2 → powercli-0.2.0}/src/cli/commands/run.py +8 -2
- {powercli-0.1.2 → powercli-0.2.0}/src/cli/commands/runner.py +2 -2
- {powercli-0.1.2 → powercli-0.2.0/src/powercli.egg-info}/PKG-INFO +2 -2
- {powercli-0.1.2 → powercli-0.2.0}/LICENSE +0 -0
- {powercli-0.1.2 → powercli-0.2.0}/setup.cfg +0 -0
- {powercli-0.1.2 → powercli-0.2.0}/src/cli/__init__.py +0 -0
- {powercli-0.1.2 → powercli-0.2.0}/src/cli/cli/__init__.py +0 -0
- {powercli-0.1.2 → powercli-0.2.0}/src/cli/commands/__init__.py +0 -0
- {powercli-0.1.2 → powercli-0.2.0}/src/cli/commands/install.py +0 -0
- {powercli-0.1.2 → powercli-0.2.0}/src/cli/commands/open_.py +0 -0
- {powercli-0.1.2 → powercli-0.2.0}/src/cli/input.py +0 -0
- {powercli-0.1.2 → powercli-0.2.0}/src/cli/models/__init__.py +0 -0
- {powercli-0.1.2 → powercli-0.2.0}/src/cli/models/models.py +0 -0
- {powercli-0.1.2 → powercli-0.2.0}/src/cli/output/__init__.py +0 -0
- {powercli-0.1.2 → powercli-0.2.0}/src/cli/output/console.py +0 -0
- {powercli-0.1.2 → powercli-0.2.0}/src/cli/output/message.py +0 -0
- {powercli-0.1.2 → powercli-0.2.0}/src/cli/output/progress.py +0 -0
- {powercli-0.1.2 → powercli-0.2.0}/src/cli/output/rich.py +0 -0
- {powercli-0.1.2 → powercli-0.2.0}/src/cli/output/status.py +0 -0
- {powercli-0.1.2 → powercli-0.2.0}/src/cli/py.typed +0 -0
- {powercli-0.1.2 → powercli-0.2.0}/src/powercli.egg-info/SOURCES.txt +0 -0
- {powercli-0.1.2 → powercli-0.2.0}/src/powercli.egg-info/dependency_links.txt +0 -0
- {powercli-0.1.2 → powercli-0.2.0}/src/powercli.egg-info/entry_points.txt +0 -0
- {powercli-0.1.2 → powercli-0.2.0}/src/powercli.egg-info/requires.txt +0 -0
- {powercli-0.1.2 → powercli-0.2.0}/src/powercli.egg-info/top_level.txt +0 -0
- {powercli-0.1.2 → powercli-0.2.0}/tests/test_cli_entry_point.py +0 -0
- {powercli-0.1.2 → powercli-0.2.0}/tests/test_message.py +0 -0
- {powercli-0.1.2 → powercli-0.2.0}/tests/test_progress.py +0 -0
- {powercli-0.1.2 → powercli-0.2.0}/tests/test_runner.py +0 -0
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
Metadata-Version: 2.1
|
|
2
2
|
Name: powercli
|
|
3
|
-
Version: 0.
|
|
3
|
+
Version: 0.2.0
|
|
4
4
|
Summary: High-level CLI interaction
|
|
5
5
|
Author-email: Quinten Roets <qdr2104@columbia.edu>
|
|
6
6
|
License: MIT
|
|
@@ -19,7 +19,7 @@ Requires-Dist: superpathlib<3,>=2.0.2; extra == "dev"
|
|
|
19
19
|
[](https://badge.fury.io/py/powercli)
|
|
20
20
|

|
|
21
21
|

|
|
22
|
-

|
|
23
23
|
|
|
24
24
|
High-level CLI:
|
|
25
25
|
* Run commands
|
|
@@ -2,7 +2,7 @@
|
|
|
2
2
|
[](https://badge.fury.io/py/powercli)
|
|
3
3
|

|
|
4
4
|

|
|
5
|
-

|
|
6
6
|
|
|
7
7
|
High-level CLI:
|
|
8
8
|
* Run commands
|
|
@@ -19,10 +19,10 @@ CommandItem = StringLike | dict[str, StringLike] | set[StringLike] | list[String
|
|
|
19
19
|
@dataclass
|
|
20
20
|
class CommandPreparer:
|
|
21
21
|
items: tuple[CommandItem, ...]
|
|
22
|
-
use_shell_command: bool
|
|
23
|
-
use_console: bool
|
|
24
|
-
use_root: bool
|
|
25
|
-
title: str | None
|
|
22
|
+
use_shell_command: bool = False
|
|
23
|
+
use_console: bool = False
|
|
24
|
+
use_root: bool = False
|
|
25
|
+
title: str | None = None
|
|
26
26
|
askpass_key: str = "SUDO_ASKPASS"
|
|
27
27
|
root_keyword: str = "sudo"
|
|
28
28
|
|
|
@@ -39,10 +39,16 @@ def run_commands_in_shell(*commands: str, **kwargs: Any) -> None:
|
|
|
39
39
|
return run_commands(*commands, shell=True, **kwargs)
|
|
40
40
|
|
|
41
41
|
|
|
42
|
-
def run_commands(*commands: str,
|
|
42
|
+
def run_commands(*commands: str, **kwargs: Any) -> None:
|
|
43
43
|
for command in commands:
|
|
44
44
|
args = (command,)
|
|
45
|
-
Runner(args,
|
|
45
|
+
Runner(args, kwargs=kwargs).run()
|
|
46
|
+
|
|
47
|
+
|
|
48
|
+
def launch_commands(*commands: str, **kwargs: Any) -> None:
|
|
49
|
+
for command in commands:
|
|
50
|
+
args = (command,)
|
|
51
|
+
Runner(args, kwargs=kwargs).launch()
|
|
46
52
|
|
|
47
53
|
|
|
48
54
|
def pipe_output_and_capture(
|
|
@@ -41,8 +41,9 @@ class Runner(Generic[T1]):
|
|
|
41
41
|
|
|
42
42
|
@cached_property
|
|
43
43
|
def command_parts(self) -> tuple[str, ...]:
|
|
44
|
+
use_shell_command = self.shell or self.console
|
|
44
45
|
command_preparer = CommandPreparer(
|
|
45
|
-
self.items,
|
|
46
|
+
self.items, use_shell_command, self.console, self.root, self.title
|
|
46
47
|
)
|
|
47
48
|
return command_preparer.run()
|
|
48
49
|
|
|
@@ -124,7 +125,6 @@ class Runner(Generic[T1]):
|
|
|
124
125
|
|
|
125
126
|
def prepare_console_command(self) -> None:
|
|
126
127
|
self.console = True
|
|
127
|
-
self.shell = True
|
|
128
128
|
self.activate_console()
|
|
129
129
|
if "DISPLAY" not in os.environ: # pragma: nocover
|
|
130
130
|
# needed for non-login scripts to be able to activate console
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
Metadata-Version: 2.1
|
|
2
2
|
Name: powercli
|
|
3
|
-
Version: 0.
|
|
3
|
+
Version: 0.2.0
|
|
4
4
|
Summary: High-level CLI interaction
|
|
5
5
|
Author-email: Quinten Roets <qdr2104@columbia.edu>
|
|
6
6
|
License: MIT
|
|
@@ -19,7 +19,7 @@ Requires-Dist: superpathlib<3,>=2.0.2; extra == "dev"
|
|
|
19
19
|
[](https://badge.fury.io/py/powercli)
|
|
20
20
|

|
|
21
21
|

|
|
22
|
-

|
|
23
23
|
|
|
24
24
|
High-level CLI:
|
|
25
25
|
* Run commands
|
|
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
|