From 0fcb0082328857bbef04b9727378223ddca73e58 Mon Sep 17 00:00:00 2001 From: Markus Birth Date: Thu, 5 Oct 2017 17:59:08 +0200 Subject: [PATCH] Make timeout for check configurable. --- tclcheck_allfull.py | 1 + tclcheck_allota.py | 1 + tcllib.py | 3 ++- 3 files changed, 4 insertions(+), 1 deletion(-) diff --git a/tclcheck_allfull.py b/tclcheck_allfull.py index 75273a7..5cd09ce 100755 --- a/tclcheck_allfull.py +++ b/tclcheck_allfull.py @@ -16,6 +16,7 @@ fc.mode = fc.MODE_FULL # CLTP = 10 (only show actual updates or HTTP 206) / 2010 (always show latest version for MODE_FULL) #fc.cltp = 10 fc.cltp = 2010 +fc.timeout = 20 print("List of latest FULL firmware by PRD:") diff --git a/tclcheck_allota.py b/tclcheck_allota.py index 9ebf978..dac3ddb 100755 --- a/tclcheck_allota.py +++ b/tclcheck_allota.py @@ -14,6 +14,7 @@ fc.serid = "3531510" #fc.osvs = "7.1.1" fc.mode = fc.MODE_OTA fc.cltp = 10 +fc.timeout = 20 force_ver = False force_ver_text = "" diff --git a/tcllib.py b/tcllib.py index 855824f..41ac65a 100644 --- a/tcllib.py +++ b/tcllib.py @@ -55,6 +55,7 @@ class FotaCheck: self.cktp = self.CKTP_CHECKMANUAL self.rtd = self.RTD_UNROOTED self.chnl = self.CHNL_WIFI + self.timeout = 10 self.reset_session() def reset_session(self): @@ -99,7 +100,7 @@ class FotaCheck: params["chnl"] = self.chnl #params["osvs"] = self.osvs - req = self.sess.get(url, params=params, timeout=10) + req = self.sess.get(url, params=params, timeout=self.timeout) if req.status_code == 200: return req.text elif req.status_code == 204: