diff --git a/flit/__init__.py b/flit/__init__.py index f023be7..9142eff 100644 --- a/flit/__init__.py +++ b/flit/__init__.py @@ -1,6 +1,6 @@ from flit.flit import main -__version__ = "20241202.1" +__version__ = "20241216.0" def flit(): diff --git a/flit/flit.py b/flit/flit.py index 01b068f..e66994e 100755 --- a/flit/flit.py +++ b/flit/flit.py @@ -127,6 +127,7 @@ class Flit: config["name"] = name config["to_deletion"] = to_del_time config["due"] = is_due + config["URL"] = f"{self.opts.root}/{name}/" return config @@ -201,7 +202,14 @@ class Flit: """ folders = self.get_folders() - header_format = "{:" + str(12 + len(self.opts.root)) + "} {} {} {} {}" + pad=4 + for c in folders: + if filter_name is not None: + if filter_name != c["name"]: + continue + pad = max(pad,len(c['URL'])) + header_format = "{:" + str(pad) + "} {:10} {:10} {:5} {}" + row_format = "{:" +str(pad)+ "} {} {} {: 4d}d{} {}" print(header_format.format("URL", "Created", "ToDelete", "InDays", "Description")) for c in folders: if filter_name is not None: @@ -209,9 +217,8 @@ class Flit: continue due = "*" if c["due"] else " " print( - "{}/{}/ {} {} {: 4d}d{} {}".format( - self.opts.root, - c["name"], + row_format.format( + c["URL"], c["created"].isoformat()[0:10], c["delete_time"].isoformat()[0:10], c["to_deletion"].days, @@ -222,7 +229,7 @@ class Flit: if verbose: sub_files = self.get_sub_files(c["name"]) for sp in sub_files: - print(" {}/{}/{}".format(self.opts.root, c["name"], quote(sp, "/"))) + print(" {}{}".format(c["URL"], quote(sp, "/"))) def get_sub_files(self, name): """Get 1st level files in a share