mirror of
https://github.com/scito/extract_otp_secrets.git
synced 2025-12-12 17:59:48 +01:00
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:
9
utils.py
9
utils.py
@@ -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):
|
||||
|
||||
Reference in New Issue
Block a user