fixed version check for Catalina

This commit is contained in:
Rhet Turnbull
2019-10-14 09:44:11 -07:00
parent d311431c91
commit f62a9d3d4e
3 changed files with 17 additions and 4 deletions

View File

@@ -13,6 +13,9 @@ Only works on Mac OS X. Tested on Mac OS 10.12.6 / Photos 2.0, 10.13.6 / Photos
This module will read Photos databases for any supported version on any supported OS version. E.g. you can read a database created with Photos 4.0 on Mac OS 10.14 on a machine running Mac OS 10.12
NOTE: Does NOT currently support Mac OS 10.15 / Catalina and Photos 5.0. This module will run on Catalina but you will only be able to read Photos database files created with Photos 4.0 or lower. Photos 5.0 on Catalina uses an entirely new database schema and the code has not yet been udpated to work with this version.
## Installation instructions
osxmetadata uses setuptools, thus simply run:

View File

@@ -20,10 +20,9 @@ from . import _applescript
# from loguru import logger
# TODO: Does not work with Photos 5.0 / Mac OS 10.15 Catalina
# TODO: standardize _ and __ as leading char for private variables
# TODO: fix use of ''' and """
# TODO: fix docstrings
# TODO: fix versions tested to include 10.14.6
# which Photos library database versions have been tested
# Photos 2.0 (10.12.6) == 2622
@@ -42,7 +41,18 @@ _debug = False
def _get_os_version():
# returns tuple containing OS version
# e.g. 10.13.6 = (10, 13, 6)
(ver, major, minor) = platform.mac_ver()[0].split(".")
version = platform.mac_ver()[0].split(".")
if len(version) == 2:
(ver, major) = version
minor = "0"
elif len(version) == 3:
(ver, major, minor) = version
else:
raise (
ValueError(
f"Could not parse version string: {platform.mac_ver()} {version}"
)
)
return (ver, major, minor)

View File

@@ -38,7 +38,7 @@ with open(path.join(this_directory, "README.md"), encoding="utf-8") as f:
setup(
name="osxphotos",
version="0.12.4",
version="0.12.5",
description="Manipulate (read-only) Apple's Photos app library on Mac OS X",
long_description=long_description,
long_description_content_type="text/markdown",