/[gli]/trunk/src/GLIStorageDevice.py
Gentoo

Diff of /trunk/src/GLIStorageDevice.py

Parent Directory Parent Directory | Revision Log Revision Log | View Patch Patch

Revision 386 Revision 501
1import commands, string, re, os, parted 1import commands, string, re, os, parted
2from decimal import Decimal
3
4MEGABYTE = 1024 * 1024
5
6archinfo = { 'sparc': { 'fixedparts': [ { 'minor': 3, 'type': "wholedisk" } ], 'disklabel': 'sun', 'extended': False },
7 'hppa': { 'fixedparts': [ { 'minor': 1, 'type': "boot" } ], 'disklabel': 'msdos', 'extended': False },
8 'x86': { 'fixedparts': [], 'disklabel': 'msdos', 'extended': True },
9 'ppc': { 'fixedparts': [ { 'minor': 1, 'type': "metadata" } ], 'disklabel': 'mac', 'extended': False }
10 }
2 11
3class Device: 12class Device:
4 "Class representing a partitionable device." 13 "Class representing a partitionable device."
5 14
6 _device = None 15 _device = None
11 _cylinder_bytes = 0 20 _cylinder_bytes = 0
12 _sectors_in_cylinder = 0 21 _sectors_in_cylinder = 0
13 _parted_dev = None 22 _parted_dev = None
14 _parted_disk = None 23 _parted_disk = None
15 _sector_bytes = 0 24 _sector_bytes = 0
16 25 _total_mb = 0
26 _arch = None
27
17 def __init__(self, device): 28 def __init__(self, device, arch="x86"):
18 self._device = device 29 self._device = device
19 self._partitions = {} 30 self._partitions = {}
20 self._geometry = {'cylinders': 0, 'heads': 0, 'sectors': 0, 'sectorsize': 512} 31 self._geometry = {'cylinders': 0, 'heads': 0, 'sectors': 0, 'sectorsize': 512}
21 self._total_bytes = 0 32 self._total_bytes = 0
22 self._cylinder_bytes = 0 33 self._cylinder_bytes = 0
34 self._arch = arch
23 self._parted_dev = parted.PedDevice.get(self._device) 35 self._parted_dev = parted.PedDevice.get(self._device)
24 self._parted_disk = parted.PedDisk.new(self._parted_dev) 36 self._parted_disk = parted.PedDisk.new(self._parted_dev)
25 self.set_disk_geometry_from_disk() 37 self.set_disk_geometry_from_disk()
26 38
27 def set_disk_geometry_from_disk(self): 39 def set_disk_geometry_from_disk(self):
28 self._total_bytes = self._parted_dev.length * self._parted_dev.sector_size 40 self._total_bytes = self._parted_dev.length * self._parted_dev.sector_size
29# if string.strip(commands.getoutput("echo " + self._device + " | grep '/hd'")) == self._device: # IDE
30# proc_dir = "/proc/ide/" + commands.getoutput("echo " + self._device + " | cut -d '/' -f 3")
31# proc_dir = string.strip(proc_dir)
32# heads = commands.getoutput("cat " + proc_dir + "/geometry | grep logical | cut -d '/' -f 2")
33# sectors = commands.getoutput("cat " + proc_dir + "/geometry | grep logical | cut -d '/' -f 3")
34# total_sectors = commands.getoutput("cat " + proc_dir + "/capacity")
35# cylinders = int(total_sectors) / (int(heads) * int(sectors))
36# self._geometry['heads'], self._geometry['sectors'], self._geometry['cylinders'] = int(heads), int(sectors), int(cylinders)
37# else: #SCSI
38 self._geometry['heads'], self._geometry['sectors'], self._geometry['cylinders'] = self._parted_dev.heads, self._parted_dev.sectors, self._parted_dev.cylinders 41 self._geometry['heads'], self._geometry['sectors'], self._geometry['cylinders'] = self._parted_dev.heads, self._parted_dev.sectors, self._parted_dev.cylinders
39
40 self._sector_bytes = self._parted_dev.sector_size 42 self._sector_bytes = self._parted_dev.sector_size
41 self._cylinder_bytes = self._geometry['heads'] * self._geometry['sectors'] * self._sector_bytes 43 self._cylinder_bytes = self._geometry['heads'] * self._geometry['sectors'] * self._sector_bytes
42# self._total_sectors = self._geometry['cylinders'] * self._geometry['heads'] * self._geometry['sectors']
43 self._total_sectors = self._parted_dev.length 44 self._total_sectors = self._parted_dev.length
44 self._sectors_in_cylinder = self._geometry['heads'] * self._geometry['sectors'] 45 self._sectors_in_cylinder = self._geometry['heads'] * self._geometry['sectors']
46 self._total_mb = int(self._total_bytes / MEGABYTE)
45 47
46 def set_partitions_from_disk(self): 48 def set_partitions_from_disk(self):
49 last_part = 0
50 last_log_part = 4
47 parted_part = self._parted_disk.next_partition() 51 parted_part = self._parted_disk.next_partition()
48 while parted_part != None: 52 while parted_part:
53 part_mb = int((parted_part.geom.end - parted_part.geom.start + 1) * self._sector_bytes / MEGABYTE)
49 if parted_part.num < 1: 54 if parted_part.num >= 1:
50 parted_part = self._parted_disk.next_partition(parted_part)
51 continue
52 fs_type = ""
53 if parted_part.fs_type != None: fs_type = parted_part.fs_type.name
54 if parted_part.type == 2: fs_type = "extended"
55 self._partitions[int(parted_part.num)] = Partition(self, parted_part.num, '', parted_part.geom.start, parted_part.geom.end, (parted_part.geom.end - parted_part.geom.start), fs_type, format=False, existing=True)
56 parted_part = self._parted_disk.next_partition(parted_part)
57
58 def set_partitions_from_install_profile_structure(self, ips):
59 for part in ips:
60 tmppart = ips[part]
61 existing = False
62 parted_part = self._parted_disk.get_partition(part)
63 if parted_part != None:
64 start = parted_part.geom.start / self._sectors_in_cylinder
65 end = parted_part.geom.end / self._sectors_in_cylinder
66 fs_type = "" 55 fs_type = ""
67 if parted_part.fs_type != None: fs_type = parted_part.fs_type.name 56 if parted_part.fs_type != None: fs_type = parted_part.fs_type.name
68 if parted_part.type == 2: fs_type = "extended" 57 if parted_part.type == 2: fs_type = "extended"
58 if archinfo[self._arch]['extended'] and parted_part.num > 4:
59 last_log_part = parted_part.num
60 else:
61 last_part = parted_part.num
62 self._partitions[int(parted_part.num)] = Partition(self, parted_part.num, part_mb, parted_part.geom.start, parted_part.geom.end, fs_type, format=False, existing=True)
63 elif parted_part.type_name == "free":
64 parent_part = self.get_partition_at(parted_part.geom.start, ignore_extended=0)
65 if parent_part:
66 self._partitions[Decimal(str(float(last_log_part+0.9)))] = Partition(self, Decimal(str(float(last_log_part+0.9))), part_mb, parted_part.geom.start, parted_part.geom.end, "free", format=False, existing=False)
67 last_log_part += 1
68 else:
69 self._partitions[Decimal(str(float(last_part+0.1)))] = Partition(self, Decimal(str(float(last_part+0.1))), part_mb, parted_part.geom.start, parted_part.geom.end, "free", format=False, existing=False)
70 last_part += 1
71 parted_part = self._parted_disk.next_partition(parted_part)
72
73 def set_partitions_from_install_profile_structure(self, ips):
74 pass
75# for part in ips:
76# tmppart = ips[part]
77# existing = False
78# parted_part = self._parted_disk.get_partition(part)
79# if parted_part != None:
80# start = parted_part.geom.start / self._sectors_in_cylinder
81# end = parted_part.geom.end / self._sectors_in_cylinder
82# fs_type = ""
83# if parted_part.fs_type != None: fs_type = parted_part.fs_type.name
84# if parted_part.type == 2: fs_type = "extended"
69 if int(tmppart['start']) == int(start) and int(tmppart['end']) == int(end) and tmppart['type'] == fs_type and tmppart['format'] == False: 85# if int(tmppart['start']) == int(start) and int(tmppart['end']) == int(end) and tmppart['type'] == fs_type and tmppart['format'] == False:
70 existing = True 86# existing = True
71 self._partitions[int(part)] = Partition(self, part, '', tmppart['start'], tmppart['end'], 0, tmppart['type'], mountopts=tmppart['mountopts'], mountpoint=tmppart['mountpoint'], format=tmppart['format'], existing=(not tmppart['format'])) 87# self._partitions[int(part)] = Partition(self, part, '', tmppart['start'], tmppart['end'], 0, tmppart['type'], mountopts=tmppart['mountopts'], mountpoint=tmppart['mountpoint'], format=tmppart['format'], existing=(not tmppart['format']))
72 88
73 def get_device(self): 89 def get_device(self):
74 return self._device 90 return self._device
75 91
76 def clear_partitions(self): 92 def tidy_partitions(self):
77 self._partitions = {} 93 last_minor = 0
94 last_log_minor = 4
95 last_free = 0
96 last_log_free = 0
97 parts = self._partitions.keys()
98 parts.sort()
99 for part in parts:
100 if archinfo[self._arch]['extended'] and part > 4: break
101 tmppart = self._partitions[part]
102 if tmppart.get_type() == "extended":
103 for part_log in parts:
104 if part_log < Decimal("4.9"): continue
105 tmppart_log = self._partitions[part_log]
106 if tmppart_log.get_type() == "free":
107 if last_log_minor < last_log_free:
108 self._partitions[last_log_free].set_mb(self._partitions[last_log_free].get_mb()+tmppart_log.get_mb())
109 del self._partitions[part_log]
110 else:
111 if not last_log_free:
112 last_log_free = Decimal(str(last_log_minor + 0.9))
113 tmppart_log.set_minor(last_log_free)
114 self._partitions[last_log_free] = tmppart_log
115 if part_log != last_log_free: del self._partitions[part_log]
116 continue
117 last_log_free = part_log
118 else:
119 if part_log > (last_log_minor + 1):
120 tmppart_log.set_minor(last_log_minor + 1)
121 last_log_minor = last_log_minor + 1
122 self._partitions[last_log_minor] = tmppart_log
123 del self._partitions[part_log]
124 continue
125 last_log_minor = part_log
126 if tmppart.get_type() == "free":
127 if last_minor < last_free:
128 self._partitions[last_free].set_mb(self._partitions[last_free].get_mb()+tmppart.get_mb())
129 del self._partitions[part]
130 else:
131 if not last_free:
132 last_free = Decimal(str(last_minor + 0.1))
133 tmppart.set_minor(last_free)
134 self._partitions[last_free] = tmppart
135 if part != last_free: del self._partitions[part]
136 continue
137 last_free = part
138 else:
139 if part > (last_minor + 1):
140 tmppart.set_minor(last_minor + 1)
141 last_minor = last_minor + 1
142 self._partitions[last_minor] = tmppart
143 del self._partitions[part]
144 continue
145 last_minor = part
78 146
79 def add_partition(self, minor, start, end, type, mountpoint='', mountopts=''): 147 def add_partition(self, free_minor, mb, start, end, type, mountpoint='', mountopts=''):
80 free_start, free_end = self.get_free_space(start) 148 free_minor = Decimal(str(free_minor))
81 minor = int(minor) 149 new_minor = int(free_minor) + 1
82 if not free_end: 150# print "add_partition(): free_minor=" + str(free_minor) + ", new_minor=" + str(new_minor)
83 return False
84 if self._partitions.has_key(minor): 151 if self._partitions.has_key(new_minor):
85 parts = self._partitions.keys() 152 parts = self._partitions.keys()
86 parts.sort() 153 parts.sort()
87 parts.reverse() 154 parts.reverse()
88 hole_at = 0 155 hole_at = 0
89 for i in range(1, parts[0]+1): 156 for i in range(1, parts[0]+1):
90 if i <= minor: continue 157 if i <= new_minor: continue
91 if not self._partitions.has_key(int(i)): 158 if not self._partitions.has_key(i):
92 hole_at = i 159 hole_at = i
93 break 160 break
94 stopscooting = 0 161 stopscooting = 0
95 for i in parts: 162 for i in parts:
96 if stopscooting: break 163 if stopscooting: break
97 if (i >= hole_at) and (hole_at): continue 164 if i >= hole_at and hole_at: continue
98 if i >= minor: 165 if i >= new_minor:
99 self._partitions[i].set_minor(i+1) 166 self._partitions[i].set_minor(i+1)
100 self._partitions[i+1] = self._partitions[i] 167 self._partitions[i+1] = self._partitions[i]
101 if i == minor: stopscooting = 1 168 if i == new_minor: stopscooting = 1
169 if mb != self._partitions[free_minor].get_mb():
170 old_free_mb = self._partitions[free_minor].get_mb()
171 del self._partitions[free_minor]
172 if archinfo[self._arch]['extended'] and new_minor >= 5:
173 free_minor = Decimal(str(new_minor + 0.9))
174 else:
175 free_minor = Decimal(str(new_minor + 0.1))
176 self._partitions[free_minor] = Partition(self, free_minor, old_free_mb-mb, 0, 0, "free")
177# print "add_partition(): new part doesn't use all freespace. new free part is: minor=" + str(free_minor)
178 else:
179 del self._partitions[free_minor]
102 self._partitions[minor] = Partition(self, minor, '', start, end, 0, type, mountpoint=mountpoint, mountopts=mountopts) 180 self._partitions[new_minor] = Partition(self, new_minor, mb, start, end, type, mountpoint=mountpoint, mountopts=mountopts)
181 if type == "extended":
182 self._partitions[Decimal("4.9")] = Partition(self, Decimal("4.9"), mb, 0, 0, "free")
183 self.tidy_partitions()
103 184
104 def remove_partition(self, minor): 185 def remove_partition(self, minor):
186 tmppart = self._partitions[int(minor)]
187 free_minor = 0
188 if tmppart.is_logical():
189 free_minor = Decimal(str(float(minor)-0.1))
190 else:
191 free_minor = Decimal(str(float(minor)-0.9))
192 self._partitions[free_minor] = Partition(self, free_minor, tmppart.get_mb(), 0, 0, "free", format=False, existing=False)
105 del self._partitions[int(minor)] 193 del self._partitions[int(minor)]
194 self.tidy_partitions()
106 195
107 def get_free_space(self, start): 196 def get_free_space(self, start):
108 GAP_SIZE = 100 197 GAP_SIZE = 100
109 parts = self._partitions.keys() 198 parts = self._partitions.keys()
110 parts.sort() 199 parts.sort()
181 270
182 def get_ordered_partition_list(self): 271 def get_ordered_partition_list(self):
183 parts = self._partitions.keys() 272 parts = self._partitions.keys()
184 parts.sort() 273 parts.sort()
185 partlist = [] 274 partlist = []
186 free_start, free_end = self.get_free_space(0) 275 tmppart = None
187 tmppart = None
188 tmppart_log = None 276 tmppart_log = None
189 for part in parts: 277 for part in parts:
190 if part > 4: break 278 if archinfo[self._arch]['extended'] and part > Decimal("4.1"): break
191 tmppart = self._partitions[part] 279 tmppart = self._partitions[part]
192 if free_end < tmppart.get_start() and not free_start == -1:
193 partlist.append("Free Space (" + str(free_start) + "-" + str(free_end) + ")")
194 free_start, free_end = self.get_free_space(free_end)
195 newitem = self._device + str(part) + ": " + str(tmppart.get_start()) + "-" + str(tmppart.get_end())
196 if tmppart.is_extended(): newitem = newitem + " extended"
197 partlist.append(newitem) 280 partlist.append(part)
198 if tmppart.is_extended(): 281 if tmppart.is_extended():
199 for part_log in parts: 282 for part_log in parts:
200 if part_log < 5: continue 283 if part_log < Decimal("4.9"): continue
201 tmppart_log = self._partitions[part_log] 284 tmppart_log = self._partitions[part_log]
202 if free_end < tmppart_log.get_start() and free_end <= tmppart.get_end() and not free_start == -1:
203 partlist.append("Free Space (" + str(free_start) + "-" + str(free_end) + ")")
204 free_start, free_end = self.get_free_space(free_end)
205 newitem = self._device + str(part_log) + ": " + str(tmppart_log.get_start()) + "-" + str(tmppart_log.get_end()) + " logical"
206 partlist.append(newitem) 285 partlist.append(part_log)
207 if ((tmppart_log == None) or (free_start > tmppart_log.get_end())) and free_start < tmppart.get_end():
208 partlist.append("Free Space (" + str(free_start) + "-" + str(free_end) + ") logical")
209 free_start, free_end = self.get_free_space(free_end)
210 if (tmppart == None) or (free_start > tmppart.get_end()):
211 partlist.append("Free Space (" + str(free_start) + "-" + str(free_end) + ")")
212 return partlist 286 return partlist
213 287
214 def get_install_profile_structure(self): 288 def get_install_profile_structure(self):
215 devdic = {} 289 devdic = {}
216 for part in self._partitions: 290 for part in self._partitions:
217 tmppart = self._partitions[part] 291 tmppart = self._partitions[part]
218 devdic[part] = { 'mb': 0, 'minor': int(part), 'origminor': tmppart.get_orig_minor(), 'start': tmppart.get_start(), 'end': tmppart.get_end(), 'type': tmppart.get_type(), 'mountpoint': tmppart.get_mountpoint(), 'mountopts': tmppart.get_mountopts(), 'format': tmppart.get_format() } 292 devdic[part] = { 'mb': tmppart.get_mb(), 'minor': float(part), 'origminor': tmppart.get_orig_minor(), 'start': tmppart.get_start(), 'end': tmppart.get_end(), 'type': tmppart.get_type(), 'mountpoint': tmppart.get_mountpoint(), 'mountopts': tmppart.get_mountopts(), 'format': tmppart.get_format() }
219 return devdic 293 return devdic
220 294
221 def get_extended_partition(self): 295 def get_extended_partition(self):
222 for part in self._partitions: 296 for part in self._partitions:
223 tmppart = self._partitions[part] 297 tmppart = self._partitions[part]
238 return int(self._geometry['cylinders']) 312 return int(self._geometry['cylinders'])
239 313
240 def get_drive_bytes(self): 314 def get_drive_bytes(self):
241 return int(self._total_bytes) 315 return int(self._total_bytes)
242 316
317 def get_total_mb(self):
318 return self._total_mb
319
243 def get_partitions(self): 320 def get_partitions(self):
244 return self._partitions 321 return self._partitions
245 322
246 def print_partitions(self): 323# def print_partitions(self):
247 for part in self._partitions.keys(): 324# for part in self._partitions.keys():
248 print self._partitions[part].return_info() 325# print self._partitions[part].return_info()
249 326
250 def print_geometry(self): 327 def print_geometry(self):
251 print self._total_bytes, self._geometry 328 print self._total_bytes, self._geometry
252 329
253 def _error(self, message): 330 def _error(self, message):
280 357
281class Partition: 358class Partition:
282 "Class representing a single partition within a Device object" 359 "Class representing a single partition within a Device object"
283 360
284 _device = None 361 _device = None
285 _minor = None 362 _minor = 0
286 _orig_minor = "" 363 _orig_minor = 0
287 _bootflag = None
288 _start = None 364 _start = 0
289 _end = None 365 _end = 0
290 _blocks = None
291 _type = None 366 _type = None
292 _mountpoint = None 367 _mountpoint = None
293 _mountopts = None 368 _mountopts = None
294 _format = None 369 _format = None
295 _resizeable = None 370 _resizeable = None
296 _min_sectors_for_resize = 0 371 _min_sectors_for_resize = 0
372 _mb = 0
297 373
298 def __init__(self, device, minor, bootflag, start, end, blocks, type, mountpoint='', mountopts='', format=True, existing=False): 374 def __init__(self, device, minor, mb, start, end, type, mountpoint='', mountopts='', format=True, existing=False):
299 self._device = device 375 self._device = device
300 self._minor = int(minor) 376 self._minor = float(minor)
301 if existing: self._orig_minor = int(minor) 377 if existing: self._orig_minor = int(minor)
302 self._bootflag = bootflag
303 self._start = int(start) 378 self._start = int(start)
304 self._end = int(end) 379 self._end = int(end)
305 self._blocks = int(blocks)
306 if type == "": type = "unknown" 380 self._type = type or "unknown"
307 self._type = type
308 self._mountpoint = mountpoint 381 self._mountpoint = mountpoint
309 self._mountopts = mountopts 382 self._mountopts = mountopts
310 self._format = format 383 self._format = format
311 if blocks == 0: 384 self._mb = mb
312 self._blocks = ((self._end - self._start) * self._device.get_cylinder_size()) / 512
313 if existing: 385 if existing:
386 self._orig_minor = self._minor
314 parted_part = device._parted_disk.get_partition(minor) 387 parted_part = device._parted_disk.get_partition(minor)
388 label_type = device._parted_disk.type.name
389 if label_type == "loop":
390 dev_node = device._device
391 else:
392 dev_node = device._device + str(minor)
315 if type == "ntfs": 393 if type == "ntfs":
316 min_bytes = int(commands.getoutput("ntfsresize -f --info " + device._device + str(minor) + " | grep -e '^You might resize' | sed -e 's/You might resize at //' -e 's/ bytes or .\+//'")) 394 min_bytes = int(commands.getoutput("ntfsresize -f --info " + dev_node + " | grep -e '^You might resize' | sed -e 's/You might resize at //' -e 's/ bytes or .\+//'"))
317 self._min_cylinders_for_resize = int(min_bytes / self._device._cylinder_bytes) + 1 395 self._min_cylinders_for_resize = int(min_bytes / self._device._cylinder_bytes) + 1
318 self._resizeable == True 396 self._resizeable == True
319 elif type == "ext2" or type == "ext3": 397 elif type == "ext2" or type == "ext3":
320 block_size = string.strip(commands.getoutput("dumpe2fs -h " + device._device + str(minor) + r" 2>&1 | grep -e '^Block size:' | sed -e 's/^Block size:\s\+//'")) 398 block_size = string.strip(commands.getoutput("dumpe2fs -h " + dev_node + r" 2>&1 | grep -e '^Block size:' | sed -e 's/^Block size:\s\+//'"))
321 free_blocks = string.strip(commands.getoutput("dumpe2fs -h " + device._device + str(minor) + r" 2>&1 | grep -e '^Free blocks:' | sed -e 's/^Free blocks:\s\+//'")) 399 free_blocks = string.strip(commands.getoutput("dumpe2fs -h " + dev_node + r" 2>&1 | grep -e '^Free blocks:' | sed -e 's/^Free blocks:\s\+//'"))
322 free_sec = int(int(block_size) * int(free_blocks) / self._device._sector_bytes) 400 free_sec = int(int(block_size) * int(free_blocks) / self._device._sector_bytes)
323 free_sec = free_sec - 2000 # just to be safe 401 free_sec = free_sec - 2000 # just to be safe
324 self._min_sectors_for_resize = (self._end - self._start + 1) - free_sec 402 self._min_sectors_for_resize = (self._end - self._start + 1) - free_sec
325 self._resizeable == True 403 self._resizeable == True
326 else: 404 else:
327 parted_part = self._device._parted_disk.get_partition(self._minor) 405 parted_part = self._device._parted_disk.get_partition(int(self._minor))
328 try: 406 try:
329 parted_fs = parted_part.geom.file_system_open() 407 parted_fs = parted_part.geom.file_system_open()
330 except: 408 except:
331 self._resizeable = False 409 self._resizeable = False
332 return 410 return
341 return True 419 return True
342 else: 420 else:
343 return False 421 return False
344 422
345 def is_logical(self): 423 def is_logical(self):
346 part = self._device.get_partition_at(self._start, ignore_extended=0) 424 if self._type == "free":
347 if part and self._device._partitions[part].is_extended() and not part == self._minor: 425 if int(self._minor) + Decimal("0.9") == Decimal(str(self._minor)):
426 return True
427 else:
428 return False
429 elif archinfo[self._device._arch]['extended'] and self._minor > 4:
348 return True 430 return True
431 else:
349 return False 432 return False
350 433
351 def get_logicals(self): 434 def get_logicals(self):
352 if not self.is_extended(): 435 if not self.is_extended():
353 return None 436 return None
354 logicals = [] 437 logicals = []
379 self._blocks = ((self._end - self._start) * self._device.get_cylinder_size()) / 512 462 self._blocks = ((self._end - self._start) * self._device.get_cylinder_size()) / 512
380 463
381 def get_end(self): 464 def get_end(self):
382 return int(self._end) 465 return int(self._end)
383 466
467 def get_mb(self):
468 return int(self._mb)
469
470 def set_mb(self, mb):
471 self._mb = int(mb)
472
384 def set_type(self, type): 473 def set_type(self, type):
385 self._type = type 474 self._type = type
386 475
387 def get_type(self): 476 def get_type(self):
388 return self._type 477 return self._type
389 478
390 def get_device(self): 479 def get_device(self):
391 return self._device 480 return self._device
392 481
393 def set_minor(self, minor): 482 def set_minor(self, minor):
394 self._minor = int(minor) 483 self._minor = float(minor)
395 484
396 def get_minor(self): 485 def get_minor(self):
397 return int(self._minor) 486 return float(self._minor)
398 487
399 def set_orig_minor(self, orig_minor): 488 def set_orig_minor(self, orig_minor):
400 self._orig_minor = int(orig_minor) 489 self._orig_minor = int(orig_minor)
401 490
402 def get_orig_minor(self): 491 def get_orig_minor(self):

Legend:
Removed from v.386  
changed lines
  Added in v.501

  ViewVC Help
Powered by ViewVC 1.1.20