Skip to content

Commit 7a61142

Browse files
committedMay 22, 2022
fix default value retrieval to use "_config_defaults.py" instead of "config.py" [CAS-13116]
1 parent aa7f5e1 commit 7a61142

File tree

1 file changed

+5
-5
lines changed

1 file changed

+5
-5
lines changed
 

‎casaconfig/write_default_config.py

+5-5
Original file line numberDiff line numberDiff line change
@@ -40,8 +40,8 @@ def write_default_config(name, **kwargs):
4040
if ('/' in name) and (name.rindex('/') > 0) and (not os.path.exists(name[:name.rindex('/')])):
4141
os.system('mkdir %s' % name[:name.rindex('/')])
4242

43-
# read default config.py from package installation
44-
with open(pkg_resources.resource_filename('casaconfig', 'config.py'), 'r') as fid:
43+
# read default values from package installation
44+
with open(pkg_resources.resource_filename('casaconfig', '_config_defaults.py'), 'r') as fid:
4545
config = fid.read()
4646

4747
# modify specified keys
@@ -62,8 +62,8 @@ def main():
6262
parser = argparse.ArgumentParser(prog='write_default_config', description='write out a default casa configuration file')
6363
parser.add_argument('outfile', help='output filename to write the configuration to')
6464

65-
# open the default config.py inside this package and parse it to extract the default parameters/values
66-
with open(pkg_resources.resource_filename('casaconfig', 'config.py'), 'r') as fid:
65+
# open the default values inside this package and parse it to extract the default parameters/values
66+
with open(pkg_resources.resource_filename('casaconfig', '_config_defaults.py'), 'r') as fid:
6767
config = fid.read()
6868
options = re.findall('\n\#(.+?)\n\s*(\S+?)\s*\=\s*(.+?)\n', config, flags=re.DOTALL)
6969

@@ -79,4 +79,4 @@ def main():
7979
except:
8080
set_args += [(arg, args[arg])]
8181
set_args = dict(set_args)
82-
write_default_config(args['outfile'], **set_args)
82+
write_default_config(args['outfile'], **set_args)

0 commit comments

Comments
 (0)
Please sign in to comment.