# Path: axiom/iaxiom.py
# class IStatEvent(Interface):
# class IAtomicFile(Interface):
# class IAxiomaticCommand(Interface):
# class IBeneficiary(Interface):
# class IPowerupIndirector(Interface):
# class IScheduler(Interface):
# class IQuery(Interface):
# class IColumn(Interface):
# class IOrdering(Interface):
# class IComparison(Interface):
# class IReliableListener(Interface):
# class IBatchProcessor(Interface):
# class IBatchService(Interface):
# class IVersion(Interface):
#     def __init__(tempname, destdir):
#     def tell():
#     def write(bytes):
#     def close(callback):
#     def abort():
#     def powerUp(implementor, interface):
#     def indirect(interface):
#     def schedule(runnable, when):
#     def __iter__():
#     def count():
#     def cloneQuery(limit):
#     def getShortColumnName(store):
#     def getColumnName(store):
#     def fullyQualifiedName():
#     def __get__(row):
#     def orderColumns():
#     def getInvolvedTables():
#     def getQuery(store):
#     def getArgs(store):
#     def processItem(item):
#     def suspend():
#     def resume():
#     def addReliableListener(listener, style=LOCAL):
#     def removeReliableListener(listener):
#     def getReliableListeners():
#     def start():
#     def suspend(storeID):
#     def resume(storeID):
# LOCAL, REMOTE = list(range(2))


from weakref import ref
from traceback import print_exc
from twisted.python import log
from axiom import iaxiom
            # If the entry has already been removed from the cache, this will
            # result in KeyError which we ignore. If the entry is still in the
            # cache, but the weakref has been broken, this will result in
            # CacheFault (a KeyError subclass) which we also ignore. See the
            # comment in get() for an explanation of why this might happen.
            pass


    def get(self, key):
        """
        Get an entry from the cache by key.

        @raise KeyError: if the given key is not present in the cache.

        @raise CacheFault: (a L{KeyError} subclass) if the given key is present
            in the cache, but the value it points to is gone.
        """
        o = self.data[key]()
        if o is None:
            # On CPython, the weakref callback will always(?) run before any
            # other code has a chance to observe that the weakref is broken;
            # and since the callback removes the item from the dict, this
            # branch of code should never run. However, on PyPy (and possibly
            # other Python implementations), the weakref callback does not run
            # immediately, thus we may be able to observe this intermediate
            # state. Should this occur, we remove the dict item ourselves,
            # and raise CacheFault (which is a KeyError subclass).
            del self.data[key]
            raise CacheFault(
                "FinalizingCache has {!r} but its value is no more.".format(key))

# Path: axiom/iaxiom.py
# class IStatEvent(Interface):
# class IAtomicFile(Interface):
# class IAxiomaticCommand(Interface):
# class IBeneficiary(Interface):
# class IPowerupIndirector(Interface):
# class IScheduler(Interface):
# class IQuery(Interface):
# class IColumn(Interface):
# class IOrdering(Interface):
# class IComparison(Interface):
# class IReliableListener(Interface):
# class IBatchProcessor(Interface):
# class IBatchService(Interface):
# class IVersion(Interface):
#     def __init__(tempname, destdir):
#     def tell():
#     def write(bytes):
#     def close(callback):
#     def abort():
#     def powerUp(implementor, interface):
#     def indirect(interface):
#     def schedule(runnable, when):
#     def __iter__():
#     def count():
#     def cloneQuery(limit):
#     def getShortColumnName(store):
#     def getColumnName(store):
#     def fullyQualifiedName():
#     def __get__(row):
#     def orderColumns():
#     def getInvolvedTables():
#     def getQuery(store):
#     def getArgs(store):
#     def processItem(item):
#     def suspend():
#     def resume():
#     def addReliableListener(listener, style=LOCAL):
#     def removeReliableListener(listener):
#     def getReliableListeners():
#     def start():
#     def suspend(storeID):
#     def resume(storeID):
# LOCAL, REMOTE = list(range(2))


# Path: axiom/_fincache.py
from weakref import ref
from traceback import print_exc
from twisted.python import log
from axiom import iaxiom

            # If the entry has already been removed from the cache, this will
            # result in KeyError which we ignore. If the entry is still in the
            # cache, but the weakref has been broken, this will result in
            # CacheFault (a KeyError subclass) which we also ignore. See the
            # comment in get() for an explanation of why this might happen.
            pass


    def get(self, key):
        """
        Get an entry from the cache by key.

        @raise KeyError: if the given key is not present in the cache.

        @raise CacheFault: (a L{KeyError} subclass) if the given key is present
            in the cache, but the value it points to is gone.
        """
        o = self.data[key]()
        if o is None:
            # On CPython, the weakref callback will always(?) run before any
            # other code has a chance to observe that the weakref is broken;
            # and since the callback removes the item from the dict, this
            # branch of code should never run. However, on PyPy (and possibly
            # other Python implementations), the weakref callback does not run
            # immediately, thus we may be able to observe this intermediate
            # state. Should this occur, we remove the dict item ourselves,
            # and raise CacheFault (which is a KeyError subclass).
            del self.data[key]
            raise CacheFault(
                "FinalizingCache has {!r} but its value is no more.".format(key))

        log.msg(interface=iaxiom.IStatEvent, stat_cache_hits=1, key=key)