Skip to content

Commit

Permalink
Merge pull request #58 from carloshorn/coefficients
Browse files Browse the repository at this point in the history
export coefficients to json file
  • Loading branch information
mraspaud authored Jun 11, 2020
2 parents 2d7fbaf + dcc98aa commit 3162edd
Show file tree
Hide file tree
Showing 9 changed files with 1,984 additions and 478 deletions.
896 changes: 430 additions & 466 deletions pygac/calibration.py

Large diffs are not rendered by default.

17 changes: 16 additions & 1 deletion pygac/configuration.py
Original file line number Diff line number Diff line change
Expand Up @@ -39,7 +39,7 @@ class FileNotFoundError(OSError):
LOG = logging.getLogger(__name__)


class Configuration(configparser.ConfigParser):
class Configuration(configparser.ConfigParser, object):
"""Configuration container for pygac."""

config_file = ''
Expand All @@ -66,6 +66,21 @@ def read(self, config_file):
raise
self.config_file = config_file

def get(self, *args, **kwargs):
"""python 2 compatibility for fallback attribute"""
if sys.version_info.major < 3:
if 'fallback' in kwargs:
fallback = kwargs.pop('fallback')
else:
fallback = None
try:
value = super(Configuration, self).get(*args, **kwargs)
except (configparser.NoSectionError, configparser.NoOptionError):
value = fallback
else:
value = super().get(*args, **kwargs)
return value


_config = Configuration()

Expand Down
Loading

0 comments on commit 3162edd

Please sign in to comment.