How to use the py3status.module_test.module_test function in py3status

To help you get started, we’ve selected a few py3status examples, based on popular ways it is used in public projects.

Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.

github ultrabug / py3status / py3status / modules / rainbow.py View on Github external
obj["color"] = color
            output.append(obj)

        composites = {"output": self.py3.composite_create(output)}
        rainbow = self.py3.safe_format(self.format, composites)

        return {"cached_until": self._cycle_time, "full_text": rainbow}


if __name__ == "__main__":
    """
    Run module in test mode.
    """
    from py3status.module_test import module_test

    module_test(Py3status)
github ultrabug / py3status / py3status / modules / nvidia_smi.py View on Github external
msg = "This GPU contains {} supported properties."
        for line in gpu_data.splitlines():
            gpu = dict(zip(new_properties, line.split(", ")))
            gpu = {k: v for k, v in gpu.items() if "[Not Supported]" not in v}
            gpu["= " + msg.format(len(gpu))] = ""
            gpu["=" * (len(msg) + 2)] = ""
            new_gpus.append(gpu)

        print(dumps(new_gpus, sort_keys=True, indent=4))
        exit()
    """
    Run module in test mode.
    """
    from py3status.module_test import module_test

    module_test(Py3status)
github ultrabug / py3status / py3status / modules / dpms.py View on Github external
if "DPMS is Enabled" in self.py3.command_output("xset -q"):
                self.py3.command_run("xset -dpms s off")
            else:
                self.py3.command_run("xset +dpms s on")

        if event["button"] == self.button_off:
            self.py3.command_run("xset dpms force off")


if __name__ == "__main__":
    """
    Run module in test mode.
    """
    from py3status.module_test import module_test

    module_test(Py3status)
github ultrabug / py3status / py3status / modules / external_script.py View on Github external
return response

    def on_click(self, event):
        button = event["button"]
        if button == self.button_show_notification:
            self.py3.notify_user(self.output)
            self.py3.prevent_refresh()


if __name__ == "__main__":
    """
    Run module in test mode.
    """
    from py3status.module_test import module_test

    module_test(Py3status)
github ultrabug / py3status / py3status / modules / keyboard_layout.py View on Github external
def on_click(self, event):
        button = event["button"]
        if button == self.button_next:
            self._set_active(1)
        if button == self.button_prev:
            self._set_active(-1)


if __name__ == "__main__":
    """
    Run module in test mode.
    """
    from py3status.module_test import module_test

    module_test(Py3status)
github ultrabug / py3status / py3status / modules / process_status.py View on Github external
return {
            "cached_until": self.py3.time_in(self.cache_timeout),
            "color": color,
            "full_text": self.py3.safe_format(
                self.format, {"icon": icon, "process": self.process}
            ),
        }


if __name__ == "__main__":
    """
    Run module in test mode.
    """
    from py3status.module_test import module_test

    module_test(Py3status)
github ultrabug / py3status / py3status / modules / aws_bill.py View on Github external
self.format, {"bill_amount": bill_amount}
            )
            response["color"] = self.py3.COLOR_GOOD
        else:
            response["full_text"] = "Global error - WTF exception"

        return response


if __name__ == "__main__":
    """
    Run module in test mode.
    """
    from py3status.module_test import module_test

    module_test(Py3status)
github ultrabug / py3status / py3status / modules / loadavg.py View on Github external
if x in self.load_data:
                self.py3.threshold_get_color(self.load_data[x], x)

        return {
            "cached_until": self.py3.time_in(self.cache_timeout),
            "full_text": self.py3.safe_format(self.format, self.load_data),
        }


if __name__ == "__main__":
    """
    Run module in test mode.
    """
    from py3status.module_test import module_test

    module_test(Py3status)
github ultrabug / py3status / py3status / modules / window_title_async.py View on Github external
conn.on("binding", update_title)

        conn.main()  # run the event loop

    def window_title_async(self):
        return {"cached_until": self.py3.CACHE_FOREVER, "full_text": self.title}


if __name__ == "__main__":
    """
    Run module in test mode.
    """
    config = {"always_show": True}
    from py3status.module_test import module_test

    module_test(Py3status, config=config)
github ultrabug / py3status / py3status / modules / frame.py View on Github external
Switch the displayed module or pass the event on to the active module
        """
        if event["button"] == self.button_toggle:
            # we only toggle if button was used
            if event.get("index") == "button" and self.py3.is_my_event(event):
                self.urgent = False
                self.open = not self.open


if __name__ == "__main__":
    """
    Run module in test mode.
    """
    from py3status.module_test import module_test

    module_test(Py3status)