import sys

import maya.cmds as cmds #@UnresolvedImport
import maya.OpenMaya as OpenMaya #@UnresolvedImport

VERSION = 1.0



'''
========================================================================
---->  Creates and removes callbacks  <----
========================================================================
'''
class Maya_Callback():
	"""
	----> Examples <----
	
		import maya.cmds as cmds
		
		import callback_util
		
		# Example proc
		def print_all_nodes(*args):
		    print cmds.ls('*')
		    print len(cmds.ls('*'))
		
		# Create callback instance
		callback_obj = callback_util.Callback((print_all_nodes))
		
		# Run proc before scene updates
		callback_obj.scene_update_before()
		
		# Run proc after scene updates
		callback_obj.scene_update_after()
		
		# Adds more maya node
		for i in range(20):
    		cmds.spaceLocator()
    		
    	# Open new Maya scene
    	cmds.file (f=True, new=True)
		
		# Removes callback from instance
		callback_obj.remove()

	*Author:*
		* nick.silveira, Nicholas.Silveira@gmail.com, Jun 15, 2013 7:39:20 PM
	"""
	def __init__( self, procedure, window = None ):
		# Get callback procedure
		self.procedure = procedure

		# Get callbacks main window
		self.window = window

		# Initiate callback list
		self.callback_list = []