Skip to content

Commit eec7acd

Browse files
committed
Fix Pylint issue with overriding static methods.
see pylint-dev/pylint#6019
1 parent 440db75 commit eec7acd

File tree

7 files changed

+9
-16
lines changed

7 files changed

+9
-16
lines changed

webware/Examples/JSONRPCExample.py

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -30,6 +30,5 @@ def uppercase(msg):
3030
def lowercase(msg):
3131
return msg.lower()
3232

33-
@staticmethod
34-
def exposedMethods():
33+
def exposedMethods(self):
3534
return ['echo', 'reverse', 'uppercase', 'lowercase']

webware/HTTPServlet.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -41,6 +41,7 @@ def respond(self, transaction):
4141
# For GET and HEAD, handle the HTTP If-Modified-Since header:
4242
# If the object's last modified time equals this header, we're done.
4343
if httpMethodName in ('GET', 'HEAD'):
44+
# pylint: disable=assignment-from-none
4445
lastMod = self.lastModified(transaction)
4546
if lastMod:
4647
lastMod = strftime(
@@ -65,8 +66,7 @@ def respond(self, transaction):
6566
def notImplemented(trans):
6667
trans.response().setStatus(501, 'Not Implemented')
6768

68-
@staticmethod
69-
def lastModified(_trans):
69+
def lastModified(self, _trans):
7070
"""Get time of last modification.
7171
7272
Return this object's Last-Modified time (as a float),

webware/JSONRPCServlet.py

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -48,8 +48,7 @@ def actions(self):
4848
actions.append('jsonCall')
4949
return actions
5050

51-
@staticmethod
52-
def exposedMethods():
51+
def exposedMethods(self):
5352
"""Return a list or a set of all exposed RPC methods."""
5453
return []
5554

webware/RPCServlet.py

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -18,8 +18,7 @@ def call(self, methodName, *args, **keywords):
1818
raise NotImplementedError(methodName)
1919
return getattr(self, methodName)(*args, **keywords)
2020

21-
@staticmethod
22-
def exposedMethods():
21+
def exposedMethods(self):
2322
"""Get exposed methods.
2423
2524
Subclasses should return a list of methods that will be exposed

webware/Request.py

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -100,8 +100,7 @@ def localPort(self):
100100

101101
# region Security
102102

103-
@staticmethod
104-
def isSecure():
103+
def isSecure(self):
105104
"""Check whether this is a secure channel.
106105
107106
Returns true if request was made using a secure channel,

webware/Servlet.py

Lines changed: 2 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -127,8 +127,7 @@ def log(self, message):
127127

128128
# region Abilities
129129

130-
@staticmethod
131-
def canBeThreaded():
130+
def canBeThreaded(self):
132131
"""Return whether the servlet can be multithreaded.
133132
134133
This value should not change during the lifetime of the object.
@@ -137,8 +136,7 @@ def canBeThreaded():
137136
"""
138137
return False
139138

140-
@staticmethod
141-
def canBeReused():
139+
def canBeReused(self):
142140
"""Returns whether a single servlet instance can be reused.
143141
144142
The default is True, but subclasses con override to return False.

webware/SidebarPage.py

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -152,8 +152,7 @@ def writeBanner(self):
152152
def writeSidebar(self):
153153
self.writeWebwareSidebarSections()
154154

155-
@staticmethod
156-
def cornerTitle():
155+
def cornerTitle(self):
157156
return ''
158157

159158
# endregion Content methods

0 commit comments

Comments
 (0)