def raw(args): text = sys.stdin.read() cmpush.execute(args.ip, text, 'user', 'password')
def url(args): push_xml = cmxml.create_execute_url(args.url) cmpush.execute(args.ip, push_xml, 'user', 'password')
def click(ip, button): cmpush.execute(ip, cmxml.create_execute_url(button), 'user', 'password') return 'clicking'
def status(args): data = '' text = sys.stdin.read() push_xml = cmxml.PHONE_STATUS % {'text': text, 'width': 100, 'height': 20, 'data': data} cmpush.execute(args.ip, push_xml, 'user', 'password')
import sys import plac import time import pycisco.cmpush as cmpush import pycisco.cmxml as cmxml def create_set_ringer(num): ringer_key = 'Key:KeyPad%d' % num return 'Key:Settings', 'Key:KeyPad2', ringer_key, 'Key:Soft1', 'Key:Soft3', 'Key:Settings' if __name__ == '__main__': ip = sys.argv[1] ringer = int(sys.argv[2]) for url in create_set_ringer(ringer): cmpush.execute(ip, cmxml.create_execute_url(url), 'user', 'password') time.sleep(0.5)