Removed applescript to close Photos
This commit is contained in:
@@ -18,7 +18,7 @@ import CoreFoundation
|
|||||||
import objc
|
import objc
|
||||||
from Foundation import *
|
from Foundation import *
|
||||||
|
|
||||||
from . import _applescript
|
# from . import _applescript
|
||||||
from ._version import __version__
|
from ._version import __version__
|
||||||
|
|
||||||
# TODO: find edited photos: see https://github.com/orangeturtle739/photos-export/blob/master/extract_photos.py
|
# TODO: find edited photos: see https://github.com/orangeturtle739/photos-export/blob/master/extract_photos.py
|
||||||
@@ -126,7 +126,7 @@ class PhotosDB:
|
|||||||
)
|
)
|
||||||
|
|
||||||
# configure AppleScripts used to manipulate Photos
|
# configure AppleScripts used to manipulate Photos
|
||||||
self._setup_applescript()
|
# self._setup_applescript()
|
||||||
|
|
||||||
# set up the data structures used to store all the Photo database info
|
# set up the data structures used to store all the Photo database info
|
||||||
|
|
||||||
@@ -164,7 +164,7 @@ class PhotosDB:
|
|||||||
self._dbfile = dbfile
|
self._dbfile = dbfile
|
||||||
|
|
||||||
# force Photos to quit (TODO: this might not be needed since we copy the file)
|
# force Photos to quit (TODO: this might not be needed since we copy the file)
|
||||||
self._scpt_quit.run()
|
# self._scpt_quit.run()
|
||||||
self._tmp_db = self._copy_db_file(self._dbfile)
|
self._tmp_db = self._copy_db_file(self._dbfile)
|
||||||
self._db_version = self._get_db_version()
|
self._db_version = self._get_db_version()
|
||||||
if int(self._db_version) >= int(_PHOTOS_5_VERSION):
|
if int(self._db_version) >= int(_PHOTOS_5_VERSION):
|
||||||
@@ -261,45 +261,45 @@ class PhotosDB:
|
|||||||
albums.add(self._dbalbum_details[album]["title"])
|
albums.add(self._dbalbum_details[album]["title"])
|
||||||
return list(albums)
|
return list(albums)
|
||||||
|
|
||||||
def _setup_applescript(self):
|
# def _setup_applescript(self):
|
||||||
""" setup various applescripts used internally (e.g. to close Photos) """
|
# """ setup various applescripts used internally (e.g. to close Photos) """
|
||||||
self._scpt_export = ""
|
# self._scpt_export = ""
|
||||||
self._scpt_launch = ""
|
# self._scpt_launch = ""
|
||||||
self._scpt_quit = ""
|
# self._scpt_quit = ""
|
||||||
|
|
||||||
# Compile apple script that exports one image
|
# # Compile apple script that exports one image
|
||||||
# self._scpt_export = _applescript.AppleScript('''
|
# # self._scpt_export = _applescript.AppleScript('''
|
||||||
# on run {arg}
|
# # on run {arg}
|
||||||
# set thepath to "%s"
|
# # 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"
|
# tell application "Photos"
|
||||||
# set theitem to media item id arg
|
# activate
|
||||||
# set thelist to {theitem}
|
|
||||||
# export thelist to POSIX file thepath
|
|
||||||
# end tell
|
# end tell
|
||||||
# end run
|
# 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
|
# # Compile apple script that quits Photos.App
|
||||||
self._scpt_quit = _applescript.AppleScript(
|
# self._scpt_quit = _applescript.AppleScript(
|
||||||
"""
|
# """
|
||||||
on run
|
# on run
|
||||||
tell application "Photos"
|
# tell application "Photos"
|
||||||
quit
|
# quit
|
||||||
end tell
|
# end tell
|
||||||
end run
|
# end run
|
||||||
"""
|
# """
|
||||||
)
|
# )
|
||||||
|
|
||||||
def get_db_version(self):
|
def get_db_version(self):
|
||||||
""" return the database version as stored in LiGlobals table """
|
""" return the database version as stored in LiGlobals table """
|
||||||
@@ -431,7 +431,7 @@ class PhotosDB:
|
|||||||
|
|
||||||
# Ensure Photos.App is not running
|
# Ensure Photos.App is not running
|
||||||
# TODO: Don't think we need this here
|
# TODO: Don't think we need this here
|
||||||
self._scpt_quit.run()
|
# self._scpt_quit.run()
|
||||||
|
|
||||||
(conn, c) = self._open_sql_file(self._tmp_db)
|
(conn, c) = self._open_sql_file(self._tmp_db)
|
||||||
|
|
||||||
@@ -755,7 +755,7 @@ class PhotosDB:
|
|||||||
|
|
||||||
# Ensure Photos.App is not running
|
# Ensure Photos.App is not running
|
||||||
# TODO: Don't think we need this here
|
# TODO: Don't think we need this here
|
||||||
self._scpt_quit.run()
|
# self._scpt_quit.run()
|
||||||
|
|
||||||
(conn, c) = self._open_sql_file(self._tmp_db)
|
(conn, c) = self._open_sql_file(self._tmp_db)
|
||||||
|
|
||||||
|
|||||||
@@ -1,4 +1,4 @@
|
|||||||
""" version info """
|
""" version info """
|
||||||
|
|
||||||
__version__ = "0.14.14"
|
__version__ = "0.14.15"
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user