Esempio n. 1
0
def do_getitemestimates(collection_ids):
    getitemestimate_xmldoc_req = GetItemEstimate.build(
        storage.get_synckeys_dict(curs), collection_ids, gie_options)
    getitemestimate_xmldoc_res = as_request("GetItemEstimate",
                                            getitemestimate_xmldoc_req)

    getitemestimate_res = GetItemEstimate.parse(getitemestimate_xmldoc_res)
    return getitemestimate_res
Esempio n. 2
0
def do_sync(collections):
    as_sync_xmldoc_req = Sync.build(storage.get_synckeys_dict(curs), collections)
    print "\r\nRequest:"
    print as_sync_xmldoc_req
    res = as_conn.post("Sync", parser.encode(as_sync_xmldoc_req))
    print "\r\nResponse:"
    if res == '':
        print "Nothing to Sync!"
    else:
        collectionid_to_type_dict = storage.get_serverid_to_type_dict()
        as_sync_xmldoc_res = parser.decode(res)
        print as_sync_xmldoc_res
        sync_res = Sync.parse(as_sync_xmldoc_res, collectionid_to_type_dict)
        storage.update_items(sync_res)
        return sync_res
Esempio n. 3
0
def do_sync(collections):
    as_sync_xmldoc_req = Sync.build(storage.get_synckeys_dict(curs), collections)
    print ("\r\nRequest:")
    print (as_sync_xmldoc_req)
    res = as_conn.post("Sync", parser.encode(as_sync_xmldoc_req))
    print ("\r\nResponse:")
    if res == '':
        print ("Nothing to Sync!")
    else:
        collectionid_to_type_dict = storage.get_serverid_to_type_dict()
        as_sync_xmldoc_res = parser.decode(res)
        print (as_sync_xmldoc_res)
        sync_res = Sync.parse(as_sync_xmldoc_res, collectionid_to_type_dict)
        storage.update_items(sync_res)
        return sync_res
Esempio n. 4
0
def do_getitemestimates(collection_ids):
    getitemestimate_xmldoc_req = GetItemEstimate.build(storage.get_synckeys_dict(curs), collection_ids, gie_options)
    getitemestimate_xmldoc_res = as_request("GetItemEstimate", getitemestimate_xmldoc_req)

    getitemestimate_res = GetItemEstimate.parse(getitemestimate_xmldoc_res)
    return getitemestimate_res