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

Add a customized config parser #344

Merged
merged 15 commits into from
Apr 13, 2022
Merged
Show file tree
Hide file tree
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
8 changes: 3 additions & 5 deletions compass/cache.py
Original file line number Diff line number Diff line change
Expand Up @@ -4,11 +4,10 @@
from datetime import datetime
import os
from importlib import resources
import configparser
import shutil
import pickle

from compass.config import add_config
from compass.config import CompassConfigParser


def update_cache(step_paths, date_string=None, dry_run=False):
Expand Down Expand Up @@ -39,9 +38,8 @@ def update_cache(step_paths, date_string=None, dry_run=False):
if invalid:
raise ValueError('You must cache files from either Anvil or Chrysalis')

config = configparser.ConfigParser(
interpolation=configparser.ExtendedInterpolation())
add_config(config, 'compass.machines', '{}.cfg'.format(machine))
config = CompassConfigParser()
config.add_from_package('compass.machines', '{}.cfg'.format(machine))

if date_string is None:
date_string = datetime.now().strftime("%y%m%d")
Expand Down
Loading