Lines Matching refs:self
23 def __init__(self, version, info, fstab=None): argument
24 self.script = []
25 self.mounts = set()
26 self.version = version
27 self.info = info
29 self.fstab = self.info.get("fstab", None)
31 self.fstab = fstab
33 def MakeTemporary(self): argument
37 x = EdifyGenerator(self.version, self.info)
38 x.mounts = self.mounts
69 def AppendScript(self, other): argument
72 self.script.extend(other.script)
74 def AssertOemProperty(self, name, value): argument
85 self.script.append(cmd)
87 def AssertSomeFingerprint(self, *fp): argument
96 self.script.append(cmd)
98 def AssertSomeThumbprint(self, *fp): argument
107 self.script.append(cmd)
109 def AssertOlderBuild(self, timestamp, timestamp_text): argument
112 self.script.append(
118 def AssertDevice(self, device): argument
124 self.script.append(cmd)
126 def AssertSomeBootloader(self, *bootloaders): argument
132 self.script.append(self.WordWrap(cmd))
134 def ShowProgress(self, frac, dur): argument
138 self.script.append("show_progress(%f, %d);" % (frac, int(dur)))
140 def SetProgress(self, frac): argument
144 self.script.append("set_progress(%f);" % (frac,))
146 def PatchCheck(self, filename, *sha1): argument
150 self.script.append(
155 def FileCheck(self, filename, *sha1): argument
158 self.script.append('assert(sha1_check(read_file("%s")' % (filename,) +
162 def CacheFreeSpaceCheck(self, amount): argument
165 self.script.append(('apply_patch_space(%d) || abort("Not enough free space '
168 def Mount(self, mount_point, mount_options_by_format=""): argument
175 fstab = self.fstab
187 self.script.append('mount("%s", "%s", "%s", "%s", "%s");' % (
190 self.mounts.add(p.mount_point)
192 def UnpackPackageDir(self, src, dst): argument
195 self.script.append('package_extract_dir("%s", "%s");' % (src, dst))
197 def Comment(self, comment): argument
199 self.script.append("")
201 self.script.append("# " + i)
202 self.script.append("")
204 def Print(self, message): argument
206 self.script.append('ui_print("%s");' % (message,))
208 def TunePartition(self, partition, *options): argument
209 fstab = self.fstab
214 self.script.append(
219 def FormatPartition(self, partition): argument
223 fstab = self.fstab
226 self.script.append('format("%s", "%s", "%s", "%s", "%s");' %
230 def WipeBlockDevice(self, partition): argument
233 fstab = self.fstab
234 size = self.info.get(partition.lstrip("/") + "_size", None)
237 self.script.append('wipe_block_device("%s", %s);' % (device, size))
239 def DeleteFiles(self, file_list): argument
244 self.script.append(self.WordWrap(cmd))
246 def DeleteFilesIfNotMatching(self, file_list): argument
253 self.script.append(self.WordWrap(cmd))
255 def RenameFile(self, srcfile, tgtfile): argument
257 if self.info.get("update_rename_support", False):
258 self.script.append('rename("%s", "%s");' % (srcfile, tgtfile))
262 def SkipNextActionIfTargetExists(self, tgtfile, tgtsha1): argument
267 self.script.append(self.WordWrap(cmd))
269 def ApplyPatch(self, srcfile, tgtfile, tgtsize, tgtsha1, *patchpairs): argument
281 self.script.append(self.WordWrap(cmd))
283 def WriteRawImage(self, mount_point, fn, mapfn=None): argument
287 fstab = self.fstab
293 self.script.append(
299 self.script.append(
302 self.script.append(
308 def SetPermissions(self, fn, uid, gid, mode, selabel, capabilities): argument
310 if not self.info.get("use_set_metadata", False):
311 self.script.append('set_perm(%d, %d, 0%o, "%s");' % (uid, gid, mode, fn))
320 self.script.append(cmd)
322 def SetPermissionsRecursive(self, fn, uid, gid, dmode, fmode, selabel, argument
325 if not self.info.get("use_set_metadata", False):
326 self.script.append('set_perm_recursive(%d, %d, 0%o, 0%o, "%s");'
337 self.script.append(cmd)
339 def MakeSymlinks(self, symlink_list): argument
348 self.script.append(self.WordWrap(cmd))
350 def AppendExtra(self, extra): argument
352 self.script.append(extra)
354 def Unmount(self, mount_point): argument
355 self.script.append('unmount("%s");' % mount_point)
356 self.mounts.remove(mount_point)
358 def UnmountAll(self): argument
359 for p in sorted(self.mounts):
360 self.script.append('unmount("%s");' % (p,))
361 self.mounts = set()
363 def AddToZip(self, input_zip, output_zip, input_path=None): argument
369 self.UnmountAll()
372 "\n".join(self.script) + "\n")