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
示例#2
0
 def login(self):
     return Observable.of(True) \
         .delay(1000) \
         .do_action(lambda x: setattr(self, 'is_logged', x))
示例#3
0
 def get_pyro(self, pyd):
     return Observable.from_(Pyroes).filter(lambda pyro: pyro.pyd == pyd)
示例#4
0
 def get_pyroes(self):
     return Observable.of(Pyroes)
 def __init__(self):
     self.disasters_ = Observable.of(DISASTERS)
示例#6
0
 def confirm(self, message='Is it OK?'):
     confirmation = window.confirm(message)
     return Observable.of(confirmation)