1
0
mirror of https://github.com/spl0k/supysonic.git synced 2024-12-23 01:16:18 +00:00

WIP rewrite config.py: update cli

This commit is contained in:
Óscar García Amor 2017-08-07 09:04:49 +02:00
parent 2a3f13bb82
commit 6a6bc577cb

View File

@ -20,7 +20,7 @@
# along with this program. If not, see <http://www.gnu.org/licenses/>.
import sys, cmd, argparse, getpass, time
from supysonic import config
from supysonic.config import Config
from supysonic.db import get_store, Folder, User
from supysonic.managers.folder import FolderManager
@ -225,10 +225,10 @@ class CLI(cmd.Cmd):
print "Successfully changed '{}' password".format(name)
if __name__ == "__main__":
if not config.check():
if not Config().check():
sys.exit(1)
cli = CLI(get_store(config.get('base', 'database_uri')))
cli = CLI(get_store(Config().get('base', 'database_uri')))
if len(sys.argv) > 1:
cli.onecmd(' '.join(sys.argv[1:]))
else: