Пример #1
0
 def __init__(self):
     self.mounts = []
     (ret, out, err) = call(['mount'])
     lines = out.split('\n')
     if len(lines) < 3:
         return
     for l in lines[2:]:
         if len(l) == 0:
             continue
         x = l.split()
         if x[0] == '-hosts':
             continue
         elif x[0][0] == '/':
             dev, mnt, type, null, null, null, mnt_opt = l.split()
         else:
             v = l.split()
             if len(v) == 7:
                 node, dev, mnt, type, null, null, null = l.split()
                 mntopt = ""
             if len(v) == 8:
                 node, dev, mnt, type, null, null, null, mnt_opt = l.split()
             else:
                 continue
         m = rcMounts.Mount(dev, mnt, type, mnt_opt)
         self.mounts.append(m)
Пример #2
0
 def parse_mounts(self):
     mounts = []
     out, err, ret = justcall(['mount'])
     lines = out.split('\n')
     if len(lines) < 3:
         return
     for l in lines[2:]:
         if len(l) == 0:
             continue
         x = l.split()
         if x[0] == '-hosts':
             continue
         elif x[0][0] == '/':
             dev, mnt, type, null, null, null, mnt_opt = l.split()
         else:
             v = l.split()
             if len(v) == 7:
                 node, dev, mnt, type, null, null, null = l.split()
                 mntopt = ""
             if len(v) == 8:
                 node, dev, mnt, type, null, null, null, mnt_opt = l.split()
             else:
                 continue
         m = rcMounts.Mount(dev, mnt, type, mnt_opt)
         mounts.append(m)
     return mounts
Пример #3
0
 def __init__(self):
     self.mounts = []
     out, err, ret = justcall(['mount'])
     for l in out.split('\n'):
         l = l.replace(', ', ',')
         if len(l.split()) != 6:
             return
         dev, null, mnt, null, type, mnt_opt = l.split()
         m = rcMounts.Mount(dev, mnt, type, mnt_opt.strip('()'))
         self.mounts.append(m)
Пример #4
0
 def __init__(self):
     self.mounts = []
     (ret, out, err) = call([rcEnv.syspaths.mount])
     out = out.replace(" (deleted)", "")
     for l in out.split('\n'):
         if len(l.split()) != 6:
             return
         dev, null, mnt, null, type, mnt_opt = l.split()
         m = rcMounts.Mount(dev, mnt, type, mnt_opt.strip('()'))
         self.mounts.append(m)
Пример #5
0
 def parse_mounts(self):
     mounts = []
     out, err, ret = justcall(['mount', '-v'])
     for l in out.split('\n'):
         if len(l.split()) != 12:
             break
         dev, null, mnt, null, type, mnt_opt, null, null, null, null, null, null = l.split(
         )
         m = rcMounts.Mount(dev, mnt, type, mnt_opt.strip('()'))
         mounts.append(m)
     return mounts
Пример #6
0
 def parse_mounts(self):
     out, err, ret = justcall([rcEnv.syspaths.mount])
     out = out.replace(" (deleted)", "")
     mounts = []
     for l in out.split('\n'):
         if len(l.split()) != 6:
             break
         dev, null, mnt, null, type, mnt_opt = l.split()
         m = rcMounts.Mount(dev, mnt, type, mnt_opt.strip('()'))
         mounts.append(m)
     return mounts
Пример #7
0
 def __init__(self, wmi=None):
     if wmi is None:
         import wmi
         wmi = wmi.WMI()
     self.mounts = []
     for volume in wmi.Win32_Volume():
         dev = volume.DeviceID
         mnt = volume.Name
         if mnt is None:
             mnt = ""
         type = volume.FileSystem
         mnt_opt = "NULL"  # quoi mettre d autre...
         m = rcMounts.Mount(dev, mnt, type, mnt_opt)
         self.mounts.append(m)
Пример #8
0
 def __init__(self):
     self.mounts = []
     (ret, out, err) = call(['mount','-p'], outdebug=False)
     for line in out.split('\n'):
         words=line.split()
         if len(words) < 6 :
             continue
         elif words[1]+words[4] != '--' :
             # ignore mount line with space in mountpoint or dev
             continue
         elif len(words) == 6 :
             words.append('-')
         dev, null, mnt, type, null, null, mnt_opt = words
         m = rcMounts.Mount(dev, mnt, type, mnt_opt.strip('()'))
         self.mounts.append(m)
Пример #9
0
 def parse_mounts(self):
     mounts = []
     out, err, ret = justcall(['mount', '-p'])
     for line in out.split('\n'):
         words = line.split()
         if len(words) < 6:
             continue
         elif words[1] + words[4] != '--':
             # ignore mount line with space in mountpoint or dev
             continue
         elif len(words) == 6:
             words.append('-')
         dev, null, mnt, type, null, null, mnt_opt = words
         m = rcMounts.Mount(dev, mnt, type, mnt_opt.strip('()'))
         mounts.append(m)
     return mounts
Пример #10
0
 def parse_mounts(self):
     mounts = []
     out, err, ret = justcall(['mount'])
     for l in out.split('\n'):
         words = l.split()
         if len(words) < 4:
             break
         dev = words[0]
         mnt = words[2]
         opts = ' '.join(words[3:]).strip('(').strip(')').split(', ')
         type = opts[0]
         if len(opts) < 3:
             mnt_opt = ''
         else:
             mnt_opt = ','.join(opts[2:])
         m = rcMounts.Mount(dev, mnt, type, mnt_opt)
         mounts.append(m)
     return mounts