summaryrefslogtreecommitdiff
path: root/bin/update/config.py
blob: 0279a172d2581459c8b597f21b853d6718b0e3ba (plain)
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

import configparser

class Config(object):

    def __init__(self):
        self.certificate_path = None
        self.certificate_name = None
        self.channel = None
        self.base_url = None
        self.upload_url = None
        self.server_url = None

def parse_config(config_file):
    config = configparser.ConfigParser()
    config.read(config_file)

    data = Config()
    updater_data = config['Updater']
    data.base_url = updater_data['base-url']
    data.certificate_name = updater_data['certificate-name']
    data.certificate_path = updater_data['certificate-path']
    data.channel = updater_data['channel']
    data.upload_url = updater_data['upload-url']
    data.server_url = updater_data["ServerURL"]

    return data