removed old progress bar code

This commit is contained in:
Rhet Turnbull
2019-11-24 08:35:30 -08:00
parent aa73c2f055
commit 6abd10eddf
2 changed files with 1 additions and 30 deletions

View File

@@ -404,7 +404,6 @@ class PhotosDB:
"select count(*) from RKFace, RKPerson, RKVersion where RKFace.personID = RKperson.modelID " "select count(*) from RKFace, RKPerson, RKVersion where RKFace.personID = RKperson.modelID "
+ "and RKFace.imageModelId = RKVersion.modelId and RKVersion.isInTrash = 0" + "and RKFace.imageModelId = RKVersion.modelId and RKVersion.isInTrash = 0"
) )
# init_pbar_status("Faces", c.fetchone()[0])
# c.execute("select RKPerson.name, RKFace.imageID from RKFace, RKPerson where RKFace.personID = RKperson.modelID") # c.execute("select RKPerson.name, RKFace.imageID from RKFace, RKPerson where RKFace.personID = RKperson.modelID")
c.execute( c.execute(
"select RKPerson.name, RKVersion.uuid from RKFace, RKPerson, RKVersion, RKMaster " "select RKPerson.name, RKVersion.uuid from RKFace, RKPerson, RKVersion, RKMaster "
@@ -421,9 +420,7 @@ class PhotosDB:
self._dbfaces_person[person[0]] = [] self._dbfaces_person[person[0]] = []
self._dbfaces_uuid[person[1]].append(person[0]) self._dbfaces_uuid[person[1]].append(person[0])
self._dbfaces_person[person[0]].append(person[1]) self._dbfaces_person[person[0]].append(person[1])
# set_pbar_status(i)
i = i + 1 i = i + 1
# close_pbar_status()
i = 0 i = 0
c.execute( c.execute(
@@ -432,7 +429,6 @@ class PhotosDB:
+ "RKAlbumVersion.versionID = RKVersion.modelId and " + "RKAlbumVersion.versionID = RKVersion.modelId and "
+ "RKVersion.filename not like '%.pdf' and RKVersion.isInTrash = 0" + "RKVersion.filename not like '%.pdf' and RKVersion.isInTrash = 0"
) )
# init_pbar_status("Albums", c.fetchone()[0])
# c.execute("select RKPerson.name, RKFace.imageID from RKFace, RKPerson where RKFace.personID = RKperson.modelID") # c.execute("select RKPerson.name, RKFace.imageID from RKFace, RKPerson where RKFace.personID = RKperson.modelID")
c.execute( c.execute(
"select RKAlbum.name, RKVersion.uuid from RKAlbum, RKVersion, RKAlbumVersion " "select RKAlbum.name, RKVersion.uuid from RKAlbum, RKVersion, RKAlbumVersion "
@@ -448,9 +444,7 @@ class PhotosDB:
self._dbalbums_album[album[0]] = [] self._dbalbums_album[album[0]] = []
self._dbalbums_uuid[album[1]].append(album[0]) self._dbalbums_uuid[album[1]].append(album[0])
self._dbalbums_album[album[0]].append(album[1]) self._dbalbums_album[album[0]].append(album[1])
# set_pbar_status(i)
i = i + 1 i = i + 1
# close_pbar_status()
c.execute( c.execute(
"select count(*) from RKKeyword, RKKeywordForVersion,RKVersion, RKMaster " "select count(*) from RKKeyword, RKKeywordForVersion,RKVersion, RKMaster "
@@ -458,7 +452,6 @@ class PhotosDB:
+ "RKVersion.modelID = RKKeywordForVersion.versionID and RKMaster.uuid = " + "RKVersion.modelID = RKKeywordForVersion.versionID and RKMaster.uuid = "
+ "RKVersion.masterUuid and RKVersion.filename not like '%.pdf' and RKVersion.isInTrash = 0" + "RKVersion.masterUuid and RKVersion.filename not like '%.pdf' and RKVersion.isInTrash = 0"
) )
# init_pbar_status("Keywords", c.fetchone()[0])
c.execute( c.execute(
"select RKKeyword.name, RKVersion.uuid, RKMaster.uuid from " "select RKKeyword.name, RKVersion.uuid, RKMaster.uuid from "
+ "RKKeyword, RKKeywordForVersion, RKVersion, RKMaster " + "RKKeyword, RKKeywordForVersion, RKVersion, RKMaster "
@@ -475,26 +468,20 @@ class PhotosDB:
self._dbkeywords_keyword[keyword[0]] = [] self._dbkeywords_keyword[keyword[0]] = []
self._dbkeywords_uuid[keyword[1]].append(keyword[0]) self._dbkeywords_uuid[keyword[1]].append(keyword[0])
self._dbkeywords_keyword[keyword[0]].append(keyword[1]) self._dbkeywords_keyword[keyword[0]].append(keyword[1])
# set_pbar_status(i)
i = i + 1 i = i + 1
# close_pbar_status()
c.execute("select count(*) from RKVolume") c.execute("select count(*) from RKVolume")
# init_pbar_status("Volumes", c.fetchone()[0])
c.execute("select RKVolume.modelId, RKVolume.name from RKVolume") c.execute("select RKVolume.modelId, RKVolume.name from RKVolume")
i = 0 i = 0
for vol in c: for vol in c:
self._dbvolumes[vol[0]] = vol[1] self._dbvolumes[vol[0]] = vol[1]
# set_pbar_status(i)
i = i + 1 i = i + 1
# close_pbar_status()
c.execute( c.execute(
"select count(*) from RKVersion, RKMaster where RKVersion.isInTrash = 0 and " "select count(*) from RKVersion, RKMaster where RKVersion.isInTrash = 0 and "
+ "RKVersion.type = 2 and RKVersion.masterUuid = RKMaster.uuid and " + "RKVersion.type = 2 and RKVersion.masterUuid = RKMaster.uuid and "
+ "RKVersion.filename not like '%.pdf'" + "RKVersion.filename not like '%.pdf'"
) )
# init_pbar_status("Photos", c.fetchone()[0])
c.execute( c.execute(
"select RKVersion.uuid, RKVersion.modelId, RKVersion.masterUuid, RKVersion.filename, " "select RKVersion.uuid, RKVersion.modelId, RKVersion.masterUuid, RKVersion.filename, "
+ "RKVersion.lastmodifieddate, RKVersion.imageDate, RKVersion.mainRating, " + "RKVersion.lastmodifieddate, RKVersion.imageDate, RKVersion.mainRating, "
@@ -506,7 +493,6 @@ class PhotosDB:
) )
i = 0 i = 0
for row in c: for row in c:
# set_pbar_status(i)
i = i + 1 i = i + 1
uuid = row[0] uuid = row[0]
logging.debug(f"i = {i:d}, uuid = '{uuid}, master = '{row[2]}") logging.debug(f"i = {i:d}, uuid = '{uuid}, master = '{row[2]}")
@@ -540,7 +526,6 @@ class PhotosDB:
self._dbphotos[uuid]["name"] = row[13] self._dbphotos[uuid]["name"] = row[13]
self._dbphotos[uuid]["isMissing"] = row[14] self._dbphotos[uuid]["isMissing"] = row[14]
# close_pbar_status()
conn.close() conn.close()
# add faces and keywords to photo data # add faces and keywords to photo data
@@ -635,7 +620,6 @@ class PhotosDB:
"WHERE ZDETECTEDFACE.ZPERSON = ZPERSON.Z_PK AND ZDETECTEDFACE.ZASSET = ZGENERICASSET.Z_PK " "WHERE ZDETECTEDFACE.ZPERSON = ZPERSON.Z_PK AND ZDETECTEDFACE.ZASSET = ZGENERICASSET.Z_PK "
"AND ZGENERICASSET.ZTRASHEDSTATE = 0 AND ZGENERICASSET.ZKIND = 0 " "AND ZGENERICASSET.ZTRASHEDSTATE = 0 AND ZGENERICASSET.ZKIND = 0 "
) )
# init_pbar_status("Faces", c.fetchone()[0])
# c.execute("select RKPerson.name, RKFace.imageID from RKFace, RKPerson where RKFace.personID = RKperson.modelID") # c.execute("select RKPerson.name, RKFace.imageID from RKFace, RKPerson where RKFace.personID = RKperson.modelID")
c.execute( c.execute(
"SELECT ZPERSON.ZFULLNAME, ZGENERICASSET.ZUUID " "SELECT ZPERSON.ZFULLNAME, ZGENERICASSET.ZUUID "
@@ -652,13 +636,11 @@ class PhotosDB:
self._dbfaces_person[person[0]] = [] self._dbfaces_person[person[0]] = []
self._dbfaces_uuid[person[1]].append(person[0]) self._dbfaces_uuid[person[1]].append(person[0])
self._dbfaces_person[person[0]].append(person[1]) self._dbfaces_person[person[0]].append(person[1])
# set_pbar_status(i)
i = i + 1 i = i + 1
logging.debug(f"Finished walking through persons") logging.debug(f"Finished walking through persons")
logging.debug(pformat(self._dbfaces_person)) logging.debug(pformat(self._dbfaces_person))
logging.debug(self._dbfaces_uuid) logging.debug(self._dbfaces_uuid)
# close_pbar_status()
i = 0 i = 0
c.execute( c.execute(
@@ -668,7 +650,6 @@ class PhotosDB:
"JOIN ZGENERICALBUM ON ZGENERICALBUM.Z_PK = Z_26ASSETS.Z_26ALBUMS " "JOIN ZGENERICALBUM ON ZGENERICALBUM.Z_PK = Z_26ASSETS.Z_26ALBUMS "
"WHERE ZGENERICASSET.ZTRASHEDSTATE = 0 AND ZGENERICASSET.ZKIND = 0 " "WHERE ZGENERICASSET.ZTRASHEDSTATE = 0 AND ZGENERICASSET.ZKIND = 0 "
) )
# init_pbar_status("Albums", c.fetchone()[0])
# c.execute("select RKPerson.name, RKFace.imageID from RKFace, RKPerson where RKFace.personID = RKperson.modelID") # c.execute("select RKPerson.name, RKFace.imageID from RKFace, RKPerson where RKFace.personID = RKperson.modelID")
c.execute( c.execute(
"SELECT ZGENERICALBUM.ZTITLE, ZGENERICASSET.ZUUID " "SELECT ZGENERICALBUM.ZTITLE, ZGENERICASSET.ZUUID "
@@ -685,12 +666,10 @@ class PhotosDB:
self._dbalbums_album[album[0]] = [] self._dbalbums_album[album[0]] = []
self._dbalbums_uuid[album[1]].append(album[0]) self._dbalbums_uuid[album[1]].append(album[0])
self._dbalbums_album[album[0]].append(album[1]) self._dbalbums_album[album[0]].append(album[1])
# set_pbar_status(i)
i = i + 1 i = i + 1
logging.debug(f"Finished walking through albums") logging.debug(f"Finished walking through albums")
logging.debug(pformat(self._dbalbums_album)) logging.debug(pformat(self._dbalbums_album))
logging.debug(pformat(self._dbalbums_uuid)) logging.debug(pformat(self._dbalbums_uuid))
# close_pbar_status()
c.execute( c.execute(
"SELECT COUNT(*) " "SELECT COUNT(*) "
@@ -700,7 +679,6 @@ class PhotosDB:
"JOIN ZKEYWORD ON ZKEYWORD.Z_PK = Z_1KEYWORDS.Z_37KEYWORDS " "JOIN ZKEYWORD ON ZKEYWORD.Z_PK = Z_1KEYWORDS.Z_37KEYWORDS "
"WHERE ZGENERICASSET.ZTRASHEDSTATE = 0 AND ZGENERICASSET.ZKIND = 0 " "WHERE ZGENERICASSET.ZTRASHEDSTATE = 0 AND ZGENERICASSET.ZKIND = 0 "
) )
# init_pbar_status("Keywords", c.fetchone()[0])
c.execute( c.execute(
"SELECT ZKEYWORD.ZTITLE, ZGENERICASSET.ZUUID " "SELECT ZKEYWORD.ZTITLE, ZGENERICASSET.ZUUID "
"FROM ZGENERICASSET " "FROM ZGENERICASSET "
@@ -717,24 +695,19 @@ class PhotosDB:
self._dbkeywords_keyword[keyword[0]] = [] self._dbkeywords_keyword[keyword[0]] = []
self._dbkeywords_uuid[keyword[1]].append(keyword[0]) self._dbkeywords_uuid[keyword[1]].append(keyword[0])
self._dbkeywords_keyword[keyword[0]].append(keyword[1]) self._dbkeywords_keyword[keyword[0]].append(keyword[1])
# set_pbar_status(i)
i = i + 1 i = i + 1
logging.debug(f"Finished walking through keywords") logging.debug(f"Finished walking through keywords")
# close_pbar_status()
logging.debug(pformat(self._dbkeywords_keyword)) logging.debug(pformat(self._dbkeywords_keyword))
logging.debug(pformat(self._dbkeywords_uuid)) logging.debug(pformat(self._dbkeywords_uuid))
c.execute("SELECT COUNT(*) FROM ZFILESYSTEMVOLUME") c.execute("SELECT COUNT(*) FROM ZFILESYSTEMVOLUME")
# init_pbar_status("Volumes", c.fetchone()[0])
c.execute("SELECT ZUUID, ZNAME from ZFILESYSTEMVOLUME") c.execute("SELECT ZUUID, ZNAME from ZFILESYSTEMVOLUME")
i = 0 i = 0
for vol in c: for vol in c:
self._dbvolumes[vol[0]] = vol[1] self._dbvolumes[vol[0]] = vol[1]
# set_pbar_status(i)
i = i + 1 i = i + 1
logging.debug(f"Finished walking through volumes") logging.debug(f"Finished walking through volumes")
logging.debug(self._dbvolumes) logging.debug(self._dbvolumes)
# close_pbar_status()
logging.debug(f"Getting information about photos") logging.debug(f"Getting information about photos")
# TODO: Since I don't use progress bars now, can probably remove the count # TODO: Since I don't use progress bars now, can probably remove the count
@@ -744,7 +717,6 @@ class PhotosDB:
"JOIN ZADDITIONALASSETATTRIBUTES ON ZADDITIONALASSETATTRIBUTES.ZASSET = ZGENERICASSET.Z_PK " "JOIN ZADDITIONALASSETATTRIBUTES ON ZADDITIONALASSETATTRIBUTES.ZASSET = ZGENERICASSET.Z_PK "
"WHERE ZGENERICASSET.ZTRASHEDSTATE = 0 AND ZGENERICASSET.ZKIND = 0 " "WHERE ZGENERICASSET.ZTRASHEDSTATE = 0 AND ZGENERICASSET.ZKIND = 0 "
) )
# init_pbar_status("Photos", c.fetchone()[0])
c.execute( c.execute(
"SELECT ZGENERICASSET.ZUUID, " "SELECT ZGENERICASSET.ZUUID, "
"ZADDITIONALASSETATTRIBUTES.ZMASTERFINGERPRINT, " "ZADDITIONALASSETATTRIBUTES.ZMASTERFINGERPRINT, "
@@ -788,7 +760,6 @@ class PhotosDB:
i = 0 i = 0
for row in c: for row in c:
# set_pbar_status(i)
i = i + 1 i = i + 1
uuid = row[0] uuid = row[0]
if _debug: if _debug:

View File

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