Lines Matching defs:self
86 def __init__(self):
87 self.path = None
88 self.isdir = False
89 self.target = None
90 self.owner = None
91 self.group = None
92 self.mode = None
93 self.hardkey = None
94 self.hardpaths = set()
95 self.editable = False
97 def name(self):
100 if self.isdir:
103 if self.target:
106 if self.hardkey:
111 def checkmodes(self, modechecks):
118 t = self.name()
121 m = int(self.mode, 8)
122 o = self.owner
123 p = self.path
135 e = self.editable
161 def __ne__(self, other):
175 if isinstance(self, ActionInfo):
176 lhs = self
180 rhs = self
245 def __str__(self):
251 name = self.name()
255 out += " " + label + str(getattr(self, member))
259 def protostr(self):
266 mode = self.mode
267 owner = self.owner
268 group = self.group
270 name = self.name()
277 target = self.target
283 (ftype, self.path, target, mode, owner, group, 0, 1)
294 def __init__(self, action):
295 FileInfo.__init__(self)
301 self.path = action.attrs["path"]
304 self.owner = action.attrs["owner"]
305 self.group = action.attrs["group"]
306 self.mode = action.attrs["mode"]
307 self.hash = action.hash
309 self.editable = True
312 self.target = os.path.normpath(target)
313 self.mediator = action.attrs.get("mediator")
315 self.owner = action.attrs["owner"]
316 self.group = action.attrs["group"]
317 self.mode = action.attrs["mode"]
318 self.isdir = True
321 self.hardkey = target
322 self.hardpaths.add(target)
339 def __init__(self, path, mode):
340 Exception.__init__(self)
341 self.path = path
342 self.mode = mode
344 def __str__(self):
345 return '%s: unsupported S_IFMT %07o' % (self.path, self.mode)
358 def __init__(self, root=None, path=None):
359 FileInfo.__init__(self)
360 self.path = path
369 self.hash = self.path
371 self.isdir = True
373 self.target = os.path.normpath(os.readlink(path))
374 self.mediator = None
379 self.mode = "%04o" % stat.S_IMODE(mode)
386 self.owner = "owner"
387 self.group = "group"
397 self.hardkey = lstat.st_ino
403 def __init__(self, name):
404 dict.__init__(self)
405 self.name = name
407 def compare(self, other):
410 keys1 = frozenset(list(self.keys()))
419 (self.name, other.name))
421 print(("\t%s" % str(self[path])))
426 (other.name, self.name))
433 if self[path] != other[path]:
437 % (self.name, other.name))
438 print(("%14s %s" % (self.name, self[path])))
449 def __str__(self):
450 return 'bad proto list entry: "%s"' % Exception.__str__(self)
458 def adddir(self, proto, exceptions):
488 # here, FileInfo object comparison can be self contained.
502 self.update(newentries)
504 def addprotolist(self, protolist, exceptions):
554 self.update(newentries)
562 def __init__(self, mfile, error):
563 Exception.__init__(self)
564 self.mfile = mfile
565 self.error = error
567 def __str__(self):
568 return "unable to parse manifest %s: %s" % (self.mfile, self.error)
579 def addmanifest(self, root, mfile, arch, modechecks, exceptions):
636 if path in self:
657 self[path] = ActionInfo(action)
659 modewarnings.update(self[path].checkmodes(modechecks))
667 def adddir(self, mdir, arch, modechecks, exceptions):
674 self.addmanifest(mdir, mfile, arch, modechecks, exceptions)
678 def resolvehardlinks(self):
682 for info in list(self.values()):
685 if tgt in self:
686 tgtinfo = self[tgt]
696 def __init__(self, files, arch):
697 set.__init__(self)
700 self.readexceptionfile(fname, arch)
705 def readexceptionfile(self, efile, arch):
719 self.add(os.path.normpath(exc[0]))