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