about summary refs log tree commit diff
path: root/weechat/.weechat/python/urlview.py
diff options
context:
space:
mode:
authorBen Harris <ben@tilde.team>2021-04-16 13:49:55 -0400
committerBen Harris <ben@tilde.team>2021-04-16 13:49:55 -0400
commitc602ed4c3b8554760f80740ee2dbcbd79de945dd (patch)
tree3edbc350ffa626b335009ad7a31441b65e353b3f /weechat/.weechat/python/urlview.py
parent1b0443ec4d93ff9e7be6fed61898178362ed5109 (diff)
update weechat autojoins
Diffstat (limited to 'weechat/.weechat/python/urlview.py')
-rw-r--r--weechat/.weechat/python/urlview.py57
1 files changed, 0 insertions, 57 deletions
diff --git a/weechat/.weechat/python/urlview.py b/weechat/.weechat/python/urlview.py
deleted file mode 100644
index a429f1e..0000000
--- a/weechat/.weechat/python/urlview.py
+++ /dev/null
@@ -1,57 +0,0 @@
-# This weechat plugin pipes the current weechat buffer through urlview
-#
-# Usage:
-# /urlview
-#
-# History:
-# 10-04-2015
-# Version 1.0.0: initial release
-# Version 1.0.1: reverse text passed to urlview
-# Version 1.0.2: remove weechat color from messages
-
-import distutils.spawn
-import os
-import pipes
-import weechat
-
-
-def urlview(data, buf, args):
-    infolist = weechat.infolist_get("buffer_lines", buf, "")
-    lines = []
-    while weechat.infolist_next(infolist) == 1:
-        lines.append(
-            weechat.string_remove_color(
-                weechat.infolist_string(infolist, "message"),
-                ""
-            )
-        )
-
-    weechat.infolist_free(infolist)
-
-    if not lines:
-        weechat.prnt(buf, "No URLs found")
-        return weechat.WEECHAT_RC_OK
-
-    text = "\n".join(reversed(lines))
-    response = os.system("echo %s | urlview" % pipes.quote(text))
-    if response != 0:
-        weechat.prnt(buf, "No URLs found")
-
-    weechat.command(buf, "/window refresh")
-
-    return weechat.WEECHAT_RC_OK
-
-
-def main():
-    if distutils.spawn.find_executable("urlview") is None:
-        return weechat.WEECHAT_RC_ERROR
-
-    if not weechat.register("urlview", "Keith Smiley", "1.0.2", "MIT",
-                            "Use urlview on the current buffer", "", ""):
-        return weechat.WEECHAT_RC_ERROR
-
-    weechat.hook_command("urlview", "Pass the current buffer to urlview", "",
-                         "", "", "urlview", "")
-
-if __name__ == "__main__":
-    main()