summary refs log tree commit diff stats
path: root/examples/plugin_new_macro.py
diff options
context:
space:
mode:
authornfnty <git@nfnty.se>2016-12-21 05:06:55 +0100
committernfnty <git@nfnty.se>2017-01-17 05:59:02 +0100
commitb3d031a913814900467358b2adf20a148bf6de1a (patch)
tree6f5b435817ec9cbe850fb73485a7e6c77da28c14 /examples/plugin_new_macro.py
parent76791a70467d7223a966aa9f12f5583b01d704a8 (diff)
downloadranger-b3d031a913814900467358b2adf20a148bf6de1a.tar.gz
linting: pylint and flake8
Diffstat (limited to 'examples/plugin_new_macro.py')
-rw-r--r--examples/plugin_new_macro.py14
1 files changed, 8 insertions, 6 deletions
diff --git a/examples/plugin_new_macro.py b/examples/plugin_new_macro.py
index 8dbe435d..1c69b841 100644
--- a/examples/plugin_new_macro.py
+++ b/examples/plugin_new_macro.py
@@ -4,18 +4,20 @@
 # date in commands that allow macros.  You can test it with the command
 # ":shell echo %date; read"
 
-# Save the original macro function
+import time
+
 import ranger.core.actions
-old_get_macros = ranger.core.actions.Actions._get_macros
 
-# Define a new macro function
-import time
+# Save the original macro function
+GET_MACROS_OLD = ranger.core.actions.Actions._get_macros  # pylint: disable=protected-access
 
 
+# Define a new macro function
 def get_macros_with_date(self):
-    macros = old_get_macros(self)
+    macros = GET_MACROS_OLD(self)
     macros['date'] = time.strftime('%m/%d/%Y')
     return macros
 
+
 # Overwrite the old one
-ranger.core.actions.Actions._get_macros = get_macros_with_date
+ranger.core.actions.Actions._get_macros = get_macros_with_date  # pylint: disable=protected-access