Wobuzz/wobuzz/command_line.py

30 lines
764 B
Python
Raw Normal View History

#!/usr/bin/python3
import sys
import argparse
from .main import Wobuzz
description = "A music player made by The Wobbler."
parser = argparse.ArgumentParser(description=description)
parser.add_argument("track", nargs="*", help="Plays audio files the from given paths.", metavar="TRACKS")
parser.add_argument("-p", "--playlist", help="Imports a playlist from the given path.", metavar="PLAYLIST_PATH")
arguments = parser.parse_args()
app = Wobuzz()
if arguments.playlist:
app.library.temporary_playlist.load_from_m3u(arguments.playlist)
if arguments.track:
app.library.temporary_playlist.load_from_paths(arguments.track)
app.player.current_playlist = app.library.temporary_playlist
app.library.create_playlist_views()
sys.exit(app.qt_app.exec())