File: filter-plugin.py

package info (click to toggle)
vlc 3.0.12-0+deb10u1
  • links: PTS, VCS
  • area: main
  • in suites: buster
  • size: 203,740 kB
  • sloc: ansic: 436,293; cpp: 104,587; objc: 35,648; sh: 6,704; makefile: 6,499; javascript: 4,900; xml: 1,610; asm: 1,355; yacc: 640; python: 323; lex: 88; perl: 77; sed: 16
file content (31 lines) | stat: -rw-r--r-- 665 bytes parent folder | download | duplicates (3)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
#!/usr/bin/python3

# Inverse dh-exec-filter-profiles
# Author: Sebastian Ramacher <sramacher@debian.org>

import os
import re
import sys


remove_plugins = os.getenv("removeplugins")
if remove_plugins is not None:
    remove_plugins = set(remove_plugins.split(" "))
else:
    remove_plugins = set()

plugin_re = re.compile(r"^(\S*) \[([a-zA-Z1-9.,_-]*)\]$")


for line in sys.stdin.readlines():
    line = line.rstrip("\n")
    match = plugin_re.match(line)
    if not match:
        print(line)
        continue

    path = match.group(1)
    plugins = match.group(2)
    plugins = set(plugins.split(','))
    if not plugins & remove_plugins:
        print(path)