[kupfer] plugin.commands: Don't match absolute paths



commit 931b8c822eee5bb312f820fefa4649937d29df03
Author: Ulrik Sverdrup <ulrik sverdrup gmail com>
Date:   Thu Dec 10 15:06:40 2009 +0100

    plugin.commands: Don't match absolute paths
    
    Matching absolute paths as shell commands is unnecessesary and it
    creates (near-)duplicate items.

 kupfer/plugin/commands.py |    2 ++
 1 files changed, 2 insertions(+), 0 deletions(-)
---
diff --git a/kupfer/plugin/commands.py b/kupfer/plugin/commands.py
index 3defec4..1f7f968 100644
--- a/kupfer/plugin/commands.py
+++ b/kupfer/plugin/commands.py
@@ -48,6 +48,8 @@ class CommandTextSource (TextSource):
 		if len(text.splitlines()) > 1:
 			return
 		firstword = text.split()[0]
+		if firstword.startswith("/"):
+			return
 		# iterate over $PATH directories
 		PATH = os.environ.get("PATH") or os.defpath
 		for execdir in PATH.split(os.pathsep):



[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]