FAQ Search Today's Posts Mark Forums Read
» Video Reviews

» Linux Archive

Linux-archive is a website aiming to archive linux email lists and to make them easily accessible for linux users/developers.


» Sponsor

» Partners

» Sponsor

Go Back   Linux Archive > Ubuntu > Ubuntu User

 
 
LinkBack Thread Tools
 
Old 07-29-2011, 05:44 PM
Chris Lumens
 
Default Move out the parts of Device.__str__ that are StorageDevice specific.

---
pyanaconda/storage/devices.py | 19 +++++++++++--------
1 files changed, 11 insertions(+), 8 deletions(-)

diff --git a/pyanaconda/storage/devices.py b/pyanaconda/storage/devices.py
index 0ac9aa4..d3c3bda 100644
--- a/pyanaconda/storage/devices.py
+++ b/pyanaconda/storage/devices.py
@@ -262,14 +262,7 @@ class Device(object):
return s

def __str__(self):
- exist = "existing"
- if not self.exists:
- exist = "non-existent"
- s = "%s %dMB %s %s (%d)" % (exist, self.size, self.type, self.name,
- self.id)
- if self.format.type:
- s += " with %s" % self.format
-
+ s = "%s %s (%d)" % (self.type, self.name, self.id)
return s

@property
@@ -489,6 +482,16 @@ class StorageDevice(Device):

self._partedDevice = None

+ def __str__(self):
+ exist = "existing"
+ if not self.exists:
+ exist = "non-existent"
+ s = "%s %dMB %s" % (exist, self.size, super(StorageDevice, self).__str__())
+ if self.format.type:
+ s += " with %s" % self.format
+
+ return s
+
@property
def packages(self):
""" List of packages required to manage devices of this type.
--
1.7.6

_______________________________________________
Anaconda-devel-list mailing list
Anaconda-devel-list@redhat.com
https://www.redhat.com/mailman/listinfo/anaconda-devel-list
 

Thread Tools




All times are GMT. The time now is 11:18 AM.

VBulletin, Copyright ©2000 - 2014, Jelsoft Enterprises Ltd.
Content Relevant URLs by vBSEO ©2007, Crawlability, Inc.
Copyright 2007 - 2008, www.linux-archive.org