Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.
return MTPDevice(self._get_item(key))
# --------
# Beginning LibMTP_File, MTPFile and MTPFiles
# --------
class LIBMTP_File(ctypes.Structure):
"""
LIBMTP_File
Contains the ctypes structure for LIBMTP_file_t
"""
def __repr__(self):
return "%s (%s)" % (self.filename, self.item_id)
LIBMTP_File._fields_ = [
("item_id", ctypes.c_uint32),
("parent_id", ctypes.c_uint32),
("storage_id", ctypes.c_uint32),
("filename", ctypes.c_char_p),
("filesize", ctypes.c_uint64),
("modificationdate", ctypes.c_int),
("filetype", ctypes.c_int),
("next", ctypes.POINTER(LIBMTP_File)),
]
LIBMTP_File_p = ctypes.POINTER(LIBMTP_File)
class MTPFile(BaseModel):
"""
MTPFile
LIBMTP_File
Contains the ctypes structure for LIBMTP_file_t
"""
def __repr__(self):
return "%s (%s)" % (self.filename, self.item_id)
LIBMTP_File._fields_ = [
("item_id", ctypes.c_uint32),
("parent_id", ctypes.c_uint32),
("storage_id", ctypes.c_uint32),
("filename", ctypes.c_char_p),
("filesize", ctypes.c_uint64),
("modificationdate", ctypes.c_int),
("filetype", ctypes.c_int),
("next", ctypes.POINTER(LIBMTP_File)),
]
LIBMTP_File_p = ctypes.POINTER(LIBMTP_File)
class MTPFile(BaseModel):
"""
MTPFile
A class representing a file on an MTP device.
"""
@property
def item_id(self):
"""
The unique identifier for the file
@return: File identifier
@rtype: int