Fix display countdown. Add option of select installing operation system.

netsetup
Mike Hiretsky 14 years ago
parent dd6635caef
commit 4a87c151d5

@ -204,7 +204,7 @@ class Distributive(object):
def _removeDirectory(self,directory):
"""Remove directory and files contained in it"""
print "removeDirectory:",directory
#print "removeDirectory:",directory
try:
removeDir(directory)
except (Exception,KeyboardInterrupt),e:
@ -337,7 +337,7 @@ class PartitionDistributive(Distributive):
return DirectoryDistributive(mdirectory,parent=self)
def formatPartition(self,format="reiserfs"):
res,errmes = self.runOsCommand("mkfs.reiserfs -f %s" % self.partition)
res,errmes = self.runOsCommand("/sbin/mkfs.reiserfs -f %s" % self.partition)
if res == 0:
return True
else:

@ -149,9 +149,13 @@ class cl_install(color_print):
self.printSUCCESS("Found update: %s"%self.clVars.Get('os_linux_name'))
def wait(self,sec=10):
self.printSUCCESS(_("Press %s to cancel")%"Ctrl+C"+"... %d"%sec, printBR=False)
for i in xrange(sec,0,-1):
self.printSUCCESS(_("Press %s to cancel")%"Ctrl+C"+"... %d"%i)
sys.stdout.write( "\a\b\b %d" % i)
sys.stdout.flush()
sleep(1)
sys.stdout.write("\b\b \n")
sys.stdout.flush()
def prepareBoot(self):
pass
@ -185,7 +189,7 @@ class cl_install(color_print):
distRep = DistributiveRepository('/usr/calculate/share/linux')
sourceDistr = distRep.getLastDistributive(
march=self.clVars.Get('os_arch_machine'),
shortname=self.clVars.Get('os_linux_shortname').lower())
shortname=self.values.s.lower())
if sourceDistr:
# print info
self.printInfo(sourceDistr,targetDistr)
@ -210,14 +214,15 @@ class cl_install(color_print):
except (InstallError,DistributiveError),e:
error = e
except KeyboardInterrupt,e:
self.printWARNING("Interruping the installation")
self.defaultPrint("\n")
self.printWARNING("Interrupting the installation")
error = _("Installation manually interrupt")
try:
if sourceDistr:
self.printSUCCESS("Releasing source distributive")
self.printSUCCESS(_("Releasing source distributive"))
sourceDistr.close()
if targetDistr:
self.printSUCCESS("Unmount installed system volume")
self.printSUCCESS(_("Unmount installed system volume"))
targetDistr.close()
except KeyboardInterrupt,e:
pass
@ -225,6 +230,7 @@ class cl_install(color_print):
for line in str(error).split('\n'):
self.printERROR(line)
return False
self.printSUCCESS(_("System successfully installed"))
return False
def setAllLocaleByLang(self,lang):

@ -36,6 +36,13 @@ CMD_OPTIONS = [{'shortOption':"T",
'optVal':"DISK",
'help':_("the disk for installation")
},
{'shortOption':"s",
'longOption':"os",
'optVal':"SYSTEM",
'type':'choice',
'choices':['cld','cds','cls','css','cldg','cldx'],
'help':_("select operation system")
},
{'shortOption':"b",
'longOption':"build",
'help':_("installation for assembling")
@ -61,6 +68,8 @@ class install_cmd(cl_install,opt,share_cmd):
values.vars is None and \
values.d is None:
self.error(_("need specify disk by '-d' option"))
if values.b:
self.error(_("builder mode yet hasn`t supported"))
if not values.T in [None,"all"]:
self.error(
_("defenition of a particular template yet is not supported"))

@ -32,4 +32,3 @@ class Data:
cl_ver = {'value':'2.2.0'}
os_arch_machine = {'mode':'w'}
os_linux_shortname = {'mode':'w'}

Loading…
Cancel
Save