# Path: hashmal_lib/config.py
# def set_config(c):
# def get_config():
#     def __init__(self, parent=None):
#     def get_option(self, key, default=None):
#     def set_option(self, key, value, do_save=True):
# class Config(QtCore.QObject):


from functools import wraps
from collections import namedtuple
from PyQt4.QtGui import QDockWidget, QWidget, QVBoxLayout
from PyQt4 import QtCore
from hashmal_lib import config

    def augmenters(self):
        return self.ui.augmenters if self.ui else None

    def get_augmenter(self, hook_name):
        return getattr(self.ui, hook_name) if self.ui else None

class BasePluginUI(object):
    """Base class for plugin user interfaces."""
    tool_name = ''
    description = ''
    category = Category.General

    def __init__(self, handler):
        self.handler = handler
        self.config = config.get_config()
        self.config.optionChanged.connect(self.on_option_changed)
        self.is_enabled = True

        self.augmenters = []
        for name in dir(self):
            if name in known_augmenters:
                self.augmenters.append(name)

    def on_option_changed(self, key):
        """Called when a config option changes."""
        pass

    def options(self):
        """Return the config dict for this plugin."""

# Path: hashmal_lib/config.py
# def set_config(c):
# def get_config():
#     def __init__(self, parent=None):
#     def get_option(self, key, default=None):
#     def set_option(self, key, value, do_save=True):
# class Config(QtCore.QObject):


# Path: hashmal_lib/plugins/base.py
from functools import wraps
from collections import namedtuple
from PyQt4.QtGui import QDockWidget, QWidget, QVBoxLayout
from PyQt4 import QtCore
from hashmal_lib import config


    def augmenters(self):
        return self.ui.augmenters if self.ui else None

    def get_augmenter(self, hook_name):
        return getattr(self.ui, hook_name) if self.ui else None

class BasePluginUI(object):
    """Base class for plugin user interfaces."""
    tool_name = ''
    description = ''
    category = Category.General

    def __init__(self, handler):
        self.handler = handler
        self.config = config.get_config()
        self.config.optionChanged.connect(self.on_option_changed)
        self.is_enabled = True

        self.augmenters = []
        for name in dir(self):
            if name in known_augmenters:
                self.augmenters.append(name)

    def on_option_changed(self, key):
        """Called when a config option changes."""
        pass

    def options(self):
        """Return the config dict for this plugin."""

        return self.config.get_option(self.tool_name, {})