-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathgeneral_options.py
More file actions
37 lines (29 loc) · 806 Bytes
/
general_options.py
File metadata and controls
37 lines (29 loc) · 806 Bytes
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
import os
import configparser
def get_options_from_file():
config_file = 'eistools.config'
if os.path.exists(config_file) and os.path.isfile(config_file):
options = configparser.ConfigParser()
options.read(config_file)
return options
else:
return None
def get_param(section, option):
options = get_options_from_file()
if options is None:
return None
if options.has_option(section, option):
return options[section][option]
else:
return None
def use_dt_suffix():
op = get_param('GENERAL', 'use_dt_suffix')
if op is None:
return False
op = op.strip().lower()
if op == '1' or op == 'yes':
return True
else:
return False
def get_eis():
return get_param('GENERAL', 'eis')