Support passing config as first argument
parent
56425527bc
commit
32c60c085f
|
@ -3,7 +3,7 @@
|
|||
import configparser
|
||||
from os.path import expanduser,exists
|
||||
from cmdlistener import CmdListener
|
||||
from sys import exit
|
||||
from sys import exit,argv
|
||||
# Error Codes:
|
||||
# 1 - Unknown problem has occured
|
||||
# 2 - Could not find the server.
|
||||
|
@ -57,7 +57,7 @@ def read_config(path):
|
|||
return True
|
||||
|
||||
#Get config
|
||||
cfgfile = expanduser("~/.config/mpddj.ini")
|
||||
cfgfile = argv[1] or expanduser("~/.config/mpddj.ini")
|
||||
config = None
|
||||
if not exists(cfgfile):
|
||||
print("Config file not found, writing a new one")
|
||||
|
|
Loading…
Reference in New Issue