implement rm

This commit is contained in:
foamyguy 2024-05-28 18:26:35 -05:00
parent e75a7dbf3a
commit a01586b342
2 changed files with 6 additions and 19 deletions

View file

@ -726,7 +726,6 @@ class WebBackend(Backend):
"""
return "/".join((self.device_location, "fs", filename))
def is_device_present(self):
"""
returns True if the device is currently connected and running supported version

View file

@ -211,25 +211,13 @@ def get_cli(ctx, file, location): # pragma: no cover
@main.command("rm")
@click.argument("file", nargs=-1)
@click.argument("file", nargs=1)
@click.pass_context
def rm_cli(ctx, module): # pragma: no cover
def rm_cli(ctx, file): # pragma: no cover
"""
Delete a file on the device.
"""
# device_path = ctx.obj["DEVICE_PATH"]
# print(f"Uninstalling {module} from {device_path}")
# for name in module:
# device_modules = ctx.obj["backend"].get_device_versions()
# name = name.lower()
# mod_names = {}
# for module_item, metadata in device_modules.items():
# mod_names[module_item.replace(".py", "").lower()] = metadata
# if name in mod_names:
# metadata = mod_names[name]
# module_path = metadata["path"]
# ctx.obj["backend"].uninstall(device_path, module_path)
# click.echo("Uninstalled '{}'.".format(name))
# else:
# click.echo("Module '{}' not found on device.".format(name))
# continue
click.echo(f"running: rm {file}")
ctx.obj["backend"].uninstall(
ctx.obj["backend"].device_location, ctx.obj["backend"].get_file_path(file)
)