-
Notifications
You must be signed in to change notification settings - Fork 3
/
Copy pathStart_New_inasra.py
executable file
·48 lines (42 loc) · 1.49 KB
/
Start_New_inasra.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
#!/usr/bin/env python3
from whiptail import Whiptail
import json
from os import system
from lorem import text as lorem
def directory_initializer():
for essentialdir in ['users','acronym/summary','acronym/content','acronym/links','acronym/images','.NextMoves' ]:
system('mkdir -p ' + essentialdir)
def Color_Scheme():
system("export NEWT_COLORS='\
window=green,gray\
border=black,green\
textbox=green,black\
button=black,green\
title=green,black\
root=lightgray,gray\
entry=,black\
roottext=green,gray\
shadow=gray\
actbutton=green,black\
entry=green,black\
'")
print('color not schemed!')
def WikiQueryPrep(word_or_phrase):
''' Hola pass me any string and I'll format it as a wikipedia article title.
so "legislative chamber" becomes "Legislative_chamber"'''
if ' ' in word_or_phrase:
words = word_or_phrase.split(' ')
wiki_article = words[0].capitalize() + "_" + '_'.join(words[1:])
return wiki_article
else: return word_or_phrase.capitalize()
def main():
directory_initializer()
#Color_Scheme()
new_adventure = Whiptail()
new_adventure.title = "inasra welcomes you"
new_adventure.backtitle = lorem()
spinehead, exitstatus = new_adventure.inputbox('what shall you offer to inasra?')
if exitstatus == 0:
#this is where all the good sanitizing and CAP permutation should go
system('./init_scrrrrp.sh ' + WikiQueryPrep(spinehead))
if __name__ == "__main__": main()