Skip to content

Commit

Permalink
IPython 0.11+ compatibility
Browse files Browse the repository at this point in the history
  • Loading branch information
thobbs committed Oct 14, 2011
1 parent 2d0db6f commit 97ad974
Showing 1 changed file with 17 additions and 9 deletions.
26 changes: 17 additions & 9 deletions pycassaShell
Expand Up @@ -5,19 +5,27 @@ interactive Cassandra Python shell
"""

#try:
# from IPython.Shell import IPShellEmbed
#except ImportError:
# print "[I]: IPython not found, falling back to default interpreter."
try:
from IPython.Shell import IPShellEmbed
import IPython

if hasattr(IPython, "embed"):
def runshell():
IPython.embed(banner1="")
else:
import IPython.Shell
def runshell():
IPython.Shell.IPShellEmbed([])()

except ImportError:
print "[I]: IPython not found, falling back to default interpreter."

def runshell():
import os
os.environ['PYTHONINSPECT'] = '1'

try:
runshell = IPShellEmbed([])
except NameError:
pass
def runshell():
import os
os.environ['PYTHONINSPECT'] = '1'

import pycassa, optparse
from pycassa.system_manager import *
Expand Down

0 comments on commit 97ad974

Please sign in to comment.