10.1.1. Class cerebro.aclasses.AbstractAttachment¶
-
class
cerebro.aclasses.AbstractAttachment(event_id, message_id, attach_id)[source]¶ Basic class of attachment. Provides basic functions to access attachment properties
Methods
-
DATA_= ''¶ Tuple fields of attacment
-
DATA_COMMENT= 7¶ Text comment. Type - string.
-
DATA_EVENT_ID= 1¶ Message ID. Type - int.
-
DATA_FILE_HASH= 10¶ Attachment file hash sum. Type - string.
-
DATA_FILE_PATH= 8¶ File path to attachment. Type - string.
-
DATA_FILE_SIZE= 5¶ Attachment filesize, bytes. Type - int.
-
DATA_GROUP_ID= 2¶ Attachment ID. Type - int.
-
DATA_HAS_REVIEW= 4¶ A mediafile has a review. 0 - no, 1 - yes.
-
DATA_IS_LINK= 3¶ Attachment type: 0 - file, 1 - link.
-
DATA_MTM= 0¶ Data modification time. Type - datetime.
-
DATA_NAME= 6¶ Attachment name. Type - string.
-
DATA_REVIEW_HASH= 11¶ Review file hash sum. Type - string.
-
DATA_REVIEW_PATH= 9¶ File path to review. Type - string.
-
DATA_THUMB1_HASH= 12¶ First thumbnail hash sum. Type - string.
-
DATA_THUMB2_HASH= 13¶ Second thumbnail hash sum. Type - string.
-
DATA_THUMB3_HASH= 14¶ Third thumbnail hash sum. Type - string.
-
file_path()[source]¶ Returns: the path to the file. May be absent if there is no file in the file storage. In thise case, an empty string is returned. Return type: string
-
file_size()[source]¶ Returns: the attachment’s filesize in bytes. In case the attachment is a link, returns 0. Return type: int
-