Skip to content

Commit

Permalink
README.md & config.py: Deprecate COBOT_PREFIX
Browse files Browse the repository at this point in the history
Deprecate the use of the environment variable
COBOT_PREFIX -> BOT_PREFIX
issue warning if COBOT_PREFIX is still being used.

Closes #370
  • Loading branch information
aashraybhandar1 committed Apr 16, 2018
1 parent 583785c commit 7a9e09b
Show file tree
Hide file tree
Showing 2 changed files with 9 additions and 3 deletions.
2 changes: 1 addition & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -31,7 +31,7 @@ Read more about what `corobo` could do for you
## Environment Variables

1. `COBOT_ROOT` - absolute path of the project root.
2. `COBOT_PREFIX` - prefix to use for issuing bot commands.
2. `BOT_PREFIX` - prefix to use for issuing bot commands.
3. `BOT_ADMINS` - Admins of the errbot instance.
4. `ROOMS` - Space separated list of rooms to join on startup. e.g.
`ROOMS="coala/coala coala/coala/corobo"`
Expand Down
10 changes: 8 additions & 2 deletions config.py
Original file line number Diff line number Diff line change
Expand Up @@ -52,10 +52,16 @@
BOT_LOG_FILE = os.path.join(COBOT_ROOT, 'errbot.log')
BOT_LOG_LEVEL = logging.DEBUG

BOT_PREFIX = os.environ.get('COBOT_PREFIX', 'corobo ')
BOT_PREFIX = os.environ.get('BOT_PREFIX', 'corobo ')

if 'COBOT_PREFIX' in os.environ:
BOT_PREFIX = os.environ['COBOT_PREFIX']
logging.warning(
'Deprecation warning: environment variable COBOT_PREFIX is replaced '
'by BOT_PREFIX.')

# Also listen to cobot, if the bot being ran is corobo
if not os.environ.get('COBOT_PREFIX'):
if not os.environ.get('BOT_PREFIX'):
BOT_ALT_PREFIXES = ('cobot ', )

BOT_DEPRECATED_PREFIXES = os.environ.get(
Expand Down

0 comments on commit 7a9e09b

Please sign in to comment.