-
Notifications
You must be signed in to change notification settings - Fork 0
/
main.py
49 lines (41 loc) · 1.49 KB
/
main.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
#!/usr/local/bin/python3
# -*- coding: utf-8 -*-
"""AddOnManager
simple script to manage ElvUI from tukui.org
Author: Francesco Argentieri
Website: https://github.com/frank1789
Last edited: August 2018
"""
import sys
from PyQt5.QtWidgets import QApplication
from AddOnManager import MakeTitle, Example
from AddOnManager import Addonupdate as Addondownloader
from AddOnManager import Filemanager
from AddOnManager import PrintColour
if __name__ == '__main__':
program_name = sys.argv[0]
arguments = sys.argv[1:]
count = len(arguments)
print(arguments)
if len(arguments) != 0:
if arguments[0] == "-a" or arguments[0] == "-auto":
# set local path
addonfile = Filemanager()
# check local version
addonversion = Addondownloader()
addonversion.checklocalversion(addonfile.getlocalfolder())
# check remote version
addonversion.checkremoteversion()
if addonversion.getremoteversion() > addonversion.getlocalversion():
print("Starting update...")
addonfile.upgrade(addonversion.update())
else:
print(PrintColour("No new version").setfontstyle('blink'))
elif arguments[0] == "-g" or arguments[0] == "--gui":
app = QApplication(sys.argv)
ex = Example()
sys.exit(app.exec_())
else:
MakeTitle()
# 4
# addonfile.cleanup('/Users/francesco/PycharmProjects/AddOnClient/elvui-10.78.zip')