Current location

narf Source control manager Git

summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorshtrom <shtrom@1991c358-8f32-0410-a49a-990740bdf4c2>2007-11-03 13:31:01 +0000
committershtrom <shtrom@1991c358-8f32-0410-a49a-990740bdf4c2>2007-11-03 13:31:01 +0000
commit38f4342deca6c806b7077646b6932855b20e6dcf (patch)
treea71aa6c154de95a64d134be21c08eca0f618260b /lastfm.py
parent2711fd6470b6c78eabd212ae441c91cdf65001ab (diff)
lastfm.py is now executable and has a dummy action.
git-svn-id: svn+ssh://scm.narf.ssji.net/svn/shtrom/scripts@46 1991c358-8f32-0410-a49a-990740bdf4c2
Diffstat (limited to 'lastfm.py')
-rwxr-xr-x[-rw-r--r--]lastfm.py8
1 files changed, 8 insertions, 0 deletions
diff --git a/lastfm.py b/lastfm.py
index 17349ed..6230587 100644..100755
--- a/lastfm.py
+++ b/lastfm.py
@@ -140,3 +140,11 @@ class LastFM:
if self.lastSongIsRecent(delay):
return self.getLastSong()
return None
+
+# Fallback if the script is called directly
+if __name__ == "__main__":
+ from sys import argv
+ if len(argv) != 2:
+ raise Exception("Incorrect number of arguments. Only the Last.fm usernam is required.")
+
+ print LastFM(argv[1])