summary refs log tree commit diff stats
path: root/examples/plugin_new_macro.py
diff options
context:
space:
mode:
authornfnty <git@nfnty.se>2017-01-20 12:07:53 +0100
committernfnty <git@nfnty.se>2017-01-20 12:07:53 +0100
commit1c90e610de6591e8052a1056c775219b5e767002 (patch)
tree69b56f67dee1d6dfcea869de897846baaded3fa6 /examples/plugin_new_macro.py
parente26d163debc9f55a89a27f94a43771526d2ff0b7 (diff)
parent03ee065e35c6a8f0e0dc1e66d8f4c3e83c51f315 (diff)
downloadranger-1c90e610de6591e8052a1056c775219b5e767002.tar.gz
Merge branch 'lint'
Diffstat (limited to 'examples/plugin_new_macro.py')
-rw-r--r--examples/plugin_new_macro.py16
1 files changed, 10 insertions, 6 deletions
diff --git a/examples/plugin_new_macro.py b/examples/plugin_new_macro.py
index 8dbe435d..0e44cdd3 100644
--- a/examples/plugin_new_macro.py
+++ b/examples/plugin_new_macro.py
@@ -4,18 +4,22 @@
 # date in commands that allow macros.  You can test it with the command
 # ":shell echo %date; read"
 
-# Save the original macro function
-import ranger.core.actions
-old_get_macros = ranger.core.actions.Actions._get_macros
+from __future__ import (absolute_import, print_function)
 
-# Define a new macro function
 import time
 
+import ranger.core.actions
 
+# 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