Exemplo n.º 1
0
 def __repr__(self):
     result = ""
     if self.out_buffer:
         result += decode(self.out_buffer.getvalue())
     if self.err_buffer:
         result += decode(self.err_buffer.getvalue())
     return result.rstrip()
Exemplo n.º 2
0
 def to_string(self):
     result = ''
     if self.out_buffer:
         result += decode(self.out_buffer.getvalue())
     if self.err_buffer:
         result += decode(self.err_buffer.getvalue())
     return result
Exemplo n.º 3
0
def cleaned_output(text, folder=None):
    text = decode(text)
    if not text:
        return text

    result = []
    cwd = os.getcwd()
    for line in text.splitlines():
        line = line.rstrip()
        if should_ignore_output(line):
            continue

        if setupmeta.WINDOWS:
            if " \\_: " not in line:
                line = line.replace("\\", "/")

        if folder:
            line = line.replace(folder, "<target>")

        line = line.replace(cwd, "<target>")
        # Ingore minor change in how missing meta-data warning is phrased...
        line = line.replace(" must be supplied", " should be supplied")
        result.append(line)

    return "\n".join(result).rstrip()
Exemplo n.º 4
0
def cleaned_output(text, folder=None):
    text = decode(text)
    if not text:
        return text
    result = []
    for line in text.splitlines():
        line = line.rstrip()
        if line and all(m not in line for m in IGNORED_OUTPUT):
            if folder:
                line = line.replace(folder, '<target>')
            result.append(line)
    return '\n'.join(result).strip()
Exemplo n.º 5
0
def cleaned_output(text, folder=None):
    text = decode(text)
    if not text:
        return text
    result = []
    for line in text.splitlines():
        line = line.rstrip()
        if setupmeta.WINDOWS:
            if " \_: " not in line:
                line = line.replace("\\", "/")
        if line and not line.startswith("pydev debugger:"):
            if folder:
                line = line.replace(folder, "<target>")
            result.append(line)
    return "\n".join(result).strip()
Exemplo n.º 6
0
def test_decode():
    assert setupmeta.decode(None) is None
    assert setupmeta.decode('') == ''
    assert setupmeta.decode(b'') == ''
Exemplo n.º 7
0
def test_decode():
    assert setupmeta.decode(None) is None
    assert setupmeta.decode("") == ""
    assert setupmeta.decode(b"") == ""