File: __init__.py

package info (click to toggle)
python-persist-queue 1.0.0-1
  • links: PTS, VCS
  • area: main
  • in suites: forky, sid, trixie
  • size: 328 kB
  • sloc: python: 2,754; sh: 13; makefile: 3
file content (57 lines) | stat: -rw-r--r-- 1,466 bytes parent folder | download
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
__author__ = 'Peter Wang'
__license__ = 'BSD'
__version__ = '1.0.0'

# Relative imports assuming the current package structure
from .exceptions import Empty, Full  # noqa: F401
from .queue import Queue  # noqa: F401
import logging
log = logging.getLogger(__name__)

# Attempt to import optional components, logging if not found.
try:
    from .pdict import PDict  # noqa: F401
    from .sqlqueue import (  # noqa: F401
        SQLiteQueue,
        FIFOSQLiteQueue,
        FILOSQLiteQueue,
        UniqueQ
    )
    from .sqlackqueue import (  # noqa: F401
        SQLiteAckQueue,
        FIFOSQLiteAckQueue,
        FILOSQLiteAckQueue,
        UniqueAckQ,
        AckStatus
    )
except ImportError:
    # If sqlite3 is not available, log a message.
    log.info("No sqlite3 module found, sqlite3 based queues are not available")

try:
    from .mysqlqueue import MySQLQueue  # noqa: F401
except ImportError:
    # failed due to DBUtils not installed via extra-requirements.txt
    log.info("DBUtils may not be installed, install "
             "via 'pip install persist-queue[extra]'")

# Define what symbols are exported by the module.
__all__ = [
    "Queue",
    "SQLiteQueue",
    "FIFOSQLiteQueue",
    "FILOSQLiteQueue",
    "UniqueQ",
    "PDict",
    "SQLiteAckQueue",
    "FIFOSQLiteAckQueue",
    "FILOSQLiteAckQueue",
    "UniqueAckQ",
    "AckStatus",
    "MySQLQueue",
    "Empty",
    "Full",
    "__author__",
    "__license__",
    "__version__"
]