Lines Matching refs:self
20 def __init__(self, lines, path): argument
21 self.reset(lines, path)
23 def __repr__(self): argument
28 " initrd: %s\n" %(self.title, self.root, self.kernel,
29 self.args, self.initrd))
30 def reset(self, lines, path): argument
31 self._initrd = self._kernel = self._readonly = None
32 self._args = ""
33 self.title = ""
34 self.lines = []
35 self.path = path
36 self.root = ""
38 self.set_from_line(line)
40 def set_from_line(self, line, replace = None): argument
45 if com.lower() == "append" and self.kernel is not None:
46 (_,kernel) = self.kernel
59 setattr(self, "kernel", kernel.strip())
61 setattr(self, "initrd", initrd.strip())
70 setattr(self, "initrd", a.replace("initrd=", ""))
73 if com is not None and com in self.commands:
74 if self.commands[com] is not None:
75 setattr(self, self.commands[com], re.sub('^"(.+)"$', r"\1", arg.strip()))
83 self.lines.append(line)
85 self.lines.pop(replace)
86 self.lines.insert(replace, line)
88 def set_kernel(self, val): argument
90 self._kernel = (None,val)
91 self._args = None
94 self._kernel = (None,kernel)
95 self._args = args
96 def get_kernel(self): argument
97 return self._kernel
98 def set_args(self, val): argument
99 self._args = val
100 def get_args(self): argument
101 return self._args
105 def set_initrd(self, val): argument
106 self._initrd = (None,val)
107 def get_initrd(self): argument
108 return self._initrd
111 def set_readonly(self, val): argument
112 self._readonly = 1
113 def get_readonly(self): argument
114 return self._readonly
124 def __init__(self, fn = None): argument
125 self.filename = fn
126 self.images = []
127 self.timeout = -1
128 self._default = 0
131 self.parse()
133 def new_image(self, title, lines): argument
139 def parse(self, buf = None): argument
141 if self.filename is None:
144 f = open(self.filename, 'r')
150 path = os.path.dirname(self.filename)
163 self.add_image(ExtLinuxImage(img, path))
173 if com in self.commands:
174 if self.commands[com] is not None:
175 setattr(self, self.commands[com], arg.strip())
182 self.add_image(ExtLinuxImage(img, path))
184 def hasPassword(self): argument
187 def hasPasswordAccess(self): argument
190 def add_image(self, image): argument
191 self.images.append(image)
193 def _get_default(self): argument
194 for i in range(len(self.images)):
195 if self.images[i].title == self._default:
198 def _set_default(self, val): argument
199 self._default = val