from client.Sync import Sync from client.GetItemEstimate import GetItemEstimate from client.Ping import Ping from client.Provision import Provision from client.ValidateCert import ValidateCert from objects.MSASHTTP import ASHTTPConnector from objects.MSASCMD import FolderHierarchy, as_status from objects.MSASAIRS import airsync_FilterType, airsync_Conflict, airsync_MIMETruncation, airsync_MIMESupport, airsync_Class, airsyncbase_Type from proto_creds import * #create a file proto_creds.py with vars: as_server, as_user, as_pass pyver = sys.version_info storage.create_db_if_none() conn, curs = storage.get_conn_curs() device_info = { "Model": "%d.%d.%d" % (pyver[0], pyver[1], pyver[2]), "IMEI": "123457", "FriendlyName": "My pyAS Client 2", "OS": "Python", "OSLanguage": "en-us", "PhoneNumber": "NA", "MobileOperator": "NA", "UserAgent": "pyAS" } #create wbxml_parser test cp, cp_sh = as_code_pages.build_as_code_pages() parser = wbxml_parser(cp, cp_sh)
from client.ItemOperations import ItemOperations from client.ValidateCert import ValidateCert from client.SendMail import SendMail from client.SmartForward import SmartForward from client.SmartReply import SmartReply from objects.MSASHTTP import ASHTTPConnector from objects.MSASCMD import FolderHierarchy, as_status from objects.MSASAIRS import airsync_FilterType, airsync_Conflict, airsync_MIMETruncation, airsync_MIMESupport, airsync_Class, airsyncbase_Type from proto_creds import * #create a file proto_creds.py with vars: as_server, as_user, as_pass pyver = sys.version_info storage.create_db_if_none() conn, curs = storage.get_conn_curs() device_info = {"Model":"%d.%d.%d" % (pyver[0], pyver[1], pyver[2]), "IMEI":"123456", "FriendlyName":"My pyAS Client", "OS":"Python", "OSLanguage":"en-us", "PhoneNumber": "NA", "MobileOperator":"NA", "UserAgent": "pyAS"} #create wbxml_parser test cp, cp_sh = as_code_pages.build_as_code_pages() parser = wbxml_parser(cp, cp_sh) #create activesync connector as_conn = ASHTTPConnector(as_server) #e.g. "as.myserver.com" as_conn.set_credential(as_user, as_pass) as_conn.options() policykey = storage.get_keyvalue("X-MS-PolicyKey") if policykey: as_conn.set_policykey(policykey) def as_request(cmd, wapxml_req):