How to use the pymtp.models.LIBMTP_DeviceStorage function in PyMTP

To help you get started, we’ve selected a few PyMTP examples, based on popular ways it is used in public projects.

Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.

github emdete / python-mtp / pymtp / models.py View on Github external
# ---------
# Begin LIBMTP_DeviceStorage and MTPDeviceStorage
# ---------

class LIBMTP_DeviceStorage(ctypes.Structure):
	"""
		LIBMTP_DeviceStorage

		Contains the ctypes structure for LIBMTP_devicestorage_t
	"""

	def __repr__(self):
		return 'Storage storage_id=%s'% self.storage_id

LIBMTP_DeviceStorage._fields_ = [
	("storage_id", ctypes.c_uint32),
	("storage_type", ctypes.c_uint16),
	("filesystem_type", ctypes.c_uint16),
	("access_capability", ctypes.c_uint16),
	("max_capacity", ctypes.c_uint64),
	("free_space", ctypes.c_uint64),
	("free_space_in_objects", ctypes.c_uint64),
	("storage_description", ctypes.c_char_p),
	("volume_id", ctypes.c_char_p),
	("next", ctypes.POINTER(LIBMTP_DeviceStorage)),
	("prev", ctypes.POINTER(LIBMTP_DeviceStorage)),
	]

class MTPDeviceStorage(BaseModel):
	"""
		MTPDeviceStorage
github emdete / python-mtp / pymtp / models.py View on Github external
class LIBMTP_MTPDevice(ctypes.Structure):
	"""
		LIBMTP_MTPDevice

		Contains the ctypes structure for LIBMTP_mtpdevice_struct
	"""

	def __repr__(self):
		return 'Device with object_bitsize=%s, maximum_battery_level=%s, cached=%s, storage=%s'% (
			self.object_bitsize, self.maximum_battery_level, self.cached, self.storage, )

LIBMTP_MTPDevice._fields_ = [
	("object_bitsize", ctypes.c_uint8),
	("params", ctypes.c_void_p),
	("usbinfo", ctypes.c_void_p),
	("storage", ctypes.POINTER(LIBMTP_DeviceStorage)),
	("errorstack", ctypes.POINTER(LIBMTP_Error)),
	("maximum_battery_level", ctypes.c_uint8),
	("default_music_folder", ctypes.c_uint32),
	("default_playlist_folder", ctypes.c_uint32),
	("default_picture_folder", ctypes.c_uint32),
	("default_video_folder", ctypes.c_uint32),
	("default_organizer_folder", ctypes.c_uint32),
	("default_zencast_folder", ctypes.c_uint32),
	("default_album_folder", ctypes.c_uint32),
	("default_text_folder", ctypes.c_uint32),
	("cd", ctypes.c_void_p),
	("extensions", ctypes.c_void_p),
	("cached", ctypes.c_int),
	("next", ctypes.POINTER(LIBMTP_MTPDevice)),
	]