def connect_iTunes(profile={}): global __itc if not __itc: __itc = DACP.itunes( profile['itunes']['host'], profile['itunes']['guid'] ) return __itc
def configure(old_profile): if not old_profile: old_profile = {'host': '', 'guid': ''} else: print "Host: %s\nGUID: %s" % (old_profile['host'], old_profile['guid']) if yn_input("Is this information correct"): return old_profile print "Open iTunes and choose IRIS as a remote. Enter any passcode" host, guid = DACP.pair() return {'host': host, 'guid': guid}