forked from andresriancho/hash-blender
-
Notifications
You must be signed in to change notification settings - Fork 0
/
hash-blender.py
executable file
·41 lines (32 loc) · 900 Bytes
/
hash-blender.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
#!/usr/bin/env python
import json
import sys
from hash_blender.main import main
if __name__ == '__main__':
try:
config_filename = sys.argv[1]
except IndexError:
print('Usage: ./hash-blender.py config.json')
sys.exit(1)
try:
config = json.loads(file(config_filename).read())
except Exception, e:
print(e)
sys.exit(1)
try:
user_inputs = config['values']
except:
print('config.json needs to have "values" keys')
sys.exit(2)
try:
configured_hash_string = config['hash']['string'].strip()
except:
print('config.json needs to have "values" and "string" keys')
sys.exit(2)
try:
verbose = config['verbose']
except:
verbose = False
main(user_inputs=user_inputs,
configured_hash_string=configured_hash_string,
verbose=verbose)