##// END OF EJS Templates
Update exception colors API to PEP8, various small fixes in related files....
Update exception colors API to PEP8, various small fixes in related files. - XXX: we are still carrying two copies of ultraTB, we need to clean this up. Will be done in a later commit.

File last commit:

r1608:387274eb
r1845:cf8cb577
Show More
cutils.py
34 lines | 1.1 KiB | text/x-python | PythonLexer
# encoding: utf-8
"""Configuration-related utilities for all IPython."""
__docformat__ = "restructuredtext en"
#-------------------------------------------------------------------------------
# Copyright (C) 2008 The IPython Development Team
#
# Distributed under the terms of the BSD License. The full license is in
# the file COPYING, distributed as part of this software.
#-------------------------------------------------------------------------------
#-------------------------------------------------------------------------------
# Imports
#-------------------------------------------------------------------------------
import os
import sys
#---------------------------------------------------------------------------
# Normal code begins
#---------------------------------------------------------------------------
def import_item(key):
"""
Import and return bar given the string foo.bar.
"""
package = '.'.join(key.split('.')[0:-1])
obj = key.split('.')[-1]
execString = 'from %s import %s' % (package, obj)
exec execString
exec 'temp = %s' % obj
return temp