This website requires JavaScript.
Explore
Help
Register
Sign In
sugarlabs
/
sugar-toolkit-gtk3
Watch
1
Star
0
Fork
0
You've already forked sugar-toolkit-gtk3
Code
Issues
Pull Requests
Releases
Wiki
Activity
9a6c9ce69c
sugar-toolkit-gtk3
/
bin
/
sugar-activity
6 lines
94 B
Plaintext
Raw
Normal View
History
Unescape
Escape
Use python2 shebang Some distributions have switched to python3 as default and our code breaks because it's python2 specific. Follow the PEP 394 recommendation.
2013-09-28 11:33:40 +02:00
#!/usr/bin/env python2
sugar-activity: import and make independent of sugar-toolkit GTK versions As we move to adding support for a second UI toolkit (GTK+ 3.x), the sugar-activity binary used by all activities must become backend-toolkit-independent. It would be wasteful to have two backend toolkits loaded in memory, and in the GTK2/GTK3 case, it is impossible (importing both results in an instant crash). To achieve this, we split the existing sugar-toolkit activity/main.py:main() functionality into two parts, moving it into the sugar-activity binary and the Activity class as follows: 1. All toolkit-specific stuff is moved into the Activity class (i.e. everything that interacts with GTK) 2. Everything that can be reasonably/easily moved into the Activity class is also moved. 3. What remains is the stuff that is inherently involved with the construction of the Activity object, not related to UI toolkits. This is moved into the sugar-activity binary. main.py is then removed from sugar-toolkit, and sugar-activity is moved from sugar to sugar-toolkit-gtk3 in order to keep toolkit-related code with the toolkit itself. With this work done, the one remaining question is how to invoke the main loop. An optional run_main_loop() method is added to the activity class, for GTK2 this will run the GTK2 main loop, for GTK3 the GTK3 main loop will be run, etc. Signed-off-by: Daniel Drake <dsd@laptop.org>
2011-12-13 20:47:33 +01:00
Port from Python 2 to six Signed-off-by: James Cameron <quozl@laptop.org>
2018-03-01 12:58:56 +01:00
from sugar3.activity import activityinstance
Factor out sugar-activity code to the toolkit.
2008-08-27 11:04:54 +02:00
Port from Python 2 to six Signed-off-by: James Cameron <quozl@laptop.org>
2018-03-01 12:58:56 +01:00
activityinstance.main()
Reference in New Issue
Copy Permalink