11#!/usr/bin/env python3
22# -*- coding: utf-8 -*-
33### This file was automatically generated by wsjcpp-jsonrpc20
4- ### Version: v0.0.2
5- ### Date: Sun, 13 Sep 2020 19:26:47 GMT
4+ ### Version: v0.0.3
5+ ### Date: Fri, 18 Sep 2020 03:27:31 GMT
66
77import asyncio
88import websocket
1313class SomeClient :
1414 __ws = None
1515 __url = None
16- __cli_version = 'v0.0.2 '
16+ __cli_version = 'v0.0.3 '
1717 __loop = None
1818 __token = None
1919 __connecting = False
@@ -45,7 +45,7 @@ def hasConnection(self):
4545 def getToken (self ):
4646 return self .__token
4747 def setToken (self , token ):
48- if self .__token == None :
48+ if self .__token is None :
4949 self .__token = token
5050 else :
5151 print ('ERROR: Token can be set only once' )
@@ -56,10 +56,10 @@ def close(self):
5656 self .__ws = None
5757
5858 def receiveIncomingMesssages (self ):
59- if self .__ws == None :
59+ if self .__ws is None :
6060 return None # TODO has not connection
6161 while True :
62- if self .__ws == None :
62+ if self .__ws is None :
6363 return None # TODO has not connection
6464 ready = select .select ([self .__ws ], [], [], 1 )
6565 if ready [0 ]:
@@ -83,7 +83,7 @@ async def __looper(self, messageId):
8383 max_time = 5 * 10 # 5 seconds
8484 counter_time = 0
8585 while True :
86- if self .__ws == None :
86+ if self .__ws is None :
8787 return None # TODO has not connection
8888 for inmsg in self .__incomingMesssages :
8989 if inmsg ['id' ] == messageId :
@@ -130,7 +130,7 @@ def __sendCommand(self, req):
130130 return result
131131
132132 def preprocessIncomeJson (self , jsonIn ):
133- if jsonIn == None :
133+ if jsonIn is None :
134134 return jsonIn
135135 if jsonIn ['method' ] == 'auth_logoff' and 'result' in jsonIn :
136136 self .__token = None
@@ -157,12 +157,12 @@ def auth_login(self, login, password, client_app_name = None, client_app_version
157157 """
158158 if not self .hasConnection (): return None
159159 reqJson = self .generateBaseCommand ('auth_login' )
160- if login == None :
160+ if login is None :
161161 raise Exception ('Parameter "login" expected (lib: SomeClient.auth_login)' )
162162 if not isinstance (login , str ):
163163 raise Exception ('Parameter "login" expected datatype "str" (lib: SomeClient.auth_login )' )
164164 reqJson ['params' ]['login' ] = login
165- if password == None :
165+ if password is None :
166166 raise Exception ('Parameter "password" expected (lib: SomeClient.auth_login)' )
167167 if not isinstance (password , str ):
168168 raise Exception ('Parameter "password" expected datatype "str" (lib: SomeClient.auth_login )' )
@@ -207,7 +207,7 @@ def auth_token(self, token, client_app_name = None, client_app_version = None):
207207 """
208208 if not self .hasConnection (): return None
209209 reqJson = self .generateBaseCommand ('auth_token' )
210- if token == None :
210+ if token is None :
211211 raise Exception ('Parameter "token" expected (lib: SomeClient.auth_token)' )
212212 if not isinstance (token , str ):
213213 raise Exception ('Parameter "token" expected datatype "str" (lib: SomeClient.auth_token )' )
@@ -242,7 +242,7 @@ def game_create(self, uuid, cost, public, name = None, age = None, activated = N
242242 """
243243 if not self .hasConnection (): return None
244244 reqJson = self .generateBaseCommand ('game_create' )
245- if uuid == None :
245+ if uuid is None :
246246 raise Exception ('Parameter "uuid" expected (lib: SomeClient.game_create)' )
247247 if not isinstance (uuid , str ):
248248 raise Exception ('Parameter "uuid" expected datatype "str" (lib: SomeClient.game_create )' )
@@ -251,7 +251,7 @@ def game_create(self, uuid, cost, public, name = None, age = None, activated = N
251251 if not isinstance (name , str ):
252252 raise Exception ('Parameter "name" expected datatype "str" (lib: SomeClient.game_create )' )
253253 reqJson ['params' ]['name' ] = name
254- if cost == None :
254+ if cost is None :
255255 raise Exception ('Parameter "cost" expected (lib: SomeClient.game_create)' )
256256 if not isinstance (cost , int ):
257257 raise Exception ('Parameter "cost" expected datatype "int" (lib: SomeClient.game_create )' )
@@ -260,7 +260,7 @@ def game_create(self, uuid, cost, public, name = None, age = None, activated = N
260260 if not isinstance (age , int ):
261261 raise Exception ('Parameter "age" expected datatype "int" (lib: SomeClient.game_create )' )
262262 reqJson ['params' ]['age' ] = age
263- if public == None :
263+ if public is None :
264264 raise Exception ('Parameter "public" expected (lib: SomeClient.game_create)' )
265265 if not isinstance (public , bool ):
266266 raise Exception ('Parameter "public" expected datatype "bool" (lib: SomeClient.game_create )' )
0 commit comments