Clean up and update Travis intergration

This commit is contained in:
Nguyễn Gia Phong 2018-09-18 18:34:15 +07:00
parent 900a3f359a
commit 6576c01801
7 changed files with 34 additions and 34 deletions

View File

@ -1,17 +1,15 @@
group: travis_latest dist: trusty
sudo: required
language: python language: python
cache: pip cache: pip
python: python:
- 3.6 - "3.5"
install: - "3.6"
- pip install flake8 # pytest # add another testing frameworks later - "3.7"
before_script: before_install:
# stop the build if there are Python syntax errors or undefined names - sudo apt-get update
- flake8 . --count --select=E501,E9,F821,F822,F823,W191 --show-source --statistics - sudo apt-get install -y libmpv1
# exit-zero treats all errors as warnings. - pip install pyflakes
- flake8 . --count --exit-zero --max-complexity=10 --statistics - pyflakes .
script: install: pip install .
- true # pytest --capture=sys # add other tests here script: comp -v
notifications:
on_success: change
on_failure: change # `always` will be the setting once code changes slow down

View File

@ -262,7 +262,7 @@ Configuration files
------------------- -------------------
If not specified by the ``--config``, (user-specific) configuration file is If not specified by the ``--config``, (user-specific) configuration file is
``~/.config/mpv/settings.ini``. Default configurations ``~/.config/comp/settings.ini``. Default configurations
are listed below:: are listed below::
[comp] [comp]
@ -285,7 +285,7 @@ are listed below::
[youtube-dl] [youtube-dl]
# Video format/quality to be passed to youtube-dl. See FORMAT SELECTION in # Video format/quality to be passed to youtube-dl. See FORMAT SELECTION in
# youtube-dl(1) man page for more details and descriptions. # youtube-dl(1) man page for more details and descriptions.
format = best format = bestvideo+bestaudio
Bugs Bugs

10
comp
View File

@ -16,10 +16,9 @@
# #
# Copyright (C) 2017 Nguyễn Gia Phong <vn.mcsinyx@gmail.com> # Copyright (C) 2017 Nguyễn Gia Phong <vn.mcsinyx@gmail.com>
__version__ = '0.4.5' __version__ = '0.4.6'
import curses import curses
import json
import re import re
from argparse import ArgumentParser from argparse import ArgumentParser
from collections import deque from collections import deque
@ -27,14 +26,12 @@ from configparser import ConfigParser
from curses.ascii import ctrl, alt from curses.ascii import ctrl, alt
from functools import reduce from functools import reduce
from gettext import bindtextdomain, gettext as _, textdomain from gettext import bindtextdomain, gettext as _, textdomain
from os import makedirs from os.path import expanduser
from os.path import abspath, dirname, expanduser, expandvars
from threading import Thread from threading import Thread
from traceback import print_exception from traceback import print_exception
from mpv import MPV from mpv import MPV
from pkg_resources import resource_filename from pkg_resources import resource_filename
from youtube_dl import YoutubeDL
from omp import extract_info, Omp from omp import extract_info, Omp
@ -332,7 +329,8 @@ config.read(args.config)
mode = config.get('comp', 'play-mode', fallback='play-current') mode = config.get('comp', 'play-mode', fallback='play-current')
mpv_args = dict(config['mpv']) if 'mpv' in config else {} mpv_args = dict(config['mpv']) if 'mpv' in config else {}
if args.vo is not None: mpv_args['vo'] = args.vo if args.vo is not None: mpv_args['vo'] = args.vo
ytdlf = args.format or config.get('youtube-dl', 'format', fallback='best') ytdlf = args.format or config.get('youtube-dl', 'format',
fallback='bestvideo+bestaudio')
with Comp(entries, json_file, mode, mpv_args, ytdlf) as comp: with Comp(entries, json_file, mode, mpv_args, ytdlf) as comp:
while True: while True:

View File

