def loadSkin(self, file):
        """
        This parses your skin file for global settings, such as name,
        background and foreground colors, size, button info, etc.
        """
        
        skinTree = ElementTree.parse(file).getroot()

        # parse the window information
        windowTree = skinTree.find('window')
        self.topWindowSize = wx.Size(int(windowTree.findtext("width")), int(windowTree.findtext("height")))
        self.topWindowPos = wx.Point(int(windowTree.findtext("pos_X")), int(windowTree.findtext("pos_Y")))
        self.topWindowCentered = windowTree.findtext("is_centered")
        # TODO: add the centered part

        # parse the main colors
        self.day_bgColor = utility.str2tuple(windowTree.findtext("day_bgColor"), "window.day_bgColor")
        self.day_fgColor = utility.str2tuple(windowTree.findtext("day_fgColor"), "window.day_fgColor")
        self.day_toolbarColor = utility.str2tuple(windowTree.findtext("day_toolbarColor"), "window.day_toolbarColor")
        self.day_textColor = utility.str2tuple(windowTree.findtext("day_textColor"), "window.day_textColor")
        self.day_highlightColor = utility.str2tuple(windowTree.findtext("day_highlightColor"), "window.day_highlightColor")
        self.night_bgColor = utility.str2tuple(windowTree.findtext("night_bgColor"), "window.night_bgColor")
        self.night_fgColor = utility.str2tuple(windowTree.findtext("night_fgColor"), "window.night_fgColor")
        self.night_toolbarColor = utility.str2tuple(windowTree.findtext("night_toolbarColor"), "window.night_toolbarColor")
        self.night_textColor = utility.str2tuple(windowTree.findtext("night_textColor"), "window.night_textColor")
        self.night_highlightColor = utility.str2tuple(windowTree.findtext("night_highlightColor"), "window.night_highlightColor")

        # parse global information
        globalTree = skinTree.find('globalSkin')
        self._currentSkinName = globalTree.findtext("skinName")
        self._currentSkinFile = file
        self._buttonImagePath = globalTree.findtext("buttonPath")
Esempio n. 2
0
    def loadSkin(self, file):
        """
        This parses your skin file for global settings, such as name,
        background and foreground colors, size, button info, etc.
        """

        skinTree = ElementTree.parse(file).getroot()

        # parse the window information
        windowTree = skinTree.find('window')
        self.topWindowSize = wx.Size(int(windowTree.findtext("width")),
                                     int(windowTree.findtext("height")))
        self.topWindowPos = wx.Point(int(windowTree.findtext("pos_X")),
                                     int(windowTree.findtext("pos_Y")))
        self.topWindowCentered = windowTree.findtext("is_centered")
        # TODO: add the centered part

        # parse the main colors
        self.day_bgColor = utility.str2tuple(
            windowTree.findtext("day_bgColor"), "window.day_bgColor")
        self.day_fgColor = utility.str2tuple(
            windowTree.findtext("day_fgColor"), "window.day_fgColor")
        self.day_toolbarColor = utility.str2tuple(
            windowTree.findtext("day_toolbarColor"), "window.day_toolbarColor")
        self.day_textColor = utility.str2tuple(
            windowTree.findtext("day_textColor"), "window.day_textColor")
        self.day_highlightColor = utility.str2tuple(
            windowTree.findtext("day_highlightColor"),
            "window.day_highlightColor")
        self.night_bgColor = utility.str2tuple(
            windowTree.findtext("night_bgColor"), "window.night_bgColor")
        self.night_fgColor = utility.str2tuple(
            windowTree.findtext("night_fgColor"), "window.night_fgColor")
        self.night_toolbarColor = utility.str2tuple(
            windowTree.findtext("night_toolbarColor"),
            "window.night_toolbarColor")
        self.night_textColor = utility.str2tuple(
            windowTree.findtext("night_textColor"), "window.night_textColor")
        self.night_highlightColor = utility.str2tuple(
            windowTree.findtext("night_highlightColor"),
            "window.night_highlightColor")

        # parse global information
        globalTree = skinTree.find('globalSkin')
        self._currentSkinName = globalTree.findtext("skinName")
        self._currentSkinFile = file
        self._buttonImagePath = globalTree.findtext("buttonPath")
Esempio n. 3
0
    def loadSkin(self, file):
        """
        This function loads a new skin by reading and parsing the file, and then
        updating the variables in this class. The skin is specified by a file, in the
        path specified in the class documentation. It only updates the variables here,
        and doesn't make any changes to the GUI.
        NOTE: The size of buttons is exactly the size of the image used for the button.
        """

        skinTree = ElementTree.parse(file).getroot()
        internalThermoTree = skinTree.find('internalThermo')

        self.day_fgColor = utility.str2tuple(
            internalThermoTree.findtext("day_fgColor"),
            "internalThermo.day_fgColor")
        self.day_bgColor = utility.str2tuple(
            internalThermoTree.findtext("day_bgColor"),
            "internalThermo.day_bgColor")
        self.day_fadeColor = utility.str2tuple(
            internalThermoTree.findtext("day_fadeColor"),
            "internalThermo.day_fadeColor")
        self.night_fgColor = utility.str2tuple(
            internalThermoTree.findtext("night_fgColor"),
            "internalThermo.night_fgColor")
        self.night_bgColor = utility.str2tuple(
            internalThermoTree.findtext("night_bgColor"),
            "internalThermo.night_bgColor")
        self.night_fadeColor = utility.str2tuple(
            internalThermoTree.findtext("night_fadeColor"),
            "internalThermo.night_fadeColor")
        self.fadeFactor = int(internalThermoTree.findtext("fadeFactor"))
    def loadSkin(self, file):
        """
        This function loads a new skin by reading and parsing the file, and then
        updating the variables in this class. The skin is specified by a file, in the
        path specified in the class documentation. It only updates the variables here,
        and doesn't make any changes to the GUI.
        NOTE: The size of buttons is exactly the size of the image used for the button.
        """

        skinTree = ElementTree.parse(file).getroot()
        digitalClockTree = skinTree.find('digitalClock')

        self.day_fgColor = utility.str2tuple(digitalClockTree.findtext("day_fgColor"), "digitalClock.day_fgColor")
        self.day_bgColor = utility.str2tuple(digitalClockTree.findtext("day_bgColor"), "digitalClock.day_bgColor")
        self.day_fadeColor = utility.str2tuple(digitalClockTree.findtext("day_fadeColor"), "digitalClock.day_fadeColor")
        self.night_fgColor = utility.str2tuple(digitalClockTree.findtext("night_fgColor"), "digitalClock.night_fgColor")
        self.night_bgColor = utility.str2tuple(digitalClockTree.findtext("night_bgColor"), "digitalClock.night_bgColor")
        self.night_fadeColor = utility.str2tuple(digitalClockTree.findtext("night_fadeColor"), "digitalClock.night_fadeColor")
        self.fadeFactor = int(digitalClockTree.findtext("fadeFactor"))
