示例#1
0
 def add_collection_item(self, item, count):
     item_name = item[1:] if item[:1] == '@' else item
     coll_items = self.get_collection_items()
     coll_count = obj2dict(coll_items).get(item_name, 0) + count
     self.get_state().collectionItems.__setattr__(item_name, coll_count)
示例#2
0
 def add_collection_item(self, item, count):
     item_name = item[1:] if item[:1] == '@' else item
     coll_items = self.get_collection_items()
     coll_count = obj2dict(coll_items).get(item_name, 0) + count
     self.get_state().collectionItems.__setattr__(item_name, coll_count)
示例#3
0
 def send(self, data):
     data = obj2dict(data)
     assert 'type' in data
     request = self.factory.create_request(data)
     return dict2obj(request.send(self.connection))
示例#4
0
 def send(self, data):
     data = obj2dict(data)
     assert 'type' in data
     request = self.factory.create_request(data)
     return dict2obj(request.send(self.connection))