MCPcopy Create free account
hub / github.com/couchbase/sync_gateway / _process_file

Method _process_file

tools/tasks.py:43–58  ·  view source on GitHub ↗
(self, ifile, ofile, processor)

Source from the content-addressed store, hash-verified

41 self.regular_log = RegularLogProcessor(salt)
42
43 def _process_file(self, ifile, ofile, processor):
44 try:
45 with get_open_fn(ifile)(
46 ifile,
47 "rb",
48 ) as inp:
49 with get_open_fn(ofile)(
50 ofile,
51 "wb+",
52 ) as out:
53 # Write redaction header
54 out.write(self.couchbase_log.do(b"RedactLevel"))
55 for line in inp:
56 out.write(processor.do(line))
57 except IOError as e:
58 log("I/O error(%s): %s" % (e.errno, e.strerror))
59
60 def redact_file(self, name, ifile):
61 _, filename = os.path.split(name)

Callers 1

redact_fileMethod · 0.95

Calls 3

get_open_fnFunction · 0.85
logFunction · 0.85
doMethod · 0.45

Tested by

no test coverage detected