• 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.script.append(self.WordWrap((
193 def CacheFreeSpaceCheck(self, amount): argument
196 self._required_cache = max(self._required_cache, amount)
197 self.script.append(('apply_patch_space(%d) || abort("E%d: Not enough free '
202 def Mount(self, mount_point, mount_options_by_format=""): argument
209 fstab = self.fstab
221 self.script.append('mount("%s", "%s", "%s", "%s", "%s");' % (
224 self.mounts.add(p.mount_point)
226 def Comment(self, comment): argument
228 self.script.append("")
230 self.script.append("# " + i)
231 self.script.append("")
233 def Print(self, message): argument
235 self.script.append('ui_print("%s");' % (message,))
237 def TunePartition(self, partition, *options): argument
238 fstab = self.fstab
243 self.script.append(
248 def FormatPartition(self, partition): argument
252 fstab = self.fstab
255 self.script.append('format("%s", "%s", "%s", "%s", "%s");' %
259 def WipeBlockDevice(self, partition): argument
262 fstab = self.fstab
263 size = self.info.get(partition.lstrip("/") + "_size", None)
266 self.script.append('wipe_block_device("%s", %s);' % (device, size))
268 def ApplyPatch(self, srcfile, tgtfile, tgtsize, tgtsha1, *patchpairs): argument
296 self.PatchPartition(target, source, patch)
298 def PatchPartition(self, target, source, patch): argument
300 self.script.append(self.WordWrap((
307 def WriteRawImage(self, mount_point, fn, mapfn=None): argument
311 fstab = self.fstab
319 self.script.append(
322 self.script.append(
328 def AppendExtra(self, extra): argument
330 self.script.append(extra)
332 def Unmount(self, mount_point): argument
333 self.script.append('unmount("%s");' % mount_point)
334 self.mounts.remove(mount_point)
336 def UnmountAll(self): argument
337 for p in sorted(self.mounts):
338 self.script.append('unmount("%s");' % (p,))
339 self.mounts = set()
341 def AddToZip(self, input_zip, output_zip, input_path=None): argument
347 self.UnmountAll()
350 "\n".join(self.script) + "\n")