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
|
#! /usr/bin/env python
print "\n-------- Installing Guido van Robot ---------"
from os.path import exists
import sys,os
from os import makedirs, mkdir, system
import compileall
if os.environ['USER'] != 'root':
print "Only root can install this"
sys.exit(1)
if not exists('/usr/local/GvR'):
makedirs('/usr/local/GvR')
if not exists('/usr/local/share/icons'):
makedirs('/usr/local/share/icons')
if not exists('/usr/local/share/locale'):
makedirs('/usr/local/share/locale')
if not exists('/usr/local/man/man1'):
makedirs('/usr/local/man/man1')
system('cp -rf *.py /usr/local/GvR/')
system('chmod 0755 /usr/local/GvR/gvr.py')
system('cp -f gvrrc /usr/local/GvR/')
system('cp gvr.sh /usr/local/bin/gvr')
system('cp -rf po /usr/local/GvR/')
system('cp -rf bitmaps /usr/local/GvR/')
try:
system('cp -f bitmaps/gvrIcon-big.png /usr/local/share/icons/gvrIcon-big.png')
except Exception,info:
print info
system('cp -rf docs /usr/local/GvR/')
system('cp -f docs/gvr.1.gz /usr/local/man/man1/gvr.1.gz')
system('cp -rf examples /usr/local/GvR/')
system('cp -rf locale/* /usr/local/share/locale')
system('chmod a+rx /usr/local/bin/gvr')
# python2.3.4 does not support the quiet option for
# compileall
try:
print "Trying to compiling modules to bytecode."
compileall.compile_dir('/usr/local/GvR',quiet=1)
except:
compileall.compile_dir('/usr/local/GvR')
print "Installation complete."
print "To start Guido van Robot -> gvr [Enter]"
print "Be sure to check the website http://gvr.sf.net, for additional information\nand lessons."
print "\nEnjoy\n"
|