
import os


class Config:
    def __init__(self, prefix='SHELDON_'):
        """
        Load config from environment variables.

        :param prefix: string, all needed environment variables
                            starts from it.
                            Default - 'SHELDON_'. So, environment
                            variables will be looking like:
                            'SHELDON_BOT_NAME', 'SHELDON_TWITTER_KEY'
        :return:
        """
        # Bot config variables
        self.variables = {}

        for variable in os.environ:
            if variable.startswith(prefix):
                self.variables[variable] = os.environ[variable]

    def get(self, variable, default_value):
        """

        :param variable: string, needed variable
        :param default_value: string, value that returns if
                              variable is not set
        :return:
        """
        if variable not in self.variables:
            return default_value

        return self.variables[variable]



import os


class Config:
    def __init__(self, prefix='SHELDON_'):
        """
        Load config from environment variables.

        :param prefix: string, all needed environment variables
                            starts from it.
                            Default - 'SHELDON_'. So, environment
                            variables will be looking like:
                            'SHELDON_BOT_NAME', 'SHELDON_TWITTER_KEY'
        :return:
        """
        # Bot config variables
        self.variables = {}

        for variable in os.environ:
            if variable.startswith(prefix):
                self.variables[variable] = os.environ[variable]

    def get(self, variable, default_value):
        """
        Get variable value from environment

        :param variable: string, needed variable
        :param default_value: string, value that returns if
                              variable is not set
        :return: variable value
        """
        if variable not in self.variables:
            return default_value

        return self.variables[variable]

    def get_installed_plugins(self):
        """
        Return list of installed plugins from installed_plugins.txt
        :return: list of strings with names of plugins
        """
        plugins_file = open('installed_plugins.txt')
        return plugins_file.readlines()


Add function for getting installed plugins
Add function for getting installed plugins

  
  import os
  
  
  class Config:
      def __init__(self, prefix='SHELDON_'):
          """
          Load config from environment variables.
  
          :param prefix: string, all needed environment variables
                              starts from it.
                              Default - 'SHELDON_'. So, environment
                              variables will be looking like:
                              'SHELDON_BOT_NAME', 'SHELDON_TWITTER_KEY'
          :return:
          """
          # Bot config variables
          self.variables = {}
  
          for variable in os.environ:
              if variable.startswith(prefix):
                  self.variables[variable] = os.environ[variable]
  
      def get(self, variable, default_value):
          """
+         Get variable value from environment
  
          :param variable: string, needed variable
          :param default_value: string, value that returns if
                                variable is not set
-         :return:
+         :return: variable value
          """
          if variable not in self.variables:
              return default_value
  
          return self.variables[variable]
  
+     def get_installed_plugins(self):
+         """
+         Return list of installed plugins from installed_plugins.txt
+         :return: list of strings with names of plugins
+         """
+         plugins_file = open('installed_plugins.txt')
+         return plugins_file.readlines()
  
+ 
Add function for getting installed plugins
## Code Before:

import os


class Config:
    def __init__(self, prefix='SHELDON_'):
        """
        Load config from environment variables.

        :param prefix: string, all needed environment variables
                            starts from it.
                            Default - 'SHELDON_'. So, environment
                            variables will be looking like:
                            'SHELDON_BOT_NAME', 'SHELDON_TWITTER_KEY'
        :return:
        """
        # Bot config variables
        self.variables = {}

        for variable in os.environ:
            if variable.startswith(prefix):
                self.variables[variable] = os.environ[variable]

    def get(self, variable, default_value):
        """

        :param variable: string, needed variable
        :param default_value: string, value that returns if
                              variable is not set
        :return:
        """
        if variable not in self.variables:
            return default_value

        return self.variables[variable]


## Instruction:
Add function for getting installed plugins
## Code After:

import os


class Config:
    def __init__(self, prefix='SHELDON_'):
        """
        Load config from environment variables.

        :param prefix: string, all needed environment variables
                            starts from it.
                            Default - 'SHELDON_'. So, environment
                            variables will be looking like:
                            'SHELDON_BOT_NAME', 'SHELDON_TWITTER_KEY'
        :return:
        """
        # Bot config variables
        self.variables = {}

        for variable in os.environ:
            if variable.startswith(prefix):
                self.variables[variable] = os.environ[variable]

    def get(self, variable, default_value):
        """
        Get variable value from environment

        :param variable: string, needed variable
        :param default_value: string, value that returns if
                              variable is not set
        :return: variable value
        """
        if variable not in self.variables:
            return default_value

        return self.variables[variable]

    def get_installed_plugins(self):
        """
        Return list of installed plugins from installed_plugins.txt
        :return: list of strings with names of plugins
        """
        plugins_file = open('installed_plugins.txt')
        return plugins_file.readlines()

