summary refs log tree commit diff stats
path: root/setup.py
diff options
context:
space:
mode:
authorhut <hut@lepus.uberspace.de>2015-04-09 16:36:09 +0200
committerhut <hut@lepus.uberspace.de>2015-04-09 16:36:09 +0200
commite01be7133607697331b82d35476ac6131e110e1a (patch)
tree2af796b3049b3cc672af579c6a97f2871d5d5585 /setup.py
parent05eb02687f8d06fd5c334f11e21a44bd3243bbba (diff)
parente2393938bf56f2bd6b93ea11e9282cf6d40a2514 (diff)
downloadranger-e01be7133607697331b82d35476ac6131e110e1a.tar.gz
Merge branch 'feature/fix-embedded-shell' of git://github.com/eiiches/ranger
Diffstat (limited to 'setup.py')
0 files changed, 0 insertions, 0 deletions
012-12-04 21:20:09 +0100 removed options.py, improved plugins. *UPDATE YOUR COMMANDS.PY*' href='/akspecs/ranger/commit/examples/plugin_new_macro.py?h=v1.9.2&id=972da7babcecbe47bd56a3d2d19157b4aba61e99'>972da7ba ^
972da7ba ^
b3d031a9 ^
185c022e ^
ab41c776 ^

b3d031a9 ^
972da7ba ^
b3d031a9 ^
24712b90 ^

972da7ba ^
b3d031a9 ^
972da7ba ^
185c022e ^
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
                                            
 



                                                                            
                                                                  
 

           
                          
 
                                  
                                                       

 
                             
                               
                                 

                                              
 
 
                       
                                                             
# Compatible with ranger 1.6.0 through 1.7.*
#
# This plugin adds the new macro %date which is substituted with the current
# date in commands that allow macros.  You can test it with the command
# ":shell echo %date; read"

from __future__ import (absolute_import, division, print_function)

import time

import ranger.core.actions

# Save the original macro function
GET_MACROS_OLD = ranger.core.actions.Actions.get_macros


# Define a new macro function
def get_macros_with_date(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