[Uludag-commits] r17002 - in branches/yali4-md/yali4: . gui
uludag-commits at pardus.org.tr
uludag-commits at pardus.org.tr
6 Şub 2008 Çar 03:39:50 EET
Author: isbaran
Date: Wed Feb 6 03:39:50 2008
New Revision: 17002
Modified:
branches/yali4-md/yali4/__init__.py
branches/yali4-md/yali4/bootloader.py
branches/yali4-md/yali4/constants.py
branches/yali4-md/yali4/exception.py
branches/yali4-md/yali4/filesystem.py
branches/yali4-md/yali4/fstab.py
branches/yali4-md/yali4/gui/DiskWidgets.py
branches/yali4-md/yali4/gui/GUIGPL.py
branches/yali4-md/yali4/gui/ScrBootloader.py
branches/yali4-md/yali4/gui/ScrCheckCD.py
branches/yali4-md/yali4/gui/ScrPartitionAuto.py
branches/yali4-md/yali4/gui/ScrPartitionManual.py
branches/yali4-md/yali4/gui/YaliDialog.py
branches/yali4-md/yali4/gui/YaliWindow.py
branches/yali4-md/yali4/gui/debugger.py
branches/yali4-md/yali4/gui/runner.py
branches/yali4-md/yali4/localedata.py
branches/yali4-md/yali4/localeutils.py
branches/yali4-md/yali4/options.py
branches/yali4-md/yali4/parteddata.py
branches/yali4-md/yali4/partition.py
branches/yali4-md/yali4/partitionrequest.py
branches/yali4-md/yali4/partitiontype.py
branches/yali4-md/yali4/pisiiface.py
branches/yali4-md/yali4/postinstall.py
branches/yali4-md/yali4/steps.py
branches/yali4-md/yali4/storage.py
branches/yali4-md/yali4/sysutils.py
branches/yali4-md/yali4/users.py
Log:
documentez le code
Modified: branches/yali4-md/yali4/__init__.py
=================================================================
--- branches/yali4-md/yali4/__init__.py (original)
+++ branches/yali4-md/yali4/__init__.py Wed Feb 6 03:39:50 2008
@@ -1,6 +1,6 @@
# -*- coding: utf-8 -*-
#
-# Copyright (C) 2005-2007, TUBITAK/UEKAE
+# Copyright (C) 2005-2008, TUBITAK/UEKAE
#
# This program is free software; you can redistribute it and/or modify it under
# the terms of the GNU General Public License as published by the Free
Modified: branches/yali4-md/yali4/bootloader.py
=================================================================
--- branches/yali4-md/yali4/bootloader.py (original)
+++ branches/yali4-md/yali4/bootloader.py Wed Feb 6 03:39:50 2008
@@ -1,6 +1,6 @@
# -*- coding: utf-8 -*-
#
-# Copyright (C) 2005-2007, TUBITAK/UEKAE
+# Copyright (C) 2005-2008, TUBITAK/UEKAE
#
# This program is free software; you can redistribute it and/or modify it under
# the terms of the GNU General Public License as published by the Free
Modified: branches/yali4-md/yali4/constants.py
=================================================================
--- branches/yali4-md/yali4/constants.py (original)
+++ branches/yali4-md/yali4/constants.py Wed Feb 6 03:39:50 2008
@@ -1,6 +1,6 @@
# -*- coding: utf-8 -*-
#
-# Copyright (C) 2005-2007, TUBITAK/UEKAE
+# Copyright (C) 2005-2008, TUBITAK/UEKAE
#
# This program is free software; you can redistribute it and/or modify it under
# the terms of the GNU General Public License as published by the Free
Modified: branches/yali4-md/yali4/exception.py
=================================================================
--- branches/yali4-md/yali4/exception.py (original)
+++ branches/yali4-md/yali4/exception.py Wed Feb 6 03:39:50 2008
@@ -1,6 +1,6 @@
# -*- coding: utf-8 -*-
#
-# Copyright (C) 2005-2007, TUBITAK/UEKAE
+# Copyright (C) 2005-2008, TUBITAK/UEKAE
#
# This program is free software; you can redistribute it and/or modify it under
# the terms of the GNU General Public License as published by the Free
Modified: branches/yali4-md/yali4/filesystem.py
=================================================================
--- branches/yali4-md/yali4/filesystem.py (original)
+++ branches/yali4-md/yali4/filesystem.py Wed Feb 6 03:39:50 2008
@@ -1,6 +1,6 @@
# -*- coding: utf-8 -*-
#
-# Copyright (C) 2005 - 2007 TUBITAK/UEKAE
+# Copyright (C) 2005 - 2008 TUBITAK/UEKAE
# Copyright 2001 - 2004 Red Hat, Inc.
#
# This program is free software; you can redistribute it and/or modify it under
Modified: branches/yali4-md/yali4/fstab.py
=================================================================
--- branches/yali4-md/yali4/fstab.py (original)
+++ branches/yali4-md/yali4/fstab.py Wed Feb 6 03:39:50 2008
@@ -1,6 +1,6 @@
# -*- coding: utf-8 -*-
#
-# Copyright (C) 2005-2007, TUBITAK/UEKAE
+# Copyright (C) 2005-2008, TUBITAK/UEKAE
#
# This program is free software; you can redistribute it and/or modify it under
# the terms of the GNU General Public License as published by the Free
Modified: branches/yali4-md/yali4/gui/DiskWidgets.py
=================================================================
Suppressed!
Too long (more than 250 lines) diff output suppressed...
Modified: branches/yali4-md/yali4/gui/GUIGPL.py
=================================================================
--- branches/yali4-md/yali4/gui/GUIGPL.py (original)
+++ branches/yali4-md/yali4/gui/GUIGPL.py Wed Feb 6 03:39:50 2008
@@ -60,6 +60,4 @@
if exists(f):
return f
else:
- # For testing. Dont forget to remove ..
- return "/home/rat/pardus/uludag/CD-image/CD-image-version-2007.3/license/license-tr.txt"
raise GUIException, _("Can't open License file!")
Modified: branches/yali4-md/yali4/gui/ScrBootloader.py
=================================================================
--- branches/yali4-md/yali4/gui/ScrBootloader.py (original)
+++ branches/yali4-md/yali4/gui/ScrBootloader.py Wed Feb 6 03:39:50 2008
@@ -29,8 +29,7 @@
from yali4.gui.ScreenWidget import ScreenWidget
from yali4.gui.Ui.bootloaderwidget import Ui_BootLoaderWidget
-from yali4.gui.YaliDialog import WarningDialog, WarningWidget
-#from yali4.gui.InformationWindow import InformationWindow
+from yali4.gui.YaliDialog import WarningDialog, WarningWidget, InformationWindow
from yali4.gui.GUIException import *
import yali4.gui.context as ctx
@@ -99,8 +98,9 @@
self.slotSelect)
def backCheck(self):
- # we need to go partition auto screen, not manual ;)
- ctx.mainScreen.moveInc = 2
+ if ctx.autoInstall:
+ # we need to go partition auto screen, not manual ;)
+ ctx.mainScreen.moveInc = 2
return True
def slotSelect(self):
@@ -123,8 +123,10 @@
# first delete partitions on device
dev.deleteAllPartitions()
dev.commit()
+ ctx.mainScreen.processEvents()
- p = dev.addPartition(parttype.root.parted_type,
+ p = dev.addPartition(None,
+ parttype.root.parted_type,
parttype.root.filesystem,
dev.getFreeMB(),
parttype.root.parted_flags)
@@ -132,6 +134,7 @@
# create the partition
dev.commit()
+ ctx.mainScreen.processEvents()
# make partition requests
ctx.partrequests.append(request.MountRequest(p, parttype.root))
@@ -178,31 +181,40 @@
return False
ctx.mainScreen.processEvents()
+ info = InformationWindow(_("Writing disk tables ..."))
# We should do partitioning operations in here.
# Auto Partitioning
if ctx.installData.autoPartDev:
+ info.show()
+ ctx.mainScreen.processEvents()
ctx.partrequests.remove_all()
ctx.use_autopart = True
- # self.autopartDevice()
- time.sleep(1)
- #ctx.partrequests.applyAll()
+ self.autopartDevice()
+ time.sleep(2)
+ info.updateMessage(_("Formatting ..."))
+ ctx.mainScreen.processEvents()
+ ctx.partrequests.applyAll()
# Manual Partitioning
else:
ctx.debugger.log("Format Operation Started")
+ info.show()
for dev in yali4.storage.devices:
ctx.mainScreen.processEvents()
dev.commit()
# wait for udev to create device nodes
time.sleep(2)
+ info.updateMessage(_("Formatting ..."))
ctx.mainScreen.processEvents()
ctx.partrequests.applyAll()
ctx.debugger.log("Format Operation Finished")
ctx.mainScreen.processEvents()
self.checkSwap()
+ info.close()
+
root_part_req = ctx.partrequests.searchPartTypeAndReqType(parttype.root,
request.mountRequestType)
Modified: branches/yali4-md/yali4/gui/ScrCheckCD.py
=================================================================
--- branches/yali4-md/yali4/gui/ScrCheckCD.py (original)
+++ branches/yali4-md/yali4/gui/ScrCheckCD.py Wed Feb 6 03:39:50 2008
@@ -60,14 +60,15 @@
self.ui.checkLabel.setText(_('<font color="#FF6D19">Please wait while checking CD.</font>'))
yali4.pisiiface.initialize(ui=PisiUI())
yali4.pisiiface.add_cd_repo()
+ ctx.mainScreen.proceesEvents()
pkg_names = yali4.pisiiface.get_available()
- self.ui.progressBar.setTotalSteps(len(pkg_names))
+ self.ui.progressBar.setMaximum(len(pkg_names))
cur = 0
for pkg_name in pkg_names:
cur += 1
if yali4.pisiiface.check_package_hash(pkg_name):
- self.ui.progressBar.setProgress(cur)
+ self.ui.progressBar.setValue(cur)
else:
yali4.pisiiface.finalize()
self.showError()
Modified: branches/yali4-md/yali4/gui/ScrPartitionAuto.py
=================================================================
--- branches/yali4-md/yali4/gui/ScrPartitionAuto.py (original)
+++ branches/yali4-md/yali4/gui/ScrPartitionAuto.py Wed Feb 6 03:39:50 2008
@@ -1,6 +1,6 @@
# -*- coding: utf-8 -*-
#
-# Copyright (C) 2005-2007, TUBITAK/UEKAE
+# Copyright (C) 2005-2008, TUBITAK/UEKAE
#
# This program is free software; you can redistribute it and/or modify it under
# the terms of the GNU General Public License as published by the Free
@@ -81,15 +81,17 @@
self.ui.device_list.setCurrentRow(0)
if not self.ui.device_list.count():
- raise YaliExceptionInfo, _("It seems that you don't have the required disk space (min. %s) for Pardus installation." % ctx.consts.min_root_size)
+ raise YaliExceptionInfo, _("It seems that you don't have the required disk space "
+ "(min. %s) for Pardus installation." % ctx.consts.min_root_size)
self.connect(self.ui.accept_auto_1, SIGNAL("clicked()"),self.slotSelectAuto)
self.connect(self.ui.accept_auto_2, SIGNAL("clicked()"),self.slotSelectAuto)
self.connect(self.ui.manual, SIGNAL("clicked()"),self.slotSelectManual)
- self.connect(self.ui.device_list, SIGNAL("itemChanged(QListWidgetItem*)"),self.slotDeviceChanged)
+ self.connect(self.ui.device_list, SIGNAL("currentRowChanged(int)"),self.slotDeviceChanged)
def shown(self):
- ctx.mainScreen.disableNext()
+ # bu gereksiz, alttaki overrides.
+ # ctx.mainScreen.disableNext()
self.updateUI()
def execute(self):
@@ -98,6 +100,7 @@
if self.ui.accept_auto_1.isChecked() or self.ui.accept_auto_2.isChecked():
ctx.installData.autoPartDev = self.device
ctx.debugger.log("Automatic Partition selected..")
+ ctx.debugger.log("Trying to use %s for automatic partitioning.." % self.device.getPath())
if self.ui.accept_auto_2.isChecked():
ctx.installData.autoPartMethod = methodEraseAll
# skip next screen()
@@ -107,7 +110,7 @@
return True
def slotDeviceChanged(self, i):
- self.device = i.getDevice()
+ self.device = self.ui.device_list.item(i).getDevice()
def slotSelectAuto(self):
self.enable_next = True
Modified: branches/yali4-md/yali4/gui/ScrPartitionManual.py
=================================================================
--- branches/yali4-md/yali4/gui/ScrPartitionManual.py (original)
+++ branches/yali4-md/yali4/gui/ScrPartitionManual.py Wed Feb 6 03:39:50 2008
@@ -1,6 +1,6 @@
# -*- coding: utf-8 -*-
#
-# Copyright (C) 2005-2007, TUBITAK/UEKAE
+# Copyright (C) 2005-2008, TUBITAK/UEKAE
#
# This program is free software; you can redistribute it and/or modify it under
# the terms of the GNU General Public License as published by the Free
@@ -77,8 +77,9 @@
def __init__(self, *args):
QtGui.QWidget.__init__(self,None)
- self.partEdit = PartEdit(self)
- self.partList = DiskList(self.partEdit,self)
+ # dont need this
+ # self.partEdit = PartEdit(self)
+ self.partList = DiskList(self)
vbox = QtGui.QVBoxLayout(self)
vbox.addWidget(self.partList)
Modified: branches/yali4-md/yali4/gui/YaliDialog.py
=================================================================
--- branches/yali4-md/yali4/gui/YaliDialog.py (original)
+++ branches/yali4-md/yali4/gui/YaliDialog.py Wed Feb 6 03:39:50 2008
@@ -1,6 +1,6 @@
# -*- coding: utf-8 -*-
#
-# Copyright (C) 2005-2007, TUBITAK/UEKAE
+# Copyright (C) 2005-2008, TUBITAK/UEKAE
#
# This program is free software; you can redistribute it and/or modify it under
# the terms of the GNU General Public License as published by the Free
@@ -19,6 +19,9 @@
import yali4.gui.context as ctx
+##
+# Base class for dialog windows. used as the title part of window
+# this lets us move the dialog
class windowTitle(QtGui.QFrame):
def __init__(self, *args):
QtGui.QFrame.__init__(self, *args)
@@ -67,8 +70,12 @@
newpos.setY(self.w_y + pos.y() - self.start_y)
self.mainwidget.move(newpos)
+##
+# Base dialog class
+# @param title is the title of dialog
+# @param widget is the widget we will embed under 'title' and create the dialog
class Dialog(QtGui.QDialog):
- def __init__(self, t, w, parent=None):
+ def __init__(self, title, widget, parent=None):
QtGui.QDialog.__init__(self, parent)
self.gridlayout = QtGui.QGridLayout(self)
@@ -77,11 +84,11 @@
self.gridlayout.setObjectName("gridlayout")
self.windowTitle = windowTitle(self)
- self.windowTitle.label.setText(t)
+ self.windowTitle.label.setText(title)
self.gridlayout.addWidget(self.windowTitle,0,0,1,1)
- self.content = w
+ self.content = widget
self.gridlayout.addWidget(self.content,1,0,1,1)
QObject.connect(self.windowTitle.pushButton,SIGNAL("clicked()"),self.reject)
@@ -153,9 +160,14 @@
self.emit(SIGNAL("signalCancel"), ())
-class InformationWindow(QtGui.QWidget):
+class InformationWindow(QtGui.QSplashScreen):
- def __init__(self, *args):
- pass
+ def __init__(self, message):
+ Pix = QtGui.QPixmap(':/gui/pics/working.png')
+ QtGui.QSplashScreen.__init__(self, ctx.mainScreen.ui, Pix)
+ self.updateMessage(message)
+ ctx.mainScreen.processEvents()
+ def updateMessage(self, message):
+ self.showMessage(message,Qt.AlignBottom | Qt.AlignHCenter)
Modified: branches/yali4-md/yali4/gui/YaliWindow.py
=================================================================
--- branches/yali4-md/yali4/gui/YaliWindow.py (original)
+++ branches/yali4-md/yali4/gui/YaliWindow.py Wed Feb 6 03:39:50 2008
@@ -33,8 +33,10 @@
self.ui = QtGui.QWidget()
self.setupUi(self.ui)
self.screenData = None
- self.debugShortCut = QtGui.QShortcut(QtGui.QKeySequence(Qt.Key_F2),self.ui)
+ # shortcut to open debug window
+ self.debugShortCut = QtGui.QShortcut(QtGui.QKeySequence(Qt.Key_F2), self.ui)
+ # move one step at a time
self.moveInc = 1
# Dont need help as default
@@ -46,51 +48,62 @@
QObject.connect(self.buttonBack, SIGNAL("clicked()"), self.slotBack)
QObject.connect(self.toggleHelp, SIGNAL("clicked()"), self.slotToggleHelp)
+ # show/hide help text
def slotToggleHelp(self):
if self.helpContent.isVisible():
self.helpContent.hide()
else:
self.helpContent.show()
+ # show/hide debug window
def toggleDebug(self):
if ctx.debugger.isVisible():
ctx.debugger.hideWindow()
else:
ctx.debugger.showWindow()
- def getCur(self,d):
+ # returns the id of current stack
+ def getCur(self, d):
new = self.mainStack.currentIndex() + d
total = self.mainStack.count()
if new < 0: new = 0
if new > total: new = total
return new
- def setCurrent(self,cur=None):
- if cur:
- self.stackMove(cur)
+ # move to id numbered step
+ def setCurrent(self, id=None):
+ if id:
+ self.stackMove(id)
+ # execute next step
def slotNext(self):
_w = self.mainStack.currentWidget()
_w.execute()
self.stackMove(self.getCur(self.moveInc))
self.moveInc = 1
+ # execute previous step
def slotBack(self):
_w = self.mainStack.currentWidget()
_w.backCheck()
self.stackMove(self.getCur(self.moveInc * -1))
self.moveInc = 1
- def stackMove(self,new):
- self.mainStack.setCurrentIndex(new)
+ # move to id numbered stack
+ def stackMove(self, id):
+ self.mainStack.setCurrentIndex(id)
_w = self.mainStack.currentWidget()
+ # shown functions contain necessary instructions before
+ # showing a stack ( updating gui, disabling some buttons etc. )
_w.shown()
self.screenName.setText(_w.title)
self.screenDescription.setText(_w.desc)
self.screenIcon.setPixmap(QtGui.QPixmap(":/gui/pics/%s.png" % (_w.icon or "pardus")))
self.helpContent.setText(_w.help)
- def createWidgets(self,screens=[]):
+ # create all widgets and add inside stack
+ # see runner.py/_all_screens for the list
+ def createWidgets(self, screens=[]):
if not self.screenData:
self.screenData = screens
self.mainStack.removeWidget(self.page)
@@ -132,7 +145,10 @@
# processEvents
def processEvents(self):
- QObject.emit(self.ui,SIGNAL("signalProcessEvents"))
+ # this is connected to QApplication's processEvents (see runner.py) which processes
+ # all pending events for the calling thread according to the specified
+ # flags until there are no more events to process.
+ QObject.emit(self.ui, SIGNAL("signalProcessEvents"))
"""
count = 0
Modified: branches/yali4-md/yali4/gui/debugger.py
=================================================================
--- branches/yali4-md/yali4/gui/debugger.py (original)
+++ branches/yali4-md/yali4/gui/debugger.py Wed Feb 6 03:39:50 2008
@@ -1,6 +1,6 @@
# -*- coding: utf-8 -*-
#
-# Copyright (C) 2007, TUBITAK/UEKAE
+# Copyright (C) 2008 TUBITAK/UEKAE
#
# This program is free software; you can redistribute it and/or modify it under
# the terms of the GNU General Public License as published by the Free
@@ -24,13 +24,13 @@
from yali4.gui.YaliDialog import Dialog
class Debugger:
- def __init__(self,showTimeStamp=True):
+ def __init__(self, showTimeStamp=True):
title = _("Debug")
self.debugWidget = QtGui.QWidget()
- self.debugShortCut = QtGui.QShortcut(QtGui.QKeySequence(Qt.Key_F2),self.debugWidget)
+ self.debugShortCut = QtGui.QShortcut(QtGui.QKeySequence(Qt.Key_F2), self.debugWidget)
QObject.connect(self.debugShortCut, SIGNAL("activated()"), self.toggleDebug)
- self.traceback = DebugContainer(self.debugWidget,showTimeStamp)
+ self.traceback = DebugContainer(self.debugWidget, showTimeStamp)
self.loglevel = QtGui.QComboBox(self.debugWidget)
self.loglevel.addItem("0 : All Messages")
self.loglevel.addItem("1 : Developer Messages")
@@ -40,8 +40,8 @@
l.addWidget(self.loglevel)
l.addWidget(self.traceback)
- self.window = Dialog(title,self.debugWidget)
- self.window.resize(500,400)
+ self.window = Dialog(title, self.debugWidget)
+ self.window.resize(500, 400)
self.aspect = DebuggerAspect(self)
def loglevelChanged(self,newLevel):
Modified: branches/yali4-md/yali4/gui/runner.py
=================================================================
--- branches/yali4-md/yali4/gui/runner.py (original)
+++ branches/yali4-md/yali4/gui/runner.py Wed Feb 6 03:39:50 2008
@@ -85,6 +85,9 @@
"""
self._app = QtGui.QApplication(sys.argv)
+
+ # main application window, widgets in _all_screens
+ # are created here
self._window = YaliWindow.Widget()
# check for oemInstall
@@ -135,7 +138,7 @@
# For testing..
self._window.ui.resize(QSize(800,600))
- # self._window.ui.move(0,0)
+ self._window.ui.move(0,0)
self._app.exec_()
Modified: branches/yali4-md/yali4/localedata.py
=================================================================
--- branches/yali4-md/yali4/localedata.py (original)
+++ branches/yali4-md/yali4/localedata.py Wed Feb 6 03:39:50 2008
@@ -1,6 +1,6 @@
# -*- coding: utf-8 -*-
#
-# Copyright (C) 2005-2007, TUBITAK/UEKAE
+# Copyright (C) 2005-2008, TUBITAK/UEKAE
#
# This program is free software; you can redistribute it and/or modify it under
# the terms of the GNU General Public License as published by the Free
Modified: branches/yali4-md/yali4/localeutils.py
=================================================================
--- branches/yali4-md/yali4/localeutils.py (original)
+++ branches/yali4-md/yali4/localeutils.py Wed Feb 6 03:39:50 2008
@@ -1,6 +1,6 @@
# -*- coding: utf-8 -*-
#
-# Copyright (C) 2005-2007, TUBITAK/UEKAE
+# Copyright (C) 2005-2008, TUBITAK/UEKAE
#
# This program is free software; you can redistribute it and/or modify it under
# the terms of the GNU General Public License as published by the Free
Modified: branches/yali4-md/yali4/options.py
=================================================================
--- branches/yali4-md/yali4/options.py (original)
+++ branches/yali4-md/yali4/options.py Wed Feb 6 03:39:50 2008
@@ -1,6 +1,6 @@
# -*- coding: utf-8 -*-
#
-# Copyright (C) 2006-2007, TUBITAK/UEKAE
+# Copyright (C) 2006-2008, TUBITAK/UEKAE
#
# This program is free software; you can redistribute it and/or modify it under
# the terms of the GNU General Public License as published by the Free
Modified: branches/yali4-md/yali4/parteddata.py
=================================================================
--- branches/yali4-md/yali4/parteddata.py (original)
+++ branches/yali4-md/yali4/parteddata.py Wed Feb 6 03:39:50 2008
@@ -1,6 +1,6 @@
# -*- coding: utf-8 -*-
#
-# Copyright (C) 2005-2007, TUBITAK/UEKAE
+# Copyright (C) 2005-2008, TUBITAK/UEKAE
#
# This program is free software; you can redistribute it and/or modify it under
# the terms of the GNU General Public License as published by the Free
Modified: branches/yali4-md/yali4/partition.py
=================================================================
--- branches/yali4-md/yali4/partition.py (original)
+++ branches/yali4-md/yali4/partition.py Wed Feb 6 03:39:50 2008
@@ -1,6 +1,6 @@
# -*- coding: utf-8 -*-
#
-# Copyright (C) 2005-2007, TUBITAK/UEKAE
+# Copyright (C) 2005-2008, TUBITAK/UEKAE
#
# This program is free software; you can redistribute it and/or modify it under
# the terms of the GNU General Public License as published by the Free
@@ -60,6 +60,11 @@
return self._partition.type == parted.PARTITION_LOGICAL
##
+ # check if partition is logical
+ def isFreespace(self):
+ return self._partition.type == parted.PARTITION_FREESPACE
+
+ ##
# check if partition is extended
def isExtended(self):
return self._partition.type == parted.PARTITION_EXTENDED
Modified: branches/yali4-md/yali4/partitionrequest.py
=================================================================
--- branches/yali4-md/yali4/partitionrequest.py (original)
+++ branches/yali4-md/yali4/partitionrequest.py Wed Feb 6 03:39:50 2008
@@ -1,6 +1,6 @@
# -*- coding: utf-8 -*-
#
-# Copyright (C) 2005-2007, TUBITAK/UEKAE
+# Copyright (C) 2005-2008, TUBITAK/UEKAE
#
# This program is free software; you can redistribute it and/or modify it under
# the terms of the GNU General Public License as published by the Free
Modified: branches/yali4-md/yali4/partitiontype.py
=================================================================
--- branches/yali4-md/yali4/partitiontype.py (original)
+++ branches/yali4-md/yali4/partitiontype.py Wed Feb 6 03:39:50 2008
@@ -1,6 +1,6 @@
# -*- coding: utf-8 -*-
#
-# Copyright (C) 2005-2007, TUBITAK/UEKAE
+# Copyright (C) 2005-2008, TUBITAK/UEKAE
#
# This program is free software; you can redistribute it and/or modify it under
# the terms of the GNU General Public License as published by the Free
Modified: branches/yali4-md/yali4/pisiiface.py
=================================================================
--- branches/yali4-md/yali4/pisiiface.py (original)
+++ branches/yali4-md/yali4/pisiiface.py Wed Feb 6 03:39:50 2008
@@ -1,6 +1,6 @@
# -*- coding: utf-8 -*-
#
-# Copyright (C) 2005-2007, TUBITAK/UEKAE
+# Copyright (C) 2005-2008, TUBITAK/UEKAE
#
# This program is free software; you can redistribute it and/or modify it under
# the terms of the GNU General Public License as published by the Free
Modified: branches/yali4-md/yali4/postinstall.py
=================================================================
--- branches/yali4-md/yali4/postinstall.py (original)
+++ branches/yali4-md/yali4/postinstall.py Wed Feb 6 03:39:50 2008
@@ -1,6 +1,6 @@
# -*- coding: utf-8 -*-
#
-# Copyright (C) 2005-2007, TUBITAK/UEKAE
+# Copyright (C) 2005-2008, TUBITAK/UEKAE
#
# This program is free software; you can redistribute it and/or modify it under
# the terms of the GNU General Public License as published by the Free
Modified: branches/yali4-md/yali4/steps.py
=================================================================
--- branches/yali4-md/yali4/steps.py (original)
+++ branches/yali4-md/yali4/steps.py Wed Feb 6 03:39:50 2008
@@ -1,6 +1,6 @@
# -*- coding: utf-8 -*-
#
-# Copyright (C) 2005-2007, TUBITAK/UEKAE
+# Copyright (C) 2005-2008, TUBITAK/UEKAE
#
# This program is free software; you can redistribute it and/or modify it under
# the terms of the GNU General Public License as published by the Free
Modified: branches/yali4-md/yali4/storage.py
=================================================================
--- branches/yali4-md/yali4/storage.py (original)
+++ branches/yali4-md/yali4/storage.py Wed Feb 6 03:39:50 2008
@@ -1,6 +1,6 @@
# -*- coding: utf-8 -*-
#
-# Copyright (C) 2005-2007, TUBITAK/UEKAE
+# Copyright (C) 2005-2008, TUBITAK/UEKAE
# Copyright 1999-2005 Gentoo Foundation
#
# This program is free software; you can redistribute it and/or modify it under
@@ -277,8 +277,8 @@
# (OK not really ;)
size_parts = 8
for p in self.getPartitions():
- # don't count logical parts
- if not p.isLogical():
+ # don't count logical parts and free spaces
+ if not p.isLogical() and not p.isFreespace():
size_parts += p.getMB()
size = size_total - size_parts
@@ -324,13 +324,16 @@
# @param fs: filesystem.FileSystem or file system name (like "ext3")
# @param size_mb: size of the partition in MBs.
def addPartition(self, part, type, fs, size_mb, flags = []):
- size = int(size_mb * MEGABYTE / self._sector_size)
# Don't set bootable flag if there is already a bootable
# partition in this disk. See bug #2217
if (parted.PARTITION_BOOT in flags) and self.hasBootablePartition():
flags = list(set(flags) - set([parted.PARTITION_BOOT]))
+ if not part:
+ part = self.__getLargestFreePedPartition()
+
+ size = int(size_mb * MEGABYTE / self._sector_size)
geom = part.geom
# creating a partition
Modified: branches/yali4-md/yali4/sysutils.py
=================================================================
--- branches/yali4-md/yali4/sysutils.py (original)
+++ branches/yali4-md/yali4/sysutils.py Wed Feb 6 03:39:50 2008
@@ -1,6 +1,6 @@
# -*- coding: utf-8 -*-
#
-# Copyright (C) 2005-2007, TUBITAK/UEKAE
+# Copyright (C) 2005-2008, TUBITAK/UEKAE
#
# This program is free software; you can redistribute it and/or modify it under
# the terms of the GNU General Public License as published by the Free
Modified: branches/yali4-md/yali4/users.py
=================================================================
--- branches/yali4-md/yali4/users.py (original)
+++ branches/yali4-md/yali4/users.py Wed Feb 6 03:39:50 2008
@@ -1,6 +1,6 @@
# -*- coding: utf-8 -*-
#
-# Copyright (C) 2005-2007, TUBITAK/UEKAE
+# Copyright (C) 2005-2008, TUBITAK/UEKAE
#
# This program is free software; you can redistribute it and/or modify it under
# the terms of the GNU General Public License as published by the Free
Uludag-commits mesaj listesiyle ilgili
daha fazla bilgi