"""
This file loads and maintains the configuration of the application
"""


class Configuration:
    def __init__(self, marker, begin, end=None):
        self.marker = marker
        self.begin = begin
        self.end = end

    def __str__(self):
        return self.marker + " --> " + self.begin + " " +  self.end

sourcecode_added = False
configuration = []


def load_configuration(config_file="mdxml.conf"):
    config = open(config_file)
    config_lines = config.readlines()
    for line in config_lines:
        if len(line.strip()) == 0:
            continue
        params = line.split()
        marker = params[0]
        begin = params[1]
        if len(params) >= 3:
            end =params[2]
        else:
            end =None
        configuration.append(Configuration(marker, begin, end))

def print_configuration():
    for configuration_element in configuration:
        print configuration_element

@@ -357,10 +357,10 @@
 n = 
-%5B%5D
+%7B%7D
 %0A%0A%0Ad
@@ -763,15 +763,19 @@
 tion
-.append
+%5Bmarker%5D = 
 (Con
@@ -842,37 +842,19 @@
     for 
-configuration_element
+key
  in conf
@@ -895,13 +895,10 @@
 tion
-_element
+%5Bkey%5D
 %0A

change config to map to do not depend on the order in the config file