Esempio n. 5
0
    def loadSkin(self, file):
        """
        This function loads a new skin by reading and parsing the file, and then
        updating the variables in this class. The skin is specified by a file, in the
        path specified in the class documentation. It only updates the variables here,
        and doesn't make any changes to the GUI.
        NOTE: The size of buttons is exactly the size of the image used for the button.
        """

        skinTree = ElementTree.parse(file).getroot()
        analogClockTree = skinTree.find('analogClock')

        # analog clock settings
        self.day_handColor = utility.str2tuple(
            analogClockTree.findtext("day_handColor"),
            "analogClock.day_handColor")
        self.day_shadowColor = utility.str2tuple(
            analogClockTree.findtext("day_shadowColor"),
            "analogClock.day_shadowColor")
        self.day_bgColor = utility.str2tuple(
            analogClockTree.findtext("day_bgColor"), "analogClock.day_bgColor")
        self.day_tickColor = utility.str2tuple(
            analogClockTree.findtext("day_tickColor"),
            "analogClock.day_tickColor")
        self.day_faceColor = utility.str2tuple(
            analogClockTree.findtext("day_faceColor"),
            "analogClock.day_faceColor")
        self.day_faceBorderColor = utility.str2tuple(
            analogClockTree.findtext("day_faceBorderColor"),
            "analogClock.day_faceBorderColor")

        self.night_handColor = utility.str2tuple(
            analogClockTree.findtext("night_handColor"),
            "analogClock.night_handColor")
        self.night_shadowColor = utility.str2tuple(
            analogClockTree.findtext("night_shadowColor"),
            "analogClock.night_shadowColor")
        self.night_bgColor = utility.str2tuple(
            analogClockTree.findtext("night_bgColor"),
            "analogClock.night_bgColor")
        self.night_tickColor = utility.str2tuple(
            analogClockTree.findtext("night_tickColor"),
            "analogClock.night_tickColor")
        self.night_faceColor = utility.str2tuple(
            analogClockTree.findtext("night_faceColor"),
            "analogClock.night_faceColor")
        self.night_faceBorderColor = utility.str2tuple(
            analogClockTree.findtext("night_faceBorderColor"),
            "analogClock.night_faceBorderColor")
    def loadSkin(self, file):
        """
        This function loads a new skin by reading and parsing the file, and then
        updating the variables in this class. The skin is specified by a file, in the
        path specified in the class documentation. It only updates the variables here,
        and doesn't make any changes to the GUI.
        NOTE: The size of buttons is exactly the size of the image used for the button.
        """

        skinTree = ElementTree.parse(file).getroot()
        analogClockTree = skinTree.find('analogClock')

        # analog clock settings
        self.day_handColor = utility.str2tuple(analogClockTree.findtext("day_handColor"), "analogClock.day_handColor")
        self.day_shadowColor = utility.str2tuple(analogClockTree.findtext("day_shadowColor"), "analogClock.day_shadowColor")
        self.day_bgColor = utility.str2tuple(analogClockTree.findtext("day_bgColor"), "analogClock.day_bgColor")
        self.day_tickColor = utility.str2tuple(analogClockTree.findtext("day_tickColor"), "analogClock.day_tickColor")
        self.day_faceColor = utility.str2tuple(analogClockTree.findtext("day_faceColor"), "analogClock.day_faceColor")
        self.day_faceBorderColor = utility.str2tuple(analogClockTree.findtext("day_faceBorderColor"), "analogClock.day_faceBorderColor")

        self.night_handColor = utility.str2tuple(analogClockTree.findtext("night_handColor"), "analogClock.night_handColor")
        self.night_shadowColor = utility.str2tuple(analogClockTree.findtext("night_shadowColor"), "analogClock.night_shadowColor")
        self.night_bgColor = utility.str2tuple(analogClockTree.findtext("night_bgColor"), "analogClock.night_bgColor")
        self.night_tickColor = utility.str2tuple(analogClockTree.findtext("night_tickColor"), "analogClock.night_tickColor")
        self.night_faceColor = utility.str2tuple(analogClockTree.findtext("night_faceColor"), "analogClock.night_faceColor")
        self.night_faceBorderColor = utility.str2tuple(analogClockTree.findtext("night_faceBorderColor"), "analogClock.night_faceBorderColor")