SourceForge.net Logo

CGRU

LinkedIn
Since 1.6.7 (at 2012.12.03) site moved to cgru.info

Afanasy Python Module


Example:

#!/usr/bin/env python
# Type python binary to specify the version of python to use.

# Specify afanasy encoding.
# coding=utf8

# Import afanasy python module ( must be in PYTHONPATH).
import af

# Create a job.
job = af.Job('somejob')

# Set job depend mask to wait other jobs which names match this pattern. By default it is empty (job not wait anything)
job.setDependMask('another_job_name')

# Set maximum hosts job can run on. Default value is -1 means that there is no limit for hosts number.
job.setMaxHosts( 15)

# Set job hosts mask. By default job can run on any host (which user can run on).
job.setHostsMask('r0')

# Start job paused.
job.offLine()

# Create a block. Provide block name and type to function as strings.
block = job.addBlock('back', 'nuke')

# Set block tasks working directory.
block.setWorkingDirectory('/projects/test/nuke')

# Set block tasks command.
block.setCommand('nuke -i -X WriteBack -x scene.nk.tmp.nk %1,%2')

# Set block tasks preview command arguments.
block.setFiles('jpg/img.%04d.jpg')

# Set block to numeric type, providing first, last frame and frames per host
block.setNumeric( 1, 100, 10)

# Set command to execute by server after a job is deleted.
job.setCmdPost('rm /projects/test/nuke/scene.nk.tmp.nk')

# Send job to Afanasy server.
job.send()

# Commands marked with italic font are not necessary.

# You can copy this text and paste it in python (ensure that your browser will not insert an extra spaces before python commands).
Since 1.6.7 (at 2012.12.03) site moved to cgru.info
SourceForge.net Project

CGRU

Libre Graphics World