def add_disaster(self, name): disaster = Disaster(did=self.next_disaster_id, name=name) self.next_disaster_id += 1 DISASTERS.append(disaster) self.disasters_ = o = Observable.of(DISASTERS) return o
def login(self): return Observable.of(True) \ .delay(1000) \ .do_action(lambda x: setattr(self, 'is_logged', x))
def get_pyro(self, pyd): return Observable.from_(Pyroes).filter(lambda pyro: pyro.pyd == pyd)
def get_pyroes(self): return Observable.of(Pyroes)
def __init__(self): self.disasters_ = Observable.of(DISASTERS)
def confirm(self, message='Is it OK?'): confirmation = window.confirm(message) return Observable.of(confirmation)