I have a pango cairo question.<br><br>Can someone help me to understand why my variable &quot;todisk&quot; can be False in sugar-jhbuild, but has to be True on an xo?&nbsp; It would be nice to avoid writing to disk on the xo.&nbsp; Thanks.
<span style="font-family: courier new,monospace;"><br><br>&nbsp;&nbsp;&nbsp; def createCountdownPng( self, num ):</span><br style="font-family: courier new,monospace;"><span style="font-family: courier new,monospace;">&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; &nbsp;todisk = True
</span><br style="font-family: courier new,monospace;"><br style="font-family: courier new,monospace;"><span style="font-family: courier new,monospace;">&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; &nbsp;w = 55</span><br style="font-family: courier new,monospace;">
<span style="font-family: courier new,monospace;">&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; &nbsp;h = w</span><br style="font-family: courier new,monospace;"><span style="font-family: courier new,monospace;">&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; &nbsp;if (todisk):</span><br style="font-family: courier new,monospace;">
<span style="font-family: courier new,monospace;">&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; &nbsp;cimg = cairo.ImageSurface(cairo.FORMAT_ARGB32, w, h)</span><br style="font-family: courier new,monospace;"><span style="font-family: courier new,monospace;">&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; &nbsp;ctx = 
cairo.Context(cimg)</span><br style="font-family: courier new,monospace;"><span style="font-family: courier new,monospace;">&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; &nbsp;else:</span><br style="font-family: courier new,monospace;"><span style="font-family: courier new,monospace;">
&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; &nbsp;pixmap = gtk.gdk.Pixmap(None, w, h, 24)</span><br style="font-family: courier new,monospace;"><span style="font-family: courier new,monospace;">&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; &nbsp;ctx = pixmap.cairo_create()</span><br style="font-family: courier new,monospace;">
<span style="font-family: courier new,monospace;">&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; &nbsp;ctx.rectangle(0, 0, w, h)</span><br style="font-family: courier new,monospace;"><span style="font-family: courier new,monospace;">&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; &nbsp;ctx.set_source_rgb(0, 0, 0)
</span><br style="font-family: courier new,monospace;"><span style="font-family: courier new,monospace;">&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; &nbsp;ctx.fill()</span><br style="font-family: courier new,monospace;"><span style="font-family: courier new,monospace;">
&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; &nbsp;x = 0</span><br style="font-family: courier new,monospace;"><span style="font-family: courier new,monospace;">&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; &nbsp;y = 4</span><br style="font-family: courier new,monospace;"><span style="font-family: courier new,monospace;">
&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; &nbsp;ctx.translate(x,y)</span><br style="font-family: courier new,monospace;"><span style="font-family: courier new,monospace;">&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; &nbsp;ctx.set_source_surface (self.__class__.recCircleCairo, 0, 0) #a cairo surface</span>
<br style="font-family: courier new,monospace;"><span style="font-family: courier new,monospace;">&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; &nbsp;ctx.paint()</span><br style="font-family: courier new,monospace;"><span style="font-family: courier new,monospace;">
&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; &nbsp;ctx.translate(-x,-y)</span><br style="font-family: courier new,monospace;"><br style="font-family: courier new,monospace;"><span style="font-family: courier new,monospace;">&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; &nbsp;ctx.set_source_rgb(255, 255, 255)
</span><br style="font-family: courier new,monospace;"><span style="font-family: courier new,monospace;">&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; &nbsp;pctx = pangocairo.CairoContext(ctx)</span><br style="font-family: courier new,monospace;"><span style="font-family: courier new,monospace;">
&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; &nbsp;play = pctx.create_layout()</span><br style="font-family: courier new,monospace;"><span style="font-family: courier new,monospace;">&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; &nbsp;font = pango.FontDescription(&quot;sans 30&quot;)</span><br style="font-family: courier new,monospace;">
<span style="font-family: courier new,monospace;">&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; &nbsp;play.set_font_description(font)</span><br style="font-family: courier new,monospace;"><span style="font-family: courier new,monospace;">&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; &nbsp;play.set_text( &quot;&quot;+str(num) )
</span><br style="font-family: courier new,monospace;"><span style="font-family: courier new,monospace;">&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; &nbsp;dim = play.get_pixel_extents()</span><br style="font-family: courier new,monospace;"><span style="font-family: courier new,monospace;">
&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; &nbsp;ctx.translate( -dim[0][0], -dim[0][1] )</span><br style="font-family: courier new,monospace;"><span style="font-family: courier new,monospace;">&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; &nbsp;xoff = (w-dim[0][2])/2</span><br style="font-family: courier new,monospace;">
<span style="font-family: courier new,monospace;">&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; &nbsp;yoff = (h-dim[0][3])/2</span><br style="font-family: courier new,monospace;"><span style="font-family: courier new,monospace;">&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; &nbsp;ctx.translate( xoff, yoff )</span>
<br style="font-family: courier new,monospace;"><span style="font-family: courier new,monospace;">&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; &nbsp;ctx.translate( -3, 0 )</span><br style="font-family: courier new,monospace;"><span style="font-family: courier new,monospace;">
&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; &nbsp;pctx.show_layout(play)</span><br style="font-family: courier new,monospace;"><br style="font-family: courier new,monospace;"><span style="font-family: courier new,monospace;">&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; &nbsp;img = gtk.Image()</span><br style="font-family: courier new,monospace;">
<span style="font-family: courier new,monospace;">&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; &nbsp;if (todisk):</span><br style="font-family: courier new,monospace;"><span style="font-family: courier new,monospace;">&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; &nbsp;path = os.path.join(Instance.tmpPath
, str(num)+&quot;.png&quot;)</span><br style="font-family: courier new,monospace;"><span style="font-family: courier new,monospace;">&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; &nbsp;path = utils.getUniqueFilepath(path, 0)</span><br style="font-family: courier new,monospace;">
<span style="font-family: courier new,monospace;">&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; &nbsp;cimg.write_to_png(path)</span><br style="font-family: courier new,monospace;"><span style="font-family: courier new,monospace;">&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; &nbsp;numPixbuf = gtk.gdk.pixbuf_new_from_file
(path)</span><br style="font-family: courier new,monospace;"><span style="font-family: courier new,monospace;">&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; &nbsp;img.set_from_pixbuf( numPixbuf )</span><br style="font-family: courier new,monospace;"><span style="font-family: courier new,monospace;">
&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; &nbsp;else:</span><br style="font-family: courier new,monospace;"><span style="font-family: courier new,monospace;">&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; &nbsp;img.set_from_pixmap(pixmap, None)</span><br style="font-family: courier new,monospace;"><br style="font-family: courier new,monospace;">
<span style="font-family: courier new,monospace;">&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; &nbsp;self.__class__.countdownImgs[int(num)] = img</span>