# Path: pwm/config.py
# class Config:
#     def __init__(self):
#     def load(self, default=False):
#     def _load_default(self):
#     def _ensure_config_exists(self, path):
#     def __getattr__(self, name):
# def setup_keys():
# def handle_key_press_event(event):
# def create_arguments(func):
#     def wrapper(*args, **kwargs):
# 
# Path: pwm/ffi/xcb.py
# class XcbError(Exception):
# class Cookie:
# class Xcb:
#     def __init__(self, error):
#     def __str__(self):
#     def __init__(self, name, value):
#     def __getattr__(self, name):
#     def reply(self):
#     def check(self):
#     def __init__(self):
#     def __getattr__(self, name):
#         def request(func, *args, **kwargs):
#     def connect(self, display=None):
#     def mask(self, masks):


import argparse
import logging
import os
import sys
import pwm
import pwm.root
import pwm.events
import pwm.bar
import pwm.menu
import pwm.systray
import pwm.workspaces
import pwm.keybind
import pwm.state
import pwm.worker
from pwm.config import config
from pwm.ffi.xcb import xcb
    if args.restore:
        logging.info("Restoring state...")
        pwm.state.restore()

    # Manage existing windows after restoring state.
    pwm.windows.manage_existing()

    logging.info("Starting threads...")
    pwm.worker.start()
    pwm.widgets.start()

    try:
        logging.info("Entering main event loop...")
        pwm.events.loop()
    except (KeyboardInterrupt, SystemExit):
        pass
    except:
        logging.exception("Event loop error")

    if restart:
        logging.info("Storing state...")
        pwm.state.store()

    logging.info("Shutting down...")
    pwm.widgets.destroy()
    pwm.worker.destroy()
    pwm.systray.destroy()
    pwm.menu.destroy()
    pwm.bar.destroy()
    pwm.workspaces.destroy()

# Path: pwm/config.py
# class Config:
#     def __init__(self):
#     def load(self, default=False):
#     def _load_default(self):
#     def _ensure_config_exists(self, path):
#     def __getattr__(self, name):
# def setup_keys():
# def handle_key_press_event(event):
# def create_arguments(func):
#     def wrapper(*args, **kwargs):
# 
# Path: pwm/ffi/xcb.py
# class XcbError(Exception):
# class Cookie:
# class Xcb:
#     def __init__(self, error):
#     def __str__(self):
#     def __init__(self, name, value):
#     def __getattr__(self, name):
#     def reply(self):
#     def check(self):
#     def __init__(self):
#     def __getattr__(self, name):
#         def request(func, *args, **kwargs):
#     def connect(self, display=None):
#     def mask(self, masks):


# Path: pwm/main.py
import argparse
import logging
import os
import sys
import pwm
import pwm.root
import pwm.events
import pwm.bar
import pwm.menu
import pwm.systray
import pwm.workspaces
import pwm.keybind
import pwm.state
import pwm.worker
from pwm.config import config
from pwm.ffi.xcb import xcb

    if args.restore:
        logging.info("Restoring state...")
        pwm.state.restore()

    # Manage existing windows after restoring state.
    pwm.windows.manage_existing()

    logging.info("Starting threads...")
    pwm.worker.start()
    pwm.widgets.start()

    try:
        logging.info("Entering main event loop...")
        pwm.events.loop()
    except (KeyboardInterrupt, SystemExit):
        pass
    except:
        logging.exception("Event loop error")

    if restart:
        logging.info("Storing state...")
        pwm.state.store()

    logging.info("Shutting down...")
    pwm.widgets.destroy()
    pwm.worker.destroy()
    pwm.systray.destroy()
    pwm.menu.destroy()
    pwm.bar.destroy()
    pwm.workspaces.destroy()

    xcb.core.disconnect()