Exemplo n.º 1
0
 def start(self, bgui=True):
     confjson = {}
     try:
         f = utils.file_open('config.json')
         confjson = json.loads(f.read())
         f.close()
     except Exception:
         None
     prmsui = {}
     if "name" in confjson:
         self._name = unicode(confjson["name"])
     prmsui["title"] = self._get_message('configureTitle')
     if "topinfo" in confjson:
         prmsui["topinfo"] = confjson["topinfo"]
     if "topimage" in confjson:
         prmsui[
             "topimage"] = u"ui" + utils.path_sep + u"images" + utils.path_sep + u"custom" + utils.path_sep + confjson[
                 "topimage"]
     applg = gdi._get_logo_from_conf(
         confjson, u"ui" + utils.path_sep + u"images" + utils.path_sep +
         u"custom" + utils.path_sep)
     if applg != "":
         prmsui["logo"] = applg
     if "leftcolor" in confjson:
         prmsui["leftcolor"] = confjson["leftcolor"]
     self._uinterface = ui.UI(prmsui, self.step_init)
     self._uinterface.start(bgui)
     self.close_req()
Exemplo n.º 2
0
 def __init__(self):
     self._name = u"DWAgent"
     self._logo = None
     self._properties = {}
     try:
         f = utils.file_open('config.json')
         self._properties = json.loads(f.read())
         f.close()
     except Exception:
         None
     if 'name' in self._properties:
         self._name = unicode(self._properties["name"])
     applg = gdi._get_logo_from_conf(
         self._properties, u"ui" + utils.path_sep + u"images" +
         utils.path_sep + u"custom" + utils.path_sep)
     if applg != "":
         self._logo = applg