HDK
|
#include "pxr/pxr.h"
#include "pxr/base/tf/api.h"
#include <hboost/python/dict.hpp>
#include <hboost/python/tuple.hpp>
#include <string>
#include <vector>
Go to the source code of this file.
Classes | |
class | TfPyArg |
Typedefs | |
typedef std::vector< TfPyArg > | TfPyArgs |
Functions | |
TF_API std::pair < hboost::python::tuple, hboost::python::dict > | TfPyProcessOptionalArgs (const hboost::python::tuple &args, const hboost::python::dict &kwargs, const TfPyArgs &expectedArgs, bool allowExtraArgs=false) |
TF_API std::string | TfPyCreateFunctionDocString (const std::string &functionName, const TfPyArgs &requiredArguments=TfPyArgs(), const TfPyArgs &optionalArguments=TfPyArgs(), const std::string &description=std::string()) |
TF_API std::string TfPyCreateFunctionDocString | ( | const std::string & | functionName, |
const TfPyArgs & | requiredArguments = TfPyArgs() , |
||
const TfPyArgs & | optionalArguments = TfPyArgs() , |
||
const std::string & | description = std::string() |
||
) |
Create a doc string for a function with the given functionName
, requiredArguments
and optionalArguments
. An extra description
may also be supplied.
TF_API std::pair<hboost::python::tuple, hboost::python::dict> TfPyProcessOptionalArgs | ( | const hboost::python::tuple & | args, |
const hboost::python::dict & | kwargs, | ||
const TfPyArgs & | expectedArgs, | ||
bool | allowExtraArgs = false |
||
) |
Helper function for processing optional arguments given as a tuple of positional arguments and a dictionary of keyword arguments.
This function will match the given positional arguments in args
with the ordered list of allowed arguments in optionalArgs
. Arguments that are matched up in this way will be stored as (name, value) pairs and merged with kwargs
in the returned dictionary.
If allowExtraArgs
is false
, any unrecognized keyword or positional arguments will cause a Python TypeError to be emitted. Otherwise, unmatched arguments will be added to the returned tuple or dict.