fix pylint warning '(old-style-class) Old-style class defined.'
authorAndrey Skvortsov <andrej.skvortzov@gmail.com>
Mon, 09 Oct 2017 12:30:14 +0300
changeset 1851 1b8b5324506c
parent 1850 614396cbffbf
child 1852 70c1cc354a8f
fix pylint warning '(old-style-class) Old-style class defined.'

This warning is ignored for classes from PyJSLib, because library
overrides base object class.
svgui/pyjs/jsonrpc/jsonrpc.py
svgui/pyjs/lib/pyjslib.py
svgui/pyjs/pyjs.py
svgui/svguilib.py
tests/tools/check_source.sh
--- a/svgui/pyjs/jsonrpc/jsonrpc.py	Fri Oct 06 17:52:34 2017 +0300
+++ b/svgui/pyjs/jsonrpc/jsonrpc.py	Mon Oct 09 12:30:14 2017 +0300
@@ -2,7 +2,7 @@
 import gluon.contrib.simplejson as simplejson
 
 
-class JSONRPCServiceBase:
+class JSONRPCServiceBase(object):
 
     def __init__(self):
         self.methods = {}
--- a/svgui/pyjs/lib/pyjslib.py	Fri Oct 06 17:52:34 2017 +0300
+++ b/svgui/pyjs/lib/pyjslib.py	Mon Oct 09 12:30:14 2017 +0300
@@ -187,6 +187,7 @@
 """)
 
 
+# pylint: disable=C1001
 class Object:
     pass
 
--- a/svgui/pyjs/pyjs.py	Fri Oct 06 17:52:34 2017 +0300
+++ b/svgui/pyjs/pyjs.py	Mon Oct 09 12:30:14 2017 +0300
@@ -136,7 +136,7 @@
     return '.'.join(name)
 
 
-class Klass:
+class Klass(object):
 
     klasses = {}
 
@@ -192,7 +192,7 @@
         mod_var_name_decl(importName)
 
 
-class Translator:
+class Translator(object):
 
     def __init__(self, mn, module_name, raw_module_name, src, debug, mod, output,
                  dynamic=0, optimize=False,
@@ -1539,7 +1539,7 @@
     return output.getvalue()
 
 
-class PlatformParser:
+class PlatformParser(object):
     def __init__(self, platform_dir="", verbose=True):
         self.platform_dir = platform_dir
         self.parse_cache = {}
@@ -1634,7 +1634,7 @@
     return path.replace(".", "/") + ext
 
 
-class AppTranslator:
+class AppTranslator(object):
 
     def __init__(self, library_dirs=[], parser=None, dynamic=False,
                  optimize=False, verbose=True):
--- a/svgui/svguilib.py	Fri Oct 06 17:52:34 2017 +0300
+++ b/svgui/svguilib.py	Mon Oct 09 12:30:14 2017 +0300
@@ -23,6 +23,7 @@
 # Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA  02110-1301, USA.
 
 
+# pylint: disable=C1001
 class button:
 
     def __init__(self, parent, id, args):
--- a/tests/tools/check_source.sh	Fri Oct 06 17:52:34 2017 +0300
+++ b/tests/tools/check_source.sh	Mon Oct 09 12:30:14 2017 +0300
@@ -201,7 +201,9 @@
     disable=$disable,W0511        # fixme
     disable=$disable,W0110        # (deprecated-lambda) map/filter on lambda could be replaced by comprehension
     disable=$disable,W1401        # (anomalous-backslash-in-string) Anomalous backslash in string: '\.'. String constant might be missing an r prefix.
-
+    disable=$disable,W0613        # (unused-argument) Unused argument 'X'
+    disable=$disable,W0622        # (redefined-builtin) Redefining built-in
+    
     enable=
     enable=$enable,E1601          # print statement used
     enable=$enable,C0325          # (superfluous-parens) Unnecessary parens after keyword    
@@ -217,11 +219,10 @@
     enable=$enable,E0102          # (function-redefined) method already defined
     enable=$enable,W0602          # (global-variable-not-assigned) Using global for 'X' but no assignment is done
     enable=$enable,W0612          # (unused-variable) Unused variable 'X'
-    enable=$enable,W0611          # (unused-import), Unused import connectors
+    enable=$enable,W0611          # (unused-import) Unused import X
+    enable=$enable,C1001          # (old-style-class) Old-style class defined. Problem with PyJS
 
     # enable=$enable,W0403        # relative import
-    # enable=$enable,W0622        # (redefined-builtin) Redefining built-in
-    # enable=$enable,C1001        # (old-style-class) Old-style class defined. Problem with PyJS
     # enable=
 
     options=