Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.
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: