Skip to content

Commit

Permalink
improved code style a bit
Browse files Browse the repository at this point in the history
Signed-off-by: Christoph Massmann <[email protected]>
  • Loading branch information
ma4nn committed Dec 13, 2023
1 parent 94c88f2 commit 5373b85
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 4 deletions.
2 changes: 1 addition & 1 deletion .github/workflows/verify-plugin-scripts.yml
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,7 @@ jobs:
pip install -r requirements.txt
- name: Analysing the code with pylint
run: |
pylint --errors-only $(find . -name "*.py" | xargs)
pylint --errors-only $(find src/ -name "*.py" | xargs)
- name: Running tests
run: |
pytest --cov
Expand Down
4 changes: 1 addition & 3 deletions src/fritzbox_file_session.py
Original file line number Diff line number Diff line change
Expand Up @@ -6,8 +6,6 @@
import os
from typing import Optional

NoneOrString = Optional[str] # for Python 3.9 compatibility, since 3.10 you can type None | str

def get_session_dir() -> str:
return str(os.getenv('MUNIN_PLUGSTATE')) + '/fritzbox'

Expand Down Expand Up @@ -40,7 +38,7 @@ def save(self, session_id):
with open(statefilename, 'w', encoding='utf8') as statefile:
statefile.write(session_id)

def load(self) -> NoneOrString:
def load(self) -> Optional[str]:
statefilename = get_session_dir() + '/' + self.__get_session_filename()
if not os.path.exists(statefilename):
return None
Expand Down

0 comments on commit 5373b85

Please sign in to comment.