# Path: lanshark/observable.py
# class Observable(object):
#     def __init__(self):
#     def connect(self, event, callback):
#     def disconnect(self, event, callback):
#     def notify(self, event, *args):
# def test():
#     def callback(bar):


import os
import simplejson
from lanshark import observable
    from StringIO import StringIO
class MyConfig(Config):
    n = Integer(10, "Some doc")
    foobar = String("bar", "Some more doc")
    trve = IsTrve(True, "Even more doc")

config = MyConfig()
config.load("foo.conf")
config.n = 0x29a
config.save()

"""
from __future__ import with_statement



class Error(Exception):
    """Raised when an error occures while parsing the confiuration file"""
    def __init__(self, lineno, line, cause):
        self.line = line
        self.lineno = lineno
        self.__cause__ = cause
        self.message = "Error while parsing configuration on line %i: '%s'\n"\
                       "%s" % (lineno, line, str(cause))
    def __str__(self):
        return self.message

    def __repr__(self):
        return self.message

# TODO:  Add some kind of onchange events

# Path: lanshark/observable.py
# class Observable(object):
#     def __init__(self):
#     def connect(self, event, callback):
#     def disconnect(self, event, callback):
#     def notify(self, event, *args):
# def test():
#     def callback(bar):


# Path: lanshark/configuration.py
import os
import simplejson
from lanshark import observable
    from StringIO import StringIO

class MyConfig(Config):
    n = Integer(10, "Some doc")
    foobar = String("bar", "Some more doc")
    trve = IsTrve(True, "Even more doc")

config = MyConfig()
config.load("foo.conf")
config.n = 0x29a
config.save()

"""
from __future__ import with_statement



class Error(Exception):
    """Raised when an error occures while parsing the confiuration file"""
    def __init__(self, lineno, line, cause):
        self.line = line
        self.lineno = lineno
        self.__cause__ = cause
        self.message = "Error while parsing configuration on line %i: '%s'\n"\
                       "%s" % (lineno, line, str(cause))
    def __str__(self):
        return self.message

    def __repr__(self):
        return self.message

# TODO:  Add some kind of onchange events

class Config(observable.Observable):