Skip to content

Commit

Permalink
Merge pull request #1 from TheUdK/sourcery/main
Browse files Browse the repository at this point in the history
Sourcery refactored main branch
  • Loading branch information
TheUdK authored Sep 14, 2023
2 parents 94f4b99 + ccee378 commit 63012b9
Showing 1 changed file with 7 additions and 9 deletions.
16 changes: 7 additions & 9 deletions windowmover.py
Original file line number Diff line number Diff line change
Expand Up @@ -16,22 +16,21 @@
def construct_exe_path():
"""Constructs the path to the GUIPropView.exe executable."""
exe_name = "GUIPropView.exe"

if getattr(sys, 'frozen', False):
base_path = sys._MEIPASS
else:
base_path = os.path.dirname(os.path.abspath(__file__))

exe_path = os.path.join(base_path, 'bin', exe_name)
return exe_path

return os.path.join(base_path, 'bin', exe_name)


def read_window_positions():
"""Reads the window positions and sizes from a CSV file."""
filename = os.path.join(os.getcwd(), 'config.csv')
with open(filename) as f:
reader = csv.reader(f)
windows = [row for row in reader]
windows = list(reader)
return windows


Expand Down Expand Up @@ -82,15 +81,14 @@ def continuously_update_windows(windows, exe_path):
def open_icon_image():
"""Opens the icon image file."""
image_name = "icon.ico"

if getattr(sys, 'frozen', False):
base_path = sys._MEIPASS
else:
base_path = os.path.dirname(os.path.abspath(__file__))

image_path = os.path.join(base_path, image_name)
icon_image = Image.open(image_path)
return icon_image
return Image.open(image_path)

if __name__ == '__main__':
# Construct the path to the executable file
Expand Down

0 comments on commit 63012b9

Please sign in to comment.