Skip to content

Commit bd5ddb1

Browse files
committed
Linting fixes + actions fix
1 parent d7d5d5f commit bd5ddb1

File tree

12 files changed

+40
-81
lines changed

12 files changed

+40
-81
lines changed

.github/workflows/python-package.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -42,7 +42,7 @@ jobs:
4242
flake8 src --count --exit-zero --max-complexity=10 --max-line-length=127 --statistics
4343
- name: Test with pytest
4444
env:
45-
ONE_JOB_ONLY_TESTS: ${{ secrets[matrix.primary-config] }}
45+
ONE_JOB_ONLY_TESTS: ${{ matrix.primary-config }}
4646
WIOTP_API_KEY: ${{ secrets.WIOTP_API_KEY }}
4747
WIOTP_API_TOKEN: ${{ secrets.WIOTP_API_TOKEN }}
4848
WIOTP_ORG_ID: ${{ secrets.WIOTP_ORG_ID }}

src/wiotp/sdk/api/common.py

Lines changed: 5 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -18,7 +18,6 @@
1818

1919
from wiotp.sdk.exceptions import ConfigurationException
2020

21-
2221
class ApiClient:
2322
def __init__(self, config, logger=None):
2423
self._config = config
@@ -263,7 +262,7 @@ def updatedBy(self):
263262

264263

265264
"""
266-
This should be instantiated as a class property,
265+
This should be instantiated as a class property,
267266
it uses the instance parameter to access instance specific values TBD describe!!!
268267
"""
269268

@@ -360,11 +359,11 @@ def __iter__(self, *args, **kwargs):
360359
def find(self, query_params={}):
361360
"""
362361
Gets the list of Schemas, they are used to call specific business logic when data in Watson IoT Platform changes.
363-
362+
364363
Parameters:
365-
364+
366365
- queryParams(dict) - Filter the results by the key-value pairs in the dictionary
367-
366+
368367
Throws APIException on failure.
369368
"""
370369
return self._listToCast(self._apiClient, self._baseUrl, filters=query_params)
@@ -394,7 +393,7 @@ def __delitem__(self, key):
394393

