wiki:TorqueUsage/DataTypes/Batch_status

Version 6 (modified by bas, 18 years ago) (diff)

--

Batch_status data type

Batch_status is a structure which is defined in pbs_ifl.h as:

struct batch_status {
        struct batch_status *next;
        char                *name;
        struct attrl        *attribs;
        char                *text;
};

See for explanation for struct attrl *attribs this page

Python Usage

This type is mostly use as return type. Here is an example how to use it:

nodes = pbs.pbs_statnode(c, "", "NULL", "NULL")
for node in nodes:
   print node.name
   for attrib in node.attribs:
      if attrib.resource:
         print '%s.%s = %s' %(attrib.name, attrib.resource, attrib.value)
      else:
         print '%s = %s' %(attrib.name, attrib.value)

Note: That the next pointer definition is not used in the Python code. The module will automatically convert a C linked list to a Python list a vice versa