How to use the py3status.core.Py3statusWrapper 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 / tests / test_user_modules.py View on Github external
def make_status_wrapper():
    args = argparse.Namespace()
    status_wrapper = Py3statusWrapper(args)
    return status_wrapper
github ultrabug / py3status / py3status / __init__.py View on Github external
monkey.patch_all()
        except Exception:
            # user will be notified when we start
            pass

    from py3status.core import Py3statusWrapper

    try:
        locale.setlocale(locale.LC_ALL, "")
    except locale.Error:
        print("No locale available")
        sys.exit(2)

    py3 = None
    try:
        py3 = Py3statusWrapper(options)
        py3.setup()
    except (BrokenPipeError, KeyboardInterrupt):
        if py3:
            py3.notify_user("Setup interrupted")
        sys.exit(0)
    except Exception:
        if py3:
            py3.report_exception("Setup error")
        else:
            # we cannot report this Exception
            raise
        sys.exit(2)

    try:
        py3.run()
    except (BrokenPipeError, KeyboardInterrupt):
github ultrabug / py3status / py3status / __init__.py View on Github external
def main():
    from py3status.core import Py3statusWrapper
    try:
        locale.setlocale(locale.LC_ALL, '')
    except locale.Error:
        print('No locale available')
        sys.exit(2)

    py3 = None
    try:
        py3 = Py3statusWrapper()
        py3.setup()
    except (IOPipeError, KeyboardInterrupt):
        if py3:
            py3.notify_user('Setup interrupted')
        sys.exit(0)
    except Exception:
        if py3 and not py3.config.get('cli_command'):
            py3.report_exception('Setup error')
        else:
            # we cannot report this Exception
            raise
        sys.exit(2)

    try:
        py3.run()
    except (IOPipeError, KeyboardInterrupt):