~azzar1/unity/add-show-desktop-key

« back to all changes in this revision

Viewing changes to ivle/worksheet/rst.py

  • Committer: David Coles
  • Date: 2010-08-30 03:26:13 UTC
  • Revision ID: coles.david@gmail.com-20100830032613-d14vng0jkelniu3l
python-console: Fix globals broken with new JSON library.

simplejson always returns unicode strings. cJSON would return ordinary strings 
if possible. cPickle.loads() only accepts strings. At present we use pickle 
version 0 so they should all works as ASCII strings. Higher versions of pickle 
are not plain ASCII and are likely to break this and so this should be fixed 
at some point.

Also replaced unconditional exception with one that catches Pickle errors. Not 
sure the best way to report failures of these functions.

Show diffs side-by-side

added added

removed removed

Lines of Context:
1555
1555
        self.body.append('<exercise weight="1" src="')
1556
1556
 
1557
1557
    def depart_exercise(self, node):
1558
 
        self.body.append('"/>')
 
1558
        self.body.append('"/>\n')
1559
1559
 
1560
1560
    def visit_challenge(self, node):
1561
1561
        self.body.append('<exercise weight="0" src="')
1562
1562
 
1563
1563
    def depart_challenge(self, node):
1564
 
        self.body.append('"/>')
 
1564
        self.body.append('"/>\n')
1565
1565
 
1566
1566
    def visit_literal(self, node):
1567
1567
        """Process text to prevent tokens from wrapping."""