-
Notifications
You must be signed in to change notification settings - Fork 1
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
123 changed files
with
2,049 additions
and
1,453 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -7,7 +7,7 @@ accounts: | |
role: user | ||
extra: | ||
allowed_apps: | ||
- rstudio | ||
- all | ||
- enabled: false | ||
username: anonymous | ||
name: | ||
|
Large diffs are not rendered by default.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,16 +1,17 @@ | ||
from .base import config_dir_type, quiet_type, verbosity_type | ||
from .base import config_dir_type, dev_type, quiet_type, verbosity_type | ||
from ..app.state import app_manager, console | ||
|
||
|
||
def main( | ||
config_dir: config_dir_type = None, | ||
dev: dev_type = False, | ||
quiet: quiet_type = False, | ||
verbosity: verbosity_type = 0, | ||
) -> None: | ||
""" | ||
Check if the configuration is valid. | ||
""" | ||
app_manager().process_args(config_dir, quiet, verbosity) | ||
app_manager().load_config() | ||
app_manager().process_args(config_dir, dev, quiet, verbosity) | ||
app_manager().load_config_and_plugins() | ||
|
||
console().print("Configuration is valid.") |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,44 @@ | ||
from typing import Annotated | ||
|
||
from typer import Argument | ||
|
||
from .base import config_dir_type, dev_type, quiet_type, verbosity_type | ||
from ..app.state import app_manager, console, plugin_manager | ||
from ..helpers.format import format_input | ||
|
||
|
||
def main( | ||
args: Annotated[ | ||
list[str], | ||
Argument( | ||
help="Names of the plugins to add.", | ||
show_default=False, | ||
), | ||
], | ||
config_dir: config_dir_type = None, | ||
dev: dev_type = False, | ||
quiet: quiet_type = False, | ||
verbosity: verbosity_type = 0, | ||
) -> None: | ||
""" | ||
Install or upgrade plugins. | ||
""" | ||
app_manager().process_args(config_dir, dev, quiet, verbosity) | ||
app_manager().load_config() | ||
|
||
count = 0 | ||
|
||
for arg in args: | ||
plugin_cls = next((x for x in plugin_manager().installable_plugin_classes if x.config.name == arg), None) | ||
|
||
if plugin_cls is None: | ||
console().print_warning(f"Plugin {format_input(arg)} not found or not installable. Skipping.") | ||
continue | ||
|
||
plugin_manager().add_plugin(plugin_cls) | ||
count += 1 | ||
|
||
if count == 1: | ||
console().print("1 plugin added successfully.") | ||
elif count > 1: | ||
console().print(f"{count} plugins added successfully.") |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,84 @@ | ||
from typing import Annotated, Optional | ||
|
||
from rich.table import Table | ||
from typer import Argument | ||
|
||
from .base import config_dir_type, dev_type, quiet_type, verbosity_type | ||
from ..app.state import app_manager, console, plugin_manager | ||
from ..helpers.format import format_input | ||
|
||
|
||
def main( | ||
args: Annotated[ | ||
Optional[list[str]], | ||
Argument( | ||
help="Names of the plugins to list.", | ||
show_default=False, | ||
), | ||
] = None, | ||
config_dir: config_dir_type = None, | ||
dev: dev_type = False, | ||
quiet: quiet_type = False, | ||
verbosity: verbosity_type = 0, | ||
) -> None: | ||
""" | ||
List all installed and custom plugins. | ||
""" | ||
app_manager().process_args(config_dir, dev, quiet, verbosity) | ||
app_manager().load_config() | ||
|
||
plugin_classes = plugin_manager().installed_plugin_classes | ||
|
||
for installable_plugin_cls in plugin_manager().installable_plugin_classes: | ||
if plugin_cls := next((x for x in plugin_classes if x.config.name == installable_plugin_cls.config.name), None): | ||
plugin_cls.installable = True | ||
plugin_cls.alt_version = installable_plugin_cls.config.version | ||
else: | ||
installable_plugin_cls.alt_version = installable_plugin_cls.config.version | ||
plugin_classes.append(installable_plugin_cls) | ||
|
||
if args: | ||
for arg in args: | ||
if plugin_cls := next((x for x in plugin_classes if x.config.name == arg), None): | ||
console().print( | ||
f"{plugin_cls.config.name}" | ||
f"{f' ({plugin_cls.config.descriptive_name})' if plugin_cls.config.descriptive_name else ''}" | ||
) | ||
console().print( | ||
f"{(plugin_cls.installed and plugin_cls.config.version) or '-'}" | ||
f" -> {(plugin_cls.installable and plugin_cls.alt_version) or '-'}" | ||
if plugin_cls.installable | ||
else "" | ||
) | ||
console().print( | ||
f"{'Custom' if plugin_cls.custom else 'Built-in'} plugin " | ||
f"({'installed' if plugin_cls.installed else 'not installed'})" | ||
) | ||
console().print(plugin_cls.config.description or "No description.") | ||
else: | ||
console().print(f"Plugin {format_input(arg)} not found. Skipping.") | ||
|
||
console().request_newline() | ||
else: | ||
if len(plugin_classes) == 0: | ||
console().print("No plugins found.") | ||
return | ||
|
||
plugin_classes.sort(key=lambda x: x.config.name) | ||
plugin_classes.sort(key=lambda x: not x.installed) | ||
|
||
table = Table() | ||
table.add_column("Name") | ||
table.add_column("Current") | ||
table.add_column("Available") | ||
table.add_column("Installed") | ||
|
||
for plugin_cls in plugin_classes: | ||
table.add_row( | ||
plugin_cls.config.name, | ||
(plugin_cls.installed and plugin_cls.config.version) or "-", | ||
(plugin_cls.installable and plugin_cls.alt_version) or "-", | ||
"Yes" if plugin_cls.installed else "No", | ||
) | ||
|
||
console().print(table) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,44 @@ | ||
from typing import Annotated | ||
|
||
from typer import Argument | ||
|
||
from .base import config_dir_type, dev_type, quiet_type, verbosity_type | ||
from ..app.state import app_manager, console, plugin_manager | ||
from ..helpers.format import format_input | ||
|
||
|
||
def main( | ||
args: Annotated[ | ||
list[str], | ||
Argument( | ||
help="Names of the plugins to remove.", | ||
show_default=False, | ||
), | ||
], | ||
config_dir: config_dir_type = None, | ||
dev: dev_type = False, | ||
quiet: quiet_type = False, | ||
verbosity: verbosity_type = 0, | ||
) -> None: | ||
""" | ||
Uninstall plugins. | ||
""" | ||
app_manager().process_args(config_dir, dev, quiet, verbosity) | ||
app_manager().load_config() | ||
|
||
count = 0 | ||
|
||
for arg in args: | ||
plugin_cls = next((x for x in plugin_manager().installed_plugin_classes if x.config.name == arg), None) | ||
|
||
if plugin_cls is None: | ||
console().print_warning(f"Plugin {format_input(arg)} not found or not installed. Skipping.") | ||
continue | ||
|
||
plugin_manager().remove_plugin(plugin_cls) | ||
count += 1 | ||
|
||
if count == 1: | ||
console().print("1 plugin removed successfully.") | ||
elif count > 1: | ||
console().print(f"{count} plugins removed successfully.") |
Oops, something went wrong.