Skip to content

Commit 69bce2f

Browse files
committed
Merge branch 'path_fixes' into HEAD
2 parents 7d75b5e + 9a2a668 commit 69bce2f

File tree

2 files changed

+15
-13
lines changed

2 files changed

+15
-13
lines changed

pokete.py

Lines changed: 9 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -741,7 +741,7 @@ def save():
741741
"pokete_care": pokete_care.dict(),
742742
"time": timer.time.time
743743
}
744-
with open(SAVEPATH + "/pokete.json", "w+") as file:
744+
with open(SAVEPATH / "pokete.json", "w+") as file:
745745
# writes the data to the save file in a nice format
746746
json.dump(_si, file, indent=4)
747747
logging.info("[General] Saved")
@@ -781,15 +781,15 @@ def read_save():
781781
"time": 0
782782
}
783783

784-
if os.path.exists(SAVEPATH + "/pokete.json"):
785-
with open(SAVEPATH + "/pokete.json") as _file:
784+
if os.path.exists(SAVEPATH / "pokete.json"):
785+
with open(SAVEPATH / "pokete.json") as _file:
786786
_si = json.load(_file)
787-
elif os.path.exists(HOME + "/.cache/pokete/pokete.json"):
788-
with open(HOME + "/.cache/pokete/pokete.json") as _file:
787+
elif os.path.exists(HOME / ".cache" / "pokete" / "pokete.json"):
788+
with open(HOME / ".cache" / "pokete" / "pokete.json") as _file:
789789
_si = json.load(_file)
790-
elif os.path.exists(HOME + "/.cache/pokete/pokete.py"):
790+
elif os.path.exists(HOME / ".cache" / "pokete" / "pokete.py"):
791791
l_dict = {}
792-
with open(HOME + "/.cache/pokete/pokete.py", "r") as _file:
792+
with open(HOME / ".cache" / "pokete" / "pokete.py", "r") as _file:
793793
exec(_file.read(), {"session_info": _si}, l_dict)
794794
_si = json.loads(json.dumps(l_dict["session_info"]))
795795
return _si
@@ -1402,7 +1402,7 @@ def recogniser():
14021402
width, height = tss()
14031403

14041404
# Home global
1405-
HOME = str(Path.home())
1405+
HOME = Path.home()
14061406

14071407
# loading screen
14081408
loading_screen = LoadingScreen(VERSION, CODENAME)
@@ -1412,7 +1412,7 @@ def recogniser():
14121412
session_info = read_save()
14131413

14141414
# logging config
1415-
log_file = f"{SAVEPATH}/pokete.log" if do_logging else None
1415+
log_file = (SAVEPATH / "pokete.log") if do_logging else None
14161416
logging.basicConfig(filename=log_file,
14171417
format='[%(asctime)s][%(levelname)s]: %(message)s',
14181418
level=logging.DEBUG if do_logging else logging.ERROR)

release.py

Lines changed: 6 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -5,8 +5,10 @@
55

66
VERSION = "0.7.2"
77
CODENAME = "Grey Edition"
8-
SAVEPATH = os.environ.get(
9-
"XDG_DATA_HOME",
10-
str(Path.home())+"/.local/share"
11-
) + "/pokete"
8+
SAVEPATH = Path(
9+
os.environ.get(
10+
"XDG_DATA_HOME",
11+
str(Path.home())+"/.local/share"
12+
)
13+
) / "pokete"
1214
FRAMETIME = 0.05

0 commit comments

Comments
 (0)