mirror of
https://github.com/scito/extract_otp_secret_keys.git
synced 2025-12-06 14:54:57 +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:
parent
fbefb3474c
commit
dbfd3464f2
5 changed files with 123 additions and 21 deletions
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):
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue