Beispiel #1
0
 def __init__(self, ewctrl, orig_offer, my_offer):
     super(MyEProposal, self).__init__(make_random_id(), ewctrl, orig_offer)
     self.my_offer = my_offer
     if not orig_offer.matches(my_offer):
         raise Exception("Offers are incongruent!")
     self.etx_spec = ewctrl.make_etx_spec(self.offer.B, self.offer.A)
     self.etx_data = None
Beispiel #2
0
 def __init__(self, ewctrl, orig_offer, my_offer):
     super(MyEProposal, self).__init__(make_random_id(),
                                       ewctrl, orig_offer)
     self.my_offer = my_offer
     if not orig_offer.matches(my_offer):
         raise Exception("offers are incongruent")
     self.etx_spec = ewctrl.make_etx_spec(self.offer.B, self.offer.A)
     self.etx_data = None
Beispiel #3
0
 def post_message(self, content):
     msgid = make_random_id()
     content['msgid'] = msgid
     self.own_msgids.add(msgid)
     LOGDEBUG( "----- POSTING MESSAGE ----")
     data = json.dumps(content)
     LOGDEBUG(data)
     u = urllib2.urlopen(self.url, data)
     return u.read() == 'Success'
Beispiel #4
0
 def post_message(self, content):
     msgid = make_random_id()
     content['msgid'] = msgid
     self.own_msgids.add(msgid)
     LOGDEBUG("----- POSTING MESSAGE ----")
     data = json.dumps(content)
     LOGDEBUG(data)
     u = urllib2.urlopen(self.url, data)
     return u.read() == 'Success'
Beispiel #5
0
 def __init__(self, oid, A, B):
     self.oid = oid or make_random_id()
     self.A = A
     self.B = B
     self.expires = None
Beispiel #6
0
 def post_message(self, content):
   msgid = make_random_id()
   content['msgid'] = msgid
   self.own_msgids.add(msgid)
   return self.http_interface.post(self.url, content)
Beispiel #7
0
 def __init__(self, oid, A, B):
     self.oid = oid or make_random_id()
     self.A = A
     self.B = B
     self.expires = None
Beispiel #8
0
 def post_message(self, content):
     msgid = make_random_id()
     content['msgid'] = msgid
     self.own_msgids.add(msgid)
     return self.http_interface.post(self.url, content)