-
Notifications
You must be signed in to change notification settings - Fork 17
Expand file tree
/
Copy pathconfig.py
More file actions
31 lines (20 loc) · 778 Bytes
/
config.py
File metadata and controls
31 lines (20 loc) · 778 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
import configparser as ConfigParser
from dotenv import load_dotenv
import os
load_dotenv()
config = ConfigParser.RawConfigParser(allow_no_value=True)
config.read('config.ini')
def get_chain_names():
return config['chains']['names']
def get_chain_targets():
return config['chains']['targets']
def remove_chain_from_config(chain):
chain_names_arr = config['chains']['names'].split()
chain_index = chain_names_arr.index(chain)
del chain_names_arr[chain_index]
config['chains']['names'] = ' '.join(chain_names_arr)
chains_targets_arr = config['chains']['targets'].split(", ")
del chains_targets_arr[chain_index]
config['chains']['targets'] = ', '.join(chains_targets_arr)
def get_pats():
return os.getenv('GITHUB_PATS').split(" ")