Skip to content

Commit d7c7c57

Browse files
committed
added output directory option
1 parent ec855dc commit d7c7c57

File tree

2 files changed

+2
-17
lines changed

2 files changed

+2
-17
lines changed

swish-qr-generator.py

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -28,6 +28,7 @@
2828
parser = argparse.ArgumentParser("Generate Swish QR code for client and amount")
2929
parser.add_argument('--client', required=True)
3030
parser.add_argument('--amount', required=True)
31+
parser.add_argument('--dir', required=False, default="/tmp/")
3132
args = parser.parse_args()
3233

3334
client = args.client
@@ -40,7 +41,7 @@
4041
r = requests.post(base_url + endpoint, json=body, headers=headers)
4142

4243
if r.status_code == 200:
43-
with open(client+'.png', 'wb') as out_file:
44+
with open(args.dir + client+'.png', 'wb') as out_file:
4445
out_file.write(r.content)
4546
else:
4647
print (r)

swish.json

Lines changed: 0 additions & 16 deletions
This file was deleted.

0 commit comments

Comments
 (0)