Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Make SafeEyes compatible with Python 3.6 again #657

Merged
merged 3 commits into from
Oct 17, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
5 changes: 3 additions & 2 deletions safeeyes/model.py
Original file line number Diff line number Diff line change
Expand Up @@ -24,6 +24,7 @@
import random
from enum import Enum
from dataclasses import dataclass
from typing import Optional, Union

from packaging.version import parse

Expand Down Expand Up @@ -424,11 +425,11 @@ def build(cls, name, icon_path, icon_id, action):
@dataclass
class PluginDependency:
message: str
link: str|None = None
link: Optional[str] = None
retryable: bool = False

class RequiredPluginException(Exception):
def __init__(self, plugin_id, plugin_name: str, message: str|PluginDependency):
def __init__(self, plugin_id, plugin_name: str, message: Union[str, PluginDependency]):
if isinstance(message, PluginDependency):
msg = message.message
else:
Expand Down
3 changes: 2 additions & 1 deletion safeeyes/plugins/healthstats/plugin.py
Original file line number Diff line number Diff line change
Expand Up @@ -55,7 +55,8 @@ def init(ctx, safeeyes_config, plugin_config):
'total_resets': 0,
}

session = context['session']['plugin'].get('healthstats', {}) | defaults
session = context['session']['plugin'].get('healthstats', {}).copy()
session.update(defaults)
if 'no_of_breaks' in session:
# Ignore old format session.
session = defaults
Expand Down
Loading