# Path: axiom/errors.py
# class TimeoutError(Exception):
# class BadCredentials(UnauthorizedLogin):
# class NoSuchUser(UnauthorizedLogin):
# class MissingDomainPart(NoSuchUser):
# class DuplicateUser(Exception):
# class CannotOpenStore(RuntimeError):
# class NoUpgradePathAvailable(CannotOpenStore):
# class NoCrossStoreReferences(AttributeError):
# class SQLError(RuntimeError):
# class TableAlreadyExists(SQLError):
# class UnknownItemType(Exception):
# class SQLWarning(Warning):
# class TableCreationConcurrencyError(RuntimeError):
# class DuplicateUniqueItem(KeyError):
# class ItemNotFound(KeyError):
# class ItemClassesOnly(TypeError):
# class ChangeRejected(Exception):
# class DependencyError(Exception):
# class DeletionDisallowed(ValueError):
# class DataIntegrityError(RuntimeError):
# class BrokenReference(DataIntegrityError):
# class UpgraderRecursion(RuntimeError):
# class ItemUpgradeError(RuntimeError):
# class UnsatisfiedRequirement(AttributeError):
#     def __init__(self, statement, timeout, underlying):
#     def __init__(self, sql, args, underlying):
#     def __str__(self):
#     def __init__(self, originalFailure, storeID, oldType, newType):
# 
# 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))


import time, sys
        import sqlite3 as dbapi2
    from pysqlite2 import dbapi2
from twisted.python import log
from axiom import errors, iaxiom
    Wrapper for an SQLite3 C{Connection} object.

    @type closed: L{bool}
    @ivar closed: Has this cursor been closed?
    """
    def __init__(self, connection, timeout=None):
        self._connection = connection
        self._timeout = timeout
        self.closed = False


    def fromDatabaseName(cls, dbFilename, timeout=None, isolationLevel=None):
        return cls(dbapi2.connect(dbFilename, timeout=0,
                                  isolation_level=isolationLevel))
    fromDatabaseName = classmethod(fromDatabaseName)


    def cursor(self):
        return Cursor(self, self._timeout)


    def identifySQLError(self, sql, args, e):
        """
        Identify an appropriate SQL error object for the given message for the
        supported versions of sqlite.

        @return: an SQLError
        """
        message = e.args[0]
        if message.startswith("table") and message.endswith("already exists"):

# Path: axiom/errors.py
# class TimeoutError(Exception):
# class BadCredentials(UnauthorizedLogin):
# class NoSuchUser(UnauthorizedLogin):
# class MissingDomainPart(NoSuchUser):
# class DuplicateUser(Exception):
# class CannotOpenStore(RuntimeError):
# class NoUpgradePathAvailable(CannotOpenStore):
# class NoCrossStoreReferences(AttributeError):
# class SQLError(RuntimeError):
# class TableAlreadyExists(SQLError):
# class UnknownItemType(Exception):
# class SQLWarning(Warning):
# class TableCreationConcurrencyError(RuntimeError):
# class DuplicateUniqueItem(KeyError):
# class ItemNotFound(KeyError):
# class ItemClassesOnly(TypeError):
# class ChangeRejected(Exception):
# class DependencyError(Exception):
# class DeletionDisallowed(ValueError):
# class DataIntegrityError(RuntimeError):
# class BrokenReference(DataIntegrityError):
# class UpgraderRecursion(RuntimeError):
# class ItemUpgradeError(RuntimeError):
# class UnsatisfiedRequirement(AttributeError):
#     def __init__(self, statement, timeout, underlying):
#     def __init__(self, sql, args, underlying):
#     def __str__(self):
#     def __init__(self, originalFailure, storeID, oldType, newType):
# 
# 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/_pysqlite2.py
import time, sys
        import sqlite3 as dbapi2
    from pysqlite2 import dbapi2
from twisted.python import log
from axiom import errors, iaxiom

    Wrapper for an SQLite3 C{Connection} object.

    @type closed: L{bool}
    @ivar closed: Has this cursor been closed?
    """
    def __init__(self, connection, timeout=None):
        self._connection = connection
        self._timeout = timeout
        self.closed = False


    def fromDatabaseName(cls, dbFilename, timeout=None, isolationLevel=None):
        return cls(dbapi2.connect(dbFilename, timeout=0,
                                  isolation_level=isolationLevel))
    fromDatabaseName = classmethod(fromDatabaseName)


    def cursor(self):
        return Cursor(self, self._timeout)


    def identifySQLError(self, sql, args, e):
        """
        Identify an appropriate SQL error object for the given message for the
        supported versions of sqlite.

        @return: an SQLError
        """
        message = e.args[0]
        if message.startswith("table") and message.endswith("already exists"):

            return errors.TableAlreadyExists(sql, args, e)