Skip to content

Commit

Permalink
ref: improve logging and docstrings
Browse files Browse the repository at this point in the history
  • Loading branch information
paulmueller committed May 3, 2024
1 parent 1c82b13 commit c4ffc19
Show file tree
Hide file tree
Showing 3 changed files with 11 additions and 3 deletions.
3 changes: 3 additions & 0 deletions CHANGELOG
Original file line number Diff line number Diff line change
@@ -1,3 +1,6 @@
0.14.2
- docs: improve doc strings
- ref: improve logging
0.14.1
- setup: fix build pipeline (remove editable install)
0.14.0
Expand Down
7 changes: 4 additions & 3 deletions dcoraid/api/ckan_api.py
Original file line number Diff line number Diff line change
Expand Up @@ -35,7 +35,7 @@ class CKANAPI:
def __init__(self,
server: str,
api_key: str | None = "",
ssl_verify: bool = True,
ssl_verify: bool | str = True,
check_ckan_version: bool = True,
caching: bool | str | pathlib.Path = True):
"""User-convenient interface to the CKAN API
Expand All @@ -46,8 +46,9 @@ def __init__(self,
Server to which to connect to, e.g. dcor.mpl.mpg.de
api_key: str
API token to use for accessing private datasets
ssl_verify: bool
Whether to verify SSL connections
ssl_verify: bool or str
Either a boolean indicating whether SSL certificates should be
verified or a path to an SSL certificate for certificate pinning.
check_ckan_version: bool
Whether to check for the proper CKAN version
caching: bool or str or pathlib.Path
Expand Down
4 changes: 4 additions & 0 deletions dcoraid/gui/api.py
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
import atexit
import logging
import os
import pathlib
import shutil
Expand All @@ -13,6 +14,8 @@
#: to `None` which means DCOR-Aid decides depending on where it is.
_SSL_VERIFY = False if _disable_ssl else None

logger = logging.getLogger(__name__)


def get_ckan_api(public=False):
"""Convenience function for obtaining CKANAPI instance from settings"""
Expand Down Expand Up @@ -41,4 +44,5 @@ def setup_certificate_file():
_SSL_VERIFY = str(cert_path)
else:
_SSL_VERIFY = True
logger.info(f"SSL verification: {_SSL_VERIFY}")
return _SSL_VERIFY

0 comments on commit c4ffc19

Please sign in to comment.