Ejemplo n.º 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
Ejemplo n.º 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
Ejemplo n.º 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'
Ejemplo n.º 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'
Ejemplo n.º 5
0
 def __init__(self, oid, A, B):
     self.oid = oid or make_random_id()
     self.A = A
     self.B = B
     self.expires = None
Ejemplo n.º 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)
Ejemplo n.º 7
0
 def __init__(self, oid, A, B):
     self.oid = oid or make_random_id()
     self.A = A
     self.B = B
     self.expires = None
Ejemplo n.º 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)