• Home
  • Raw
  • Download

Lines Matching refs:self

23   def __init__(self, version, info, fstab=None):  argument
24 self.script = []
25 self.mounts = set()
26 self._required_cache = 0
27 self.version = version
28 self.info = info
30 self.fstab = self.info.get("fstab", None)
32 self.fstab = fstab
35 def required_cache(self): argument
37 return self._required_cache
67 def AppendScript(self, other): argument
70 self.script.extend(other.script)
72 def AssertOemProperty(self, name, values, oem_no_mount): argument
94 self.script.append(cmd)
96 def AssertSomeFingerprint(self, *fp): argument
105 self.script.append(cmd)
107 def AssertSomeThumbprint(self, *fp): argument
116 self.script.append(cmd)
118 def AssertFingerprintOrThumbprint(self, fp, tp): argument
127 self.script.append(cmd)
129 def AssertOlderBuild(self, timestamp, timestamp_text): argument
132 self.script.append(
138 def AssertDevice(self, device): argument
144 self.script.append(cmd)
146 def AssertSomeBootloader(self, *bootloaders): argument
152 self.script.append(self.WordWrap(cmd))
154 def ShowProgress(self, frac, dur): argument
158 self.script.append("show_progress(%f, %d);" % (frac, int(dur)))
160 def SetProgress(self, frac): argument
164 self.script.append("set_progress(%f);" % (frac,))
166 def PatchCheck(self, filename, *sha1): # pylint: disable=unused-argument argument
178 self.PatchPartitionCheck(target, source)
180 def PatchPartitionCheck(self, target, source): argument
186 self._CheckSecondTokenNotSlotSuffixed(target, "PatchPartitionExprCheck")
187 self._CheckSecondTokenNotSlotSuffixed(source, "PatchPartitionExprCheck")
188 self.PatchPartitionExprCheck('"%s"' % target, '"%s"' % source)
190 def PatchPartitionExprCheck(self, target_expr, source_expr): argument
204 self.script.append(self.WordWrap((
212 def CacheFreeSpaceCheck(self, amount): argument
215 self._required_cache = max(self._required_cache, amount)
216 self.script.append(('apply_patch_space(%d) || abort("E%d: Not enough free '
221 def Mount(self, mount_point, mount_options_by_format=""): argument
228 fstab = self.fstab
240 self.script.append('mount("%s", "%s", %s, "%s", "%s");' % (
242 self._GetSlotSuffixDeviceForEntry(p),
244 self.mounts.add(p.mount_point)
246 def Comment(self, comment): argument
248 self.script.append("")
250 self.script.append("# " + i)
251 self.script.append("")
253 def Print(self, message): argument
255 self.script.append('ui_print("%s");' % (message,))
257 def TunePartition(self, partition, *options): argument
258 fstab = self.fstab
263 self.script.append(
266 self._GetSlotSuffixDeviceForEntry(p),
269 def FormatPartition(self, partition): argument
273 fstab = self.fstab
276 self.script.append('format("%s", "%s", %s, "%s", "%s");' %
278 self._GetSlotSuffixDeviceForEntry(p),
281 def WipeBlockDevice(self, partition): argument
284 fstab = self.fstab
285 size = self.info.get(partition.lstrip("/") + "_size", None)
286 device = self._GetSlotSuffixDeviceForEntry(fstab[partition])
288 self.script.append('wipe_block_device(%s, %s);' % (device, size))
290 def ApplyPatch(self, srcfile, tgtfile, tgtsize, tgtsha1, *patchpairs): argument
318 self.PatchPartition(target, source, patch)
320 def PatchPartition(self, target, source, patch): argument
331 self._CheckSecondTokenNotSlotSuffixed(target, "PatchPartitionExpr")
332 self._CheckSecondTokenNotSlotSuffixed(source, "PatchPartitionExpr")
333 self.PatchPartitionExpr('"%s"' % target, '"%s"' % source, '"%s"' % patch)
335 def PatchPartitionExpr(self, target_expr, source_expr, patch_expr): argument
349 self.script.append(self.WordWrap((
359 def _GetSlotSuffixDeviceForEntry(self, entry=None): argument
375 def _CheckSecondTokenNotSlotSuffixed(self, s, fn): argument
378 if self.fstab:
379 entry = common.GetEntryForDevice(self.fstab, lst[1])
384 def WriteRawImage(self, mount_point, fn, mapfn=None): argument
388 fstab = self.fstab
392 device = self._GetSlotSuffixDeviceForEntry(p)
397 self.script.append(
400 self.script.append(
406 def AppendExtra(self, extra): argument
408 self.script.append(extra)
410 def Unmount(self, mount_point): argument
411 self.script.append('unmount("%s");' % mount_point)
412 self.mounts.remove(mount_point)
414 def UnmountAll(self): argument
415 for p in sorted(self.mounts):
416 self.script.append('unmount("%s");' % (p,))
417 self.mounts = set()
419 def AddToZip(self, input_zip, output_zip, input_path=None): argument
425 self.UnmountAll()
428 "\n".join(self.script) + "\n")