/
kalki.py
62 lines (53 loc) · 1.3 KB
/
kalki.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
57
58
59
60
61
62
import sys
try:
import settings
except:
pass
try:
from kalki import kalkiminify
except:
pass
try:
from kalki import service
except:
pass
try:
from kalki import create_app
except:
pass
try:
appname = sys.argv[2]
except:
print('provide a appname')
def check_appname():
for app in settings.APP_NAME:
if app == appname:
return True
def startapp():
create_app.startapp(appname)
def compile():
if check_appname():
service.service(appname)
else:
print('Appname do not exists.')
print("If the app exists, add the app to APP_NAME in settings.py")
def minify():
if check_appname():
kalkiminify.kalkiminify(appname)
else:
print('Appname do not exists.')
print("If the app exists, add the app to APP_NAME in settings.py")
if __name__ == '__main__':
try:
globals()[sys.argv[1]]()
except IndexError:
print("""
available commands-
startapp
compile
minify
Use these commands like-
'python kalki.py startapp' to create working directory
'python kalki.py compile' to create compiled css file
'python kalki.py minify' to create minified css file
""")