#!/usr/bin/env python

import sys
import argparse
from magento import MagentoAPI

try:
    from IPython import embed
except:
    print "You must have IPython installed to use this shell. Try"
    print "'pip install ipython', 'easy_install ipython' , or head"
    print "over to ipython.org."
    sys.exit(1)

def main():
    parser = argparse.ArgumentParser(
        description=\
            "Launch an IPython shell with a MagentoAPI instance, 'magento' " + \
            "connected to a given endpoint.")
    parser.add_argument("host", help="The Magento server host.")
    parser.add_argument("port", type=int, help="The Magento server port.")
    parser.add_argument("api_user", help="The API user to log in as.")
    parser.add_argument("api_key", help="The API key to log in with.")
    parser.add_argument("-v", "--verbose", action="store_true", 
                        help="Set the XML-RPC client to verbose.")
        
    args = parser.parse_args()

    endpoint = {
        "host": args.host,
        "port": args.port,
        "api_user": args.api_user,
        "api_key": args.api_key,
        "verbose": args.verbose
    }

    url = "http://%s:%d" % (args.host, args.port) + MagentoAPI.PATH

    print
    print
    print "-- magento-ipython-shell -----------------"
    print "Connecting to '%s'" % url
    print "Using API user/key %s/%s" % (args.api_user, args.api_key)
    magento = MagentoAPI(**endpoint)
    print "Connected! The 'magento' variable is bound to a usable MagentoAPI instance."
    print "-- magento-ipython-shell -----------------"
    print
    print
    embed() # Shell time!

if __name__ == "__main__":
    main()

@@ -780,24 +780,117 @@
  in with.%22)%0A
+    parser.add_argument(%22-p%22, %22--path%22, help=%22The URL path to your instance's XML-RPC API.%22)%0A
     parser.a
@@ -1189,16 +1189,43 @@
 pi_key,%0A
+        %22path%22: args.path,%0A
         
@@ -1255,16 +1255,71 @@
 %0A    %7D%0A%0A
+    path = args.path if args.path else MagentoAPI.PATH%0A
     url 
@@ -1362,31 +1362,20 @@
 port) + 
-MagentoAPI.PATH
+path
 %0A%0A    pr

Add ability to specify path in magento-ipython-shell