Made installer, which creates an uninstaller in the /opt/scion directory
This commit is contained in:
parent
69fc5db07d
commit
67914890f7
|
@ -31,28 +31,18 @@ from bt.file import fopen
|
|||
|
||||
# Return the value at key
|
||||
def get(key, all=False):
|
||||
global settings
|
||||
if(all == False):
|
||||
return settings[key.upper()][0]
|
||||
else:
|
||||
return settings[key.upper()]
|
||||
return settings[key.upper()]
|
||||
|
||||
|
||||
#def replace(key,value):
|
||||
# global settings
|
||||
# if (key in settings) == True:
|
||||
# del settings[key]
|
||||
# set(key,value)
|
||||
|
||||
|
||||
def pop(key):
|
||||
def replace(key,value):
|
||||
global settings
|
||||
value = None
|
||||
if (key in settings) == True:
|
||||
values = settings[key]
|
||||
if len(values) > 0:
|
||||
value = values.pop(0)
|
||||
return value
|
||||
|
||||
del settings[key]
|
||||
set(key,value)
|
||||
|
||||
|
||||
# Read settings from file
|
||||
|
|
|
@ -10,7 +10,6 @@ app = "scion"
|
|||
type = "core"
|
||||
path = ""
|
||||
opt = []
|
||||
|
||||
import curses
|
||||
from bt.message import *
|
||||
#from bt.needle import Needle
|
||||
|
|
|
@ -25,7 +25,7 @@ def loop():
|
|||
write("Beginning command line loop",True)
|
||||
global halt
|
||||
|
||||
#stdscr = settings.get("stdscr")
|
||||
stdscr = settings.get("stdscr")
|
||||
input = settings.get("prompt")
|
||||
(y, x) = settings.get("stdscr").getyx()
|
||||
disp(input)
|
||||
|
|
|
@ -12,9 +12,9 @@ import settings
|
|||
# Add string to line y
|
||||
def insert(string):
|
||||
stdscr = settings.get("stdscr")
|
||||
y = settings.pop("cliney")
|
||||
y = settings.get("cliney")
|
||||
y+=1
|
||||
settings.set("cliney", y)
|
||||
settings.replace("cliney", y)
|
||||
stdscr.addstr(y, 0, string)
|
||||
|
||||
|
||||
|
|
|
@ -21,5 +21,7 @@ def run(input):
|
|||
manager.run(input)
|
||||
|
||||
y = settings.get("cliney")
|
||||
settings.replace("cliney", y+1)
|
||||
y+=1
|
||||
settings.replace("cliney", y)
|
||||
|
||||
return prompt
|
||||
|
|
|
@ -0,0 +1,19 @@
|
|||
#!/bin/bash
|
||||
|
||||
mkdir /opt/scion
|
||||
rsync -avz --progress base /opt/scion/
|
||||
rsync -avz --progress core /opt/scion/
|
||||
|
||||
FILE="/usr/bin/scion"
|
||||
touch $FILE
|
||||
echo "#!/bin/bash" > $FILE
|
||||
echo "cd /opt/scion/base && \`which python\` scion.py \$\*" >> $FILE
|
||||
|
||||
chmod +x $FILE
|
||||
|
||||
|
||||
UNINSTALL="/opt/scion/uninstall.sh"
|
||||
touch $UNINSTALL
|
||||
echo "#!/bin/bash" > $UNINSTALL
|
||||
echo "cd /opt/ && rm -r scion" >> $UNINSTALL
|
||||
echo "rm /usr/bin/scion" >> $UNINSTALL
|
Loading…
Reference in New Issue