From 43e418ebd4086dd483d0ec727ddcabf375f7d360 Mon Sep 17 00:00:00 2001 From: Max Kellermann Date: Thu, 25 Sep 2008 17:49:56 +0200 Subject: [PATCH] lyrics: replaced "hd.py" with "hd.sh" Replace the "hd" plugin with a trivial shell script. --- Makefile.am | 2 +- lyrics/hd.py | 22 ---------------------- lyrics/hd.sh | 8 ++++++++ 3 files changed, 9 insertions(+), 23 deletions(-) delete mode 100755 lyrics/hd.py create mode 100755 lyrics/hd.sh diff --git a/Makefile.am b/Makefile.am index e4f2895..fd57ca3 100644 --- a/Makefile.am +++ b/Makefile.am @@ -26,7 +26,7 @@ EXTRA_DIST = \ 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 deleted file mode 100755 index 173342c..0000000 --- a/lyrics/hd.py +++ /dev/null @@ -1,22 +0,0 @@ -#!/usr/bin/python -# -# Load lyrics from the user's home directory -# -# Author: Max Kellermann -# - -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 new file mode 100755 index 0000000..4bcbce4 --- /dev/null +++ b/lyrics/hd.sh @@ -0,0 +1,8 @@ +#!/bin/sh -e +# +# Load lyrics from the user's home directory +# +# Author: Max Kellermann +# + +cat ~/.lyrics/"$1 - $2".txt 2>/dev/null -- 2.30.2