mirror of https://github.com/coddrago/Heroku
fix for hashable types
parent
8e417eaf95
commit
7d4ad92325
|
@ -12,6 +12,7 @@ import logging
|
||||||
import os
|
import os
|
||||||
import time
|
import time
|
||||||
import asyncio
|
import asyncio
|
||||||
|
import collections
|
||||||
|
|
||||||
try:
|
try:
|
||||||
import psycopg2
|
import psycopg2
|
||||||
|
@ -32,13 +33,9 @@ from telethon.tl.types import Message
|
||||||
from telethon.errors.rpcerrorlist import ChannelsTooMuchError
|
from telethon.errors.rpcerrorlist import ChannelsTooMuchError
|
||||||
|
|
||||||
from . import utils, main
|
from . import utils, main
|
||||||
from ._types import (
|
from .pointers import (
|
||||||
PointerBool,
|
|
||||||
PointerInt,
|
|
||||||
PointerStr,
|
|
||||||
PointerList,
|
PointerList,
|
||||||
PointerDict,
|
PointerDict,
|
||||||
PointerTuple,
|
|
||||||
)
|
)
|
||||||
|
|
||||||
DATA_DIR = (
|
DATA_DIR = (
|
||||||
|
@ -387,12 +384,9 @@ class Database(dict):
|
||||||
"""Get a pointer to database key"""
|
"""Get a pointer to database key"""
|
||||||
value = self.get(owner, key, default)
|
value = self.get(owner, key, default)
|
||||||
mapping = {
|
mapping = {
|
||||||
int: PointerInt,
|
|
||||||
str: PointerStr,
|
|
||||||
bool: PointerBool,
|
|
||||||
list: PointerList,
|
list: PointerList,
|
||||||
dict: PointerDict,
|
dict: PointerDict,
|
||||||
tuple: PointerTuple,
|
collections.abc.Hashable: lambda v: v,
|
||||||
}
|
}
|
||||||
|
|
||||||
pointer_constructor = next(
|
pointer_constructor = next(
|
||||||
|
|
Loading…
Reference in New Issue