From f0d9dc871a4a375c1646f2b0d7684df3870b8d51 Mon Sep 17 00:00:00 2001 From: Sylvain Pineau Date: Tue, 14 Jul 2020 12:13:47 +0200 Subject: bin:optical_detect: Deleted --- bin/optical_detect | 29 ----------------------------- 1 file changed, 29 deletions(-) delete mode 100755 bin/optical_detect diff --git a/bin/optical_detect b/bin/optical_detect deleted file mode 100755 index f1fe94b..0000000 --- a/bin/optical_detect +++ /dev/null @@ -1,29 +0,0 @@ -#!/usr/bin/env python3 - -import os -import re -import sys - - -def main(args): - line_pattern = r"\s*(\d+)\s+dev='([^']+)'" \ - "\s+([wr-]{6})\s:\s'([^']+)'\s'([^']+)'" - line_regex = re.compile(line_pattern) - - count = 0 - command = "wodim --devices" - for line in os.popen(command).readlines(): - match = re.match(line_regex, line) - if match: - count += 1 - print(match.group(4), match.group(5)) - - if not count: - print("No optical devices detected.", file=sys.stderr) - return 1 - - return 0 - - -if __name__ == "__main__": - sys.exit(main(sys.argv[1:])) -- cgit v1.2.3