import os
+from Tools.Directories import *
+
def tryOpen(filename):
try:
procFile = open(filename)
return self.index
def bus(self):
- #TODO: add the host
+ ret = ""
+
+ if self.index & 2:
+ ret = "External (CF) - "
+ else:
+ ret = "Internal - "
+
if self.index & 1:
- return "Slave"
+ return ret + "Slave"
else:
- return "Master"
+ return ret + "Master"
def capacity(self):
procfile = tryOpen(self.prochdx + "capacity")
def unmount(self):
cmd = "/bin/umount " + self.devidex + "part*"
- os.system(cmd)
+ res = os.system(cmd)
+ return (res >> 8)
def createPartition(self):
cmd = "/sbin/sfdisk -f " + self.devidex + "disc"
return (res >> 8)
def createMovieFolder(self):
- res = os.system("mkdir /hdd/movie")
+ res = os.system("mkdir " + resolveFilename(SCOPE_HDD))
return (res >> 8)
+ errorList = [ _("Everything is fine"), _("Creating partition failed"), _("Mkfs failed"), _("Mount failed"), _("Create movie folder failed"), _("Unmount failed")]
+
def initialize(self):
self.unmount()
if hddNum > 8:
break
+ def HDDCount(self):
+ cnt = 0
+ for hd in self.hdd:
+ cnt = cnt + 1
+ return cnt
+
def HDDList(self):
list = [ ]
for hd in self.hdd: