summary refs log tree commit diff stats
diff options
context:
space:
mode:
authornfnty <git@nfnty.se>2016-12-24 06:02:05 +0100
committernfnty <git@nfnty.se>2017-01-17 05:59:03 +0100
commitcc5c53a696f6d517f8661fbac89444afa3224475 (patch)
tree74ec71d82b808ee0206da5c9c0792cbb871b8413
parentf6de16792bd4f2ebce354a6b493dd7c310eadc77 (diff)
downloadranger-cc5c53a696f6d517f8661fbac89444afa3224475.tar.gz
linting: `ranger.core.runner.Context`: Init all attributes
-rw-r--r--.pylintrc2
-rw-r--r--ranger/core/runner.py18
2 files changed, 14 insertions, 6 deletions
diff --git a/.pylintrc b/.pylintrc
index 5a5c135f..2adabf2f 100644
--- a/.pylintrc
+++ b/.pylintrc
@@ -11,4 +11,4 @@ max-line-length = 99
 disable=locally-disabled,locally-enabled,missing-docstring,duplicate-code,fixme,broad-except,cyclic-import,attribute-defined-outside-init,access-member-before-definition
 
 [TYPECHECK]
-ignored-classes=ranger.core.runner.Context,ranger.core.actions.Actions,ranger.gui.widgets.view_base.ViewBase,ranger.gui.curses_shortcuts.CursesShortcuts
+ignored-classes=ranger.core.actions.Actions,ranger.gui.widgets.view_base.ViewBase,ranger.gui.curses_shortcuts.CursesShortcuts
diff --git a/ranger/core/runner.py b/ranger/core/runner.py
index a0eb161f..ee182c29 100644
--- a/ranger/core/runner.py
+++ b/ranger/core/runner.py
@@ -47,7 +47,7 @@ def press_enter():
     waitfnc()
 
 
-class Context(object):
+class Context(object):  # pylint: disable=too-many-instance-attributes
     """A context object contains data on how to run a process.
 
     The attributes are:
@@ -64,10 +64,18 @@ class Context(object):
     popen_kws -- keyword arguments which are directly passed to Popen
     """
 
-    def __init__(self, **keywords):
-        self.flags = None
-        self.wait = False
-        self.__dict__ = keywords
+    def __init__(  # pylint: disable=redefined-builtin,too-many-arguments
+            self, action=None, app=None, mode=None, flags=None,
+            files=None, file=None, fm=None, wait=None, popen_kws=None):
+        self.action = action
+        self.app = app
+        self.mode = mode
+        self.flags = flags
+        self.files = files
+        self.file = file
+        self.fm = fm
+        self.wait = wait
+        self.popen_kws = popen_kws
 
     @property
     def filepaths(self):