trustedsec/social-engineer-toolkit — pull request #67 by corelanc0d3r (2014-04-16 10:28:55+00:00)
Title: Refactor config

Added a SetConfig class, which provides easy access to configuration parameters in set_config (or any other config file that uses = as delimeters).
I have edited the web command_center.py file to demonstrate to use of the SetConfig class.

Basically, all you need to do is:
Import the necessary stuff in the current module:
```
from src.core.setconfig import *
```
Create an instance of the SetConfig class and tell it what config file to use:
```
sconfig = SetConfig("%s/config/set_config" % (definepath))
```
Then "get" the argument you want, and tell it what the default value should be if no value was found:
The returning value is a string, so if it needs to become an int, just use int():
```
port = int(sconfig.get("COMMAND_CENTER_PORT",44444))
```