Added shared to json and str, updated __repr__
This commit is contained in:
@@ -472,8 +472,7 @@ class PhotoInfo:
|
|||||||
return self._info["latitude"]
|
return self._info["latitude"]
|
||||||
|
|
||||||
def __repr__(self):
|
def __repr__(self):
|
||||||
# TODO: update to use __class__ and __name__
|
return f"osxphotos.{self.__class__.__name__}(db={self._db}, uuid='{self._uuid}', info={self._info})"
|
||||||
return f"osxphotos.PhotoInfo(db={self._db}, uuid='{self._uuid}', info={self._info})"
|
|
||||||
|
|
||||||
def __str__(self):
|
def __str__(self):
|
||||||
info = {
|
info = {
|
||||||
@@ -495,12 +494,12 @@ class PhotoInfo:
|
|||||||
"latitude": self._latitude,
|
"latitude": self._latitude,
|
||||||
"longitude": self._longitude,
|
"longitude": self._longitude,
|
||||||
"path_edited": self.path_edited,
|
"path_edited": self.path_edited,
|
||||||
|
"shared": self.shared,
|
||||||
}
|
}
|
||||||
return yaml.dump(info, sort_keys=False)
|
return yaml.dump(info, sort_keys=False)
|
||||||
|
|
||||||
def json(self):
|
def json(self):
|
||||||
""" return JSON representation """
|
""" return JSON representation """
|
||||||
# TODO: Add additional details here
|
|
||||||
pic = {
|
pic = {
|
||||||
"uuid": self.uuid,
|
"uuid": self.uuid,
|
||||||
"filename": self.filename,
|
"filename": self.filename,
|
||||||
@@ -520,6 +519,7 @@ class PhotoInfo:
|
|||||||
"latitude": self._latitude,
|
"latitude": self._latitude,
|
||||||
"longitude": self._longitude,
|
"longitude": self._longitude,
|
||||||
"path_edited": self.path_edited,
|
"path_edited": self.path_edited,
|
||||||
|
"shared": self.shared,
|
||||||
}
|
}
|
||||||
return json.dumps(pic)
|
return json.dumps(pic)
|
||||||
|
|
||||||
|
|||||||
@@ -1118,5 +1118,4 @@ class PhotosDB:
|
|||||||
return photoinfo
|
return photoinfo
|
||||||
|
|
||||||
def __repr__(self):
|
def __repr__(self):
|
||||||
# TODO: update to use __class__ and __name__
|
return f"osxphotos.{self.__class__.__name__}(dbfile='{self.db_path}')"
|
||||||
return f"osxphotos.PhotosDB(dbfile='{self.db_path}')"
|
|
||||||
|
|||||||
Reference in New Issue
Block a user