[ui] feature: themes

This commit is contained in:
Vinicius Moreira
2020-11-27 15:52:57 -03:00
parent 813c812030
commit 60228eec97
176 changed files with 11941 additions and 2985 deletions

View File

@@ -1,12 +1,20 @@
import http.client as http_client
def is_available() -> bool:
conn = http_client.HTTPConnection("www.google.com", timeout=5)
try:
conn.request("HEAD", "/")
conn.close()
return True
except:
conn.close()
return False
class InternetChecker:
def __init__(self, offline: bool):
self.offline = offline
def is_available(self) -> bool:
if self.offline:
return False
conn = http_client.HTTPConnection("www.google.com", timeout=5)
try:
conn.request("HEAD", "/")
conn.close()
return True
except:
conn.close()
return False