def run_match(self): for target, target_data, matches, db in self.match(): log.default("* %s" % target.user) log.default(" %s" % target_data.path) matches.sort() for match in matches: if not match.is_remote: log.default(" %s" % match.path) else: log.default(" %s:%s" % (match.source, match.path))
def run_view(self): try: timeformat = locale.nl_langinfo(locale.D_T_FMT) # '%a %d %b %Y %T %Z' except: timeformat = "%Y-%m-%d %H:%M:%S" numpadd = len(locale.format("%d", 2 ** 31, True)) for row, db in self.view(): m = "*" if row.mark == 0 else " " h = row.hash s = locale.format("%d", row.size, True) t = time.strftime(timeformat, time.localtime(row.time)) p = row.path log.default( # hash:mark time size path "%s%s %s %*s %s" % (h, m, t, numpadd, s, p) )
def run_schema(self): for x in self.schema(): log.default(x)
def run_hash(self): for target, hash, db in self.hash(): log.default("%s %s" % (hash, target.user))