Mercurial > libervia-web
diff src/server/server.py @ 482:437eefa53a01
misc: remove some pylint errors and warnings
author | souliane <souliane@mailoo.org> |
---|---|
date | Sun, 15 Jun 2014 18:16:24 +0200 |
parents | bbdc5357dc00 |
children | e588335b6aa8 |
line wrap: on
line diff
--- a/src/server/server.py Sun Jun 15 17:52:08 2014 +0200 +++ b/src/server/server.py Sun Jun 15 18:16:24 2014 +0200 @@ -181,7 +181,7 @@ #user is not identified, we return a jsonrpc fault parsed = jsonrpclib.loads(request.content.read()) fault = jsonrpclib.Fault(C.ERRNUM_LIBERVIA, C.NOT_ALLOWED) # FIXME: define some standard error codes for libervia - return jsonrpc.JSONRPC._cbRender(self, fault, request, parsed.get('id'), parsed.get('jsonrpc')) + return jsonrpc.JSONRPC._cbRender(self, fault, request, parsed.get('id'), parsed.get('jsonrpc')) # pylint: disable=E1103 return jsonrpc.JSONRPC.render(self, request) def jsonrpc_getProfileJid(self): @@ -580,14 +580,14 @@ return self.loginOrRegister(request) _session = request.getSession() parsed = jsonrpclib.loads(request.content.read()) - method = parsed.get("method") + method = parsed.get("method") # pylint: disable=E1103 if method not in ['isRegistered', 'registerParams', 'getMenus']: #if we don't call these methods, we need to be identified profile = ISATSession(_session).profile if not profile: #user is not identified, we return a jsonrpc fault fault = jsonrpclib.Fault(C.ERRNUM_LIBERVIA, C.NOT_ALLOWED) # FIXME: define some standard error codes for libervia - return jsonrpc.JSONRPC._cbRender(self, fault, request, parsed.get('id'), parsed.get('jsonrpc')) + return jsonrpc.JSONRPC._cbRender(self, fault, request, parsed.get('id'), parsed.get('jsonrpc')) # pylint: disable=E1103 self.request = request return jsonrpc.JSONRPC.render(self, request) @@ -855,7 +855,7 @@ if not profile in self.sat_host.prof_connected: return if profile in self.signalDeferred: - self.signalDeferred[profile].callback((function_name,args[:-1])) + self.signalDeferred[profile].callback((function_name, args[:-1])) del self.signalDeferred[profile] else: if profile not in self.queue: @@ -892,7 +892,7 @@ if not profile: #user is not identified, we return a jsonrpc fault fault = jsonrpclib.Fault(C.ERRNUM_LIBERVIA, C.NOT_ALLOWED) # FIXME: define some standard error codes for libervia - return jsonrpc.JSONRPC._cbRender(self, fault, request, parsed.get('id'), parsed.get('jsonrpc')) + return jsonrpc.JSONRPC._cbRender(self, fault, request, parsed.get('id'), parsed.get('jsonrpc')) # pylint: disable=E1103 self.request = request return jsonrpc.JSONRPC.render(self, request) @@ -1018,8 +1018,8 @@ ['security_warning', 'w', 1, _(u'Warn user that he is about to connect on HTTP.').encode('utf-8'), int], ['passphrase', 'k', '', (_(u"Passphrase for the SàT profile named '%s'") % C.SERVICE_PROFILE).encode('utf-8'), str], ['data_dir', 'd', DATA_DIR_DEFAULT, _(u'Data directory for Libervia').encode('utf-8'), coerceDataDir], - ] # options which are in sat.conf and on command line, see https://twistedmatrix.com/documents/current/api/twisted.python.usage.Options.html - OPT_PARAMETERS_CFG = [['empty_password_allowed_warning_dangerous_list', None, '', None]] # Options which are in sat.conf only + ] # options which are in sat.conf and on command line, see https://twistedmatrix.com/documents/current/api/twisted.python.usage.Options.html + OPT_PARAMETERS_CFG = [['empty_password_allowed_warning_dangerous_list', None, '', None]] # Options which are in sat.conf only def __init__(self, *args, **kwargs): self.initialised = defer.Deferred()