Package nuke :: Module callbacks
[hide private]
[frames] | no frames]

Source Code for Module nuke.callbacks

  1  # callbacks.py 
  2  # 
  3  # Callbacks from Nuke to user-defined Python. 
  4  # Nuke actually calls "nuke.onCreate()" but users will normally use 
  5  # the default versions of these functions and use "nuke.addOnCreate()" 
  6  # to add to the list of callbacks that the default calls. 
  7   
  8  import types 
  9  import nuke 
 10   
 11   
12 -def _addCallback(dict, call, args, kwargs, nodeClass, node=None):
13 if not callable(call): 14 raise ValueError("call must be a callable") 15 if type(args) != types.TupleType: 16 args = (args,) 17 if type(kwargs) != types.DictType: 18 raise ValueError("kwargs must be a dictionary") 19 if dict.has_key(nodeClass): 20 list = dict[nodeClass] 21 # make it appear only once in list 22 try: 23 list.remove((call,args,kwargs,node)) 24 except: 25 pass 26 list.append((call,args,kwargs,node)) 27 else: 28 dict[nodeClass] = [(call,args,kwargs,node)]
29
30 -def _removeCallback(dict, call, args, kwargs, nodeClass, node=None):
31 if type(args) != types.TupleType: 32 args = (args,) 33 if dict.has_key(nodeClass): 34 list = dict[nodeClass] 35 try: 36 list.remove((call,args,kwargs,node)) 37 except: 38 pass
39
40 -def _doCallbacks(dict, node=None):
41 list = dict.get(nuke.thisClass()) 42 node = nuke.thisNode() 43 if list: 44 for f in list: 45 if f[3] == None or f[3] is node: 46 f[0](*f[1],**f[2]) 47 list = dict.get('*') 48 if list: 49 for f in list: 50 if f[3] == None or f[3] is node: 51 f[0](*f[1],**f[2])
52 53 onUserCreates={}
54 -def addOnUserCreate(call, args=(), kwargs={}, nodeClass='*'):
55 """Add code to execute when user creates a node""" 56 _addCallback(onUserCreates, call, args, kwargs, nodeClass)
57 -def removeOnUserCreate(call, args=(), kwargs={}, nodeClass='*'):
58 """Remove a previously-added callback with the same arguments.""" 59 _removeCallback(onUserCreates, call, args, kwargs, nodeClass)
60 -def onUserCreate():
61 _doCallbacks(onUserCreates) 62 if not len(onUserCreates): nuke.tcl("OnCreate")
63 64 onCreates={}
65 -def addOnCreate(call, args=(), kwargs={}, nodeClass='*'):
66 """Add code to execute when a node is created or undeleted""" 67 _addCallback(onCreates, call, args, kwargs, nodeClass)
68 -def removeOnCreate(call, args=(), kwargs={}, nodeClass='*'):
69 """Remove a previously-added callback with the same arguments.""" 70 _removeCallback(onCreates, call, args, kwargs, nodeClass)
71 -def onCreate():
72 _doCallbacks(onCreates)
73 74 onScriptLoads={}
75 -def addOnScriptLoad(call, args=(), kwargs={}, nodeClass='Root'):
76 """Add code to execute when a script is loaded""" 77 _addCallback(onScriptLoads, call, args, kwargs, nodeClass)
78 -def removeOnScriptLoad(call, args=(), kwargs={}, nodeClass='Root'):
79 """Remove a previously-added callback with the same arguments.""" 80 _removeCallback(onScriptLoads, call, args, kwargs, nodeClass)
81 -def onScriptLoad():
82 _doCallbacks(onScriptLoads)
83 84 onScriptSaves={}
85 -def addOnScriptSave(call, args=(), kwargs={}, nodeClass='Root'):
86 """Add code to execute before a script is saved""" 87 _addCallback(onScriptSaves, call, args, kwargs, nodeClass)
88 -def removeOnScriptSave(call, args=(), kwargs={}, nodeClass='Root'):
89 """Remove a previously-added callback with the same arguments.""" 90 _removeCallback(onScriptSaves, call, args, kwargs, nodeClass)
91 -def onScriptSave():
92 _doCallbacks(onScriptSaves)
93 94 onScriptCloses={}
95 -def addOnScriptClose(call, args=(), kwargs={}, nodeClass='Root'):
96 """Add code to execute before a script is closed""" 97 _addCallback(onScriptCloses, call, args, kwargs, nodeClass)
98 -def removeOnScriptClose(call, args=(), kwargs={}, nodeClass='Root'):
99 """Remove a previously-added callback with the same arguments.""" 100 _removeCallback(onScriptCloses, call, args, kwargs, nodeClass)
101 -def onScriptClose():
102 _doCallbacks(onScriptCloses)
103 104 onDestroys={}
105 -def addOnDestroy(call, args=(), kwargs={}, nodeClass='*'):
106 """Add code to execute when a node is destroyed""" 107 _addCallback(onDestroys, call, args, kwargs, nodeClass)
108 -def removeOnDestroy(call, args=(), kwargs={}, nodeClass='*'):
109 """Remove a previously-added callback with the same arguments.""" 110 _removeCallback(onDestroys, call, args, kwargs, nodeClass)
111 -def onDestroy():
112 _doCallbacks(onDestroys)
113 114 knobChangeds={}
115 -def addKnobChanged(call, args=(), kwargs={}, nodeClass='*', node=None):
116 """Add code to execute when the user changes a knob 117 The knob is availble in nuke.thisKnob() and the node in nuke.thisNode(). 118 This is also called with dummy knobs when the control panel is opened 119 or when the inputs to the node changes. The purpose is to update other 120 knobs in the control panel. Use addUpdateUI() for changes that 121 should happen even when the panel is closed.""" 122 _addCallback(knobChangeds, call, args, kwargs, nodeClass, node)
123 -def removeKnobChanged(call, args=(), kwargs={}, nodeClass='*', node=None):
124 """Remove a previously-added callback with the same arguments.""" 125 _removeCallback(knobChangeds, call, args, kwargs, nodeClass, node)
126 -def knobChanged():
127 _doCallbacks(knobChangeds)
128 129 updateUIs={}
130 -def addUpdateUI(call, args=(), kwargs={}, nodeClass='*'):
131 """Add code to execute on every node when things change. This is done 132 during idle, you cannot rely on it being done before it starts updating 133 the viewer""" 134 _addCallback(updateUIs, call, args, kwargs, nodeClass)
135 -def removeUpdateUI(call, args=(), kwargs={}, nodeClass='*'):
136 """Remove a previously-added callback with the same arguments.""" 137 _removeCallback(updateUIs, call, args, kwargs, nodeClass)
138 -def updateUI():
139 _doCallbacks(updateUIs)
140 141 # autolabel is somewhat different due to it returning a string 142 autolabels={}
143 -def addAutolabel(call, args=(), kwargs={}, nodeClass='*'):
144 """Add code to execute on every node to produce the text to draw on it 145 in the DAG. Any value other than None is converted to a string and used 146 as the text. None indicates that previously-added functions should 147 be tried""" 148 _addCallback(autolabels, call, args, kwargs, nodeClass)
149 -def removeAutolabel(call, args=(), kwargs={}, nodeClass='*'):
150 """Remove a previously-added callback with the same arguments.""" 151 _removeCallback(autolabels, call, args, kwargs, nodeClass)
152 -def autolabel():
153 list = autolabels.get(nuke.thisClass()) 154 if list: 155 for f in list[::-1]: 156 s = f[0](*f[1],**f[2]) 157 if s != None: return s 158 list = autolabels.get('*') 159 if list: 160 for f in list[::-1]: 161 s = f[0](*f[1],**f[2]) 162 if s != None: return s
163 164 # Normal rendering callbacks 165 beforeRenders={}
166 -def addBeforeRender(call, args=(), kwargs={}, nodeClass='Write'):
167 """Add code to execute before starting any renders""" 168 _addCallback(beforeRenders, call, args, kwargs, nodeClass)
169 -def removeBeforeRender(call, args=(), kwargs={}, nodeClass='Write'):
170 """Remove a previously-added callback with the same arguments.""" 171 _removeCallback(beforeRenders, call, args, kwargs, nodeClass)
172 -def beforeRender():
173 _doCallbacks(beforeRenders)
174 175 beforeFrameRenders={}
176 -def addBeforeFrameRender(call, args=(), kwargs={}, nodeClass='Write'):
177 """Add code to execute before each frame of a render""" 178 _addCallback(beforeFrameRenders, call, args, kwargs, nodeClass)
179 -def removeBeforeFrameRender(call, args=(), kwargs={}, nodeClass='Write'):
180 """Remove a previously-added callback with the same arguments.""" 181 _removeCallback(beforeFrameRenders, call, args, kwargs, nodeClass)
182 -def beforeFrameRender():
183 _doCallbacks(beforeFrameRenders)
184 185 afterFrameRenders={}
186 -def addAfterFrameRender(call, args=(), kwargs={}, nodeClass='Write'):
187 """Add code to execute after each frame of a render""" 188 _addCallback(afterFrameRenders, call, args, kwargs, nodeClass)
189 -def removeAfterFrameRender(call, args=(), kwargs={}, nodeClass='Write'):
190 """Remove a previously-added callback with the same arguments.""" 191 _removeCallback(afterFrameRenders, call, args, kwargs, nodeClass)
192 -def afterFrameRender():
193 _doCallbacks(afterFrameRenders)
194 195 afterRenders={}
196 -def addAfterRender(call, args=(), kwargs={}, nodeClass='Write'):
197 """Add code to execute after any renders""" 198 _addCallback(afterRenders, call, args, kwargs, nodeClass)
199 -def removeAfterRender(call, args=(), kwargs={}, nodeClass='Write'):
200 """Remove a previously-added callback with the same arguments.""" 201 _removeCallback(afterRenders, call, args, kwargs, nodeClass)
202 -def afterRender():
203 _doCallbacks(afterRenders)
204 205 renderProgresses={}
206 -def addRenderProgress(call, args=(), kwargs={}, nodeClass='Write'):
207 """Add code to execute when the progress bar updates during any renders""" 208 _addCallback(renderProgresses, call, args, kwargs, nodeClass)
209 -def removeRenderProgress(call, args=(), kwargs={}, nodeClass='Write'):
210 """Remove a previously-added callback with the same arguments.""" 211 _removeCallback(renderProgresses, call, args, kwargs, nodeClass)
212 -def renderProgress():
213 _doCallbacks(renderProgresses)
214 215 # Callbacks for internal use only 216 _beforeRecordings={}
217 -def addBeforeRecording(call, args=(), kwargs={}, nodeClass='Viewer'):
218 """Add code to execute before viewer recording""" 219 _addCallback(_beforeRecordings, call, args, kwargs, nodeClass)
220 -def removeBeforeRecording(call, args=(), kwargs={}, nodeClass='Viewer'):
221 """Remove a previously-added callback with the same arguments.""" 222 _removeCallback(_beforeRecordings, call, args, kwargs, nodeClass)
223 -def beforeRecording():
224 _doCallbacks(_beforeRecordings)
225 226 _afterRecordings={}
227 -def addAfterRecording(call, args=(), kwargs={}, nodeClass='Viewer'):
228 """Add code to execute after viewer recording""" 229 _addCallback(_afterRecordings, call, args, kwargs, nodeClass)
230 -def removeAfterRecording(call, args=(), kwargs={}, nodeClass='Viewer'):
231 """Remove a previously-added callback with the same arguments.""" 232 _removeCallback(_afterRecordings, call, args, kwargs, nodeClass)
233 -def afterRecording():
234 _doCallbacks(_afterRecordings)
235 236 _beforeReplays={}
237 -def addBeforeReplay(call, args=(), kwargs={}, nodeClass='Viewer'):
238 """Add code to execute before viewer replay""" 239 _addCallback(_beforeReplays, call, args, kwargs, nodeClass)
240 -def removeBeforeReplay(call, args=(), kwargs={}, nodeClass='Viewer'):
241 """Remove a previously-added callback with the same arguments.""" 242 _removeCallback(_beforeReplays, call, args, kwargs, nodeClass)
243 -def beforeReplay():
244 _doCallbacks(_beforeReplays)
245 246 _afterReplays={}
247 -def addAfterReplay(call, args=(), kwargs={}, nodeClass='Viewer'):
248 """Add code to execute after viewer replay""" 249 _addCallback(_afterReplays, call, args, kwargs, nodeClass)
250 -def removeAfterReplay(call, args=(), kwargs={}, nodeClass='Viewer'):
251 """Remove a previously-added callback with the same arguments.""" 252 _removeCallback(_afterReplays, call, args, kwargs, nodeClass)
253 -def afterReplay():
254 _doCallbacks(_afterReplays)
255 256 # LiveGroup callbacks 257 _onLiveGroupMakeLocalCallbacks={}
258 -def addOnLiveGroupMakeLocal(call, args=(), kwargs={}, nodeClass='LiveGroup'):
259 """Add code to execute after LiveGroup is made local""" 260 _addCallback(_onLiveGroupMakeLocalCallbacks, call, args, kwargs, nodeClass)
261 -def removeOnLiveGroupMakeLocal(call, args=(), kwargs={}, nodeClass='LiveGroup'):
262 """Remove a previously-added callback with the same arguments.""" 263 _removeCallback(_onLiveGroupMakeLocalCallbacks, call, args, kwargs, nodeClass)
264 -def onLiveGroupMakeLocal():
265 _doCallbacks(_onLiveGroupMakeLocalCallbacks)
266 267 _onLiveGroupPrePublishCallbacks={}
268 -def addOnLiveGroupPrePublish(call, args=(), kwargs={}, nodeClass='LiveGroup'):
269 """Add code to execute before LiveGroup is published.""" 270 _addCallback(_onLiveGroupPrePublishCallbacks, call, args, kwargs, nodeClass)
271 -def removeOnLiveGroupPrePublish(call, args=(), kwargs={}, nodeClass='LiveGroup'):
272 """Remove a previously-added callback with the same arguments.""" 273 _removeCallback(_onLiveGroupPrePublishCallbacks, call, args, kwargs, nodeClass)
274 -def onLiveGroupPrePublish():
275 _doCallbacks(_onLiveGroupPrePublishCallbacks)
276 277 _onLiveGroupPublishCallbacks={}
278 -def addOnLiveGroupPublish(call, args=(), kwargs={}, nodeClass='LiveGroup'):
279 """Add code to execute after LiveGroup has been published""" 280 _addCallback(_onLiveGroupPublishCallbacks, call, args, kwargs, nodeClass)
281 -def removeOnLiveGroupPublish(call, args=(), kwargs={}, nodeClass='LiveGroup'):
282 """Remove a previously-added callback with the same arguments.""" 283 _removeCallback(_onLiveGroupPublishCallbacks, call, args, kwargs, nodeClass)
284 -def onLiveGroupPublish():
285 _doCallbacks(_onLiveGroupPublishCallbacks)
286 287 _onLiveGroupReloadCallbacks={}
288 -def addOnLiveGroupReload(call, args=(), kwargs={}, nodeClass='LiveGroup'):
289 """Add code to execute after LiveGroup has been loaded or reloaded""" 290 _addCallback(_onLiveGroupReloadCallbacks, call, args, kwargs, nodeClass)
291 -def removeOnLiveGroupReload(call, args=(), kwargs={}, nodeClass='LiveGroup'):
292 """Remove a previously-added callback with the same arguments.""" 293 _removeCallback(_onLiveGroupReloadCallbacks, call, args, kwargs, nodeClass)
294 -def onLiveGroupReload():
295 _doCallbacks(_onLiveGroupReloadCallbacks)
296 297 # End LiveGroup callbacks 298 299 # Special functions to perform background callbacks as these have no node as 300 # context.
301 -def _addBackgroundCallback(list, call, args, kwargs):
302 if not callable(call): 303 raise ValueError("call must be a callable") 304 if type(args) != types.TupleType: 305 args = (args,) 306 if type(kwargs) != types.DictType: 307 raise ValueError("kwargs must be a dictionary") 308 # make it appear only once in list 309 try: 310 list.remove((call,args,kwargs)) 311 except: 312 pass 313 list.append((call,args,kwargs))
314
315 -def _removeBackgroundCallback(list, call, args, kwargs):
316 if type(args) != types.TupleType: 317 args = (args,) 318 try: 319 list.remove((call,args,kwargs)) 320 except: 321 pass
322
323 -def _doBackgroundCallbacks(list, context):
324 for f in list: 325 f[0](context, *f[1],**f[2])
326 327 # Background rendering callbacks 328 beforeBackgroundRenders=[]
329 -def addBeforeBackgroundRender(call, args=(), kwargs={}):
330 """Add code to execute before starting any background renders. 331 The call must be in the form of: 332 def foo(context): 333 pass 334 335 The context object that will be passed in is a dictionary containing the following elements: 336 id => The identifier for the task that's about to begin 337 338 Please be aware that the current Nuke context will not make sense in the callback (e.g. nuke.thisNode will return a random node). 339 """ 340 _addBackgroundCallback(beforeBackgroundRenders, call, args, kwargs)
341 -def removeBeforeBackgroundRender(call, args=(), kwargs={}):
342 """Remove a previously-added callback with the same arguments.""" 343 _removeBackgroundCallback(beforeBackgroundRenders, call, args, kwargs)
344 -def beforeBackgroundRender(context):
345 _doBackgroundCallbacks(beforeBackgroundRenders, context)
346 347 # There is no logical place for this to be called at the moment, so don't expose it. 348 #def addBeforeBackgroundFrameRender(call, args=(), kwargs={}): 349 # """Add code to execute before each frame of a background render""" 350 # _addBackgroundCallback(beforeBackgroundFrameRenders, call, args, kwargs) 351 #def removeBeforeBackgroundFrameRender(call, args=(), kwargs={}): 352 # """Remove a previously-added callback with the same arguments.""" 353 # _removeBackgroundCallback(beforeBackgroundFrameRenders, call, args, kwargs) 354 #def beforeBackgroundFrameRender(): 355 # _doBackgroundCallbacks(beforeBackgroundFrameRenders) 356 357 afterBackgroundFrameRenders=[]
358 -def addAfterBackgroundFrameRender(call, args=(), kwargs={}):
359 """Add code to execute after each frame of a background render. 360 The call must be in the form of: 361 def foo(context): 362 pass 363 364 The context object that will be passed in is a dictionary containing the following elements: 365 id => The identifier for the task that's making progress 366 frame => the current frame number being rendered 367 numFrames => the total number of frames that is being rendered 368 frameProgress => the number of frames rendered so far. 369 370 Please be aware that the current Nuke context will not make sense in the callback (e.g. nuke.thisNode will return a random node). 371 """ 372 _addBackgroundCallback(afterBackgroundFrameRenders, call, args, kwargs)
373 -def removeAfterBackgroundFrameRender(call, args=(), kwargs={}):
374 """Remove a previously-added callback with the same arguments.""" 375 _removeBackgroundCallback(afterBackgroundFrameRenders, call, args, kwargs)
376 -def afterBackgroundFrameRender(context):
377 _doBackgroundCallbacks(afterBackgroundFrameRenders, context)
378 379 afterBackgroundRenders=[]
380 -def addAfterBackgroundRender(call, args=(), kwargs={}):
381 """Add code to execute after any background renders. 382 The call must be in the form of: 383 def foo(context): 384 pass 385 386 The context object that will be passed in is a dictionary containing the following elements: 387 id => The identifier for the task that's ended 388 389 Please be aware that the current Nuke context will not make sense in the callback (e.g. nuke.thisNode will return a random node). 390 """ 391 _addBackgroundCallback(afterBackgroundRenders, call, args, kwargs)
392 -def removeAfterBackgroundRender(call, args=(), kwargs={}):
393 """Remove a previously-added callback with the same arguments.""" 394 _removeBackgroundCallback(afterBackgroundRenders, call, args, kwargs)
395 -def afterBackgroundRender(context):
396 _doBackgroundCallbacks(afterBackgroundRenders, context)
397 398 # filenameFilter is somewhat different due to it returning a string 399 filenameFilters={}
400 -def addFilenameFilter(call, args=(), kwargs={}, nodeClass='*'):
401 """Add a function to modify filenames before Nuke passes them to 402 the operating system. The first argument to the function is the 403 filename, and it should return the new filename. None is the same as 404 returning the string unchanged. All added functions are called 405 in backwards order.""" 406 _addCallback(filenameFilters, call, args, kwargs, nodeClass)
407 -def removeFilenameFilter(call, args=(), kwargs={}, nodeClass='*'):
408 """Remove a previously-added callback with the same arguments.""" 409 _removeCallback(filenameFilters, call, args, kwargs, nodeClass)
410
411 -def filenameFilter(filename):
412 import __main__ 413 list = filenameFilters.get(nuke.thisClass()) 414 if list: 415 for f in list[::-1]: 416 s = f[0](filename,*f[1],**f[2]) 417 if s != None: filename = s 418 list = filenameFilters.get('*') 419 if list: 420 for f in list[::-1]: 421 s = f[0](filename,*f[1],**f[2]) 422 if s != None: filename = s 423 if not len(filenameFilters): 424 # For back-compatibility allow user to define a filenameFix() function: 425 if __main__.__dict__.has_key('filenameFix'): 426 return __main__.__dict__['filenameFix'](filename) 427 # For even further back-compatibility let them define a tcl filename_fix function: 428 return nuke.tcl("filename_fix",filename) 429 return filename
430 431 validateFilenames={}
432 -def addValidateFilename(call, args=(), kwargs={}, nodeClass='Write'):
433 """Add a function to validate a filename in Write nodes. The first argument 434 is the filename and it should return a Boolean as to whether the filename is valid 435 or not. If a callback is provided, it will control whether the Render button of Write nodes 436 and the Execute button of WriteGeo nodes is enabled or not.""" 437 _addCallback(validateFilenames, call, args, kwargs, nodeClass)
438 -def removeFilenameValidate(call, args=(), kwargs={}, nodeClass='Write'):
439 """Remove a previously-added callback.""" 440 _removeCallback(validateFilenames, call, args, kwargs, nodeClass)
441 -def validateFilename(filename):
442 import __main__ 443 list = validateFilenames.get(nuke.thisClass()) 444 valid = True 445 446 if list: 447 for f in list: 448 b = f[0](filename) 449 if b == False: valid = False 450 list = validateFilenames.get('*') 451 if list: 452 for f in list: 453 b = f[0](filename) 454 if b == False: valid = False 455 return valid
456 457
458 -def _doAutoSaveCallbacks( filters, filename ):
459 import __main__ 460 list = filters.get( 'Root' ) 461 if list: 462 for f in list: 463 s = f[0](filename) 464 filename = s 465 466 return filename
467 468 autoSaveFilters={}
469 -def addAutoSaveFilter(filter):
470 """addAutoSaveFilter(filter) -> None 471 472 Add a function to modify the autosave filename before Nuke saves the current script on an autosave timeout. 473 474 Look at rollingAutoSave.py in the nukescripts directory for an example of using the auto save filters. 475 476 @param filter: A filter function. The first argument to the filter is the current autosave filename. 477 The filter should return the filename to save the autosave to.""" 478 _addCallback(autoSaveFilters, filter, (), {}, 'Root')
479
480 -def removeAutoSaveFilter(filter):
481 """Remove a previously-added callback with the same arguments.""" 482 _removeCallback(autoSaveFilters, call, (), {}, 'Root')
483
484 -def autoSaveFilter(filename):
485 """Internal function. Use addAutoSaveFilter to add a callback""" 486 return _doAutoSaveCallbacks( autoSaveFilters, filename )
487 488 489 autoSaveRestoreFilters={}
490 -def addAutoSaveRestoreFilter(filter):
491 """addAutoSaveRestoreFilter(filter) -> None 492 493 Add a function to modify the autosave restore file before Nuke attempts to restores the autosave file. 494 495 Look at rollingAutoSave.py in the nukescripts directory for an example of using the auto save filters. 496 497 @param filter: A filter function. The first argument to the filter is the current autosave filename. 498 This function should return the filename to load autosave from or it should return None if the autosave file should be ignored.""" 499 _addCallback(autoSaveRestoreFilters, filter, (), {}, 'Root')
500
501 -def removeAutoSaveRestoreFilter(filter):
502 """Remove a previously-added callback with the same arguments.""" 503 _removeCallback(autoSaveRestoreFilters, filter, (), {}, 'Root')
504
505 -def autoSaveRestoreFilter(filename):
506 """Internal function. Use addAutoSaveRestoreFilter to add a callback""" 507 return _doAutoSaveCallbacks( autoSaveRestoreFilters, filename )
508 509 autoSaveDeleteFilters={}
510 -def addAutoSaveDeleteFilter(filter):
511 """addAutoSaveDeleteFilter(filter) -> None 512 513 Add a function to modify the autosave filename before Nuke attempts delete the autosave file. 514 515 Look at rollingAutoSave.py in the nukescripts directory for an example of using the auto save filters. 516 517 @param filter: A filter function. The first argument to the filter is the current autosave filename. 518 This function should return the filename to delete or return None if no file should be deleted.""" 519 _addCallback(autoSaveDeleteFilters, filter, (), {}, 'Root')
520
521 -def removeAutoSaveDeleteFilter(filter):
522 """Remove a previously-added callback with the same arguments.""" 523 _removeCallback(autoSaveDeleteFilters, filter, (), {}, 'Root')
524
525 -def autoSaveDeleteFilter(filename):
526 """Internal function. Use addAutoSaveDeleteFilter to add a callback""" 527 return _doAutoSaveCallbacks( autoSaveDeleteFilters, filename )
528