diff options
-rwxr-xr-x | bin/optical_detect | 29 |
1 files changed, 0 insertions, 29 deletions
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:])) |