Page MenuHomeDevCentral

D3976.id10322.diff
No OneTemporary

D3976.id10322.diff

diff --git a/support/terminator/README.md b/support/terminator/README.md
new file mode 100644
--- /dev/null
+++ b/support/terminator/README.md
@@ -0,0 +1,11 @@
+resolve_hash.py is a Terminator plugin to call Resolve hash as URL handler for longer hashes.
+
+How to install :
+
+The plugin file must be placed in ~/.config/terminator/plugins/
+The plugin needs "resolve-hash" module to be installed on your system for it to work.
+
+--
+
+- Restart terminator.
+- Go to preferences --> plugins --> activate "ResolveHashURLHandler" in the menu.
diff --git a/support/terminator/resolve_hash.py b/support/terminator/resolve_hash.py
new file mode 100644
--- /dev/null
+++ b/support/terminator/resolve_hash.py
@@ -0,0 +1,39 @@
+# -------------------------------------------------------------
+# Resolve hash
+# - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
+# Project: Nasqueron
+# Description: Terminator plugin to call Resolve hash as
+# URL handler for longer hashes
+# License: BSD-2-Clause
+# -------------------------------------------------------------
+
+from terminatorlib.plugin import URLHandler
+
+from resolvehash.resolvehash import parse_config, find_hash
+
+AVAILABLE = ["ResolveHashURLHandler"]
+
+
+class ResolveHashURLHandler(URLHandler):
+ capabilities = ["url_handler"]
+ handler_name = "resolve_hash"
+ name = "Nasqueron Resolve Hash"
+
+ # Long enough hexadecimal expressions are good hash candidates
+ match = r"\b[0-9a-f]{7,40}\b"
+
+ def __init__(self):
+ URLHandler.__init__(self)
+ self.config = parse_config()
+
+ def callback(self, needle_hash):
+ try:
+ final_url = find_hash(self.config, needle_hash)
+
+ if final_url.startswith("http"):
+ return final_url
+
+ except Exception:
+ pass
+
+ return None

File Metadata

Mime Type
text/plain
Expires
Sun, Mar 1, 21:03 (21 h, 16 m)
Storage Engine
blob
Storage Format
Raw Data
Storage Handle
3483575
Default Alt Text
D3976.id10322.diff (1 KB)

Event Timeline