Exemple #1
0
  def __getattr__(self, name):
    if name == 'am_i_thief':
      return self.thief != None and self.thief == hruntime.user

    if name == 'am_i_victim':
      return self.victim != None and self.victim == hruntime.user

    return Event.__getattr__(self, name)
Exemple #2
0
  def to_api(self):
    d = Event.to_api(self)

    d['thief'] = hlib.api.User(self.thief) if self.thief != None else None
    d['victim'] = hlib.api.User(self.victim) if self.victim != None else None

    d['am_i_thief'] = self.am_i_thief
    d['am_i_victim'] = self.am_i_victim

    return d
Exemple #3
0
  def __init__(self, thief = None, victim = None, **kwargs):
    Event.__init__(self, **kwargs)

    self.thief		= thief
    self.victim		= victim