GetPythonModule

Syntax

GetPythonModuleResult GetPythonModule(OdId tObject)

Parameters

tObject. Moniker of repository object that is a Python unit.

Description

The GetPythonModule operation gets repository Python unit metadata.

Comments

To execute the operation, in the tObject field specify moniker of the repository object that is a Python unit. The object moniker can be obtained on executing the GetObjects operation.

The operation results in the obtained Python unit metadata.

Example

Below is the example of getting information about Python unit. The request contains moniker of unit in the repository. The response contains Python unit code text and description of the unit as a repository object. The example uses the FindObjectById function, which code is given in the Getting Object Description by Its Identifier example.

SOAP request:

<s:Envelope xmlns:s="http://schemas.xmlsoap.org/soap/envelope/">
<s:Body xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns:xsd="http://www.w3.org/2001/XMLSchema">
<GetPythonModule xmlns="http://www.fsight.ru/PP.SOM.Som">
<tObject xmlns="">
  <id>LGAABCFKMMJNFOAEJHAJNCGDICAAELAEKLDHEEPJJFLLCAAC!M!304842</id>
  </tObject>
  </GetPythonModule>
  </s:Body>
  </s:Envelope>

SOAP response:

<soapenv:Envelope xmlns:soapenv="http://schemas.xmlsoap.org/soap/envelope/">
<soapenv:Body>
<GetPythonModuleResult xmlns="http://www.fsight.ru/PP.SOM.Som" xmlns:q1="http://www.fsight.ru/PP.SOM.Som" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance">
<meta xmlns="">
  <text>from datetime import date; def SimpleProcedure(d): print("Today: " + d.strftime("%d-%b-%Y")) current_date = date.today() SimpleProcedure(current_date)</text>
<desc ds="" isShortcut="0" isLink="0" ver="6" hf="0">
  <i>M_PYTHON</i>
  <n>Python unit</n>
  <k>304842</k>
  <c>9473</c>
  <p>171999</p>
  <h>0</h>
  <hasPrv>0</hasPrv>
  <ic>0</ic>
  <trackElementDependents>0</trackElementDependents>
  </desc>
  </meta>
  </GetPythonModuleResult>
  </soapenv:Body>
  </soapenv:Envelope>

JSON request:

{
"GetPythonModule" :
{
"tObject" :
{
"id" : "LGAABCFKMMJNFOAEJHAJNCGDICAAELAEKLDHEEPJJFLLCAAC!M!304842"
}
}
}

JSON response:

{
"GetPythonModuleResult" :
{
"meta" :
{
"text" : "from datetime import date; def SimpleProcedure(d): \tprint("Today: " + d.strftime("%d-%b-%Y")) \t current_date = date.today() SimpleProcedure(current_date)",
"desc" :
{
"@ds" : "",
"@isShortcut" : "0",
"@isLink" : "0",
"@ver" : "6",
"@hf" : "0",
"i" : "M_PYTHON",
"n" : "Python unit",
"k" : "304842",
"c" : "9473",
"p" : "171999",
"h" : "0",
"hasPrv" : "0",
"ic" : "0",
"trackElementDependents" : "0"
}
}
}
}
public static GetPythonModuleResult GetPythonModuleInfo(MbId mb, string modId)
{
var somClient = new SomPortTypeClient(); // Proxy object for operation execution
// Operation execution parameters
var tGet = new GetPythonModule()
{
// Create object moniker
tObject = new OdId() { id = mb.id + "!" + FindObjectById(mb, modId).k }
};
// Get information about Python unit
var result = somClient.GetPythonModule(tGet);
return result;
}

See also:

Working with Development Environment