import string


class Decoder(object):
    decoder_name = ""
    decoder_version = 1
    decoder_author = ""
    decoder_description = ""
    file_info = object

    def set_file(self, file_info):
        self.file_info = file_info

    def get_config(self):
        pass


class PreProcessor(object):
    preprocessor_name = ""
    preprocessor_version = 1
    preprocessor_author = ""
    preprocessor_description = ""
    file_info = object

    def set_file(self, file_info):
        self.file_info = file_info

    def pre_process(self):
        pass


def string_printable(line):
    line = str(line)
    new_line = ''
    for c in line:
        if c in string.printable:
            new_line += c
        else:
            new_line += '\\x' + c.encode("utf-8").hex()
    return new_line


