Skip to content

Commit

Permalink
[skip ci] Commit black code style formatting
Browse files Browse the repository at this point in the history
  • Loading branch information
durera committed Dec 3, 2019
1 parent 6d86887 commit 1c853a8
Show file tree
Hide file tree
Showing 3 changed files with 10 additions and 11 deletions.
16 changes: 8 additions & 8 deletions samples/deviceFactory/deviceStatus.py
Original file line number Diff line number Diff line change
Expand Up @@ -56,14 +56,14 @@ def loadConfigFile(source):
client = wiotp.sdk.application.ApplicationClient(options)

# Terminal colour mods
red="%c[31m" % chr(27)
green="%c[32m" % chr(27)
off="%c[0m" % chr(27)
red = "%c[31m" % chr(27)
green = "%c[32m" % chr(27)
off = "%c[0m" % chr(27)

statuses = client.registry.connectionStatus.find(typeId=args.typeId)
output = {}
for status in statuses:
#print(status)
# print(status)
clientId = status["id"]
deviceId = clientId.split(":")[3]
if not deviceId.startswith(args.batchId):
Expand All @@ -76,7 +76,7 @@ def loadConfigFile(source):
output[batchNum] = "%s%s%s" % (green, batchNum, off)
else:
output[batchNum] = "%s" % (batchNum)

print("=================================================")
print("Device Connection State Report")
print("")
Expand All @@ -85,14 +85,14 @@ def loadConfigFile(source):
print("%sconnected%s / %sdisconnected%s / unknown" % (green, off, red, off))
print("=================================================")
outStr = ""
for i in range(1,args.numberOfDevices+1):
for i in range(1, args.numberOfDevices + 1):
batchNum = "%04d" % (i)
if batchNum in output:
outStr += output[batchNum] + " "
else:
outStr += batchNum + " "

if batchNum[3] == "0":
outStr += "\n"

print(outStr)
2 changes: 1 addition & 1 deletion samples/simpleApp/simpleApp.py
Original file line number Diff line number Diff line change
Expand Up @@ -124,7 +124,7 @@ def usage():
options = wiotp.sdk.application.parseConfigFile(configFilePath)
else:
options = wiotp.sdk.application.parseEnvVars()

try:
client = wiotp.sdk.application.ApplicationClient(options)
# If you want to see more detail about what's going on, set log level to DEBUG
Expand Down
3 changes: 1 addition & 2 deletions src/wiotp/sdk/application/client.py
Original file line number Diff line number Diff line change
Expand Up @@ -99,13 +99,12 @@ def __init__(self, config, logHandlers=None):
# We directly expose the get() method via self.serviceStatus()
self._serviceStatus = ServiceStatus(apiClient)


def serviceStatus(self):
if not self._config.isQuickstart():
return self._serviceStatus.get()
else:
return None

def subscribeToDeviceEvents(self, typeId="+", deviceId="+", eventId="+", msgFormat="+", qos=0):
"""
Subscribe to device event messages
Expand Down

0 comments on commit 1c853a8

Please sign in to comment.