generated from Hazel/python-project
properly exportet api
This commit is contained in:
parent
ec24193a72
commit
df971afea4
@ -1,8 +1,14 @@
|
|||||||
import pathlib
|
import pathlib
|
||||||
|
from .connections import Connection, SilentConnection
|
||||||
|
from .cache import clean_cache, clear_cache, set_cache_directory
|
||||||
|
|
||||||
|
|
||||||
__name__ = "python_requests"
|
__name__ = "python_requests"
|
||||||
__folder__ = str(pathlib.Path(__file__).parent)
|
__folder__ = str(pathlib.Path(__file__).parent)
|
||||||
|
__all__ = [
|
||||||
|
"Connection",
|
||||||
CACHE_DIRECTORY = "cache"
|
"SilentConnection",
|
||||||
|
"clean_cache",
|
||||||
|
"clear_cache",
|
||||||
|
"set_cache_directory",
|
||||||
|
]
|
||||||
|
@ -7,7 +7,18 @@ import pickle
|
|||||||
import sqlite3
|
import sqlite3
|
||||||
from datetime import datetime, timedelta
|
from datetime import datetime, timedelta
|
||||||
|
|
||||||
from . import CACHE_DIRECTORY
|
from . import __name__
|
||||||
|
|
||||||
|
CACHE_DIRECTORY = f"/tmp/{__name__}"
|
||||||
|
|
||||||
|
|
||||||
|
def set_cache_directory(cache_directory: Optional[str] = None):
|
||||||
|
global CACHE_DIRECTORY
|
||||||
|
|
||||||
|
if cache_directory is not None:
|
||||||
|
CACHE_DIRECTORY = cache_directory
|
||||||
|
|
||||||
|
Path(CACHE_DIRECTORY).mkdir(exist_ok=True, parents=True)
|
||||||
|
|
||||||
|
|
||||||
# SQLite database file path
|
# SQLite database file path
|
||||||
|
Loading…
x
Reference in New Issue
Block a user