aboutsummaryrefslogtreecommitdiffstats
path: root/lyrics/hd.py
diff options
context:
space:
mode:
Diffstat (limited to 'lyrics/hd.py')
-rwxr-xr-xlyrics/hd.py22
1 files changed, 22 insertions, 0 deletions
diff --git a/lyrics/hd.py b/lyrics/hd.py
new file mode 100755
index 000000000..173342c98
--- /dev/null
+++ b/lyrics/hd.py
@@ -0,0 +1,22 @@
+#!/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)