Skip to content

Commit a60942f

Browse files
committed
black formatting
1 parent 6b00421 commit a60942f

9 files changed

Lines changed: 18 additions & 26 deletions

File tree

roku/_async/core.py

Lines changed: 2 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -6,11 +6,10 @@
66
import aiohttp
77

88
from ..constants import COMMANDS, SENSORS, TOUCH_OPS
9-
from ..models import Application, Channel, DeviceInfo, MediaPlayer, RokuException
9+
from ..models import Application, DeviceInfo, MediaPlayer, RokuException
1010
from ..util import deserialize_apps, deserialize_channels
1111
from .discovery import discover as async_discover
1212

13-
1413
roku_logger = logging.getLogger("roku")
1514

1615

@@ -134,10 +133,7 @@ async def get_device_info(self):
134133
roku_type = "Box"
135134
if root.find("is-tv") is not None and root.find("is-tv").text == "true":
136135
roku_type = "TV"
137-
elif (
138-
root.find("is-stick") is not None
139-
and root.find("is-stick").text == "true"
140-
):
136+
elif root.find("is-stick") is not None and root.find("is-stick").text == "true":
141137
roku_type = "Stick"
142138
dinfo = DeviceInfo(
143139
model_name=root.find("model-name").text,

roku/_async/discovery.py

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,7 @@
11
"""
22
Async SSDP discovery for Roku devices.
33
"""
4+
45
import asyncio
56
import socket
67
from http.client import HTTPResponse

roku/cli.py

Lines changed: 10 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,9 @@
44

55

66
@click.group()
7-
@click.option("--async", "use_async", is_flag=True, default=False, help="Use async client")
7+
@click.option(
8+
"--async", "use_async", is_flag=True, default=False, help="Use async client"
9+
)
810
@click.pass_context
911
def cli(ctx, use_async):
1012
ctx.ensure_object(dict)
@@ -14,7 +16,13 @@ def cli(ctx, use_async):
1416
@cli.command()
1517
@click.option("--timeout", type=int, default=2, help="Discovery timeout in seconds")
1618
@click.option("--retries", type=int, default=1, help="Number of retries")
17-
@click.option("-i", "--inspect", is_flag=True, default=False, help="Fetch and display device details")
19+
@click.option(
20+
"-i",
21+
"--inspect",
22+
is_flag=True,
23+
default=False,
24+
help="Fetch and display device details",
25+
)
1826
@click.pass_context
1927
def discover(ctx, timeout, retries, inspect):
2028
"""Discover Roku devices on the network."""

roku/core.py

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -6,10 +6,9 @@
66

77
from . import discovery
88
from .constants import COMMANDS, SENSORS, TOUCH_OPS
9-
from .models import Application, Channel, DeviceInfo, MediaPlayer, RokuException
9+
from .models import Application, DeviceInfo, MediaPlayer, RokuException
1010
from .util import deserialize_apps, deserialize_channels
1111

12-
1312
__version__ = "4.1.0"
1413

1514

roku/discovery.py

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -3,6 +3,7 @@
33
https://gist.github.com/dankrause/6000248
44
http://github.com/dankrause
55
"""
6+
67
import socket
78
from http.client import HTTPResponse
89
from io import BytesIO

roku/models.py

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -55,8 +55,6 @@ def __repr__(self):
5555

5656
def launch(self):
5757
if self.roku:
58-
from .core import Roku
59-
6058
tv_app = Application(
6159
id="tvinput.dtv", version=None, name="TV", roku=self.roku
6260
)

roku/tests/test_async_roku.py

Lines changed: 3 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -2,24 +2,19 @@
22
from unittest.mock import AsyncMock, patch
33
from urllib.parse import quote_plus
44

5-
import pytest
6-
75
from roku._async import AsyncRoku
86
from roku.constants import COMMANDS
97
from roku.discovery import SSDPResponse
108
from roku.models import Application
119
from roku.util import serialize_apps
1210

13-
1411
TESTS_PATH = os.path.abspath(os.path.dirname(__file__))
1512

1613

1714
async def test_apps(mocker, async_roku):
1815
faux_apps = (Application("0x", "1.2.3", "Fauxku Channel Store"),)
1916

20-
mocked_get = mocker.patch.object(
21-
AsyncRoku, "_get", new_callable=AsyncMock
22-
)
17+
mocked_get = mocker.patch.object(AsyncRoku, "_get", new_callable=AsyncMock)
2318
mocked_get.return_value = serialize_apps(faux_apps)
2419

2520
apps = await async_roku.get_apps()
@@ -35,9 +30,7 @@ async def test_device_info(mocker, async_roku):
3530
with open(xml_path) as infile:
3631
content = infile.read()
3732

38-
mocked_get = mocker.patch.object(
39-
AsyncRoku, "_get", new_callable=AsyncMock
40-
)
33+
mocked_get = mocker.patch.object(AsyncRoku, "_get", new_callable=AsyncMock)
4134
mocked_get.return_value = content.encode("utf-8")
4235

4336
d = await async_roku.get_device_info()
@@ -54,9 +47,7 @@ async def test_media_player(mocker, async_roku):
5447
with open(xml_path) as infile:
5548
content = infile.read()
5649

57-
mocked_get = mocker.patch.object(
58-
AsyncRoku, "_get", new_callable=AsyncMock
59-
)
50+
mocked_get = mocker.patch.object(AsyncRoku, "_get", new_callable=AsyncMock)
6051
mocked_get.return_value = content.encode("utf-8")
6152

6253
m = await async_roku.get_media_player()

roku/tests/test_roku.py

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,6 @@
66
from roku.core import Application, Roku, COMMANDS
77
from roku.util import serialize_apps
88

9-
109
TESTS_PATH = os.path.abspath(os.path.dirname(__file__))
1110

1211

roku/tests/test_scripting.py

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,6 @@
22

33
from roku import scripting
44

5-
65
SCRIPT_PATH = "roku/tests/scripts/testscript.txt"
76

87

0 commit comments

Comments
 (0)