Created
January 31, 2015 13:59
-
-
Save Nicd/30598e036ede2eb23d1d to your computer and use it in GitHub Desktop.
Fix WeeChat script grep.py to expand home dirs in logfile path
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
diff --git a/python/grep.py b/python/grep.py | |
index fd9ca2b..4fd5c64 100644 | |
--- a/python/grep.py | |
+++ b/python/grep.py | |
@@ -65,6 +65,12 @@ | |
# | |
# | |
# History: | |
+# | |
+# 2015-01-31, Nicd- | |
+# version 0.7.5: | |
+# '~' is now expaned to the home directory in the log file path so | |
+# paths like '~/logs/' should work. | |
+# | |
# 2015-01-14, nils_2 | |
# version 0.7.4: make q work to quit grep buffer (requested by: gb) | |
# | |
@@ -194,7 +200,7 @@ except ImportError: | |
SCRIPT_NAME = "grep" | |
SCRIPT_AUTHOR = "Elián Hanisch <[email protected]>" | |
-SCRIPT_VERSION = "0.7.4" | |
+SCRIPT_VERSION = "0.7.5" | |
SCRIPT_LICENSE = "GPL3" | |
SCRIPT_DESC = "Search in buffers and logs" | |
SCRIPT_COMMAND = "grep" | |
@@ -408,6 +414,7 @@ def get_config_log_filter(): | |
def get_home(): | |
home = weechat.config_string(weechat.config_get('logger.file.path')) | |
+ home = path.abspath(path.expanduser(home)) | |
return home.replace('%h', weechat.info_get('weechat_dir', '')) | |
def strip_home(s, dir=''): |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment