-
Notifications
You must be signed in to change notification settings - Fork 1
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
chore: configure ruff and remove legacy tools (#245)
- Loading branch information
Showing
17 changed files
with
383 additions
and
242 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,12 +1,18 @@ | ||
"""Parse an existing CRID.""" | ||
|
||
from .lib import CRID | ||
|
||
|
||
def parse(value: str) -> CRID: | ||
"""Get CRID dataclass from CRID. | ||
Parameters: | ||
Args: | ||
---- | ||
value: CRID URL as a string. | ||
Returns: | ||
------- | ||
CRID: The parsed CRID. | ||
""" | ||
return CRID(value) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,24 +1,27 @@ | ||
import xml.etree.ElementTree as ET | ||
"""Handle currently running show.""" | ||
|
||
import xml.etree.ElementTree as ET # noqa: N817 | ||
from pathlib import PurePath | ||
|
||
from uritools import urisplit # type: ignore | ||
from uritools import urisplit # type: ignore[import-untyped] | ||
|
||
from ..util import get_session | ||
from cridlib.util import get_session | ||
|
||
__SONGTICKER_URL = "https://songticker.rabe.ch/songticker/0.9.3/current.xml" | ||
|
||
|
||
def get_show() -> str: | ||
"""Return the currently running show. | ||
"""Get the currently running show. | ||
Calls the the [nowplaying](https://github.com/radiorabe/nowplaying) | ||
songticker's API. | ||
Returns: | ||
Returns | ||
------- | ||
Name of the currently running show. | ||
""" | ||
""" | ||
_resp = get_session().get(__SONGTICKER_URL, timeout=10) | ||
_tree = ET.fromstring(_resp.text) | ||
_tree = ET.fromstring(_resp.text) # noqa: S314 | ||
_path = PurePath(urisplit(_tree[3][1].text).path) | ||
return _path.stem |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.