From 0429c8f88848ca8b869e01b92667df619cc5c3d4 Mon Sep 17 00:00:00 2001 From: Rhet Turnbull Date: Fri, 27 Dec 2019 07:09:14 -0800 Subject: [PATCH] Cleaned up unused applescript code --- osxphotos/_version.py | 2 +- osxphotos/photosdb.py | 54 ------------------------------------------- 2 files changed, 1 insertion(+), 55 deletions(-) diff --git a/osxphotos/_version.py b/osxphotos/_version.py index bf2c0143..0eb03758 100644 --- a/osxphotos/_version.py +++ b/osxphotos/_version.py @@ -1,3 +1,3 @@ """ version info """ -__version__ = "0.18.00" +__version__ = "0.18.01" diff --git a/osxphotos/photosdb.py b/osxphotos/photosdb.py index 40b679e8..a0909653 100644 --- a/osxphotos/photosdb.py +++ b/osxphotos/photosdb.py @@ -25,7 +25,6 @@ from ._version import __version__ from .photoinfo import PhotoInfo from .utils import _check_file_exists, _get_os_version, get_last_library_path -# TODO: find edited photos: see https://github.com/orangeturtle739/photos-export/blob/master/extract_photos.py # TODO: Add test for imageTimeZoneOffsetSeconds = None # TODO: Fix command line so multiple --keyword, etc. are AND (instead of OR as they are in .photos()) # Or fix the help text to match behavior @@ -54,9 +53,6 @@ class PhotosDB: f"you have {system}, OS version: {major}" ) - # configure AppleScripts used to manipulate Photos - # self._setup_applescript() - # set up the data structures used to store all the Photo database info # Path to the Photos library database file @@ -121,8 +117,6 @@ class PhotosDB: self._dbfile = dbfile - # force Photos to quit (TODO: this might not be needed since we copy the file) - # self._scpt_quit.run() self._tmp_db = self._copy_db_file(self._dbfile) self._db_version = self._get_db_version() if int(self._db_version) >= int(_PHOTOS_5_VERSION): @@ -296,46 +290,6 @@ class PhotosDB: albums.add(self._dbalbum_details[album]["title"]) return list(albums) - # def _setup_applescript(self): - # """ setup various applescripts used internally (e.g. to close Photos) """ - # self._scpt_export = "" - # self._scpt_launch = "" - # self._scpt_quit = "" - - # # Compile apple script that exports one image - # # self._scpt_export = _applescript.AppleScript(''' - # # on run {arg} - # # set thepath to "%s" - # # tell application "Photos" - # # set theitem to media item id arg - # # set thelist to {theitem} - # # export thelist to POSIX file thepath - # # end tell - # # end run - # # ''' % (tmppath)) - # # - # # Compile apple script that launches Photos.App - # self._scpt_launch = _applescript.AppleScript( - # """ - # on run - # tell application "Photos" - # activate - # end tell - # end run - # """ - # ) - - # # Compile apple script that quits Photos.App - # self._scpt_quit = _applescript.AppleScript( - # """ - # on run - # tell application "Photos" - # quit - # end tell - # end run - # """ - # ) - @property def db_version(self): """ return the database version as stored in LiGlobals table """ @@ -420,10 +374,6 @@ class PhotosDB: # Epoch is Jan 1, 2001 td = (datetime(2001, 1, 1, 0, 0) - datetime(1970, 1, 1, 0, 0)).total_seconds() - # Ensure Photos.App is not running - # TODO: Don't think we need this here - # self._scpt_quit.run() - (conn, c) = self._open_sql_file(self._tmp_db) # Look for all combinations of persons and pictures @@ -744,10 +694,6 @@ class PhotosDB: # Epoch is Jan 1, 2001 td = (datetime(2001, 1, 1, 0, 0) - datetime(1970, 1, 1, 0, 0)).total_seconds() - # Ensure Photos.App is not running - # TODO: Don't think we need this here - # self._scpt_quit.run() - (conn, c) = self._open_sql_file(self._tmp_db) # Look for all combinations of persons and pictures