Skip to content

Commit

Permalink
Mypy: Fixes
Browse files Browse the repository at this point in the history
  • Loading branch information
jwijenbergh committed Feb 1, 2023
1 parent 78db558 commit 4a8eab0
Show file tree
Hide file tree
Showing 3 changed files with 6 additions and 5 deletions.
7 changes: 4 additions & 3 deletions eduvpn/nm.py
Original file line number Diff line number Diff line change
Expand Up @@ -411,7 +411,7 @@ def save_connection(
):
_logger.debug("writing configuration to Network Manager")
new_con = self.import_ovpn_with_certificate(ovpn, private_key, certificate)
self.set_connection(new_con, callback, default_gateway, system_wide)
self.set_connection(new_con, callback, default_gateway)

def start_openvpn_connection(
self, ovpn: Ovpn, default_gateway, *, callback=None
Expand Down Expand Up @@ -588,9 +588,10 @@ def changed_state(
if ConnectionState.from_active_state(state) == ConnectionState.DISCONNECTED:
if signal:
active.disconnect(signal)
callback()
if callback:
callback()

signal = self.active_connection.connect("state-changed", changed_state)
signal = connection.connect("state-changed", changed_state)

def deactivate_connection_vpn(self, callback: Optional[Callable] = None) -> None:
con = self.active_connection
Expand Down
2 changes: 1 addition & 1 deletion eduvpn/ui/search.py
Original file line number Diff line number Diff line change
Expand Up @@ -81,7 +81,7 @@ def group_servers(servers):
"""
Separate the servers into three groups.
"""
groups: Dict[ServerGroup, List[Server]] = {
groups: Dict[ServerGroup, List[Server]] = { # type: ignore
ServerGroup.INSTITUTE_ACCESS: [],
ServerGroup.SECURE_INTERNET: [],
ServerGroup.OTHER: [],
Expand Down
2 changes: 1 addition & 1 deletion eduvpn/ui/ui.py
Original file line number Diff line number Diff line change
Expand Up @@ -122,7 +122,7 @@ def setup(self, builder: Builder, application: Type["EduVpnGtkApplication"]) ->
}
builder.connect_signals(handlers)

style_context = self.get_style_context()
style_context = self.get_style_context() # type: ignore
bg_color = style_context.get_background_color(Gtk.StateFlags.NORMAL)
self.is_dark_theme = is_dark(bg_color)

Expand Down

0 comments on commit 4a8eab0

Please sign in to comment.