#!/usr/bin/python ################################################### # # iTunes Python Shell Script v0.2.1 # http://blog.jadecell.org/ # # inspired by the bash shell scripts on MacOSXHints # http://www.macosxhints.com/article.php?story=20011108211802830 # # README # - give read/execute permissions to the file (ex 'chmod 755 ./itunes') # - import this script into your bin directory (ex '/usr/bin' or '~/bin') # - alternatively you can make a symbolic link: # sudo ln -s /path/to/your/mypytunes/itunes.py /usr/bin/itunes from os import system as cmd from sys import argv as args def pyTunes(args): """Main Script function to run""" try: args[1] # if no argument except: defHelp() # show help definition and exit if(mDefs.has_key(args[1])): # Verify if argument is available and execute mounter(args) else: # otherwise show list of arguments available print "\n** invalid argument **\n" showHelp() def myException(x): """Raise exception and exit out of the program""" print x raise SystemExit def defHelp(): """Minimal Help function (tells user to run 'help' for list of arguments)""" myException(" No arguments provided - Usage %s