Commit 084f022c authored by Bilal Elmoussaoui's avatar Bilal Elmoussaoui

ProviderImage: rewrite

Rewrite parts of the favicon downloader
Fix major issues on provider image
parent 5e92858c
{
"app-id" : "com.github.bilelmoussaoui.AuthenticatorDevel",
"runtime" : "org.gnome.Platform",
"runtime-version" : "master",
"sdk" : "org.gnome.Sdk",
"command" : "authenticator",
"tags" : [
"app-id": "com.github.bilelmoussaoui.AuthenticatorDevel",
"runtime": "org.gnome.Platform",
"runtime-version": "master",
"sdk": "org.gnome.Sdk",
"command": "authenticator",
"tags": [
"devel",
"development",
"nightly"
],
"desktop-file-name-prefix" : "(Development) ",
"finish-args" : [
"desktop-file-name-prefix": "(Development) ",
"finish-args": [
"--share=ipc",
"--socket=x11",
"--socket=wayland",
......@@ -26,210 +26,194 @@
"--env=ZBAR_PATH=/app/lib/libzbar.so",
"--own-name=com.github.bilelmoussaoui.AuthenticatorDevel.SearchProvider"
],
"modules" : [
{
"name" : "zbar",
"config-opts" : [
"--without-qt",
"--without-gtk",
"--without-xv",
"--without-imagemagick",
"--disable-video",
"--without-python",
"--enable-codes=qrcode"
],
"sources" : [
{
"type" : "git",
"url" : "git://git.linuxtv.org/zbar.git",
"commit" : "14900c67eccfb97e152063296f20cd32aa787578"
},
{
"type" : "script",
"dest-filename" : "autogen.sh",
"commands" : [
"autoreconf -vfi -W none"
]
}
]
},
{
"name" : "pyotp",
"buildsystem" : "simple",
"build-commands" : [
"modules": [{
"name": "pyzbar",
"buildsystem": "simple",
"build-commands": [
"python3 setup.py install --prefix=/app"
],
"ensure-writable" : [
"ensure-writable": [
"/lib/python*/site-packages/easy-install.pth",
"/lib/python*/site-packages/setuptools.pth",
"/app/lib/python*/site-packages/easy-install.pth",
"/app/lib/python*/site-packages/setuptools.pth"
],
"sources" : [
"sources": [{
"type": "archive",
"url": "https://github.com/NaturalHistoryMuseum/pyzbar/archive/v0.1.7.tar.gz",
"sha256": "4dbbece533650f2aeb6c8d1f41cf424614d2877d7331c48a9eed35ae9f949626"
},
{
"type" : "archive",
"url" : "https://pypi.python.org/packages/ac/0c/bd96508e36956ae627e527a7a7fba486865a738b4682e7290cd0e7c34f52/pyotp-2.2.4.tar.gz#md5=16cb1a08d38777ca74b5e9c7803810b6",
"sha256" : "92c3973ba91273e7e4a7fd4a1020ae4b050ccd2e149b554911e1b45ca458ac2d"
"type": "patch",
"path": "pyzbar.patch"
}
]
],
"modules": [{
"name": "zbar",
"config-opts": [
"--without-qt",
"--without-gtk",
"--without-xv",
"--without-imagemagick",
"--disable-video",
"--without-python",
"--enable-codes=qrcode"
],
"sources": [{
"type": "git",
"url": "git://git.linuxtv.org/zbar.git",
"commit": "14900c67eccfb97e152063296f20cd32aa787578"
},
{
"type": "script",
"dest-filename": "autogen.sh",
"commands": [
"autoreconf -vfi -W none"
]
}
]
}]
},
{
"name" : "python-pillow",
"buildsystem" : "simple",
"build-options" : {
"arch" : {
"i386" : {
"env" : {
"MAX_CONCURRENCY" : "1"
"name": "python-pillow",
"buildsystem": "simple",
"build-options": {
"arch": {
"i386": {
"env": {
"MAX_CONCURRENCY": "1"
}
},
"arm" : {
"env" : {
"MAX_CONCURRENCY" : "1"
"arm": {
"env": {
"MAX_CONCURRENCY": "1"
}
}
}
},
"ensure-writable" : [
"ensure-writable": [
"/lib/python*/site-packages/easy-install.pth",
"/lib/python*/site-packages/setuptools.pth",
"/app/lib/python*/site-packages/easy-install.pth",
"/app/lib/python*/site-packages/setuptools.pth"
],
"build-commands" : [
"build-commands": [
"python3 setup.py install --prefix=/app"
],
"sources" : [
{
"type" : "archive",
"url" : "https://github.com/python-pillow/Pillow/archive/5.0.0.tar.gz",
"sha256" : "e85301adaa827b9f29ab518eff99d5719e572ca5f369866ebfe57a92e7135aec"
"sources": [{
"type": "archive",
"url": "https://github.com/python-pillow/Pillow/archive/6.0.0.tar.gz",
"sha256": "f0babf5d7072ea9923a3950cd7ea41b0008429b16584de7d95cc5550a2806cda"
},
{
"type" : "shell",
"commands" : [
"type": "shell",
"commands": [
"sed -i 's/if not platform_/if not dirs/' setup.py"
]
}
]
},
{
"name" : "beautifulsoup4",
"buildsystem" : "simple",
"build-commands" : [
"python3 setup.py install --prefix=/app"
],
"ensure-writable" : [
"/lib/python*/site-packages/easy-install.pth",
"/lib/python*/site-packages/setuptools.pth",
"/app/lib/python*/site-packages/easy-install.pth",
"/app/lib/python*/site-packages/setuptools.pth"
],
"sources" : [
{
"type" : "archive",
"url" : "https://www.crummy.com/software/BeautifulSoup/bs4/download/4.7/beautifulsoup4-4.7.0.tar.gz",
"sha256" : "e394827904cc4923f443e8dd2e9968343669c8e1ad7a8d62d7541e780884acb8"
}
],
"modules" : [
{
"name" : "soupsieve",
"buildsystem" : "simple",
"build-commands" : [
"python3 setup.py install --prefix=/app"
],
"ensure-writable" : [
"/lib/python*/site-packages/easy-install.pth",
"/lib/python*/site-packages/setuptools.pth",
"/app/lib/python*/site-packages/easy-install.pth",
"/app/lib/python*/site-packages/setuptools.pth"
],
"sources" : [
{
"type" : "archive",
"url" : "https://files.pythonhosted.org/packages/ad/30/4bed751373bef51a7a1897a31bfbd2df8a7e3a7e81e080aef118fe4fc486/soupsieve-1.6.1.tar.gz",
"sha256" : "f7d99b41637be2f249dfcc06ae93c13fcbbdfa7bb68b15308cdd0734e58146f1"
}
]
}
]
},
{
"name" : "python3-requests",
"buildsystem" : "simple",
"build-commands" : [
"pip3 install --no-index --find-links=\"file://${PWD}\" --prefix=${FLATPAK_DEST} requests"
"name": "python3-pyfavicon",
"buildsystem": "simple",
"build-commands": [
"pip3 install --no-index --find-links=\"file://${PWD}\" --prefix=${FLATPAK_DEST} pyfavicon"
],
"sources" : [
{
"type" : "file",
"url" : "https://files.pythonhosted.org/packages/ad/13/eb56951b6f7950cadb579ca166e448ba77f9d24efc03edd7e55fa57d04b7/idna-2.8.tar.gz",
"sha256" : "c357b3f628cf53ae2c4c05627ecc484553142ca23264e593d327bcde5e9c3407"
},
{
"type" : "file",
"url" : "https://files.pythonhosted.org/packages/52/2c/514e4ac25da2b08ca5a464c50463682126385c4272c18193876e91f4bc38/requests-2.21.0.tar.gz",
"sha256" : "502a824f31acdacb3a35b6690b5fbf0bc41d63a24a45c4004352b0242707598e"
},
{
"type" : "file",
"url" : "https://files.pythonhosted.org/packages/55/54/3ce77783acba5979ce16674fc98b1920d00b01d337cfaaf5db22543505ed/certifi-2018.11.29.tar.gz",
"sha256" : "47f9c83ef4c0c621eaef743f133f09fa8a74a9b75f037e8624f83bd1b6626cb7"
},
{
"type" : "file",
"url" : "https://files.pythonhosted.org/packages/b1/53/37d82ab391393565f2f831b8eedbffd57db5a718216f82f1a8b4d381a1c1/urllib3-1.24.1.tar.gz",
"sha256" : "de9529817c93f27c8ccbfead6985011db27bd0ddfcdb2d86f3f663385c6a9c22"
},
{
"type" : "file",
"url" : "https://files.pythonhosted.org/packages/fc/bb/a5768c230f9ddb03acc9ef3f0d4a3cf93462473795d18e9535498c8f929d/chardet-3.0.4.tar.gz",
"sha256" : "84ab92ed1c4d4f16916e05906b6b75a6c0fb5db821cc65e70cbd64a3e2a5eaae"
}
]
"sources": [ {
"type": "file",
"url": "https://files.pythonhosted.org/packages/df/62/5e6731cd9477096152180d826aedfa63f470b3b29c1b3b489f3d914725aa/pyfavicon-0.1.1.tar.gz",
"sha256": "fdd5a222f08488824877d8a00a272657c4e66bbe115520d1d68e6d9892ba8e97"
},
{
"type": "file",
"url": "https://files.pythonhosted.org/packages/cc/d9/931a24cc5394f19383fbbe3e1147a0291276afa43a0dc3ed0d6cd9fda813/attrs-19.1.0.tar.gz",
"sha256": "f0b870f674851ecbfbbbd364d6b5cbdff9dcedbc7f3f5e18a6891057f21fe399"
},
{
"type": "file",
"url": "https://files.pythonhosted.org/packages/0f/58/c8b83f999da3b13e66249ea32f325be923791c0c10aee6cf16002a3effc1/aiohttp-3.5.4.tar.gz",
"sha256": "9c4c83f4fa1938377da32bc2d59379025ceeee8e24b89f72fcbccd8ca22dc9bf"
},
{
"type": "file",
"url": "https://files.pythonhosted.org/packages/fb/9e/2e236603b058daa6820193d4d95f4dcfbbbd0d3c709bec8c6ef1b1902501/soupsieve-1.9.1.tar.gz",
"sha256": "b20eff5e564529711544066d7dc0f7661df41232ae263619dede5059799cdfca"
},
{
"type": "file",
"url": "https://files.pythonhosted.org/packages/a1/78/aae1545aba6e87e23ecab8d212b58bb70e72164b67eb090b81bb17ad38e3/async-timeout-3.0.1.tar.gz",
"sha256": "0c3c816a028d47f659d6ff5c745cb2acf1f966da1fe5c19c77a70282b25f4c5f"
},
{
"type": "file",
"url": "https://files.pythonhosted.org/packages/ad/13/eb56951b6f7950cadb579ca166e448ba77f9d24efc03edd7e55fa57d04b7/idna-2.8.tar.gz",
"sha256": "c357b3f628cf53ae2c4c05627ecc484553142ca23264e593d327bcde5e9c3407"
},
{
"type": "file",
"url": "https://files.pythonhosted.org/packages/fb/84/6d82f6be218c50b547aa29d0315e430cf8a23c52064c92d0a8377d7b7357/yarl-1.3.0.tar.gz",
"sha256": "024ecdc12bc02b321bc66b41327f930d1c2c543fa9a561b39861da9388ba7aa9"
},
{
"type": "file",
"url": "https://files.pythonhosted.org/packages/80/f2/f6aca7f1b209bb9a7ef069d68813b091c8c3620642b568dac4eb0e507748/beautifulsoup4-4.7.1.tar.gz",
"sha256": "945065979fb8529dd2f37dbb58f00b661bdbcbebf954f93b32fdf5263ef35348"
},
{
"type": "file",
"url": "https://files.pythonhosted.org/packages/fc/bb/a5768c230f9ddb03acc9ef3f0d4a3cf93462473795d18e9535498c8f929d/chardet-3.0.4.tar.gz",
"sha256": "84ab92ed1c4d4f16916e05906b6b75a6c0fb5db821cc65e70cbd64a3e2a5eaae"
},
{
"type": "file",
"url": "https://files.pythonhosted.org/packages/7f/8f/b3c8c5b062309e854ce5b726fc101195fbaa881d306ffa5c2ba19efa3af2/multidict-4.5.2.tar.gz",
"sha256": "024b8129695a952ebd93373e45b5d341dbb87c17ce49637b34000093f243dd4f"
},
{
"type": "file",
"url": "https://files.pythonhosted.org/packages/1d/64/a18a487b4391a05b9c7f938b94a16d80305bf0369c6b0b9509e86165e1d3/setuptools-41.0.1.zip",
"sha256": "a222d126f5471598053c9a77f4b5d4f26eaa1f150ad6e01dcf1a42e185d05613"
},
{
"type": "file",
"url": "https://files.pythonhosted.org/packages/1d/b0/f478e80aeace42fe251225a86752799174a94314c4a80ebfc5bf0ab1153a/wheel-0.33.4.tar.gz",
"sha256": "62fcfa03d45b5b722539ccbc07b190e4bfff4bb9e3a4d470dd9f6a0981002565"
}]
},
{
"name" : "pyzbar",
"buildsystem" : "simple",
"build-commands" : [
"name": "pyotp",
"buildsystem": "simple",
"build-commands": [
"python3 setup.py install --prefix=/app"
],
"ensure-writable" : [
"ensure-writable": [
"/lib/python*/site-packages/easy-install.pth",
"/lib/python*/site-packages/setuptools.pth",
"/app/lib/python*/site-packages/easy-install.pth",
"/app/lib/python*/site-packages/setuptools.pth"
],
"sources" : [
{
"type" : "archive",
"url" : "https://github.com/NaturalHistoryMuseum/pyzbar/archive/v0.1.7.tar.gz",
"sha256" : "4dbbece533650f2aeb6c8d1f41cf424614d2877d7331c48a9eed35ae9f949626"
},
{
"type" : "patch",
"path" : "pyzbar.patch"
}
]
"sources": [{
"type": "archive",
"url": "https://pypi.python.org/packages/ac/0c/bd96508e36956ae627e527a7a7fba486865a738b4682e7290cd0e7c34f52/pyotp-2.2.4.tar.gz#md5=16cb1a08d38777ca74b5e9c7803810b6",
"sha256": "92c3973ba91273e7e4a7fd4a1020ae4b050ccd2e149b554911e1b45ca458ac2d"
}]
},
{
"name" : "yoyo-migrations",
"buildsystem" : "simple",
"build-commands" : [
"name": "yoyo-migrations",
"buildsystem": "simple",
"build-commands": [
"pip3 install --no-index --find-links=\"file://${PWD}\" --prefix=${FLATPAK_DEST} yoyo-migrations"
],
"ensure-writable" : [
"ensure-writable": [
"/lib/python*/site-packages/easy-install.pth",
"/lib/python*/site-packages/setuptools.pth",
"/app/lib/python*/site-packages/easy-install.pth",
"/app/lib/python*/site-packages/setuptools.pth"
],
"sources" : [
{
"type" : "file",
"url" : "https://files.pythonhosted.org/packages/5f/cf/f6d468c6929e8739cd12bf1a9cf3719e0be739e09acfaddc0f9ade67e67c/yoyo_migrations-6.1.0-py2.py3-none-any.whl",
"sha256" : "95e5c49a797873d3b86e5a7714c1a714bea8728a6fc1d6f6f5019d3d058471e5"
"sources": [{
"type": "file",
"url": "https://files.pythonhosted.org/packages/5f/cf/f6d468c6929e8739cd12bf1a9cf3719e0be739e09acfaddc0f9ade67e67c/yoyo_migrations-6.1.0-py2.py3-none-any.whl",
"sha256": "95e5c49a797873d3b86e5a7714c1a714bea8728a6fc1d6f6f5019d3d058471e5"
},
{
"type": "file",
......@@ -239,18 +223,17 @@
],
"modules": [{
"name": "iniherit",
"buildsystem" : "simple",
"ensure-writable" : [
"buildsystem": "simple",
"ensure-writable": [
"/lib/python*/site-packages/easy-install.pth",
"/lib/python*/site-packages/setuptools.pth",
"/app/lib/python*/site-packages/easy-install.pth",
"/app/lib/python*/site-packages/setuptools.pth"
],
"build-commands" : [
"build-commands": [
"python3 setup.py install --prefix=/app"
],
"sources": [
{
"sources": [{
"type": "archive",
"url": "https://files.pythonhosted.org/packages/65/a5/5bb95059c92c23560a80bcd599bc737a4175b275b3a577cb19f66bd302e3/iniherit-0.3.9.tar.gz",
"sha256": "06d90849ff0c4fadb7e255ce31e7c8e188a99af90d761435c72b79b36adbb67a"
......@@ -258,37 +241,29 @@
}]
},
{
"name" : "libhandy",
"buildsystem" : "meson",
"config-opts" : [
"name": "libhandy",
"buildsystem": "meson",
"config-opts": [
"-Dtests=false",
"-Dexamples=false",
"-Dglade_catalog=disabled",
"-Dvapi=false"
],
"sources" : [
{
"type" : "git",
"url" : "https://source.puri.sm/Librem5/libhandy.git"
}
]
"sources": [{
"type": "git",
"url": "https://source.puri.sm/Librem5/libhandy.git"
}]
},
{
"name" : "Authenticator",
"buildsystem" : "meson",
"config-opts" : [
"name": "Authenticator",
"buildsystem": "meson",
"config-opts": [
"-Dprofile=development"
],
"sources" : [
{
"type" : "git",
"url" : "https://gitlab.gnome.org/World/Authenticator.git"
}
]
}
],
"build-options" : {
"env" : {
"sources": [{
"type": "git",
"url": "https://gitlab.gnome.org/World/Authenticator.git"
}]
}
}
]
}
......@@ -61,9 +61,6 @@
<property name="can_focus">False</property>
<property name="border_width">36</property>
<property name="orientation">vertical</property>
<child>
<placeholder/>
</child>
<child>
<object class="GtkGrid">
<property name="visible">True</property>
......@@ -75,23 +72,6 @@
<property name="row_spacing">6</property>
<property name="column_spacing">6</property>
<property name="column_homogeneous">True</property>
<child>
<object class="GtkEntry" id="token_entry">
<property name="visible">True</property>
<property name="can_focus">True</property>
<property name="hexpand">True</property>
<property name="visibility">False</property>
<property name="secondary_icon_name">dialog-information-symbolic</property>
<property name="secondary_icon_tooltip_text" translatable="yes">Enable 2FA for this account</property>
<property name="placeholder_text" translatable="yes">2FA Token</property>
<property name="input_purpose">pin</property>
<signal name="changed" handler="account_edited" swapped="no"/>
</object>
<packing>
<property name="left_attach">0</property>
<property name="top_attach">2</property>
</packing>
</child>
<child>
<object class="GtkEntry" id="account_name_entry">
<property name="visible">True</property>
......@@ -103,7 +83,7 @@
</object>
<packing>
<property name="left_attach">0</property>
<property name="top_attach">1</property>
<property name="top_attach">2</property>
</packing>
</child>
<child>
......@@ -130,6 +110,38 @@
<property name="top_attach">0</property>
</packing>
</child>
<child>
<object class="GtkEntry" id="token_entry">
<property name="visible">True</property>
<property name="can_focus">True</property>
<property name="hexpand">True</property>
<property name="visibility">False</property>
<property name="secondary_icon_name">dialog-information-symbolic</property>
<property name="secondary_icon_tooltip_text" translatable="yes">Enable 2FA for this account</property>
<property name="placeholder_text" translatable="yes">2FA Token</property>
<property name="input_purpose">pin</property>
<signal name="changed" handler="account_edited" swapped="no"/>
</object>
<packing>
<property name="left_attach">0</property>
<property name="top_attach">3</property>
</packing>
</child>
<child>
<object class="GtkEntry" id="provider_website_entry">
<property name="can_focus">True</property>
<property name="no_show_all">True</property>
<property name="hexpand">True</property>
<property name="placeholder_text" translatable="yes">Provider Website</property>
<property name="input_purpose">url</property>
<property name="enable_emoji_completion">True</property>
<signal name="key-release-event" handler="on_provider_website_changed" swapped="no"/>
</object>
<packing>
<property name="left_attach">0</property>
<property name="top_attach">1</property>
</packing>
</child>
</object>
<packing>
<property name="expand">True</property>
......
......@@ -14,15 +14,47 @@
<property name="can_focus">False</property>
</object>
<packing>
<property name="name">provider_spinner</property>
<property name="name">provider_loading</property>
</packing>
</child>
<child>
<object class="GtkImage" id="provider_image">
<object class="GtkEventBox" id="image_eventbox">
<property name="visible">True</property>
<property name="can_focus">False</property>
<property name="pixel_size">128</property>
<property name="icon_size">6</property>
<signal name="button-press-event" handler="select_image_clicked" swapped="no"/>
<child>
<object class="GtkOverlay">
<property name="visible">True</property>
<property name="can_focus">False</property>
<child>
<object class="GtkImage" id="provider_image">
<property name="visible">True</property>
<property name="can_focus">False</property>
<property name="pixel_size">128</property>
<property name="icon_size">6</property>
</object>
<packing>
<property name="index">-1</property>
</packing>
</child>
<child type="overlay">
<object class="GtkImage" id="insert_image">
<property name="can_focus">False</property>
<property name="no_show_all">True</property>
<property name="halign">center</property>
<property name="valign">center</property>
<property name="icon_name">insert-image-symbolic</property>
<property name="icon_size">5</property>
<style>
<class name="insert-image"/>
</style>
</object>
<packing>
<property name="pass_through">True</property>
</packing>
</child>
</object>
</child>
</object>
<packing>
<property name="name">provider_image</property>
......@@ -39,14 +71,14 @@
<property name="valign">center</property>
<property name="orientation">vertical</property>
<child>
<object class="GtkEventBox" id="image_eventbox">
<object class="GtkEventBox">
<property name="visible">True</property>
<property name="can_focus">False</property>
<property name="halign">center</property>
<property name="valign">center</property>
<signal name="button-press-event" handler="select_image_clicked" swapped="no"/>
<child>
<object class="GtkImage" id="insert_image">
<object class="GtkImage">
<property name="visible">True</property>
<property name="can_focus">False</property>
<property name="halign">center</property>
......
......@@ -163,8 +163,7 @@
<property name="valign">start</property>
<property name="hexpand">True</property>
<property name="vexpand">True</property>
<property name="resource">/com/github/bilelmoussaoui/Authenticator/authenticator.svg
</property>
<property name="resource">/com/github/bilelmoussaoui/Authenticator/authenticator.svg</property>
<property name="icon_size">6</property>
</object>
<packing>
......
beautifulsoup4==4.7.0
Pillow==5.0.0
Pillow==6.0.0
pyfavicon==0.1.1
pyotp==2.2.7
pyzbar==0.1.8
requests==2.21.0
yoyo-migrations==6.1.0
\ No newline at end of file
yoyo-migrations==6.1.0
......@@ -20,8 +20,8 @@ def do_step(conn):
for provider_name, provider_info in data.items():
if not provider_name.lower() in providers_db:
providers.append((provider_name, provider_info['url'],
provider_info['doc'], provider_info['img'],))
query = "INSERT INTO providers (name, website, doc_url, image) VALUES (?, ?, ?, ?)"
provider_info['doc'],))
query = "INSERT INTO providers (name, website, doc_url) VALUES (?, ?, ?)"
conn.executemany(query, providers)
conn.commit()
......
"""
Empty uneeded provider iamges
"""
from os import path
from yoyo import step
__depends__ = {'authenticator_20190525_04_Faezz-restore-old-accounts'}
def do_step(conn):
providers_db = conn.execute("SELECT id, image FROM providers").fetchall()
to_empty = []
for provider_id, provider_image in providers_db:
if provider_image and path.basename(provider_image) == provider_image:
to_empty.append(str(provider_id))
if len(to_empty):
providers_ids = ", ".join(to_empty)
conn.execute("UPDATE providers SET image='' WHERE id IN (?)", (providers_ids, ))
steps = [
step(do_step, ignore_errors='apply')
]
......@@ -18,7 +18,6 @@
"""
from .clipboard import Clipboard
from .favicon import FaviconManager
from .keyring import Keyring
from .logger import Logger
from .otp import OTP
......
......@@ -140,7 +140,7 @@ class Database:
"""
query = "SELECT * FROM providers WHERE name LIKE ? "
try:
data = self.conn.cursor().execute(query, ("%" + provider_name + "%",))
data = self.conn.cursor().execute(query, (provider_name,))
provider = data.fetchone()
return Provider(*provider) if provider else None
except Exception as error:
......
"""
Copyright © 2017 Bilal Elmoussaoui <bil.elmoussaoui@gmail.com>
This file is part of Authenticator.
Authenticator is free software: you can redistribute it and/or
modify it under the terms of the GNU General Public License as published
by the Free Software Foundation, either version 3 of the License, or
(at your option) any later version.
Authenticator is distributed in the hope that it will be useful,
but WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
GNU General Public License for more details.
You should have received a copy of the GNU General Public License
along with Authenticator. If not, see <http://www.gnu.org/licenses/>.
"""
from os import path, mkdir
from bs4 import BeautifulSoup
from gi.repository import GLib
from urllib.parse import urlparse