Lines Matching refs:self
54 def __init__(self, str): argument
56 (self.disk, self.part) = str.split(",", 2)
58 self.disk = str
59 self.part = None
61 def __repr__(self): argument
62 if self.part is not None:
63 return "d%dp%d" %(self.disk, self.part)
65 return "d%d" %(self.disk,)
67 def get_disk(self): argument
68 return self._disk
69 def set_disk(self, val): argument
73 self._disk = ord(disk)-ord('a')
75 self._disk = int(val[2:])
78 def get_part(self): argument
79 return self._part
80 def set_part(self, val): argument
82 self._part = val
89 self._part = int(val)
93 def __init__(self, title, lines): argument
94 self.reset(lines)
95 self.title = title.strip()
97 def __repr__(self): argument
102 " initrd: %s\n" %(self.title, self.root, self.kernel,
103 self.args, self.initrd))
104 def _parse(self, lines): argument
106 self.set_from_line(line)
108 def reset(self, lines): argument
109 self._root = self._initrd = self._kernel = self._args = None
110 self.lines = []
111 self._parse(lines)
113 def set_root(self, val): argument
114 self._root = GrubDiskPart(val)
115 def get_root(self): argument
116 return self._root
119 def set_kernel(self, val): argument
121 self._kernel = get_path(val)
122 self._args = None
125 self._kernel = get_path(kernel)
126 self._args = args
127 def get_kernel(self): argument
128 return self._kernel
129 def get_args(self): argument
130 return self._args
134 def set_initrd(self, val): argument
135 self._initrd = get_path(val)
136 def get_initrd(self): argument
137 return self._initrd
141 def __init__(self, title, lines): argument
142 _GrubImage.__init__(self, title, lines)
144 def set_from_line(self, line, replace = None): argument
147 if com in self.commands:
148 if self.commands[com] is not None:
149 setattr(self, self.commands[com], arg.strip())
157 self.lines.append(line)
159 self.lines.pop(replace)
160 self.lines.insert(replace, line)
171 def __init__(self, fn = None): argument
172 self.filename = fn
173 self.images = []
174 self.timeout = -1
175 self._default = 0
176 self.passwordAccess = True
177 self.passExc = None
180 self.parse()
182 def parse(self, buf = None): argument
185 def hasPasswordAccess(self): argument
186 return self.passwordAccess
188 def setPasswordAccess(self, val): argument
189 self.passwordAccess = val
191 def hasPassword(self): argument
192 return hasattr(self, 'password')
194 def checkPassword(self, password): argument
196 if not self.hasPassword():
199 pwd = getattr(self, 'password').split()
208 self.passExc = "Can't verify password: %s" % str(e)
217 def set(self, line): argument
219 if com in self.commands:
220 if self.commands[com] is not None:
221 setattr(self, self.commands[com], arg.strip())
227 def add_image(self, image): argument
228 self.images.append(image)
230 def _get_default(self): argument
231 return self._default
232 def _set_default(self, val): argument
234 self._default = 0
237 self._default = int(val)
240 self._default = 0
242 if self._default < 0:
246 def set_splash(self, val): argument
247 self._splash = get_path(val)
248 def get_splash(self): argument
249 return self._splash
266 def __init__(self, fn = None): argument
267 _GrubConfigFile.__init__(self,fn)
269 def new_image(self, title, lines): argument
272 def parse(self, buf = None): argument
274 if self.filename is None:
277 f = open(self.filename, 'r')
296 self.add_image(GrubImage(title, img))
306 if com in self.commands:
307 if self.commands[com] is not None:
308 setattr(self, self.commands[com], arg.strip())
315 self.add_image(GrubImage(title, img))
317 if self.hasPassword():
318 self.setPasswordAccess(False)
329 def __init__(self, title, lines): argument
330 _GrubImage.__init__(self, title, lines)
332 def set_from_line(self, line, replace = None): argument
338 if com in self.commands:
339 if self.commands[com] is not None:
340 setattr(self, self.commands[com], arg.strip())
350 self.lines.append(line)
352 self.lines.pop(replace)
353 self.lines.insert(replace, line)
365 def __init__(self, fn = None): argument
366 _GrubConfigFile.__init__(self, fn)
368 def new_image(self, title, lines): argument
371 def parse(self, buf = None): argument
373 if self.filename is None:
376 f = open(self.filename, 'r')
425 self.add_image(Grub2Image(title, img))
438 if com in self.commands:
439 if self.commands[com] is not None:
444 setattr(self, self.commands[com], arg_strip)
455 if self.hasPassword():
456 self.setPasswordAccess(False)