-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge branch 'master' of github.com:TeamGamma/directedstudies
- Loading branch information
Showing
3 changed files
with
45 additions
and
13 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,36 @@ | ||
import sps.quotes.client | ||
|
||
class ConfigObject(): | ||
""" | ||
Provides default values for all possible keys in the configuration file | ||
""" | ||
TRANSACTION_SERVER_PORT = 6000 | ||
|
||
DATABASE_CONNECTION_ARGS = { | ||
'drivername': 'mysql', | ||
'host': '127.0.0.1', | ||
'port': 3306, | ||
'database': 'sps', | ||
'username': 'root', | ||
'password': 'root', | ||
} | ||
DATABASE_ENGINE_ARGS = { | ||
'echo': True, | ||
} | ||
|
||
QUOTE_CLIENT = sps.quotes.client.RandomQuoteClient | ||
|
||
|
||
# The global configuration object | ||
config = ConfigObject() | ||
|
||
|
||
def read_config_file(filename): | ||
""" | ||
Reads a Python configuration file and replaces attributes in the | ||
configuration. Returns the global ConfigObject. | ||
""" | ||
global config | ||
execfile(filename, globals(), config.__dict__) | ||
return config | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters