def __init__(self, value=''): ''' Params: bg: background color fg: foreground color icon: icon ''' Widget.__init__(self) self.value = value self.bg = None self.fg = colors['c_white'] self.icon = icons['clock']
def __init__(self, value=''): ''' Params: bg: background color fg: foreground color icon: icon ''' Widget.__init__(self) self.value = value self.bg = None self.fg = None self.icon = None self.gaps = (0, 0)
def __init__(self, value=''): ''' Params: bg: background color fg: foreground color icon: icon ''' Widget.__init__(self) self.value = value self.bg = None self.fg = colors['c_gray_l'] self.icon = icons['ssid'] self.gaps = (10, 7) self.show_text = False
def __init__(self, value=''): ''' Params: bg: background color fg: foreground color icon: icon ''' Widget.__init__(self) self.value = value self.bg = None self.fg = colors['c_white'] self.icon = icons['thermometer_half'] self.gaps = (10, 7) self.temp = 0 self.show_text = False
def rebuild_network(self, hostnames): self.widgets = {} for name, ip in hostnames.items(): try: r = requests.get(url='http://{}:8000/widget'.format(ip)) if r.json()["msg"] == "True": self.widgets[name] = Widget(name=name, ip=ip) except Exception as e: pass
def __init__(self, value=''): ''' Params: bg: background color fg: foreground color icon: icon ''' Widget.__init__(self) self.value = value self.bg = None self.fg = colors['c_white'] self.icon = icons['battery_full'] self.gaps = (10, 7) self.charge = 0 self.show_text = False # 0: Normal. (charge > 30% or Plugged) # 1: Unplugged. (charge > 30% and unplugged) # 2: 30% limit. (charge < 30% and unplugged) # 3: 10% limit. (charge < 10% and unplugged) # 4: Charging. (charge < 30% and plugged) self.status = 0
def add_widget(self, hostname, ip): self.widgets[hostname] = Widget(name=hostname, ip=ip)