Guest User

Untitled

a guest
Jul 16th, 2018
91
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.87 KB | None | 0 0
  1. [IRC]
  2. ServerAddress: irc.freenode.org
  3. ServerPort: 6667
  4. ServerPassword:
  5. NickName: sp0ckkB0t
  6. Channels: testytest,pilife
  7.  
  8. ---
  9.  
  10. import ConfigParser
  11.  
  12. class sBotConfiguration():
  13.  
  14. _configFile = "sBot.config"
  15.  
  16. def __init__(self):
  17. self._config = ConfigParser.RawConfigParser()
  18.  
  19. try:
  20. self._config.read(self._configFile)
  21. except ConfigParser.ParsingError:
  22. print "Error! Unable to parse/read/open the configuration file %s" % self._configFile
  23.  
  24. self.ServerAddress = self._config.get('IRC', 'ServerAddress')
  25. self.ServerPort = self._config.getint('IRC', 'ServerPort')
  26. self.ServerPassword = self._config.get('IRC', 'ServerPassword')
  27.  
  28. self.Channels = self._config.get('IRC', 'Channels')
  29.  
  30. self.NickName = self._config.get('IRC', 'NickName')
Add Comment
Please, Sign In to add comment