コード例 #1
0
ファイル: tree.py プロジェクト: kotchin/th_autorig2
	def add_child( self, _value ) :		
		# # if _value is a TreeNode, use it
		# # otherwise we'll create a new TreeNode with _value as __value
		# # this is in case we want to include other objects in the hieraarchy

		if( utils.is_subclass( _value, TreeNode ) ) :
			child = _value
		else :
			child = TreeNode( _value=_value )
		
		self._check_tree_children()

		# child = _value
		child.__parent = self
		self.__children.append( child )
コード例 #2
0
ファイル: potion.py プロジェクト: jmg/potion
def get_entities(name, path=None):

    models = load_module(name, path=path)
    return [model for name, model in models.__dict__.iteritems() if is_subclass(model, Entity)]
コード例 #3
0
ファイル: urls.py プロジェクト: dlitvakb/MentoriaPython
def is_valid_view(view):
    return is_subclass(view, View) and hasattr(view, 'url')