summaryrefslogtreecommitdiffstats
path: root/isys
diff options
context:
space:
mode:
authorErik Troan <ewt@redhat.com>2001-02-09 21:39:49 +0000
committerErik Troan <ewt@redhat.com>2001-02-09 21:39:49 +0000
commitbdf3e5ff9ce5294a7c9c8c42b427a348102e2c90 (patch)
tree09af884d811da95df71cde838171e3d19ff80056 /isys
parente1e2dd054d2f0b8212e768d736031ecf5b423739 (diff)
downloadanaconda-bdf3e5ff9ce5294a7c9c8c42b427a348102e2c90.tar.gz
anaconda-bdf3e5ff9ce5294a7c9c8c42b427a348102e2c90.tar.xz
anaconda-bdf3e5ff9ce5294a7c9c8c42b427a348102e2c90.zip
added code to find rewriteable cdrom's
Diffstat (limited to 'isys')
-rw-r--r--isys/isys.py35
1 files changed, 35 insertions, 0 deletions
diff --git a/isys/isys.py b/isys/isys.py
index 52a254f65..a7a491c1e 100644
--- a/isys/isys.py
+++ b/isys/isys.py
@@ -355,3 +355,38 @@ def getGeometry(device):
def fbinfo():
return _isys.fbinfo()
+
+def ideCdRwList():
+ if not os.access("/proc/sys/dev/cdrom/info", os.R_OK): return None
+
+ f = open("/proc/sys/dev/cdrom/info", "r")
+ lines = f.readlines()
+ f.close()
+
+ driveList = []
+ finalDict = {}
+
+ for line in lines:
+ line = string.split(line, ':', 1)
+
+ if (line and line[0] == "drive name"):
+ line = string.split(line[1])
+ # no CDROM drives
+ if not line: return
+
+ for device in line:
+ if device[0:2] == 'sr':
+ device = "scd" + device[2:]
+ driveList.append(device)
+ elif ((line and line[0] == "Can write CD-R") or
+ (line and line[0] == "Can write CD-RW")):
+ line = string.split(line[1])
+ field = 0
+ for ability in line:
+ if ability == "1":
+ finalDict[driveList[field]] = 1
+ field = field + 1
+
+ l = finalDict.keys()
+ l.sort()
+ return l