diff --git a/.gitignore b/.gitignore index c0ab7e1..5cd52b9 100644 --- a/.gitignore +++ b/.gitignore @@ -4,5 +4,5 @@ venv/ venv_linux/ build/ dist/ -Finch Filer.spec +finch_filer.spec test.bat diff --git a/Finch Filer b/Finch Filer new file mode 100644 index 0000000..7854d3c Binary files /dev/null and b/Finch Filer differ diff --git a/README.md b/README.md index 72cea46..d659a78 100644 --- a/README.md +++ b/README.md @@ -1,4 +1,4 @@ -# Finch Filer V1.0.1 +# Finch Filer V1.0.2 --- @@ -80,6 +80,10 @@ Email: thomas.j.wilc@gmail.com ## Changelog +1.0.2 + +- Fixed fatal error when running on GNU/Linux + 1.0.1 - Improved directory structure diff --git a/data/file_rules_default.json b/data/file_rules_default.json index d5cb298..3ec4c23 100644 --- a/data/file_rules_default.json +++ b/data/file_rules_default.json @@ -46,14 +46,14 @@ "action": "ignore", "active": true, "destination": "~/Downloads/", - "extensions": ["*.exe", "*.msi", "*.elf"], + "extensions": ["*.exe", "*.msi", "*.dmg", "*.pkg", "*.deb", "*.elf"], "name": "Programs" }, "archive": { "action": "ignore", "active": true, "destination": "~/Downloads/", - "extensions": ["*.zip", "*.rar", "*.tar", "*.iso", "*.gz", "*.lz", "*.rz", "*.7z", "*.dmg"], + "extensions": ["*.zip", "*.rar", "*.tar", "*.iso", "*.gz", "*.lz", "*.rz", "*.xz", "*.7z"], "name": "Archives" }, "other": { diff --git a/icon.svg b/icon.svg new file mode 100644 index 0000000..a896b49 --- /dev/null +++ b/icon.svg @@ -0,0 +1,98 @@ + + + + diff --git a/src/finch_filer/__init__.py b/src/finch_filer/__init__.py index 06f3aaa..a1f4ce3 100644 --- a/src/finch_filer/__init__.py +++ b/src/finch_filer/__init__.py @@ -1,2 +1,2 @@ -__version__ = "1.0.1" +__version__ = "1.0.2" __author__ = "Gull" \ No newline at end of file diff --git a/src/finch_filer/app.py b/src/finch_filer/app.py index 93910af..0eb758b 100644 --- a/src/finch_filer/app.py +++ b/src/finch_filer/app.py @@ -54,12 +54,17 @@ class App(tk.Tk): super().__init__() self.title(APP_NAME) self.option_add('*tearOff', tk.FALSE) - self.iconbitmap(ut.parse_dir("#/icon.ico")) self.fm = fm.Manager(True) # Main file manager object self.log = list() # Running list of all logs self.temp = {"column": "", "reverse": False} # Temporary data self.current_mode = "all" self.custom_rules_path = RULES_PATH + + try: + self.iconbitmap(ut.get_icon_file()) + except Exception as error: + log.warning("Failed to load icon!") + self.gui() # User interface self.load_config() # File rules configuration self.prep() # Ready state diff --git a/src/finch_filer/utils.py b/src/finch_filer/utils.py index e69a393..3c97ba8 100644 --- a/src/finch_filer/utils.py +++ b/src/finch_filer/utils.py @@ -52,6 +52,20 @@ def save_json_file(filepath, data, raw=False): json.dump(data, f, sort_keys=True, indent=None if raw else 2) except Exception as error: raise error + +def get_icon_file(): + """Attempts to return a valid icon file.""" + if os.name == "nt": + path = "" + try: + path = sys._MEIPASS # For PyInstaller + except Exception: + path = os.path.dirname(os.path.abspath(__file__)) + + return pathlib.Path(path).parent.parent / "icon.ico" + else: + path = os.path.dirname(os.path.abspath(__file__)) + return pathlib.Path(path).parent.parent / "icon.svg" def parse_dir(path="", ignore_mkdir=False): """Converts and creates a directory (can be full file path)."""