1 class MrBeige(Person):
   2     def wakeOnLan(self):
   3         # I don't have a permanent net connection, so I haven't gotten around to this yet.
   4         raise NotImplementedError
   5 
   6 
   7     sleepLocations = ("dorm room",
   8                       "PCL",
   9                       "stanton's group's office",
  10                       "mike's place")
  11     def sleep(self):
  12         # I never know until I actually do it
  13         location = random.choice(self.sleepLocations)
  14         actualTime = time.sleep(location)
  15         if time.dayOfWeek() in ("Su", "M", "T", "W", "Th")howLong > 4.: # hours
  16             raise IrregularityError  # this shouldn't happen
  17         return actualTime
  18 
  19     def doHomework(self, homework):
  20         timeLeft = time.time() - homework.duedate()
  21         if timeLeft < time.gettimed("0 min"):
  22              self.speed(10)
  23              return os.do(homework)
  24         if homework.isInteresting():
  25              return os.do(homework)
  26         if timeleft > time.gettimed("1 day"):
  27              return False  # do I want to raise a SomethingElseInterestingToDoWarning ?
  28         return os.do(homework)
  29 
  30     def ordersSir(self, sir):
  31         self.say("Orders, SIR!", to=sir)
  32         if sir.orders() == "None":
  33             self.ordersSir(sir)

MrBeige (last edited 2008-03-10 01:39:02 by localhost)