@ -24,17 +24,14 @@ from collections import deque
from gettext import bindtextdomain, gettext as _, textdomain from gettext import bindtextdomain, gettext as _, textdomain
from itertools import cycle from itertools import cycle
from os import makedirs from os import makedirs
from os.path import abspath, dirname, expanduser, expandvars, isfile from os.path import abspath, dirname, expanduser, expandvars
from random import choice from random import choice
from sys import exc_info from sys import exc_info
from time import gmtime, sleep, strftime
from urllib import request
from youtube_dl import YoutubeDL
from pkg_resources import resource_filename from pkg_resources import resource_filename
from mpv import MPV, MpvFormat from mpv import MPV
from .ie import JSON_KEYS, extract_info from .ie import JSON_KEYS
# Init gettext # Init gettext
bindtextdomain('omp', resource_filename('omp', 'locale')) bindtextdomain('omp', resource_filename('omp', 'locale'))

View File

@ -18,4 +18,4 @@ play-mode = play-current
[youtube-dl] [youtube-dl]
# Video format/quality to be passed to youtube-dl. See FORMAT SELECTION in # Video format/quality to be passed to youtube-dl. See FORMAT SELECTION in
# youtube-dl(1) man page for more details and descriptions. # youtube-dl(1) man page for more details and descriptions.
format = best format = bestvideo+bestaudio

View File

@ -7,7 +7,7 @@ with open('README.rst') as f:
setup( setup(
name='comp', name='comp',
version='0.4.5', version='0.4.6',
description=('Curses Omni Media Player'), description=('Curses Omni Media Player'),
long_description=long_description, long_description=long_description,
url='https://github.com/McSinyx/comp', url='https://github.com/McSinyx/comp',

View File

@ -83,6 +83,13 @@
"selected": false, "selected": false,
"title": "David Banner - Play (Dirty version)" "title": "David Banner - Play (Dirty version)"
}, },
{
"duration": "00:04:14",
"error": false,
"filename": "https://www.youtube.com/watch?v=NmCFY1oYDeM",
"selected": false,
"title": "John Legend - Love Me Now (Video)"
},
{ {
"duration": "00:03:55", "duration": "00:03:55",
"error": false, "error": false,
@ -105,7 +112,7 @@
"title": "Best Goat Song Versions Compilation Ever! (HD)" "title": "Best Goat Song Versions Compilation Ever! (HD)"
}, },
{ {
"duration": "00:00:00", "duration": "00:04:03",
"error": false, "error": false,
"filename": "https://youtu.be/dMK_npDG12Q", "filename": "https://youtu.be/dMK_npDG12Q",
"selected": false, "selected": false,
@ -147,7 +154,7 @@
"title": "Can't Stop the SUSE - (Can't Stop the Feeling parody)" "title": "Can't Stop the SUSE - (Can't Stop the Feeling parody)"
}, },
{ {
"duration": "00:00:00", "duration": "00:04:28",
"error": false, "error": false,
"filename": "https://youtu.be/SYRlTISvjww", "filename": "https://youtu.be/SYRlTISvjww",
"selected": false, "selected": false,
@ -161,7 +168,7 @@
"title": "What Does the Chameleon Say? (Ylvis - What Does the Fox Say parody)" "title": "What Does the Chameleon Say? (Ylvis - What Does the Fox Say parody)"
}, },
{ {
"duration": "00:00:00", "duration": "00:03:46",
"error": false, "error": false,
"filename": "https://youtu.be/M9bq_alk-sw", "filename": "https://youtu.be/M9bq_alk-sw",
"selected": false, "selected": false,
@ -175,7 +182,7 @@
"title": "Linus Said - Music Parody (Momma Said)" "title": "Linus Said - Music Parody (Momma Said)"
}, },
{ {
"duration": "00:00:00", "duration": "00:03:58",
"error": false, "error": false,
"filename": "https://youtu.be/4VrhlyIgo3M", "filename": "https://youtu.be/4VrhlyIgo3M",
"selected": false, "selected": false,