Skip to content

Commit

Permalink
Detect directory with proper access rights on CMS
Browse files Browse the repository at this point in the history
  • Loading branch information
René Reitmann committed Aug 1, 2019
1 parent 5cd8931 commit 0a3148c
Show file tree
Hide file tree
Showing 2 changed files with 11 additions and 2 deletions.
7 changes: 6 additions & 1 deletion CHANGES.rst
Original file line number Diff line number Diff line change
Expand Up @@ -10,4 +10,9 @@ Version 0.0.1
Version 0.0.2
=============

- Move cache to temp directory
- Move cache to temp directory

Version 0.0.3
=============

- Try to detect directory with proper access rights for our CMS
6 changes: 5 additions & 1 deletion mdm_python_client/mdm_client.py
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,11 @@
import requests_cache

# use a sqllite DB for caching the MDM calls for 24 hours
requests_cache.install_cache(os.path.join(tempfile.gettempdir(), "mdm_client_cache"), expire_after=60 * 60 * 24)
plone_directory = "/usr/local/plone_local_files"
if os.path.exists(plone_directory):
requests_cache.install_cache(os.path.join(plone_directory, "mdm_client_cache"), expire_after=60 * 60 * 24)
else:
requests_cache.install_cache(os.path.join(tempfile.gettempdir(), "mdm_client_cache"), expire_after=60 * 60 * 24)


def _json_object_hook(d): return namedtuple("X", d.keys())(*d.values())
Expand Down

0 comments on commit 0a3148c

Please sign in to comment.