#7409 NORM -: Activities: if __name__ == "__main__", then what?

Zarro Boogs per Child bugtracker at laptop.org
Wed Jul 16 17:13:48 EDT 2008


#7409: Activities: if __name__ == "__main__", then what?
-------------------------+--------------------------------------------------
   Reporter:  probono    |       Owner:  marco   
       Type:  defect     |      Status:  closed  
   Priority:  normal     |   Milestone:          
  Component:  sugar      |     Version:  Update.1
 Resolution:  fixed      |    Keywords:          
Next_action:  never set  |    Verified:  0       
  Blockedby:             |    Blocking:          
-------------------------+--------------------------------------------------
Changes (by probono):

  * status:  new => closed
  * resolution:  => fixed


Comment:

 Thanks tomeu for the following solution:

 {{{
 class Handle:
     pass

 if __name__ == "__main__":
     h = Handle()
     h.activity_id = 'dummy'
     h.object_id = None
     a = testActivity(h)
 }}}

 Works as long as one doesn't run this as root.

-- 
Ticket URL: <http://dev.laptop.org/ticket/7409#comment:2>
One Laptop Per Child <http://laptop.org/>
OLPC bug tracking system


More information about the Bugs mailing list