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

Zarro Boogs per Child bugtracker at laptop.org
Tue Jul 1 17:24:00 EDT 2008


#7409: Activities: if __name__ == "__main__", then what?
---------------------+------------------------------------------------------
 Reporter:  probono  |         Owner:  marco         
     Type:  defect   |        Status:  new           
 Priority:  normal   |     Milestone:  Never Assigned
Component:  sugar    |       Version:  Update.1      
 Keywords:           |   Next_action:  never set     
 Verified:  0        |     Blockedby:                
 Blocking:           |  
---------------------+------------------------------------------------------
 Short version:

 There should be a way to run an activity's main python file directly,
 using ./activity.py - this is crucial in order to be able to run and debug
 from an IDE.

 Long version:

 Usually, python modules include a shebang and a section that starts with
 if __name__ == "__main__":
 that is used to run the module during development, run tests, etc. This is
 especially important when using a IDE (such as idle or wing), since the
 built-in debug function essentially runs the currently active file, which
 triggers its __main__.

 Unfortunately, there is currently no obvious way to run a sugar activity
 directly. Please see the attachment and
 * Provide a solution that works with what we already have
 or
 * Implement whatever is needed to make it work

 Ideally, one does NOT need to create a full activity bundle structure just
 to run a simple activity like the one in the attachment. (This will make
 distributed development much easier.)

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


More information about the Bugs mailing list