Refactored PhotoInfo to use properties instead of methods--major update
This commit is contained in:
@@ -29,17 +29,17 @@ def main():
|
||||
photos = photosdb.photos()
|
||||
for p in photos:
|
||||
print(
|
||||
p.uuid(),
|
||||
p.filename(),
|
||||
p.date(),
|
||||
p.description(),
|
||||
p.name(),
|
||||
p.keywords(),
|
||||
p.albums(),
|
||||
p.persons(),
|
||||
p.path(),
|
||||
p.ismissing(),
|
||||
p.hasadjustments(),
|
||||
p.uuid,
|
||||
p.filename,
|
||||
p.date,
|
||||
p.description,
|
||||
p.title,
|
||||
p.keywords,
|
||||
p.albums,
|
||||
p.persons,
|
||||
p.path,
|
||||
p.ismissing,
|
||||
p.hasadjustments,
|
||||
)
|
||||
|
||||
|
||||
|
||||
@@ -6,6 +6,7 @@ import os.path
|
||||
|
||||
import osxphotos
|
||||
|
||||
|
||||
def main():
|
||||
photosdb = osxphotos.PhotosDB()
|
||||
photos = photosdb.photos()
|
||||
@@ -13,14 +14,15 @@ def main():
|
||||
export_path = os.path.expanduser("~/Desktop/export")
|
||||
|
||||
for p in photos:
|
||||
if not p.ismissing():
|
||||
if p.hasadjustments():
|
||||
if not p.ismissing:
|
||||
if p.hasadjustments:
|
||||
exported = p.export(export_path, edited=True)
|
||||
else:
|
||||
exported = p.export(export_path)
|
||||
print(f"Exported {p.filename()} to {exported}")
|
||||
print(f"Exported {p.filename} to {exported}")
|
||||
else:
|
||||
print(f"Skipping missing photo: {p.filename()}")
|
||||
print(f"Skipping missing photo: {p.filename}")
|
||||
|
||||
|
||||
if __name__ == "__main__":
|
||||
main()
|
||||
main()
|
||||
|
||||
Reference in New Issue
Block a user