-
Notifications
You must be signed in to change notification settings - Fork 1
/
Copy pathupload.py
34 lines (25 loc) · 923 Bytes
/
upload.py
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
#! /usr/bin/env python
import os
import subprocess
import time
def uploadFiles(uploadFolder):
if (uploadFolder == "images"):
os.mkdir("imageOutputs")
elif(uploadFolder == "metadata"):
os.mkdir("metadataOutputs")
for filename in os.listdir(uploadFolder):
if filename.endswith(".png"):
print(filename)
runCommand = 'arweave deploy ' + uploadFolder + '/' + filename + ' --key-file quarantine-journal-keyfile.json <<< CONFIRM >> imageOutputs/output' + filename + '.txt'
output = subprocess.run(runCommand, shell=True)
print(output)
elif filename.endswith(".json"):
print(filename)
runCommand = 'arweave deploy ' + uploadFolder + '/' + filename + ' --key-file quarantine-journal-keyfile.json <<< CONFIRM >> metadataOutputs/output' + filename + '.txt'
output = subprocess.run(runCommand, shell=True)
print(output)
else:
continue
print()
print("UPLOAD COMPLETE")
print()