replaced debug print statements with logging.debug

This commit is contained in:
Rhet Turnbull
2019-11-17 16:46:34 -08:00
parent e0b1113870
commit 17bc04a24a

View File

@@ -43,6 +43,7 @@ _PHOTOS_5_VERSION = "6000"
# which major version operating systems have been tested # which major version operating systems have been tested
_TESTED_OS_VERSIONS = ["12", "13", "14"] _TESTED_OS_VERSIONS = ["12", "13", "14"]
# set _debug = True to enable debug output
_debug = True _debug = True
logging.basicConfig( logging.basicConfig(
level=logging.DEBUG, level=logging.DEBUG,
@@ -52,6 +53,7 @@ logging.basicConfig(
if not _debug: if not _debug:
logging.disable() logging.disable()
def _get_os_version(): def _get_os_version():
# returns tuple containing OS version # returns tuple containing OS version
# e.g. 10.13.6 = (10, 13, 6) # e.g. 10.13.6 = (10, 13, 6)
@@ -91,7 +93,7 @@ class PhotosDB:
"WARNING: This module has only been tested with MacOS 10." "WARNING: This module has only been tested with MacOS 10."
+ f"[{', '.join(_TESTED_OS_VERSIONS)}]: " + f"[{', '.join(_TESTED_OS_VERSIONS)}]: "
+ f"you have {system}, OS version: {major}", + f"you have {system}, OS version: {major}",
file=sys.stderr file=sys.stderr,
) )
# configure AppleScripts used to manipulate Photos # configure AppleScripts used to manipulate Photos
@@ -312,7 +314,7 @@ class PhotosDB:
else: else:
print( print(
"Could not extract photos URL String from IPXDefaultLibraryURLBookmark", "Could not extract photos URL String from IPXDefaultLibraryURLBookmark",
file=sys.stderr file=sys.stderr,
) )
return None return None