Search in sources :

Example 1 with PyString

use of org.python.core.PyString in project cucumber-jvm by cucumber.

the class JythonStepDefinition method matchedArguments.

@Override
public List<Argument> matchedArguments(Step step) {
    PyObject stepName = new PyString(step.getName());
    PyObject matched_arguments = stepdef.invoke("matched_arguments", stepName);
    if (matched_arguments instanceof PyList) {
        return (PyList) matched_arguments;
    } else {
        return null;
    }
}
Also used : PyString(org.python.core.PyString) PyList(org.python.core.PyList) PyObject(org.python.core.PyObject)

Example 2 with PyString

use of org.python.core.PyString in project cucumber-jvm by cucumber.

the class JythonBackend method dataTableToPyArray.

private PyObject dataTableToPyArray(DataTable table) {
    PyList pyTable = new PyList();
    for (List<String> row : table.raw()) {
        PyList pyRow = new PyList();
        for (String cell : row) {
            pyRow.append(new PyString(cell));
        }
        pyTable.append(pyRow);
    }
    return pyTable;
}
Also used : PyString(org.python.core.PyString) PyList(org.python.core.PyList) PyString(org.python.core.PyString)

Aggregations

PyList (org.python.core.PyList)2 PyString (org.python.core.PyString)2 PyObject (org.python.core.PyObject)1