summary refs log tree commit diff stats
path: root/main.go
Commit message (Expand)AuthorAgeFilesLines
* moved bulk of code to its own package to clean up source treeBen Morrison2019-06-051-119/+0
* cli flags for db path/type, assets dir. systemd unit file. makefile.Ben Morrison2019-06-051-1/+0
* explicit method enumeration and page query valueBen Morrison2019-06-031-12/+28
* bugfix: more incorrectly logged errorsBen Morrison2019-05-311-1/+1
* comments editedBen Morrison2019-05-281-1/+1
* removed extraneous commentsBen Morrison2019-05-271-4/+2
* configuration init changesBen Morrison2019-05-231-3/+3
* tuning query handlingBen Morrison2019-05-221-1/+16
* runtime bugs related to api outputBen Morrison2019-05-211-0/+1
* rename closeLog channelBen Morrison2019-05-211-1/+1
* added cache update / db push intervals to conf;Ben Morrison2019-05-211-3/+3
* endpoint query function addedBen Morrison2019-05-201-7/+9
* middleware func to attach remote ip to contextBen Morrison2019-05-201-1/+7
* allowing underscore and hyphen in users/tagsBen Morrison2019-05-141-2/+2
* serving css virtually instead of directlyBen Morrison2019-05-131-0/+3
* redundant path removed. comments added.Ben Morrison2019-05-131-3/+5
* watching for ^C. added comments.Ben Morrison2019-05-131-2/+12
* reorganized handlers. StrictSlash(true). handling POST /api/plain/users for n...Ben Morrison2019-05-121-9/+25
* added stdoutLogging bool and related configurationBen Morrison2019-05-121-1/+0
* commented someBen Morrison2019-05-121-1/+9
* config fleshed out; using viper+pflagBen Morrison2019-05-121-3/+4
* query vars to endpoint in routingBen Morrison2019-05-111-1/+3
* more graceful routing of http requestsBen Morrison2019-05-111-8/+23
* skeleton handlers respondingBen Morrison2019-05-111-6/+8
* stubbed out handlersBen Morrison2019-05-111-2/+8
* gzipped responsesBen Morrison2019-05-111-2/+6
* reorgBen Morrison2019-05-111-1/+1
* change port for unprivileged bindsBen Morrison2019-05-101-1/+1
* building the skeletonBen Morrison2019-05-101-0/+14
> 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