[Uludag-commits] r15088 - in trunk/yali/yali: . gui
uludag-commits at pardus.org.tr
uludag-commits at pardus.org.tr
23 Ağu 2007 Per 12:10:21 EEST
Author: gokmen.goksel
Date: Thu Aug 23 12:10:21 2007
New Revision: 15088
Modified:
trunk/yali/yali/constants.py
trunk/yali/yali/gui/ScrAdmin.py
trunk/yali/yali/gui/ScrGoodbye.py
trunk/yali/yali/gui/ScrInstall.py
trunk/yali/yali/gui/ScrUsers.py
trunk/yali/yali/gui/debugger.py
trunk/yali/yali/postinstall.py
Log:
User-Add, Root-Password and Set-Hostname are ok, also Debug log problems fixed. After installation debug logs will store at /var/log/yaliInstall.log if debugMode enabled.
Modified: trunk/yali/yali/constants.py
=================================================================
--- trunk/yali/yali/constants.py (original)
+++ trunk/yali/yali/constants.py Thu Aug 23 12:10:21 2007
@@ -50,8 +50,6 @@
consts.pardus_version = file("/etc/pardus-release").readlines()[0].strip()
-consts.log_file = "/tmp/install.log"
-
consts.data_dir = "/usr/share/yali"
consts.mnt_dir = "/mnt"
@@ -59,6 +57,9 @@
# new system will be installed directly into this target directory
consts.target_dir = join(consts.mnt_dir, "target")
+# log file for storing after installation
+consts.log_file = join(consts.target_dir,"var/log/yaliInstall.log")
+
# packages (and maybe others) will be in this source (cdrom) directory
consts.source_dir = join(consts.mnt_dir, "cdrom")
Modified: trunk/yali/yali/gui/ScrAdmin.py
=================================================================
--- trunk/yali/yali/gui/ScrAdmin.py (original)
+++ trunk/yali/yali/gui/ScrAdmin.py Thu Aug 23 12:10:21 2007
@@ -77,17 +77,12 @@
def shown(self):
from os.path import basename
ctx.debugger.log("%s loaded" % basename(__file__))
- #ctx.screens.disablePrev()
self.checkCapsLock()
self.pass1.setFocus()
def execute(self):
ctx.installData.rootPassword = self.pass1.text().ascii()
ctx.installData.hostName = self.hostname.text().ascii()
- #user = yali.users.User("root")
- #user.changePasswd()
- #yali.sysutils.add_hostname(self.hostname.text().ascii())
-
return True
def checkCapsLock(self):
Modified: trunk/yali/yali/gui/ScrGoodbye.py
=================================================================
--- trunk/yali/yali/gui/ScrGoodbye.py (original)
+++ trunk/yali/yali/gui/ScrGoodbye.py Thu Aug 23 12:10:21 2007
@@ -83,7 +83,6 @@
self.info.show()
self.info.setAlignment(QLabel.AlignCenter)
- #open(ctx.consts.log_file,"w").write(ctx.debugger.traceback.plainLogs)
try:
ctx.debugger.log("Trying to umount %s" % (ctx.consts.target_dir + "/home"))
@@ -93,7 +92,7 @@
except:
ctx.debugger.log("Umount Failed.")
pass
-
+
ctx.debugger.log("Trying to eject the CD.")
# remove cd...
w = RebootWidget(self)
@@ -102,22 +101,34 @@
self.dialog.exec_loop()
ctx.debugger.log("Yali, fastreboot calling..")
+
+ # store log content
+ if ctx.debugEnabled:
+ open(ctx.consts.log_file,"w").write(str(ctx.debugger.traceback.plainLogs))
+
yali.sysutils.fastreboot()
# process pending actions defined in other screens.
def processPendingActions(self):
+ # set hostname
+ yali.sysutils.add_hostname(ctx.installData.hostName)
+ ctx.debugger.log("Hostname setted.")
+
# add users
for u in yali.users.pending_users:
ctx.debugger.log("User %s adding to system" % u.username)
u.addUser()
ctx.debugger.log("User %s added to system" % u.username)
+ user = yali.users.User("root")
+ user.changePasswd(ctx.installData.rootPassword)
+
# write console keyboard data
- yali.localeutils.write_keymap(ctx.keydata.console)
+ yali.localeutils.write_keymap(ctx.installData.keyData.console)
ctx.debugger.log("Keymap stored.")
# migrate xorg.conf
- yali.postinstall.migrate_xorg_conf(ctx.keydata.X)
+ yali.postinstall.migrate_xorg_conf(ctx.installData.keyData.X)
ctx.debugger.log("xorg.conf merged.")
class RebootWidget(QWidget):
Modified: trunk/yali/yali/gui/ScrInstall.py
=================================================================
--- trunk/yali/yali/gui/ScrInstall.py (original)
+++ trunk/yali/yali/gui/ScrInstall.py Thu Aug 23 12:10:21 2007
@@ -94,7 +94,7 @@
from os.path import basename
ctx.debugger.log("%s loaded" % basename(__file__))
# initialize pisi
-
+
# start installer thread
self.pkg_installer = PkgInstaller(self)
self.pkg_installer.start()
@@ -125,8 +125,7 @@
if qevent.type() == QEvent.User+1:
p, event = qevent.data()
-
- # FIXME: use logging
+
if event == pisi.ui.installing:
self.info.setText(_("Installing: %s<br>%s") % (
p.name, p.summary))
Modified: trunk/yali/yali/gui/ScrUsers.py
=================================================================
--- trunk/yali/yali/gui/ScrUsers.py (original)
+++ trunk/yali/yali/gui/ScrUsers.py Thu Aug 23 12:10:21 2007
@@ -130,11 +130,11 @@
u = self.userList.item(i).getUser()
ctx.installData.users.append(u)
- # yali.users.pending_users.add(u)
+ yali.users.pending_users.add(u)
- ## Enable auto-login
- #if u.username == autoUser:
- # u.setAutoLogin()
+ # Enable auto-login
+ if u.username == ctx.installData.autoLoginUser:
+ u.setAutoLogin()
return True
Modified: trunk/yali/yali/gui/debugger.py
=================================================================
--- trunk/yali/yali/gui/debugger.py (original)
+++ trunk/yali/yali/gui/debugger.py Thu Aug 23 12:10:21 2007
@@ -25,17 +25,17 @@
title = _("Debug")
self.debugWidget = QWidget()
self.traceback = DebugContainer(self.debugWidget,showLineNumbers)
-
+
l = QVBoxLayout(self.debugWidget)
l.addWidget(self.traceback)
-
+
self.window = Dialog(title,self.debugWidget,None,extraButtons=True)
self.window.resize(500,400)
self.aspect = DebuggerAspect(self)
-
+
def showWindow(self):
self.window.show()
-
+
def log(self,log,type=1):
if ctx.debugEnabled:
self.traceback.add(QString(log),type)
@@ -43,19 +43,19 @@
class DebugContainer(QTextEdit):
def __init__(self, parent, showLineNumbers=True):
QTextEdit.__init__(self, parent)
-
+
f = QFont( "Bitstream Vera Sans Mono", 11);
self.setFont(f)
-
+
self.showLineNumbers = showLineNumbers
self.setReadOnly(True)
self.setOverwriteMode(True)
self.plainLogs = ''
self.line = 0
-
+
def add(self,log,type):
- self.plainLogs += "%s\n" % log
if type==1:
+ self.plainLogs += "%s\n" % log
log = "<b>%s</b>" % log
if self.showLineNumbers:
self.append(QString("<b>%d :</b> %s" % (self.line,log)))
Modified: trunk/yali/yali/postinstall.py
=================================================================
--- trunk/yali/yali/postinstall.py (original)
+++ trunk/yali/yali/postinstall.py Thu Aug 23 12:10:21 2007
@@ -46,7 +46,6 @@
os.chmod(os.path.join(consts.target_dir, "etc/shadow"), 0600)
cp("usr/share/baselayout/group", "etc/group")
-
# create empty log file
touch("var/log/lastlog")
Uludag-commits mesaj listesiyle ilgili
daha fazla bilgi