How to use the pymtp.MTP.set_debug 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 / examples / mtpshell.py View on Github external
def main():
	if 'LIBMTP_DEBUG' in environ: MTP.set_debug(int(environ['LIBMTP_DEBUG']))
	with MTP(False) as mtp:
		print("Welcome to the PyMTP Shell")
		print("You are currently connected to '{}'".format(mtp.get_devicename()))
		print("Your MTP object is '{}'".format("mtp"))
		print("Your progress callback object is '{}'".format("callback"))
		print("To exit, type 'quit'")
		while True:
			try:
				if mtp.device:
					result = raw_input("(connected) >>> ")
				else:
					result = raw_input("(disconnected) >>> ")
				if result.startswith("quit"):
					mtp.disconnect()
					sys.exit()
				else: