Web   ·   Wiki   ·   Activities   ·   Blog   ·   Lists   ·   Chat   ·   Meeting   ·   Bugs   ·   Git   ·   Translate   ·   Archive   ·   People   ·   Donate
summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorAjay Garg <ajay@activitycentral.com>2012-10-16 13:25:57 (GMT)
committer Ajay Garg <ajay@activitycentral.com>2012-10-16 13:34:08 (GMT)
commiteb44a0c2884d335957b53ae6df0b80c2260f3766 (patch)
treeca27e5a020a44111a3d8ca12ba4ab1542b48482a
parent274ddde27feb895905931178fffc388f983604da (diff)
Adding sections "Plazo" and "Version de actual" (gconf-controllable); and making "Lease" and "Wireless Firmware" gconf-controllable.
Signed-off-by: Ajay Garg <ajay@activitycentral.com>
-rw-r--r--extensions/cpsection/aboutcomputer/model.py28
-rw-r--r--extensions/cpsection/aboutcomputer/view.py14
2 files changed, 40 insertions, 2 deletions
diff --git a/extensions/cpsection/aboutcomputer/model.py b/extensions/cpsection/aboutcomputer/model.py
index a4ffd0f..2d68805 100644
--- a/extensions/cpsection/aboutcomputer/model.py
+++ b/extensions/cpsection/aboutcomputer/model.py
@@ -1,4 +1,5 @@
# Copyright (C) 2008 One Laptop Per Child
+# Copyright (C) 2010 Plan Ceibal <comunidad@plan.ceibal.edu.uy>
#
# This program is free software; you can redistribute it and/or modify
# it under the terms of the GNU General Public License as published by
@@ -18,6 +19,8 @@
import os
import logging
import re
+import ConfigParser
+import time
import subprocess
from gettext import gettext as _
import errno
@@ -322,3 +325,28 @@ def get_last_updated_on_field():
def get_sugar_version():
return config.version
+
+
+def get_plazo():
+ from ceibal import env
+ path_plazo = env.get_security_root()
+ try:
+ plazo = _read_file(os.path.join(path_plazo, "blacklist")).split("\n")[0].strip()
+ plazo = time.strftime( "%d-%m-%Y",time.strptime(plazo,'%Y%m%d'))
+ except:
+ plazo = _not_available
+
+ return plazo
+
+def get_act():
+ from ceibal import env
+ path_act = env.get_updates_root()
+ parser = ConfigParser.ConfigParser()
+ salida = parser.read(os.path.join(path_act, "mi_version"))
+ if salida == []:
+ version = _not_available
+ else:
+ version = ''
+ for seccion in parser.sections():
+ version = "%s%s: %s\n" %(version,seccion,parser.get(seccion,'version'))
+ return version
diff --git a/extensions/cpsection/aboutcomputer/view.py b/extensions/cpsection/aboutcomputer/view.py
index 587e1b6..1e11301 100644
--- a/extensions/cpsection/aboutcomputer/view.py
+++ b/extensions/cpsection/aboutcomputer/view.py
@@ -69,7 +69,7 @@ class AboutComputer(SectionView):
self._model.get_serial_number,
vbox_identity)
- self._setup_component_if_applicable(None,
+ self._setup_component_if_applicable('/desktop/sugar/extensions/aboutcomputer/display_lease',
_('Lease:'),
self._model.get_lease_days,
vbox_identity)
@@ -142,11 +142,21 @@ class AboutComputer(SectionView):
self._model.get_firmware_number,
box_software)
- self._setup_component_if_applicable(None,
+ self._setup_component_if_applicable('/desktop/sugar/extensions/aboutcomputer/display_wireless_firmware',
_('Wireless Firmware:'),
self._model.get_wireless_firmware,
box_software)
+ self._setup_component_if_applicable('/desktop/sugar/extensions/aboutcomputer/display_plazo',
+ _('Plazo:'),
+ self._model.get_plazo,
+ box_software)
+
+ self._setup_component_if_applicable('/desktop/sugar/extensions/aboutcomputer/display_version_de_actual',
+ _('VersiĆ³n de ActualizaciĆ³n:'),
+ self._model.get_act,
+ box_software)
+
self._setup_component_if_applicable(None,
_('Last Updated On:'),
self._model.get_last_updated_on_field,