64a65,68
> 
>     # Handling the IOstream for newer versions of IPython
>     io = IPython.utils.io
> 
66c70
<       IPython.iplib.raw_input_original = input_func
---
>       IPython.frontend.terminal.interactiveshell.raw_input_original = input_func
68c72
<       IPython.Shell.Term.cin = cin
---
>       io.stdin = io.IOStream(cin)
70c74
<       IPython.Shell.Term.cout = cout
---
>       io.stdout = io.IOStream(cout)
72c76
<       IPython.Shell.Term.cerr = cerr
---
>       io.stderr = io.IOStream(cerr)
76d79
<     IPython.iplib.raw_input = lambda x: None
78c81,83
<     self.term = IPython.genutils.IOTerm(cin=cin, cout=cout, cerr=cerr)
---
>     io.raw_input = lambda x: None
> 
> 
81,88c86,99
<     self.IP = IPython.Shell.make_IPython(
<       argv,user_ns=user_ns,
<       user_global_ns=user_global_ns,
<       embedded=True,
<       shell_class=IPython.Shell.InteractiveShell)
<     self.IP.system = lambda cmd: self.shell(self.IP.var_expand(cmd),
<                                             header='IPython system call: ',
<                                             verbose=self.IP.rc.system_verbose)
---
> 
>     from IPython.config.loader import Config
>     configuring = Config()
>     configuring.InteractiveShell.colors = "Linux"
>     old_stdout, old_stderr = sys.stdout, sys.stderr
>     sys.stdout, sys.stderr = io.stdout.stream, io.stderr.stream
>     self.IP = IPython.frontend.terminal.embed.InteractiveShellEmbed.instance(\
>             config=configuring, user_ns=user_ns)
>     sys.stdout, sys.stderr = old_stdout, old_stderr
> 
> 
>     self.IP.system = lambda cmd: self.shell(self.IP.var_expand(cmd),header='IPython system call: ') 
>     self.IP.raw_input = input_func
> 
93a105,128
> ################################################################
> # Temporary fix for now
> 
> # Mapping exit and quit calls to None
>     
>     self.updateNamespace({'exit':lambda:None})
>     self.updateNamespace({'quit':lambda:None})
> 
> ################################################################
> 
> 
>     self.IP.readline_startup_hook(self.IP.pre_readline)
>     self.__update_namespace()
> 
> 
>   def __update_namespace(self):
>     '''
>     This function updates namespace with sys.modules
>     '''
>     for k,v in sys.modules.items():
>       if not '.' in k:
>         self.IP.user_ns.update({k:v})
> 
> 
100c135,150
<     sys.stdout = IPython.Shell.Term.cout
---
>     sys.stdout = IPython.utils.io.stdout
> 
>     orig_stdin = sys.stdin
>     sys.stdin = IPython.utils.io.stdin;
>     self.prompt = self.generatePrompt(self.iter_more)
>     self.IP.hooks.pre_prompt_hook()
> 
>     if self.iter_more:
>        try:
>           self.prompt = self.generatePrompt(self.iter_more)
>        except:
>           self.IP.showtraceback()
>        if self.IP.autoindent:
>           self.IP.rl_do_indent = True
> 
> 
102,104c152
<       line = self.IP.raw_input(None, self.iter_more)
<       if self.IP.autoindent:
<         self.IP.readline_startup_hook(None)
---
>       line = self.IP.raw_input(self.prompt)
107d154
<       self.IP.resetbuffer()
110,113c157
<         
<       if self.IP.autoindent:
<         self.IP.indent_current_nsp = 0
<       self.iter_more = 0
---
>       self.IP.input_splitter.reset()
117,119c161,165
<       self.iter_more = self.IP.push(line)
<       if (self.IP.SyntaxTB.last_syntax_error and
<           self.IP.rc.autoedit_syntax):
---
>        self.IP.input_splitter.push(line)
>        self.iter_more = self.IP.input_splitter.push_accepts_more()
>        self.prompt = self.generatePrompt(self.iter_more)
> 
>     if (self.IP.SyntaxTB.last_syntax_error and self.IP.autoedit_syntax):
121,124c167,169
<     if self.iter_more:
<       self.prompt = str(self.IP.outputcache.prompt2).strip()
<       if self.IP.autoindent:
<         self.IP.readline_startup_hook(self.IP.pre_readline)
---
>     if not self.iter_more:
>         source_raw = self.IP.input_splitter.source_raw_reset()[1]
>         self.IP.run_cell(source_raw, store_history=True)
126c171,172
<       self.prompt = str(self.IP.outputcache.prompt1).strip()
---
>         pass
> 
127a174
>     sys.stdin = orig_stdin
184c231,235
<     possibilities = self.IP.complete(split_line[-1])
---
>     if split_line[-1]:
>       possibilities = self.IP.complete(split_line[-1])
>     else:
>       completed = line
>       possibilities = ['',[]]
202,203c253,257
<       common_prefix = reduce(_commonPrefix, possibilities)
<       completed = line[:-len(split_line[-1])]+common_prefix
---
>       if possibilities[1]:
>         common_prefix = reduce(_commonPrefix, possibilities[1]) or line[-1]
>         completed = line[:-len(split_line[-1])]+common_prefix
>       else:
>         completed = line
206c260
<     return completed, possibilities
---
>     return completed, possibilities[1]
230a285,304
> 
>   def generatePrompt(self, is_continuation):
>       '''
>       This function helps to provide backward compatibility for the previous versions
>       of IPython
>       '''
> 
>       if '0.11' in IPython.__version__ or '0.10' in IPython.__version__:
>         prompt = self.IP.hooks.generate_prompt(is_continuation)
>       else:
>         if is_continuation:
>           prompt = self.IP.prompt_manager.render('in2')
>         else:
>           prompt = self.IP.prompt_manager.render('in')
> 
>       return prompt
> 
> 
> 
> 
303c377
<                                              segments[i+1], tag)
---
>                 segments[i+1], str(tag))
443a518
>     self.interrupt = False
444a520
>     self.prompt = self.generatePrompt(False)
