From 60db0003aadf28aa7d4ba458d643d4b12339b182 Mon Sep 17 00:00:00 2001 From: Taeyeon Mori Date: Sat, 24 Nov 2018 14:15:54 +0100 Subject: [PATCH] Fix some typos --- bin/aur.sh | 2 +- dotfiles/makepkg.conf | 1 + lib/python/xconv/app.py | 2 +- lib/python/xconv/cmdline.py | 2 +- lib/python/xconv/profiles/getfonts.py | 42 +++++++++++++++++++++++++++ 5 files changed, 46 insertions(+), 3 deletions(-) create mode 100644 lib/python/xconv/profiles/getfonts.py diff --git a/bin/aur.sh b/bin/aur.sh index 2dc6685..c64b7a6 100755 --- a/bin/aur.sh +++ b/bin/aur.sh @@ -518,7 +518,7 @@ if $ADD_UPDATES; then updates=(${updates:|ignore}) fi - packages+=("${packages[@]}") + packages+=("${updates[@]}") fi packages_from_filter() { diff --git a/dotfiles/makepkg.conf b/dotfiles/makepkg.conf index e2c40cc..febbb9d 100644 --- a/dotfiles/makepkg.conf +++ b/dotfiles/makepkg.conf @@ -17,6 +17,7 @@ CXXFLAGS="`fix_march $CXXFLAGS`" LDFLAGS="$LDFLAGS" MAKEFLAGS="-j${MAKEPKG_MAKETHREADS:-`nproc`}" +COMPRESSXZ=(xz -T 0 -c -z -) # Store stuff source "$DOTFILES/etc/aur.conf" diff --git a/lib/python/xconv/app.py b/lib/python/xconv/app.py index 1b1ba92..1f6bec9 100644 --- a/lib/python/xconv/app.py +++ b/lib/python/xconv/app.py @@ -220,7 +220,7 @@ def main(argv): for output in [o for o in task.outputs if exists(o.filename)]: print("\033[33m Skipping existing '%s' (--update)\033[0m\033[K" % output.name) task.outputs.remove(output) - if not tasks.outputs: + if not task.outputs: print("\033[33m Skipping task '%s' because no output files are left\033[0m\033[K" % task_name(task)) tasks.remove(task) diff --git a/lib/python/xconv/cmdline.py b/lib/python/xconv/cmdline.py index 674b7d9..d4b99c2 100644 --- a/lib/python/xconv/cmdline.py +++ b/lib/python/xconv/cmdline.py @@ -123,7 +123,7 @@ def parse_args(argv): # Available Options parser.add_argument("-v", "--verbose", help="Enable verbose output", action="store_true") parser.add_argument("-q", "--quiet", help="Be less verbose", action="store_true") - parser.add_argument("-j", "--concurrent", help="Run ffmpeg concurrently using at most N instances [%(default)s]", metavar="N", default=cpu_count()) + parser.add_argument("-j", "--concurrent", help="Run ffmpeg concurrently using at most N instances [%(default)s]", metavar="N", type=int, default=cpu_count()) profile = parser.add_argument_group("Profile") profile.add_argument("-l", "--list-profiles", help="List profiles and quit", action=ProfilesAction) profile.add_argument("-i", "--profile-info", help="Give info about a profile and quit", metavar="PROFILE", action=ProfileInfoAction) diff --git a/lib/python/xconv/profiles/getfonts.py b/lib/python/xconv/profiles/getfonts.py new file mode 100644 index 0000000..af7148c --- /dev/null +++ b/lib/python/xconv/profiles/getfonts.py @@ -0,0 +1,42 @@ +#!/usr/bin/env python3 +""" +xconv ffmpeg wrapper based on AdvancedAV +----------------------------------------------------------- + AdvancedAV helps with constructing FFmpeg commandline arguments. + + It can automatically parse input files with the help of FFmpeg's ffprobe tool (WiP) + and allows programatically mapping streams to output files and setting metadata on them. +----------------------------------------------------------- + Copyright (c) 2015-2017 Taeyeon Mori + + This program is free software: you can redistribute it and/or modify + it under the terms of the GNU General Public License as published by + the Free Software Foundation, either version 3 of the License, or + (at your option) any later version. + + This program is distributed in the hope that it will be useful, + but WITHOUT ANY WARRANTY; without even the implied warranty of + MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + GNU General Public License for more details. + + You should have received a copy of the GNU General Public License + along with this program. If not, see . +----------------------------------------------------------- +Extract subtitle streams +""" + +from ..profile import * + +@profile +@description("Extract (true type) fonts") +@features(no_single_output=True, + skip_existing_outputs=True) +def getfonts(task): + for stream in task.iter_attachment_streams(): + if stream.codec in ("ttf", "otf"): + if stream.og_filename: + filename = stream.og_filename + else: + filename = "%s.%s.%s" % (stream.source.name, stream.pertype_index, stream.codec) + task.dump_attachment(stream, filename) + return True