<commit_before># 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"

# Save the original macro function
import ranger.core.actions
old_get_macros = ranger.core.actions.Actions._get_macros

# Define a new macro function
import time
def get_macros_with_date(self):
    macros = old_get_macros(self)
    macros['date'] = time.strftime('%Y-%m-%d')
    macros['dt'] = time.strftime('%Y%m%d')
    return macros

# Overwrite the old one
ranger.core.actions.Actions._get_macros = get_macros_with_date
<commit_msg>[ranger] temp disable macro_date<commit_after># 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"

# BUG: Error while loading plugin 'macro_date'
# Save the original macro function
# import ranger.core.actions
# old_get_macros = ranger.core.actions.Actions._get_macros

# Define a new macro function
import time
def get_macros_with_date(self):
    macros = old_get_macros(self)
    macros['date'] = time.strftime('%Y-%m-%d')
    macros['dt'] = time.strftime('%Y%m%d')
    return macros

# Overwrite the old one
# ranger.core.actions.Actions._get_macros = get_macros_with_date

{'fraction_non_alphanumeric': 0.10323033707865169, 'fraction_numerical': 0.007022471910112359, 'mean_word_length': 4.610236220472441, 'pattern_counts': {'":': 2, '<': 3, '<?xml version=': 0, '>': 3, 'https://': 0, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 0, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '5189408', 'n_tokens_mistral': 483, 'n_tokens_neox': 464, 'n_words': 147}