-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathjsonparser.py
More file actions
73 lines (40 loc) · 1.21 KB
/
Copy pathjsonparser.py
File metadata and controls
73 lines (40 loc) · 1.21 KB
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
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
#!/usr/bin/env python3
import json
import hashlib
import core
from urllib.request import urlretrieve
import configuration
__author__ = 'jacob'
def updatecheckerninjaconfigs():
json_data = open('data/NinjaConfigs.json')
data = json.load(json_data)
# pprint(data)
newversion = data['tag_name']
config = configuration.configreader()
oldversion = config['version']['ninjaconfigs']
print(newversion)
print(oldversion)
if newversion <= oldversion:
print('No new updates')
else:
print('New Updates are Available!')
config['version']['ninjaconfigs'] = newversion
print(config['version']['ninjaconfigs'])
configuration.configwriter(config)
def jsonupdater(program):
config = core.configreader()
link = config['config'][program]
file = program + '.json'
urlretrieve(link, file)
def updater(file):
json_data = open(file + '.json')
data = json.load(json_data)
pprint(data)
htmlurl = data['html_url']
targzdl = htmlurl + '.tar.gz'
zipdl = htmlurl + '.zip'
print(zipdl)
# pprint(tarball)
# urlretrieve(tarball, 'configs.tar.gz')
# urlretrieve(browserdownload, 'confgs.zip')
json_data.close()