[Ocfs2-tools-commits] manish commits r677 -
trunk/ocfs2console/ocfs2interface
svn-commits at oss.oracle.com
svn-commits at oss.oracle.com
Fri Mar 18 03:06:08 CST 2005
Author: manish
Date: 2005-03-18 03:06:05 -0600 (Fri, 18 Mar 2005)
New Revision: 677
Modified:
trunk/ocfs2console/ocfs2interface/format.py
Log:
Show fstype in partition list for format dialog
Modified: trunk/ocfs2console/ocfs2interface/format.py
===================================================================
--- trunk/ocfs2console/ocfs2interface/format.py 2005-03-18 07:49:41 UTC (rev 676)
+++ trunk/ocfs2console/ocfs2interface/format.py 2005-03-18 09:06:05 UTC (rev 677)
@@ -105,10 +105,10 @@
class Device(BaseCombo):
def fill(self, partitions, device):
- self.set_choices([(p, p == device) for p in partitions])
+ self.set_choices([('%s (%s)' % p, p[0] == device) for p in partitions])
def get_device(self):
- return self.get_choice()
+ return self.get_choice().split(' ')[0]
class VolumeLabel(gtk.Entry):
def __init__(self):
@@ -147,7 +147,7 @@
partitions = []
def add_partition(device, fstype):
- partitions.append(device)
+ partitions.append((device, fstype))
ocfs2.partition_list(add_partition, unmounted=True)
@@ -155,6 +155,11 @@
error_box(parent, 'No unmounted partitions')
return False
+ def sort_partition(x, y):
+ return cmp(x[0], y[0])
+
+ partitions.sort(sort_partition)
+
dialog = gtk.Dialog(parent=parent, title='Format',
buttons=(gtk.STOCK_CANCEL, gtk.RESPONSE_CANCEL,
gtk.STOCK_OK, gtk.RESPONSE_OK))
@@ -165,8 +170,6 @@
border_width=4,
parent=dialog.vbox)
- partitions.sort()
-
widgets = []
row = 0
More information about the Ocfs2-tools-commits
mailing list