Skip to content

Use pathlib to simplify ode #6

@dwt

Description

@dwt

There are quite some instances where outdated file manipulation functions are used. E.g. here.

Consider to use modern pathlib based code. Ideally self.access_token_file would already return a pathlib.Path, which would for example shorten the start of this method to something like this:

 def get_access_token(self) -> str:
    if self.access_token_file.exists():
        return self.acccess_token_file.read_text().strip()

    for attempt in range(self.MAX_LOGIN_ATTEMPTS):
        # ....

This kind of change would simplify much of the code, as this pattern is repeated multiple times.

What do you think?

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions