Skip to content

Commit

Permalink
v0.11.0
Browse files Browse the repository at this point in the history
  • Loading branch information
bartlomiejduda committed Mar 5, 2022
1 parent bc7a49f commit 80cfe6f
Show file tree
Hide file tree
Showing 18 changed files with 84 additions and 62 deletions.
1 change: 1 addition & 0 deletions CHANGELOG.txt
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,7 @@

# Ver Date Author Comment

# v0.11.0 05.03.2022 Bartlomiej Duda Moved code to "src" directory, enhanced build process
# v0.10.3 03.03.2022 Bartlomiej Duda Enhanced logging
# v0.10.2 02.03.2022 Bartlomiej Duda Enhanced logging
# v0.10.1 01.03.2022 Bartlomiej Duda Updated make_exe script
Expand Down
13 changes: 7 additions & 6 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -3,17 +3,18 @@ Program for editing FSH, SSH, XSH, PSH and MSH images from EA games.

Technologies used: Python 3.7, tkinter

This tool is not finished yet.
This program is not finished yet.

<img src="img\usage.gif">
<img src="src\data\img\usage.gif">


# Building on Windows

1. Install PyCharm 2021.3.2 (Community Edition)
2. Install virtualenv and activate it
3. Install all libraries from requirements.txt
4. Run the main.py file
1. Install **[Python 3.7.0](https://www.python.org/downloads/release/python-370/)**
2. Install **[PyCharm 2021.3.2 (Community Edition)](https://www.jetbrains.com/pycharm/download/#section=windows)**
3. Install virtualenv and activate it
4. Install all libraries from requirements.txt
5. Run the src\main.py file

# Building on Linux/MacOS

Expand Down
38 changes: 0 additions & 38 deletions docs/readme.txt

This file was deleted.

Binary file removed img/loading.png
Binary file not shown.
Binary file removed img/usage.gif
Binary file not shown.
12 changes: 12 additions & 0 deletions mypy.ini
Original file line number Diff line number Diff line change
@@ -0,0 +1,12 @@
[mypy]
python_version = 3.7


[mypy-cx_Freeze]
ignore_missing_imports = True

[mypy-center_tk_window]
ignore_missing_imports = True

[mypy-PIL]
ignore_missing_imports = True
23 changes: 18 additions & 5 deletions setup.py
Original file line number Diff line number Diff line change
@@ -1,8 +1,6 @@
import sys
from cx_Freeze import setup, Executable
from main import VERSION_NUM

build_options = {"packages": [], "excludes": []}
from src.main import VERSION_NUM

base = None
if sys.platform == "win32":
Expand All @@ -11,14 +9,29 @@

executables = [
Executable(
"main.py", base=base, target_name="EA-Graphics-Manager-" + VERSION_NUM + ".exe"
"src/main.py",
copyright="Copyright (C) 2022 Bartlomiej Duda",
base=base,
icon="src/data/img/icon_bd.ico",
target_name="EA-Graphics-Manager-" + VERSION_NUM + ".exe"
)
]

build_exe_options: dict = {
"packages": [],
'includes': [],
"excludes": [],
'include_files': ['src/docs/readme.txt'],
}

options: dict = {
'build_exe': build_exe_options
}

setup(
name="EA-Graphics-Manager " + VERSION_NUM,
version=VERSION_NUM[1:],
description="Tool for managing EA graphics",
options={"build_exe": build_options},
options=options,
executables=executables,
)
9 changes: 5 additions & 4 deletions GUI/GUI_main.py → src/GUI/GUI_main.py
Original file line number Diff line number Diff line change
Expand Up @@ -13,8 +13,8 @@
import webbrowser
import tkinter.ttk as ttk
import center_tk_window
import ea_image_logic
from logger import get_logger
from src import ea_image_logic
from src.logger import get_logger


# Program tested on Python 3.7.0
Expand Down Expand Up @@ -108,19 +108,20 @@ def get_object_bin_attach(in_dir_entry, in_iid):
return bin_attach
logger.warning("Warning! Couldn't find matching BIN_ATTACHMENT object!")

def __init__(self, master, in_version_num):
def __init__(self, master, in_version_num, in_main_directory):
logger.info("GUI init...")
self.GUI_log_text = ""
self.master = master
self.VERSION_NUM = in_version_num
self.MAIN_DIRECTORY = in_main_directory
master.title("EA GRAPHICS MANAGER " + in_version_num)
master.minsize(MIN_WINDOW_WIDTH, MIN_WINDOW_HEIGHT)
master.maxsize(MAX_WINDOW_WIDTH, MAX_WINDOW_HEIGHT)
self.current_dir = os.path.dirname(os.path.abspath(__file__))

icon_dir = None
try:
icon_dir = self.current_dir + "\\..\\img\\icon_bd.ico"
icon_dir = self.MAIN_DIRECTORY + "\\data\\img\\icon_bd.ico"
self.master.iconbitmap(icon_dir)
except tk.TclError:
logger.error("Can't load the icon file from " + icon_dir)
Expand Down
Empty file added src/GUI/__init__.py
Empty file.
Empty file added src/__init__.py
Empty file.
File renamed without changes.
Binary file added src/data/img/usage.gif
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
27 changes: 27 additions & 0 deletions src/docs/readme.txt
Original file line number Diff line number Diff line change
@@ -0,0 +1,27 @@
########################
# EA Graphics Manager #
########################


# Authors #
Program has been created by Bartlomiej Duda.
You can contact me by raising an issue on GitHub.


# Installation #
No installation needed. This program is distributed
as a standalone executable.



# Running the program #
You can simply run this program by double clicking
on the EXE file.
It was built to run on Windows x64 machines.



# Issues #
This program is in an early stage of development,
so some functionalities may not work properly.

2 changes: 1 addition & 1 deletion ea_image_logic.py → src/ea_image_logic.py
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@

import os
import struct
from logger import get_logger
from src.logger import get_logger

logger = get_logger(__name__)

Expand Down
4 changes: 3 additions & 1 deletion logger.py → src/logger.py
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,9 @@ def get_logger(name):
f_handler = logging.FileHandler("log.txt")
logger.setLevel(logging.DEBUG)

log_format = "%(asctime)s - %(name)s - line %(lineno)d - %(levelname)s - %(message)s"
log_format = (
"%(asctime)s - %(name)s - line %(lineno)d - %(levelname)s - %(message)s"
)
datetime_format = "%Y-%m-%d %H:%M:%S"
c_format = logging.Formatter(log_format, datetime_format)
f_format = logging.Formatter(log_format, datetime_format)
Expand Down
13 changes: 7 additions & 6 deletions main.py → src/main.py
Original file line number Diff line number Diff line change
Expand Up @@ -6,18 +6,19 @@
"""

# Program tested on Python 3.7.0


import os
import tkinter as tk
import GUI.GUI_main as GUI
from src.GUI.GUI_main import EAManGui
import center_tk_window
from logger import get_logger
from src.logger import get_logger


VERSION_NUM = "v0.10.3"
VERSION_NUM = "v0.11.0"

logger = get_logger("main")

MAIN_DIRECTORY = os.path.dirname(os.path.abspath(__file__))


def main():
"""
Expand All @@ -29,7 +30,7 @@ def main():
logger.info("Starting main...")

root = tk.Tk()
GUI.EAManGui(root, VERSION_NUM) # start GUI
EAManGui(root, VERSION_NUM, MAIN_DIRECTORY) # start GUI
root.lift()
center_tk_window.center_on_screen(root)
root.mainloop()
Expand Down
4 changes: 3 additions & 1 deletion make_exe.bat → src/make_exe.bat
Original file line number Diff line number Diff line change
Expand Up @@ -4,14 +4,16 @@


@ECHO OFF
cd ..
if exist dist (rd /s /q dist)
if exist build (rd /s /q build)


echo Activating venv...
CALL .\venv\Scripts\activate.bat

echo Executing cxfreeze...
python setup.py build
python setup.py build build_exe


if exist __pycache__ (rd /s /q __pycache__)
Expand Down
File renamed without changes.

0 comments on commit 80cfe6f

Please sign in to comment.