def __init__(self, **traits): """ Initializes the object. """ super(ObjectDebugger, self).__init__(**traits) self.module = CBModuleFile(path=self.file_name, python_path=self.python_path, object=self.object) do_later(self.select_object)
def _file_name_changed ( self, file_name ): """ Handles the 'file_name' trait being changed. """ if exists( file_name ): file_name = abspath( str( file_name ) ) for path in sys.path: path = join( abspath( path ), '' ) if path == file_name[ : len( path ) ]: root = self.root for mf in root.favorites: if file_name == mf.path: break else: root.favorites = ([ CBModuleFile( path = file_name, python_path = path ) ] + root.favorites)[: self.max_favorites ] self.update = not self.update return