Module _localization
[hide private]
[frames] | no frames]

Module _localization

Internal module for Nuke's localization functionality.

Functions [hide private]
Adds a callback for file localization events
addFileCallback(callback)
@param callback is a python callable object with arguments for path and event.
Adds a callback for read localization events
addReadCallback(callback)
@param callback is a python callable object with arguments for Read and status.
Trigger a manual file check, which checks and updates the states of localised files.
checkForUpdates()
Clears unused files in the localization folder
clearUnusedFiles(pathPrefix= "", olderThan= None)
@param pathPrefix Only clear files within this path.
Returns the list of read nodes that read from the argument paths
findNodes()
Returns: List of read nodes that read from the @param paths.
Update all localized files currently in use in Nuke
forceUpdateAll()
Returns: None
Update all on-demand localized files
forceUpdateOnDemand()
Returns: None
Update all localized files used by nodes that are currently selected
forceUpdateSelectedNodes()
Returns: None
Check if localization is paused
isLocalizationPaused()
Returns: whether localization was paused
gets the percentage of localization completed.
localizationProgress()
gets paths of files which are currently localized
localizedPaths()
Returns: List of strings containing file paths of localized paths
gets the current localization system mode
mode()
@return string 'on', 'off' or 'manual'
Pause the localization background thread if it was running
pauseLocalization()
Returns: None
Removes a callback for file localization events
removeFileCallback(callback)
@param callback is a python callable object with arguments path and eventID.
Removes a callback for read localization events
removeReadCallback(callback)
@param callback is a python callable object with arguments path and eventID.
Resume the localization background thread if it was paused
resumeLocalization()
Returns: None
sets the localization system mode
setMode(mode)
Variables [hide private]
  __package__ = None
hash(x)
Function Details [hide private]

addFileCallback(callback)

 
@param callback is a python callable object with arguments for path and event.
@see nuke.localization.FileEvent for possible file events.
Usage Example:
def myCallback( path, event ):
        if event == nuke.localization.FileEvent.LOCALIZED:
                print("file : " + path + " is localized")
        elif event == nuke.localization.FileEvent.OUT_OF_DATE:
                print("file : " + path + " is out of date")

nuke.localization.addFileCallback( myCallback )
# do some localization and process callbacks, when finished call:
nuke.localization.removeFileCallback( myCallback )

Returns: Adds a callback for file localization events

addReadCallback(callback)

 
@param callback is a python callable object with arguments for Read and status.
@see nuke.localization.ReadStatus
Usage Example:
def myCallback( read, event ):
        if event == nuke.localization.ReadStatus.LOCALIZED:
                print("read : " + read.name() + " localized")
        elif event == nuke.localization.ReadStatus.OUT_OF_DATE:
                print("file : " + read.name() + " is out of date")

nuke.localization.addReadCallback( myCallback )

# do some localization and process callbacks, when finished call:
nuke.localization.removeReadCallback( myCallback )

Returns: Adds a callback for read localization events

clearUnusedFiles(pathPrefix= "", olderThan= None)

 

@param pathPrefix Only clear files within this path. @param olderThan Only clear files older than this date. Must be a DateTime.

Returns: Clears unused files in the localization folder
None

findNodes()

 
Returns: Returns the list of read nodes that read from the argument paths
List of read nodes that read from the @param paths.

forceUpdateAll()

 
Returns: Update all localized files currently in use in Nuke
None

forceUpdateOnDemand()

 
Returns: Update all on-demand localized files
None

forceUpdateSelectedNodes()

 
Returns: Update all localized files used by nodes that are currently selected
None

isLocalizationPaused()

 
Returns: Check if localization is paused
whether localization was paused

localizedPaths()

 
Returns: gets paths of files which are currently localized
List of strings containing file paths of localized paths

pauseLocalization()

 
Returns: Pause the localization background thread if it was running
None

removeFileCallback(callback)

 

@param callback is a python callable object with arguments path and eventID. see addFileCallback for usage example.

Returns: Removes a callback for file localization events

removeReadCallback(callback)

 

@param callback is a python callable object with arguments path and eventID. see addReadCallback for usage example.

Returns: Removes a callback for read localization events

resumeLocalization()

 
Returns: Resume the localization background thread if it was paused
None

setMode(mode)

 
Parameters:
  • mode, str, of, value - 'on', 'off' or 'manual' @return None
Returns: sets the localization system mode