summary | shortlog | log | commit | commitdiff | tree
raw | patch | inline | side by side (parent: e4a12c7)
raw | patch | inline | side by side (parent: e4a12c7)
author | Max Kellermann <max@duempel.org> | |
Thu, 25 Sep 2008 15:49:56 +0000 (17:49 +0200) | ||
committer | Max Kellermann <max@duempel.org> | |
Thu, 25 Sep 2008 15:49:56 +0000 (17:49 +0200) |
Replace the "hd" plugin with a trivial shell script.
Makefile.am | patch | blob | history | |
lyrics/hd.py | [deleted file] | patch | blob | history |
lyrics/hd.sh | [new file with mode: 0755] | patch | blob |
diff --git a/Makefile.am b/Makefile.am
index e4f289585c7f032eab7f2984c1f59399e516e66a..fd57ca36947adedcdbd8b1102e2fbcc593bdbb0c 100644 (file)
--- a/Makefile.am
+++ b/Makefile.am
if LYRICS
lyrics_plugin_dir = @lyrics_plugin_dir@
-lyrics_plugins = hd.py leoslyrics.py lyricswiki.rb
+lyrics_plugins = hd.sh leoslyrics.py lyricswiki.rb
install-exec-local:
install -m 0755 -d $(DESTDIR)$(lyrics_plugin_dir)
diff --git a/lyrics/hd.py b/lyrics/hd.py
--- a/lyrics/hd.py
+++ /dev/null
@@ -1,22 +0,0 @@
-#!/usr/bin/python
-#
-# Load lyrics from the user's home directory
-#
-# Author: Max Kellermann <max@duempel.org>
-#
-
-from sys import argv, exit, stdout
-from os import environ
-from os.path import expanduser
-
-path = expanduser("~/.lyrics/%s - %s.txt" % (argv[1], argv[2]))
-try:
- f = file(path)
-except IOError:
- exit(2)
-
-while True:
- x = f.read(4096)
- if not x:
- break
- stdout.write(x)
diff --git a/lyrics/hd.sh b/lyrics/hd.sh
--- /dev/null
+++ b/lyrics/hd.sh
@@ -0,0 +1,8 @@
+#!/bin/sh -e
+#
+# Load lyrics from the user's home directory
+#
+# Author: Max Kellermann <max@duempel.org>
+#
+
+cat ~/.lyrics/"$1 - $2".txt 2>/dev/null