Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- def _load_questions(self):
- """
- """
- d = defer.Deferred()
- # simulate a delayed result by asking the reactor to fire the
- # Deferred in 2 seconds time with the result x * 3
- reactor.callLater(2, d.callback, 3)
- # is it the first time
- if len(self.questions) == 0:
- # load the questions from database
- logging.info("Loading Trivia questions...")
- load startup questions
- self.questions = self.service.getQuestions()
- # save the array in sharedobject (#46)
- #self.setAttribute("askedQuestions", self.questions)
- log.msg('total questions: %s' % len(self.questions))
- return d
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement