Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Allow changes to the cache base directory #7

Open
wants to merge 1 commit into
base: master
Choose a base branch
from
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
7 changes: 5 additions & 2 deletions pyembedpg.py
Original file line number Diff line number Diff line change
Expand Up @@ -48,10 +48,13 @@ def __init__(self, version=None):
Initialize a new Postgres object
:param version: version to use. If it is not set, use the latest version in .pyembedpg directory. If not present
use the latest version remotely. Use 'local' to use the local postgres version installed on the machine
:param cache_base_dir: base directory path to save the cache files. If not present, the home directory is used.
:return:
"""
home_dir = expanduser("~")
self._cache_dir = os.path.join(home_dir, PyEmbedPg.CACHE_DIRECTORY)
if not cache_base_dir:
cache_base_dir = expanduser("~")

self._cache_dir = os.path.join(cache_base_dir, PyEmbedPg.CACHE_DIRECTORY)

# if version is not specified, check local last version otherwise get last remote version
self.version = version
Expand Down