From b5af1b7fc5213dec94b267a28815794498483204 Mon Sep 17 00:00:00 2001 From: Neil Stevens Date: Fri, 24 Dec 2021 03:08:46 -0500 Subject: [PATCH 1/2] Update conversion of Python strings to CF strings for Python 3 --- gogrepoc.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/gogrepoc.py b/gogrepoc.py index 1053897..1e30cdd 100755 --- a/gogrepoc.py +++ b/gogrepoc.py @@ -2633,7 +2633,7 @@ def __init__(self): def _CFSTR(self,py_string): - return CoreFoundation.CFStringCreateWithCString(None, py_string, CoreFoundation.kCFStringEncodingASCII) + return CoreFoundation.CFStringCreateWithCString(None, py_string.encode('utf-8'), CoreFoundation.kCFStringEncodingUTF8) def raw_ptr(self,pyobjc_string): return objc.pyobjc_id(pyobjc_string.nsstring()) From 7ab1d02be830c67a1900c3d40574f6fa3bb49021 Mon Sep 17 00:00:00 2001 From: Kalanyr Date: Thu, 3 Feb 2022 14:53:53 +1000 Subject: [PATCH 2/2] More aggressive Wakelock on Windows, fix bug when game folder rename fails --- gogrepoc.py | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/gogrepoc.py b/gogrepoc.py index 1053897..bca9966 100755 --- a/gogrepoc.py +++ b/gogrepoc.py @@ -534,7 +534,7 @@ def handle_game_renames(savedir,gamesdb,dryrun): if not dryrun: shutil.move(src_dir,dst_dir) except Exception: - error(' -> rename failed "{}" -> "{}"'.format(olditem.title, newitem.title)) + error(' -> rename failed "{}" -> "{}"'.format(game.old_title, game.title)) for item in game.downloads+game.galaxyDownloads+game.sharedDownloads+game.extras: try: _ = item.old_name @@ -2614,7 +2614,7 @@ def __init__(self): self.ES_SYSTEM_REQUIRED = 0x00000001 self.ES_DISPLAY_REQUIRED = 0x00000002 #Windows is not particularly consistent on what is required for a wakelock for a script that often uses a USB device, so define WAKELOCK for easy changing. This works on Windows 10 as of the October 2017 update. - self.ES_WAKELOCK = self.ES_CONTINUOUS | self.ES_SYSTEM_REQUIRED + self.ES_WAKELOCK = self.ES_CONTINUOUS | self.ES_SYSTEM_REQUIRED | self.ES_DISPLAY_REQUIRED if (platform.system() == "Darwin"):