Skip to content

Commit

Permalink
fixes after flake8
Browse files Browse the repository at this point in the history
  • Loading branch information
ChrisLauinger77 committed Aug 9, 2024
1 parent 8f378c1 commit 18e53ca
Showing 1 changed file with 15 additions and 14 deletions.
29 changes: 15 additions & 14 deletions photocollage/gtkgui.py
Original file line number Diff line number Diff line change
Expand Up @@ -41,16 +41,17 @@
# cp po/photocollage.pot po/fr.po
# msgfmt -o po/fr.mo po/fr.po


def settings_folder_check():
app_folder = os.path.expanduser("~") + "/.PhotoCollage"
app_folder = os.path.expanduser("~") + "/.local/share/PhotoCollage"
if not os.path.lexists(app_folder):
os.makedirs(app_folder)
return app_folder


def settings_load_lastsettings():
app_folder = settings_folder_check()
settings_file = app_folder + "/lastsettings.json"
settings_file = app_folder + "/lastsettings.json"
if os.path.isfile(settings_file):
with open(settings_file, "r") as openfile:
json_object = json.load(openfile)
Expand All @@ -70,7 +71,7 @@ def settings_load_lastsettings():

def settings_store_lastsettings(settings):
app_folder = settings_folder_check()
settings_file = app_folder + "/lastsettings.json"
settings_file = app_folder + "/lastsettings.json"
dictionary = {
"border_w": settings.border_w,
"border_c": settings.border_c,
Expand All @@ -80,23 +81,24 @@ def settings_store_lastsettings(settings):
with open(settings_file, "w") as openfile:
json.dump(dictionary, openfile, indent=4)


def templates_load_presets():
app_folder = settings_folder_check()
templates_file = app_folder + "/templates.json"
templates_file = app_folder + "/templates.json"
if os.path.isfile(templates_file):
with open(templates_file, "r") as openfile:
json_object = json.load(openfile)
else:
dictionary = {
"" : None,
"800 × 600" : (800, 600),
"1600 × 1200" : (1600, 1200),
"A4 landscape (300ppi)" : (3508, 2480),
"A4 portrait (300ppi)" : (2480, 3508),
"A3 landscape (300ppi)" : (4960, 3508),
"A3 portrait (300ppi)" : (3508, 4960),
"US-Letter landscape (300ppi)" : (3300, 2550),
"US-Letter portrait (300ppi)" : (2550, 3300)
"": None,
"800 × 600": (800, 600),
"1600 × 1200": (1600, 1200),
"A4 landscape (300ppi)": (3508, 2480),
"A4 portrait (300ppi)": (2480, 3508),
"A3 landscape (300ppi)": (4960, 3508),
"A3 portrait (300ppi)": (3508, 4960),
"US-Letter landscape (300ppi)": (3300, 2550),
"US-Letter portrait (300ppi)": (2550, 3300)
}
with open(templates_file, "w") as openfile:
json.dump(dictionary, openfile, indent=4)
Expand Down Expand Up @@ -720,7 +722,6 @@ def __init__(self, parent):
json_object = templates_load_presets()
templates = json_object.items()


def apply_template(combo):
t = combo.get_model()[combo.get_active_iter()][1]
if t:
Expand Down

0 comments on commit 18e53ca

Please sign in to comment.