diff --git a/src/__pycache__/branch_tab.cpython-39.pyc b/src/__pycache__/branch_tab.cpython-39.pyc index 0231356..831f71e 100644 Binary files a/src/__pycache__/branch_tab.cpython-39.pyc and b/src/__pycache__/branch_tab.cpython-39.pyc differ diff --git a/src/__pycache__/explorer_backend.cpython-39.pyc b/src/__pycache__/explorer_backend.cpython-39.pyc index e65579e..9f94d67 100644 Binary files a/src/__pycache__/explorer_backend.cpython-39.pyc and b/src/__pycache__/explorer_backend.cpython-39.pyc differ diff --git a/src/branch_tab.py b/src/branch_tab.py index f40aa8b..b278a37 100644 --- a/src/branch_tab.py +++ b/src/branch_tab.py @@ -53,7 +53,7 @@ def setup_adress_bar(self): def setup_treeview(self): column_names = ['Filename', 'Date Modified', 'Type', 'Size'] - column_widths = [400, 100, 300, 100] + column_widths = [400, 200, 300, 100] height = 20 self.treeview = treeview_functions.create_treeview(self, column_names, column_widths, height) diff --git a/src/explorer_backend.py b/src/explorer_backend.py index cd18661..927da68 100644 --- a/src/explorer_backend.py +++ b/src/explorer_backend.py @@ -1,5 +1,7 @@ import os import subprocess +import time +import datetime class FileExplorerBackend: def __init__(self, mainapp): @@ -9,9 +11,7 @@ def __init__(self, mainapp): def get_default_directory(self): return os.getcwd() - def list_directory(self, directory=None): - file_data = '' - + def list_directory(self, directory=None): if directory == None: directory = self.current_directory try: @@ -26,15 +26,27 @@ def list_directory(self, directory=None): file_data = [] files = [o for o in files_dirs if not os.path.isdir(os.path.join(directory,o))] for f in files: - file_data.append([f, '-', 'File', '']) + full_path = os.path.join(directory,f) + + size = os.path.getsize(full_path)*0.001 # in kb + + modified = os.path.getmtime(full_path) + modified = datetime.datetime.fromtimestamp(modified) + + file_data.append([f, modified.strftime("%d/%m/%Y, %H:%M:%S"), 'File', f'{int(size):,} KB']) + #file_data.append([f, '-', 'File', '-']) self.current_directory = directory except PermissionError: directory_data = 'Permission Denied' + file_data = '' except Exception as e: + print(e) directory_data = 'An Error Ocurred' + file_data = '' if not os.path.isdir(directory): directory_data = 'Location Does Not Exist' + file_data = '' return directory_data + file_data diff --git a/src/main.py b/src/main.py index 3cead76..cfcc085 100644 --- a/src/main.py +++ b/src/main.py @@ -34,7 +34,7 @@ def __init__(self, parent, *args, **kwargs): self.setup_tabs() def setup_variables(self): - self.version = '0.03.0' + self.version = '0.04.0' self.parent.title(f"Tk Path Finder V{self.version}") self.config_data = config_file_manager.load_config_file(self)