Nafai77 (owner)

Revisions

gist: 209496 Download_button fork
public
Public Clone URL: git://gist.github.com/209496.git
Embed All Files: show embed
Python #
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
    def lineReceived(self, line):
        content = line[output.PREFIX_LENGTH:]
 
        if not content.endswith("\n"):
            content += "\n"
 
        if line.startswith(output.STDERR_PREFIX):
            if self.filterStderrLine(content):
                self.filteredError = True
            self.error_log.write(content)
        elif line.startswith(output.KERNEL_PREFIX):
            if self.filterKernelLine(content):
                self.filteredError = True
            self.kernel_log.write(content)
        elif line.startswith(output.STDOUT_PREFIX):
            if self.filterStdoutLine(content):
                self.filteredError = True
            self.output_log.write(content)
        elif line.startswith(output.FINISHED_PREFIX):
            self.exit_code = int(content)
        elif line.startswith(output.ERROR_PREFIX):
            if self.filterErrorLine(content):
                self.filteredError = True
            # Possibly call errback here
            log.err(content)
        else:
            log.err("Output from daemon not prefixed: %s" % line)