[Sugar-devel] [PATCH] Display build number at Name Page

Esteban Bordón ebordon at plan.ceibal.edu.uy
Wed Jun 15 11:01:55 EDT 2011


This patch show the build number in the name page for first boot (see
attached file). It's very useful to test the correct massive flashing for
technical team.

Index: orig/window.py
===================================================================
--- orig.orig/window.py
+++ orig/window.py
@@ -86,7 +86,20 @@ class _NamePage(_Page):
                        orientation=hippo.ORIENTATION_HORIZONTAL,)

         self._intro = intro
+
+        if os.path.exists('/boot/olpc_build'):
+            build_no_path = '/boot/olpc_build'
+        elif os.path.exists('/etc/fedora-release'):
+            build_no_path = '/etc/fedora-release'
+        else:
+            build_no_path = None

+        if build_no_path:
+            fd = open('/etc/fedora-release', 'r')
+            build = fd.read().strip()
+            fd.close()
+            self.insert_build_no(build)
+
         label = hippo.CanvasText(text=_('Name:'))
         self.append(label)

@@ -102,6 +115,15 @@ class _NamePage(_Page):
         if gtk.widget_get_default_direction() == gtk.TEXT_DIR_RTL:
             self.reverse()

+    def insert_build_no(self, build):
+        build_box =
hippo.CanvasBox(orientation=hippo.ORIENTATION_HORIZONTAL,xalign=hippo.ALIGNMENT_START,yalign=hippo.ALIGNMENT_START)
+        label_build = hippo.CanvasText(text=_("Build:"))
+        build_box.append(label_build)
+        data_build = hippo.CanvasText(text=' '+build)
+        build_box.append(data_build)
+        self.append(build_box,hippo.PACK_FIXED)
+
+
     def _text_changed_cb(self, entry, pspec):
         valid = len(entry.props.text.strip()) > 0
         self.set_valid(valid)
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.sugarlabs.org/archive/sugar-devel/attachments/20110615/4d8aa959/attachment-0001.html>
-------------- next part --------------
A non-text attachment was scrubbed...
Name: screenshot.png
Type: image/png
Size: 15237 bytes
Desc: not available
URL: <http://lists.sugarlabs.org/archive/sugar-devel/attachments/20110615/4d8aa959/attachment-0001.png>
-------------- next part --------------
A non-text attachment was scrubbed...
Name: show_build.patch
Type: text/x-patch
Size: 1519 bytes
Desc: not available
URL: <http://lists.sugarlabs.org/archive/sugar-devel/attachments/20110615/4d8aa959/attachment-0001.bin>


More information about the Sugar-devel mailing list