title: Create a config file to hold values like username password url in python behave
body: <p>I'm trying to create a config that holds information such as username password etc. </p>
  
  <p>I have created an ini file holding this:</p>
  
  <pre><code>[DEFAULT]
  username: user
  password: pass
  </code></pre>
  
  <p>I then have a config map class like: </p>
  
  <p>import configparser</p>
  
  <pre><code>class ConfigSectionMap:
      def __init__(self):
          my_config_parser = configparser.ConfigParser()
          my_config_parser.read('inilocation')
          print(my_config_parser.default_section)
  
      def config_map(self, section):
          dict1 = {}
          options = self.my_config_parser.options(section)
          for option in options:
              try:
                  dict1[option] = self.my_config_parser.get(section, option)
                  if dict1[option] == -1:
                      print("skip: %s" % option)
              except:
                  print("exception on %s!" % option)
                  dict1[option] = None
          return dict1
  </code></pre>
  
  <p>In my main class where I want to use this I do:</p>
  
  <pre><code>from config_section_map import ConfigSectionMap
  
  print(ConfigSectionMap.config_map(("DEFAULT")['password']))
  </code></pre>
  
  <p>when running this I receive an error:</p>
  
  <p>TypeError: string indices must be integers</p>
  
  <p>I've been following the docs but it's not working: <a href="https://wiki.python.org/moin/ConfigParserExamples" rel="nofollow noreferrer">https://wiki.python.org/moin/ConfigParserExamples</a></p>
  
  <p>Or if there is an easier way please show me</p>
  
  <p>edit: </p>
  
  <p>changing to this</p>
  
  <pre><code>print(ConfigSectionMap.config_map("DEFAULT")['password']) 
  </code></pre>
  
  <p>shows</p>
  
  <pre><code>TypeError: config_map() missing 1 required positional argument: 'section'
  </code></pre>