For V4, it may be interesting to add some tuple exports to the Journal as well... Let's discuss it next time we bump into each other on IRC.
-walter On Mon, Jun 22, 2009 at 10:56 PM, Benjamin M. Schwartz < bmsch...@fas.harvard.edu> wrote: > -----BEGIN PGP SIGNED MESSAGE----- > Hash: SHA1 > > SharedTextDemo-3 is available at > http://dev.laptop.org/~bemasc/SharedTextDemo-3.xo<http://dev.laptop.org/%7Ebemasc/SharedTextDemo-3.xo> > > This version introduces saving to and loading from the Journal. The > contents of the textbox are saved to the Journal, and loaded back in when > you relaunch the program. This may not sound like a very impressive > feature, but consider the source code of the activity (in its entirety): > > """ > from groupthink import sugar_tools, gtk_tools > import sugar > > class SharedTextDemoActivity(sugar_tools.GroupActivity): > def initialize_display(self): > self.cloud.textview = gtk_tools.SharedTextView() > return self.cloud.textview > """ > > The self.cloud object takes care not only of sharing the TextView over the > network, live, but also of serializing it to disk on save, and > deserializing it on load. At 6 lines of code, this system is finally > approaching a level of boilerplate I would consider acceptable for users > to build their own activities.* > > In addition to working Journal persistence, this version also adds (very > simple) wait screens. With wait screens, the user is not left at the > pulsing activity icon during slow actions, like loading a large journal > entry or joining a shared session. Instead, the activity displays a > message informing the user of its current status as soon as possible after > launch. Naturally, both automatic load/save and wait screens are > available to any activity using Groupthink, not just SharedTextDemo. > > - --Ben > > *: There is admittedly a tradeoff here between flexibility and magic. > self.cloud, providing magic load/save and sharing, will only accept > objects of appropriate type, drawn from the groupthink library. This > means that users must code with an understanding of the types of the > objects they are using. > -----BEGIN PGP SIGNATURE----- > Version: GnuPG v2.0.11 (GNU/Linux) > > iEYEARECAAYFAkpARGYACgkQUJT6e6HFtqQI9ACeNunokI+4g8V6cT8crPpLi6lf > BYsAn35d5fFxGfVfifzpjQQQbTB154aI > =OnVL > -----END PGP SIGNATURE----- > _______________________________________________ > Sugar-devel mailing list > Sugar-devel@lists.sugarlabs.org > http://lists.sugarlabs.org/listinfo/sugar-devel > -- Walter Bender Sugar Labs http://www.sugarlabs.org
_______________________________________________ Sugar-devel mailing list Sugar-devel@lists.sugarlabs.org http://lists.sugarlabs.org/listinfo/sugar-devel