How to use the pymtp.models.FixedArray 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
The location on the bus (if available)
			@rtype: int
			@return: bus location
		"""
		return int(self.base_structure.bus_location)

	@property
	def devnum(self):
		"""
			The device number on the bus (if available)
			@rtype: int
			@return: Device number
		"""
		return int(self.base_structure.devnum)

class MTPRawDevices(FixedArray):
	"""
		MTPRawDevices

		An object representing a list/array of MTP devices, such as returned
		from LIBMTP_Detect_Raw_Device
	"""
	def __init__(self, array, length):
		FixedArray.__init__(self, array, length, mutable=False)

	def _get_item(self, key):
		"""
			Returns the object specified by the key
			@param key: The index to return
			@type key: int
			@rtype: L{MTPRawDevice}
			@return: The object specified
github emdete / python-mtp / pymtp / models.py View on Github external
def tracks(self):
		"""
			A list of tracks in the album
		"""
		return FixedArray(self.base_structure.tracks,
			self.base_structure.no_tracks)