Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Make constants.py into a configuration file #10

Open
wants to merge 1 commit into
base: master
Choose a base branch
from
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
19 changes: 18 additions & 1 deletion mumblerecbot.py
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,24 @@
import time
from threading import Thread

from constants import *
# Try to use the path passed in as first argument as the config
# file. If no argument is passed in, just import constants from
# the current directory.
import sys
import os

configfile = None
try:
configfile = sys.argv[1]
except IndexError:
# No config file, import the defaults
from constants import *
if configfile:
if not os.path.exists(configfile):
print "Can't find config path."
quit()
sys.path.append(os.path.dirname(os.path.expanduser(configfile)))
from config import *

import pymumble
from pymumble.constants import *
Expand Down