Stand vor Protokollumbau
This commit is contained in:
@@ -3,7 +3,7 @@ import argparse
|
||||
import sys
|
||||
from core.config import load_config
|
||||
from core.connection import BuzzerConnection, BuzzerError
|
||||
from core.commands import info, ls, put, mkdir, rm, confirm, reboot, play, check
|
||||
from core.commands import info, ls, put, mkdir, rm, confirm, reboot, play, check, get_tag
|
||||
|
||||
def main():
|
||||
parser = argparse.ArgumentParser(description="Edis Buzzer Host Tool")
|
||||
@@ -52,6 +52,10 @@ def main():
|
||||
# Befehl: reboot
|
||||
reboot_parser = subparsers.add_parser("reboot", help="Startet den Buzzer neu")
|
||||
|
||||
# Befehl: get_tag
|
||||
get_tag_parser = subparsers.add_parser("get_tag", help="Holt die Tags einer Datei")
|
||||
get_tag_parser.add_argument("path", type=str, help="Pfad der Datei (z.B. /lfs/a/neu)")
|
||||
|
||||
# Argumente parsen
|
||||
args = parser.parse_args()
|
||||
config = load_config(args)
|
||||
@@ -105,6 +109,14 @@ def main():
|
||||
print(f"CRC32 von '{args.path}': 0x{CRC32['crc32']:08x}")
|
||||
else:
|
||||
print(f"Fehler: Keine CRC32-Information für '{args.path}' erhalten.")
|
||||
elif args.command == "get_tag":
|
||||
tags = get_tag.execute(conn, path=args.path)
|
||||
if tags:
|
||||
print(f"Tags von '{args.path}':")
|
||||
for key, value in tags.items():
|
||||
print(f" {key}: {value}")
|
||||
else:
|
||||
print(f"Fehler: Keine Tags für '{args.path}' erhalten.")
|
||||
elif args.command == "info" or args.command is None:
|
||||
# Wurde kein Befehl oder explizit 'info' angegeben, sind wir hier schon fertig
|
||||
pass
|
||||
|
||||
Reference in New Issue
Block a user