From e6625df4a7ff66da22cab1c74e80f393a9e4cd02 Mon Sep 17 00:00:00 2001 From: Hans Erik van Elburg Date: Fri, 27 Dec 2019 15:18:35 +0100 Subject: [PATCH] add documentation to FileTailReader --- dsmr_parser/clients/filereader.py | 19 +++++++++++++++++++ 1 file changed, 19 insertions(+) diff --git a/dsmr_parser/clients/filereader.py b/dsmr_parser/clients/filereader.py index 12164f2..3869a8a 100644 --- a/dsmr_parser/clients/filereader.py +++ b/dsmr_parser/clients/filereader.py @@ -124,6 +124,25 @@ class FileInputReader(object): class FileTailReader(object): + """ + Filereader to read and parse raw telegram strings from the tail of a + given file and instantiate Telegram objects for each read telegram. + Usage python script "syphon_smartmeter_readings_stdin.py": + from dsmr_parser import telegram_specifications + from dsmr_parser.clients.filereader import FileTailReader + + if __name__== "__main__": + + infile = '/data/smartmeter/readings.txt' + + filetail_reader = FileTailReader( + file = infile, + telegram_specification = telegram_specifications.V5 + ) + + for telegram in filetail_reader.read_as_object(): + print(telegram) + """ def __init__(self, file, telegram_specification): self._file = file