Made installer, which creates an uninstaller in the /opt/scion directory

This commit is contained in:
bjschuma 2009-12-21 19:28:16 -05:00
parent 69fc5db07d
commit 67914890f7
7 changed files with 31 additions and 21 deletions

View File

@ -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

View File

@ -10,7 +10,6 @@ app = "scion"
type = "core"
path = ""
opt = []
import curses
from bt.message import *
#from bt.needle import Needle

View File

@ -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)

View File

@ -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)

View File

@ -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

19
src/install.sh Normal file
View File

@ -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

View File

@ -1,4 +1,4 @@
#!/bin/bash
# This is a simple shell script for properly starting ocarina
cd base && `which python` scion.py $*
cd /opt/scion/base && `which python` scion.py $*