save qr code to specific dir, improve help, add tests

- use metavar for files and dirs in help
- support several recursive dirs in saveqr
- add saveqr and debug tests
This commit is contained in:
scito 2022-09-09 13:13:13 +02:00
parent fbefb3474c
commit dbfd3464f2
5 changed files with 123 additions and 21 deletions

View file

@ -16,6 +16,7 @@
import csv
import json
import os
import shutil
from io import StringIO
import sys
@ -38,8 +39,12 @@ with Capturing() as output:
sys.stdout = self._stdout
def remove_file(filename):
if os.path.exists(filename): os.remove(filename)
def remove_file(file):
if os.path.isfile(file): os.remove(file)
def remove_dir_with_files(dir):
if os.path.exists(dir): shutil.rmtree(dir)
def read_csv(filename):