From 3a2025c63ad574b972c904261bba125500e73cde Mon Sep 17 00:00:00 2001 From: Markus Birth Date: Fri, 1 Sep 2017 17:59:05 +0200 Subject: [PATCH] Added script to check for all PRDs from prds.txt. --- tclcheck_all.py | 33 +++++++++++++++++++++++++++++++++ 1 file changed, 33 insertions(+) create mode 100644 tclcheck_all.py diff --git a/tclcheck_all.py b/tclcheck_all.py new file mode 100644 index 0000000..b3beeae --- /dev/null +++ b/tclcheck_all.py @@ -0,0 +1,33 @@ +#!/usr/bin/env python3 +# -*- coding: utf-8 -*- + +# pylint: disable=C0111,C0326 + +import tcllib +import sys +from requests.exceptions import RequestException + +fc = tcllib.FotaCheck() +fc.serid = "3531510" +fc.fv = "AAM481" +#fc.osvs = "7.1.1" +fc.mode = fc.MODE_FULL +fc.cltp = 10 +#fc.cltp = 2010 + +print("List of latest {} firmware by PRD:".format("FULL" if fc.mode == fc.MODE_FULL else "OTA")) + +with open("prds.txt", "r") as afile: + prdx = afile.read() + prds = list(filter(None, prdx.split("\n"))) +for prdline in prds: + prd, model = prdline.split(" ", 1) + try: + fc.reset_session() + fc.curef = prd + check_xml = fc.do_check() + curef, fv, tv, fw_id, fileid, fn, fsize, fhash = fc.parse_check(check_xml) + print("{}: {} ({})".format(prd, tv, model)) + except (SystemExit, RequestException): + print("{} ({}) failed.".format(prd, model)) + continue