395394
def create(self, item):
396395
"""
397-
Create an Item for the organization in the Watson IoT Platform.
396+
Create an Item for the organization in the Watson IoT Platform.
398397
Parameters:
399398
- name (string) - Name of the service
400399
- type - must be webhook

src/wiotp/sdk/api/registry/devices.py

Lines changed: 13 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -336,36 +336,36 @@ def __init__(self, apiClient, typeId=None):
336336

337337
class Devices(defaultdict):
338338
"""
339-
Use the global unique identifier of a device, it's `clientId` to address devices.
340-
339+
Use the global unique identifier of a device, it's `clientId` to address devices.
340+
341341
# Delete
342-
342+
343343
```python
344344
del devices["d:orgId:typeId:deviceId"]
345345
```
346-
346+
347347
# Get
348-
Use the global unique identifier of a device, it's `clientId`.
349-
348+
Use the global unique identifier of a device, it's `clientId`.
349+
350350
```python
351351
device = devices["d:orgId:typeId:deviceId"]
352352
print(device.clientId)
353353
print(device)
354-
354+
355355
# Is a device registered?
356-
356+
357357
```python
358358
if "d:orgId:typeId:deviceId" in devices:
359359
print("The device exists")
360360
```
361-
361+
362362
# Iterate through all registered devices
363-
363+
364364
```python
365365
for device in devices:
366366
print(device)
367367
```
368-
368+
369369
"""
370370

371371
# https://docs.python.org/2/library/collections.html#defaultdict-objects
@@ -456,9 +456,9 @@ def create(self, devices):
456456
The response body will contain the generated authentication tokens for all devices.
457457
You must make sure to record these tokens when processing the response.
458458
We are not able to retrieve lost authentication tokens
459-
459+
460460
It accepts accepts a list of devices (List of Dictionary of Devices), or a single device
461-
461+
462462
If you provide a list as the parameter it will return a list in response
463463
If you provide a singular device it will return a singular response
464464
"""

src/wiotp/sdk/api/state/eventTypes.py

Lines changed: 0 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -7,10 +7,6 @@
77
# http://www.eclipse.org/legal/epl-v10.html
88
# *****************************************************************************
99

10-
from collections import defaultdict
11-
import iso8601
12-
13-
from wiotp.sdk.exceptions import ApiException
1410
from wiotp.sdk.api.common import IterableList
1511
from wiotp.sdk.api.common import RestApiDict
1612
from wiotp.sdk.api.common import RestApiItemBase

src/wiotp/sdk/api/state/logicalInterfaces.py

Lines changed: 0 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -7,14 +7,10 @@
77
# http://www.eclipse.org/legal/epl-v10.html
88
# *****************************************************************************
99

10-
from collections import defaultdict
11-
import iso8601
1210

13-
from wiotp.sdk.exceptions import ApiException
1411
from wiotp.sdk.api.common import IterableList
1512
from wiotp.sdk.api.common import RestApiDict
1613
from wiotp.sdk.api.common import RestApiItemBase
17-
from wiotp.sdk.api.common import RestApiDictReadOnly
1814
from wiotp.sdk.api.state.rules import DraftRulesPerLI
1915
from wiotp.sdk.api.state.rules import ActiveRulesPerLI
2016

src/wiotp/sdk/api/state/physicalInterfaces.py

Lines changed: 0 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -8,14 +8,11 @@
88
# *****************************************************************************
99

1010
from collections import defaultdict
11-
import iso8601
1211

13-
from wiotp.sdk.exceptions import ApiException
1412
from wiotp.sdk.api.common import IterableList
1513
from wiotp.sdk.api.common import IterableSimpleList
1614
from wiotp.sdk.api.common import RestApiDict
1715
from wiotp.sdk.api.common import RestApiItemBase
18-
from wiotp.sdk.api.common import RestApiDictReadOnly
1916

2017
# See docs @ https://orgid.internetofthings.ibmcloud.com/docs/v0002/state-mgmt.html#/Physical Interfaces
2118

src/wiotp/sdk/api/state/schemas.py

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -7,13 +7,11 @@
77
# http://www.eclipse.org/legal/epl-v10.html
88
# *****************************************************************************
99

10-
from collections import defaultdict
1110
from requests_toolbelt.multipart.encoder import MultipartEncoder
1211

1312
from wiotp.sdk.api.common import IterableList
1413
from wiotp.sdk.api.common import RestApiItemBase
1514
from wiotp.sdk.api.common import RestApiDict
16-
from wiotp.sdk.api.common import RestApiDictReadOnly
1715
from wiotp.sdk.exceptions import ApiException
1816

1917
import json

src/wiotp/sdk/api/state/state.py

Lines changed: 0 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -10,9 +10,6 @@
1010
from collections import defaultdict
1111
import iso8601
1212
from wiotp.sdk.exceptions import ApiException
13-
from wiotp.sdk.api.common import IterableList
14-
from wiotp.sdk.api.common import RestApiDict
15-
from wiotp.sdk.api.common import RestApiItemBase
1613
from wiotp.sdk.api.common import RestApiDictReadOnly
1714

1815
# See docs @ https://orgid.internetofthings.ibmcloud.com/docs/v0002-beta/State-mgr-beta.html

src/wiotp/sdk/exceptions.py

Lines changed: 7 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -11,7 +11,7 @@
1111
class ConnectionException(Exception):
1212
"""
1313
Generic Connection exception
14-
14+
1515
# Attributes
1616
reason (string): The reason why the connection exception occured
1717
"""
@@ -26,7 +26,7 @@ def __str__(self):
2626
class ConfigurationException(Exception):
2727
"""
2828
Specific Connection exception where the configuration is invalid
29-
29+
3030
# Attributes
3131
reason (string): The reason why the configuration is invalid
3232
"""
@@ -41,7 +41,7 @@ def __str__(self):
4141
class UnsupportedAuthenticationMethod(ConnectionException):
4242
"""
4343
Specific Connection exception where the authentication method specified is not supported
44-
44+
4545
# Attributes
4646
method (string): The authentication method that is unsupported
4747
"""
@@ -56,7 +56,7 @@ def __str__(self):
5656
class InvalidEventException(Exception):
5757
"""
5858
Specific exception where an Event object can not be constructed
59-
59+
6060
# Attributes
6161
reason (string): The reason why the event could not be constructed
6262
"""
@@ -71,7 +71,7 @@ def __str__(self):
7171
class MissingMessageDecoderException(Exception):
7272
"""
7373
Specific exception where there is no message decoder defined for the message format being processed
74-
74+
7575
# Attributes
7676
format (string): The message format for which no encoder could be found
7777
"""
@@ -86,7 +86,7 @@ def __str__(self):
8686
class MissingMessageEncoderException(Exception):
8787
"""
8888
Specific exception where there is no message encoder defined for the message format being processed
89-
89+
9090
# Attributes
9191
format (string): The message format for which no encoder could be found
9292
"""
@@ -101,7 +101,7 @@ def __str__(self):
101101
class ApiException(Exception):
102102
"""
103103
Exception raised when any API call fails unexpectedly
104-
104+
105105
# Attributes
106106
response (requests.Response): See: http://docs.python-requests.org/en/master/api/#requests.Response
107107
"""

src/wiotp/sdk/gateway/client.py

Lines changed: 1 addition & 16 deletions
Original file line numberDiff line numberDiff line change
@@ -7,25 +7,10 @@
77
# http://www.eclipse.org/legal/epl-v10.html
88
# *****************************************************************************
99

10-
import json
11-
import re
12-
import pytz
13-
import uuid
14-
import threading
15-
import requests
16-
import logging
17-
import paho.mqtt.client as paho
18-
19-
from datetime import datetime
2010

2111
from wiotp.sdk import (
2212
AbstractClient,
23-
InvalidEventException,
24-
UnsupportedAuthenticationMethod,
25-
ConfigurationException,
26-
ConnectionException,
27-
MissingMessageEncoderException,
28-
MissingMessageDecoderException,
13+
InvalidEventException
2914
)
3015
from wiotp.sdk.device import DeviceClient
3116
from wiotp.sdk.device.command import Command

0 commit comments

Comments
 (0)
pFad - Phonifier reborn

Pfad - The Proxy pFad of © 2024 Garber Painting. All rights reserved.

Note: This service is not intended for secure transactions such as banking, social media, email, or purchasing. Use at your own risk. We assume no liability whatsoever for broken pages.


Alternative Proxies:

Alternative Proxy

pFad Proxy

pFad v3 Proxy

pFad v4 Proxy