Beispiel #1
0
    def __init__(self, widget_name):
        """widget_name (str) string of the widget declared in rc.lua"""
        if widget_name == None:
            raise ValueError("You must specify the name of a widget declared in rc.lua.")

        # Checks if the widget already exists in rc.lua otherwise launch Exception
        out = to_python(execute("return " + widget_name))
        if not out:
            raise WidgetDoesNotExist("Error: The widget: " + widget_name + " doesn't exist in rc.lua.")

        if out[:6] != "widget":
            print(out)
            raise WidgetTypeError("Error: The " + widget_name + " is not a widget.")

        self.widget_name = widget_name
Beispiel #2
0
    def __init__(self, widget_name):
        """widget_name (str) string of the widget declared in rc.lua"""
        if widget_name == None:
            raise ValueError(
                'You must specify the name of a widget declared in rc.lua.')

        # Checks if the widget already exists in rc.lua otherwise launch Exception
        out = to_python(execute('return ' + widget_name))
        if not out:
            raise WidgetDoesNotExist("Error: The widget: " + widget_name +
                                     " doesn't exist in rc.lua.")

        if out[:6] != 'widget':
            print(out)
            raise WidgetTypeError("Error: The " + widget_name +
                                  " is not a widget.")

        self.widget_name = widget_name
Beispiel #3
0
 def width(self):
     """Define the width of the widget."""
     return to_python(execute("return {0}.{1}".format(self.widget_name, "width")))
Beispiel #4
0
 def text(self):
     """return The text to display."""
     return to_python(execute("return {0}.{1}".format(self.widget_name, "text")))
Beispiel #5
0
 def visible(self):
     """Returns whether the widget is visible."""
     return to_python(execute("return {0}.{1}".format(self.widget_name, "visible")))
Beispiel #6
0
 def bg(self):
     """return The background to display."""
     return to_python(execute("return {0}.{1}".format(self.widget_name, "bg")))
Beispiel #7
0
 def align(self):
     """Define the tetxt alignment: left, center or right."""
     return to_python(execute("return {0}.{1}".format(self.widget_name, "align")))
Beispiel #8
0
 def border_color(self):
     """Define the border color of the widget."""
     return to_python(execute("return {0}.{1}".format(self.widget_name, "border_color")))
Beispiel #9
0
 def width(self):
     """Define the width of the widget."""
     return to_python(
         execute("return {0}.{1}".format(self.widget_name, 'width')))
Beispiel #10
0
 def text(self):
     """return The text to display."""
     return to_python(
         execute("return {0}.{1}".format(self.widget_name, 'text')))
Beispiel #11
0
 def visible(self):
     """Returns whether the widget is visible."""
     return to_python(
         execute("return {0}.{1}".format(self.widget_name, 'visible')))
Beispiel #12
0
 def bg(self):
     """return The background to display."""
     return to_python(
         execute("return {0}.{1}".format(self.widget_name, 'bg')))
Beispiel #13
0
 def align(self):
     """Define the tetxt alignment: left, center or right."""
     return to_python(
         execute("return {0}.{1}".format(self.widget_name, 'align')))
Beispiel #14
0
 def border_color(self):
     """Define the border color of the widget."""
     return to_python(
         execute("return {0}.{1}".format(self.widget_name, 'border_color')))