Skip to content
This repository was archived by the owner on Apr 3, 2025. It is now read-only.

Commit a4e4b43

Browse files
committed
Run black and lint fixes
1 parent 18743fa commit a4e4b43

File tree

6 files changed

+49
-16
lines changed

6 files changed

+49
-16
lines changed

eduvpn/app.py

Lines changed: 7 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -10,8 +10,13 @@
1010
from eduvpn_common.discovery import DiscoOrganization, DiscoServer
1111
from eduvpn_common.error import WrappedError
1212
from eduvpn_common.main import EduVPN
13-
from eduvpn_common.server import (Config, InstituteServer,
14-
SecureInternetServer, Server, Token)
13+
from eduvpn_common.server import (
14+
Config,
15+
InstituteServer,
16+
SecureInternetServer,
17+
Server,
18+
Token,
19+
)
1520
from eduvpn_common.state import State, StateType
1621
from eduvpn_common.types import ReadRxBytes
1722

eduvpn/cli.py

Lines changed: 7 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -14,8 +14,13 @@
1414
from eduvpn.app import Application
1515
from eduvpn.i18n import country, retrieve_country_name
1616
from eduvpn.server import ServerDatabase
17-
from eduvpn.settings import (CLIENT_ID, CONFIG_DIR_MODE, CONFIG_PREFIX,
18-
LETSCONNECT_CLIENT_ID, LETSCONNECT_CONFIG_PREFIX)
17+
from eduvpn.settings import (
18+
CLIENT_ID,
19+
CONFIG_DIR_MODE,
20+
CONFIG_PREFIX,
21+
LETSCONNECT_CLIENT_ID,
22+
LETSCONNECT_CONFIG_PREFIX,
23+
)
1924
from eduvpn.ui.search import ServerGroup, group_servers
2025
from eduvpn.ui.utils import get_validity_text, should_show_error
2126
from eduvpn.utils import cmd_transition, init_logger, run_in_background_thread

eduvpn/nm.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -747,7 +747,7 @@ def connection_status(
747747
self,
748748
) -> Tuple[Optional[str], Optional["NM.ActiveConnectionState"]]:
749749
con = self.client.get_primary_connection()
750-
if type(con) != NM.VpnConnection:
750+
if not isinstance(con, NM.VpnConnection):
751751
return None, None
752752
uuid = con.get_uuid()
753753
status = con.get_state()

eduvpn/ui/ui.py

Lines changed: 27 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -28,12 +28,25 @@
2828
from eduvpn.settings import FLAG_PREFIX, IMAGE_PREFIX
2929
from eduvpn.ui import search
3030
from eduvpn.ui.stats import NetworkStats
31-
from eduvpn.ui.utils import (QUIT_ID, get_validity_text, link_markup,
32-
should_show_error, show_error_dialog,
33-
show_ui_component, style_widget)
34-
from eduvpn.utils import (ERROR_STATE, get_prefix, get_ui_state, log_exception,
35-
run_in_background_thread, run_in_glib_thread,
36-
run_periodically, ui_transition)
31+
from eduvpn.ui.utils import (
32+
QUIT_ID,
33+
get_validity_text,
34+
link_markup,
35+
should_show_error,
36+
show_error_dialog,
37+
show_ui_component,
38+
style_widget,
39+
)
40+
from eduvpn.utils import (
41+
ERROR_STATE,
42+
get_prefix,
43+
get_ui_state,
44+
log_exception,
45+
run_in_background_thread,
46+
run_in_glib_thread,
47+
run_periodically,
48+
ui_transition,
49+
)
3750

3851
logger = logging.getLogger(__name__)
3952

@@ -485,7 +498,10 @@ def recreate_profile_combo(self, server_info) -> None:
485498
active_profile = 0
486499
sorted_profiles = sorted(server_info.profiles.profiles, key=lambda p: str(p))
487500
for index, profile in enumerate(sorted_profiles):
488-
if server_info.profiles.current is not None and profile.identifier == server_info.profiles.current.identifier:
501+
if (
502+
server_info.profiles.current is not None
503+
and profile.identifier == server_info.profiles.current.identifier
504+
):
489505
active_profile = index
490506
profile_store.append([str(profile), profile]) # type: ignore
491507

@@ -1209,7 +1225,10 @@ def on_profile_combo_changed(self, combo):
12091225
active_profile = 0
12101226
sorted_profiles = sorted(profiles.profiles, key=lambda p: str(p))
12111227
for index, profile in enumerate(sorted_profiles):
1212-
if profiles.current is not None and profile.identifier == profiles.current.identifier:
1228+
if (
1229+
profiles.current is not None
1230+
and profile.identifier == profiles.current.identifier
1231+
):
12131232
active_profile = index
12141233

12151234
combo.set_active(active_profile)

eduvpn/ui/utils.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -25,7 +25,7 @@ def style_widget(widget, class_name: str, style: str):
2525
assert GtkAvailable
2626
style_context = widget.get_style_context()
2727
provider = Gtk.CssProvider.new()
28-
provider.load_from_data(f".{class_name} {{{style}}}".encode("utf-8"))
28+
provider.load_from_data(f".{class_name} {{{style}}}".encode("utf-8")) # type: ignore
2929
style_context.add_provider(provider, Gtk.STYLE_PROVIDER_PRIORITY_APPLICATION)
3030
style_context.add_class(class_name.split(":")[0])
3131

eduvpn/variants.py

Lines changed: 6 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -3,8 +3,12 @@
33

44
from eduvpn import __version__, settings
55
from eduvpn.config import Configuration
6-
from eduvpn.settings import (CLIENT_ID, CONFIG_PREFIX, LETSCONNECT_CLIENT_ID,
7-
LETSCONNECT_CONFIG_PREFIX)
6+
from eduvpn.settings import (
7+
CLIENT_ID,
8+
CONFIG_PREFIX,
9+
LETSCONNECT_CLIENT_ID,
10+
LETSCONNECT_CONFIG_PREFIX,
11+
)
812

913

1014
class ApplicationVariant:

0 commit comments

Comments
 (0)