From f78e57f8376aad262a6ac75da360a8e9678d1483 Mon Sep 17 00:00:00 2001 From: CustomIcon Date: Sun, 21 Apr 2024 12:08:37 +0000 Subject: [PATCH] added requests lib for network communication --- modules/settings/functions/config.py | 1 + requirements.txt | 1 + utils/network.py | 5 +++-- 3 files changed, 5 insertions(+), 2 deletions(-) diff --git a/modules/settings/functions/config.py b/modules/settings/functions/config.py index 9dd82ce..5f05038 100644 --- a/modules/settings/functions/config.py +++ b/modules/settings/functions/config.py @@ -8,6 +8,7 @@ phone = email = nid = theme = light +ignore_network = 0 [apps] dhiraagu = 0 diff --git a/requirements.txt b/requirements.txt index 40e195a..5933cca 100644 --- a/requirements.txt +++ b/requirements.txt @@ -1 +1,2 @@ flet==0.22.* +requests diff --git a/utils/network.py b/utils/network.py index 9f28ce6..c6160ed 100644 --- a/utils/network.py +++ b/utils/network.py @@ -1,10 +1,11 @@ import requests + def checkInternet(): try: requests.get( - "https://rest.ensembl.org/info/ping?content-type=application/json", + 'https://rest.ensembl.org/info/ping?content-type=application/json', ) return True except requests.ConnectionError: - return False \ No newline at end of file + return False