#NEWLINE# def setUnjellyableForClassTree( module , baseClass , prefix = None ) : #NEWLINE# #INDENT# '\n    Set all classes in a module derived from C{baseClass} as copiers for\n    a corresponding remote class.\n\n    When you have a heirarchy of Copyable (or Cacheable) classes on one\n    side, and a mirror structure of Copied (or RemoteCache) classes on the\n    other, use this to setUnjellyableForClass all your Copieds for the\n    Copyables.\n\n    Each copyTag (the "classname" argument to getTypeToCopyFor, and\n    what the Copyable\'s getTypeToCopyFor returns) is formed from\n    adding a prefix to the Copied\'s class name.  The prefix defaults\n    to module.__name__.  If you wish the copy tag to consist of solely\n    the classname, pass the empty string \'\'.\n\n    @param module: a module object from which to pull the Copied classes.\n        (passing sys.modules[__name__] might be useful)\n\n    @param baseClass: the base class from which all your Copied classes derive.\n\n    @param prefix: the string prefixed to classnames to form the\n        unjellyableRegistry.\n    ' #NEWLINE# if ( prefix is None ) : #NEWLINE# #INDENT# prefix = module . __name__ #NEWLINE# #UNINDENT# if prefix : #NEWLINE# #INDENT# prefix = ( '%s.' % prefix ) #NEWLINE# #UNINDENT# for i in dir ( module ) : #NEWLINE# #INDENT# i_ = getattr ( module , i ) #NEWLINE# if ( type ( i_ ) == types . ClassType ) : #NEWLINE# #INDENT# if issubclass ( i_ , baseClass ) : #NEWLINE# #INDENT# setUnjellyableForClass ( ( '%s%s' % ( prefix , i ) ) , i_ )