-
Notifications
You must be signed in to change notification settings - Fork 3
/
Copy pathnftpGenerator.py
56 lines (48 loc) · 1.83 KB
/
nftpGenerator.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
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
from app.image_loader import ImageLoader
# libs
import json
import os
import sys
def main(generate=1):
print("""
______ _ _ _
|___ / | | | | (_)
/ / __ _| |__ | |__ ___ __
/ / / _` | '_ \| '_ \| \ \/ /
/ /_| (_| | |_) | |_) | |> <
/_____\__,_|_.__/|_.__/|_/_/\_\\
_ _ ______ _______
| \ | | ____|__ __|
| \| | |__ | |
| . ` | __| | |
| |\ | | | |
|_| \_|_| |_|
_
| |
__ _ ___ _ __ ___ _ __ __ _| |_ ___ _ __
/ _` |/ _ \ '_ \ / _ \ '__/ _` | __/ _ \| '__|
| (_| | __/ | | | __/ | | (_| | || (_) | |
\__, |\___|_| |_|\___|_| \__,_|\__\___/|_|
__/ |
|___/
""")
file_config = open(os.path.dirname(
os.path.abspath(__file__))+'/config_app.json', 'r')
file_config = json.load(file_config)
for i in range(generate):
img_n = ImageLoader(n=i,
base_image=file_config['Base template'],
components_types=file_config['Types components'],
complements=file_config['Components'], backgrounds=file_config['Backgrounds'])
img_n.put_components_in_position()
img_n.save()
if __name__ == '__main__':
if len(sys.argv) == 1:
print('You need to pass the amount of NFT you want to generate')
exit()
try:
int(sys.argv[1])
except:
print('The value of first parameter need to be a number')
exit()
main(int(sys.argv[1]))