Example #1
0
class FileDestination(DestinationDriver):
    def __init__(self, file_name, **options):
        self.driver_name = "file"
        self.path = Path(tc_parameters.WORKING_DIR, file_name)
        self.io = FileIO(self.path)
        super(FileDestination, self).__init__([self.path], options)

    def get_path(self):
        return self.path

    def read_log(self):
        return self.read_logs(1)[0]

    def read_logs(self, counter):
        return self.io.read_number_of_lines(counter)

    def read_until_logs(self, logs):
        return self.io.read_until_lines(logs)
Example #2
0
class ExampleDestination(DestinationDriver):
    def __init__(self, filename, **options):
        self.driver_name = "example-destination"
        self.path = Path(tc_parameters.WORKING_DIR, filename)
        self.io = FileIO(self.path)
        super(ExampleDestination, self).__init__(
            None, dict({"filename": self.path.resolve()}, **options))

    def get_path(self):
        return self.path

    def read_log(self):
        return self.read_logs(1)[0]

    def read_logs(self, counter):
        return self.io.read_number_of_lines(counter)

    def read_until_logs(self, logs):
        return self.io.read_until_lines(logs)