Best Python code snippet using localstack_python
standard_address_space_part10.py
Source:standard_address_space_part10.py
...8def create_standard_address_space_Part10(server):9 10 11 node = ua.AddNodesItem()12 node.RequestedNewNodeId = ua.NodeId.from_string("i=2391")13 node.BrowseName = ua.QualifiedName.from_string("ProgramStateMachineType")14 node.NodeClass = ua.NodeClass.ObjectType15 node.ParentNodeId = ua.NodeId.from_string("i=2771")16 node.ReferenceTypeId = ua.NodeId.from_string("i=45")17 attrs = ua.ObjectTypeAttributes()18 attrs.Description = ua.LocalizedText("A state machine for a program.")19 attrs.DisplayName = ua.LocalizedText("ProgramStateMachineType")20 attrs.IsAbstract = false21 node.NodeAttributes = attrs22 server.add_nodes([node])23 refs = []24 ref = ua.AddReferencesItem()25 ref.IsForward = true26 ref.ReferenceTypeId = ua.NodeId.from_string("i=47")27 ref.SourceNodeId = ua.NodeId.from_string("i=2391")28 ref.TargetNodeClass = ua.NodeClass.DataType29 ref.TargetNodeId = ua.NodeId.from_string("i=3830")30 refs.append(ref)31 ref = ua.AddReferencesItem()32 ref.IsForward = true33 ref.ReferenceTypeId = ua.NodeId.from_string("i=47")34 ref.SourceNodeId = ua.NodeId.from_string("i=2391")35 ref.TargetNodeClass = ua.NodeClass.DataType36 ref.TargetNodeId = ua.NodeId.from_string("i=3835")37 refs.append(ref)38 ref = ua.AddReferencesItem()39 ref.IsForward = true40 ref.ReferenceTypeId = ua.NodeId.from_string("i=46")41 ref.SourceNodeId = ua.NodeId.from_string("i=2391")42 ref.TargetNodeClass = ua.NodeClass.DataType43 ref.TargetNodeId = ua.NodeId.from_string("i=2392")44 refs.append(ref)45 ref = ua.AddReferencesItem()46 ref.IsForward = true47 ref.ReferenceTypeId = ua.NodeId.from_string("i=46")48 ref.SourceNodeId = ua.NodeId.from_string("i=2391")49 ref.TargetNodeClass = ua.NodeClass.DataType50 ref.TargetNodeId = ua.NodeId.from_string("i=2393")51 refs.append(ref)52 ref = ua.AddReferencesItem()53 ref.IsForward = true54 ref.ReferenceTypeId = ua.NodeId.from_string("i=46")55 ref.SourceNodeId = ua.NodeId.from_string("i=2391")56 ref.TargetNodeClass = ua.NodeClass.DataType57 ref.TargetNodeId = ua.NodeId.from_string("i=2394")58 refs.append(ref)59 ref = ua.AddReferencesItem()60 ref.IsForward = true61 ref.ReferenceTypeId = ua.NodeId.from_string("i=46")62 ref.SourceNodeId = ua.NodeId.from_string("i=2391")63 ref.TargetNodeClass = ua.NodeClass.DataType64 ref.TargetNodeId = ua.NodeId.from_string("i=2395")65 refs.append(ref)66 ref = ua.AddReferencesItem()67 ref.IsForward = true68 ref.ReferenceTypeId = ua.NodeId.from_string("i=46")69 ref.SourceNodeId = ua.NodeId.from_string("i=2391")70 ref.TargetNodeClass = ua.NodeClass.DataType71 ref.TargetNodeId = ua.NodeId.from_string("i=2396")72 refs.append(ref)73 ref = ua.AddReferencesItem()74 ref.IsForward = true75 ref.ReferenceTypeId = ua.NodeId.from_string("i=46")76 ref.SourceNodeId = ua.NodeId.from_string("i=2391")77 ref.TargetNodeClass = ua.NodeClass.DataType78 ref.TargetNodeId = ua.NodeId.from_string("i=2397")79 refs.append(ref)80 ref = ua.AddReferencesItem()81 ref.IsForward = true82 ref.ReferenceTypeId = ua.NodeId.from_string("i=46")83 ref.SourceNodeId = ua.NodeId.from_string("i=2391")84 ref.TargetNodeClass = ua.NodeClass.DataType85 ref.TargetNodeId = ua.NodeId.from_string("i=2398")86 refs.append(ref)87 ref = ua.AddReferencesItem()88 ref.IsForward = true89 ref.ReferenceTypeId = ua.NodeId.from_string("i=47")90 ref.SourceNodeId = ua.NodeId.from_string("i=2391")91 ref.TargetNodeClass = ua.NodeClass.DataType92 ref.TargetNodeId = ua.NodeId.from_string("i=2399")93 refs.append(ref)94 ref = ua.AddReferencesItem()95 ref.IsForward = true96 ref.ReferenceTypeId = ua.NodeId.from_string("i=47")97 ref.SourceNodeId = ua.NodeId.from_string("i=2391")98 ref.TargetNodeClass = ua.NodeClass.DataType99 ref.TargetNodeId = ua.NodeId.from_string("i=3850")100 refs.append(ref)101 ref = ua.AddReferencesItem()102 ref.IsForward = true103 ref.ReferenceTypeId = ua.NodeId.from_string("i=47")104 ref.SourceNodeId = ua.NodeId.from_string("i=2391")105 ref.TargetNodeClass = ua.NodeClass.DataType106 ref.TargetNodeId = ua.NodeId.from_string("i=2400")107 refs.append(ref)108 ref = ua.AddReferencesItem()109 ref.IsForward = true110 ref.ReferenceTypeId = ua.NodeId.from_string("i=47")111 ref.SourceNodeId = ua.NodeId.from_string("i=2391")112 ref.TargetNodeClass = ua.NodeClass.DataType113 ref.TargetNodeId = ua.NodeId.from_string("i=2402")114 refs.append(ref)115 ref = ua.AddReferencesItem()116 ref.IsForward = true117 ref.ReferenceTypeId = ua.NodeId.from_string("i=47")118 ref.SourceNodeId = ua.NodeId.from_string("i=2391")119 ref.TargetNodeClass = ua.NodeClass.DataType120 ref.TargetNodeId = ua.NodeId.from_string("i=2404")121 refs.append(ref)122 ref = ua.AddReferencesItem()123 ref.IsForward = true124 ref.ReferenceTypeId = ua.NodeId.from_string("i=47")125 ref.SourceNodeId = ua.NodeId.from_string("i=2391")126 ref.TargetNodeClass = ua.NodeClass.DataType127 ref.TargetNodeId = ua.NodeId.from_string("i=2406")128 refs.append(ref)129 ref = ua.AddReferencesItem()130 ref.IsForward = true131 ref.ReferenceTypeId = ua.NodeId.from_string("i=47")132 ref.SourceNodeId = ua.NodeId.from_string("i=2391")133 ref.TargetNodeClass = ua.NodeClass.DataType134 ref.TargetNodeId = ua.NodeId.from_string("i=2408")135 refs.append(ref)136 ref = ua.AddReferencesItem()137 ref.IsForward = true138 ref.ReferenceTypeId = ua.NodeId.from_string("i=47")139 ref.SourceNodeId = ua.NodeId.from_string("i=2391")140 ref.TargetNodeClass = ua.NodeClass.DataType141 ref.TargetNodeId = ua.NodeId.from_string("i=2410")142 refs.append(ref)143 ref = ua.AddReferencesItem()144 ref.IsForward = true145 ref.ReferenceTypeId = ua.NodeId.from_string("i=47")146 ref.SourceNodeId = ua.NodeId.from_string("i=2391")147 ref.TargetNodeClass = ua.NodeClass.DataType148 ref.TargetNodeId = ua.NodeId.from_string("i=2412")149 refs.append(ref)150 ref = ua.AddReferencesItem()151 ref.IsForward = true152 ref.ReferenceTypeId = ua.NodeId.from_string("i=47")153 ref.SourceNodeId = ua.NodeId.from_string("i=2391")154 ref.TargetNodeClass = ua.NodeClass.DataType155 ref.TargetNodeId = ua.NodeId.from_string("i=2414")156 refs.append(ref)157 ref = ua.AddReferencesItem()158 ref.IsForward = true159 ref.ReferenceTypeId = ua.NodeId.from_string("i=47")160 ref.SourceNodeId = ua.NodeId.from_string("i=2391")161 ref.TargetNodeClass = ua.NodeClass.DataType162 ref.TargetNodeId = ua.NodeId.from_string("i=2416")163 refs.append(ref)164 ref = ua.AddReferencesItem()165 ref.IsForward = true166 ref.ReferenceTypeId = ua.NodeId.from_string("i=47")167 ref.SourceNodeId = ua.NodeId.from_string("i=2391")168 ref.TargetNodeClass = ua.NodeClass.DataType169 ref.TargetNodeId = ua.NodeId.from_string("i=2418")170 refs.append(ref)171 ref = ua.AddReferencesItem()172 ref.IsForward = true173 ref.ReferenceTypeId = ua.NodeId.from_string("i=47")174 ref.SourceNodeId = ua.NodeId.from_string("i=2391")175 ref.TargetNodeClass = ua.NodeClass.DataType176 ref.TargetNodeId = ua.NodeId.from_string("i=2420")177 refs.append(ref)178 ref = ua.AddReferencesItem()179 ref.IsForward = true180 ref.ReferenceTypeId = ua.NodeId.from_string("i=47")181 ref.SourceNodeId = ua.NodeId.from_string("i=2391")182 ref.TargetNodeClass = ua.NodeClass.DataType183 ref.TargetNodeId = ua.NodeId.from_string("i=2422")184 refs.append(ref)185 ref = ua.AddReferencesItem()186 ref.IsForward = true187 ref.ReferenceTypeId = ua.NodeId.from_string("i=47")188 ref.SourceNodeId = ua.NodeId.from_string("i=2391")189 ref.TargetNodeClass = ua.NodeClass.DataType190 ref.TargetNodeId = ua.NodeId.from_string("i=2424")191 refs.append(ref)192 ref = ua.AddReferencesItem()193 ref.IsForward = true194 ref.ReferenceTypeId = ua.NodeId.from_string("i=47")195 ref.SourceNodeId = ua.NodeId.from_string("i=2391")196 ref.TargetNodeClass = ua.NodeClass.DataType197 ref.TargetNodeId = ua.NodeId.from_string("i=2426")198 refs.append(ref)199 ref = ua.AddReferencesItem()200 ref.IsForward = true201 ref.ReferenceTypeId = ua.NodeId.from_string("i=47")202 ref.SourceNodeId = ua.NodeId.from_string("i=2391")203 ref.TargetNodeClass = ua.NodeClass.DataType204 ref.TargetNodeId = ua.NodeId.from_string("i=2427")205 refs.append(ref)206 ref = ua.AddReferencesItem()207 ref.IsForward = true208 ref.ReferenceTypeId = ua.NodeId.from_string("i=47")209 ref.SourceNodeId = ua.NodeId.from_string("i=2391")210 ref.TargetNodeClass = ua.NodeClass.DataType211 ref.TargetNodeId = ua.NodeId.from_string("i=2428")212 refs.append(ref)213 ref = ua.AddReferencesItem()214 ref.IsForward = true215 ref.ReferenceTypeId = ua.NodeId.from_string("i=47")216 ref.SourceNodeId = ua.NodeId.from_string("i=2391")217 ref.TargetNodeClass = ua.NodeClass.DataType218 ref.TargetNodeId = ua.NodeId.from_string("i=2429")219 refs.append(ref)220 ref = ua.AddReferencesItem()221 ref.IsForward = true222 ref.ReferenceTypeId = ua.NodeId.from_string("i=47")223 ref.SourceNodeId = ua.NodeId.from_string("i=2391")224 ref.TargetNodeClass = ua.NodeClass.DataType225 ref.TargetNodeId = ua.NodeId.from_string("i=2430")226 refs.append(ref)227 server.add_references(refs)228 229 node = ua.AddNodesItem()230 node.RequestedNewNodeId = ua.NodeId.from_string("i=3830")231 node.BrowseName = ua.QualifiedName.from_string("CurrentState")232 node.NodeClass = ua.NodeClass.Variable233 node.ParentNodeId = ua.NodeId.from_string("i=2391")234 node.ReferenceTypeId = ua.NodeId.from_string("i=47")235 node.TypeDefinition = ua.NodeId.from_string("i=2760")236 attrs = ua.VariableAttributes()237 attrs.DisplayName = ua.LocalizedText("CurrentState")238 attrs.DataType = ua.NodeId(ua.ObjectIds.LocalizedText)239 attrs.ValueRank = -1240 node.NodeAttributes = attrs241 server.add_nodes([node])242 refs = []243 ref = ua.AddReferencesItem()244 ref.IsForward = true245 ref.ReferenceTypeId = ua.NodeId.from_string("i=46")246 ref.SourceNodeId = ua.NodeId.from_string("i=3830")247 ref.TargetNodeClass = ua.NodeClass.DataType248 ref.TargetNodeId = ua.NodeId.from_string("i=3831")249 refs.append(ref)250 ref = ua.AddReferencesItem()251 ref.IsForward = true252 ref.ReferenceTypeId = ua.NodeId.from_string("i=46")253 ref.SourceNodeId = ua.NodeId.from_string("i=3830")254 ref.TargetNodeClass = ua.NodeClass.DataType255 ref.TargetNodeId = ua.NodeId.from_string("i=3833")256 refs.append(ref)257 ref = ua.AddReferencesItem()258 ref.IsForward = true259 ref.ReferenceTypeId = ua.NodeId.from_string("i=37")260 ref.SourceNodeId = ua.NodeId.from_string("i=3830")261 ref.TargetNodeClass = ua.NodeClass.DataType262 ref.TargetNodeId = ua.NodeId.from_string("i=78")263 refs.append(ref)264 server.add_references(refs)265 266 node = ua.AddNodesItem()267 node.RequestedNewNodeId = ua.NodeId.from_string("i=3831")268 node.BrowseName = ua.QualifiedName.from_string("Id")269 node.NodeClass = ua.NodeClass.Variable270 node.ParentNodeId = ua.NodeId.from_string("i=3830")271 node.ReferenceTypeId = ua.NodeId.from_string("i=46")272 node.TypeDefinition = ua.NodeId.from_string("i=68")273 attrs = ua.VariableAttributes()274 attrs.DisplayName = ua.LocalizedText("Id")275 attrs.DataType = ua.NodeId(ua.ObjectIds.NodeId)276 attrs.ValueRank = -1277 node.NodeAttributes = attrs278 server.add_nodes([node])279 refs = []280 ref = ua.AddReferencesItem()281 ref.IsForward = true282 ref.ReferenceTypeId = ua.NodeId.from_string("i=37")283 ref.SourceNodeId = ua.NodeId.from_string("i=3831")284 ref.TargetNodeClass = ua.NodeClass.DataType285 ref.TargetNodeId = ua.NodeId.from_string("i=78")286 refs.append(ref)287 server.add_references(refs)288 289 node = ua.AddNodesItem()290 node.RequestedNewNodeId = ua.NodeId.from_string("i=3833")291 node.BrowseName = ua.QualifiedName.from_string("Number")292 node.NodeClass = ua.NodeClass.Variable293 node.ParentNodeId = ua.NodeId.from_string("i=3830")294 node.ReferenceTypeId = ua.NodeId.from_string("i=46")295 node.TypeDefinition = ua.NodeId.from_string("i=68")296 attrs = ua.VariableAttributes()297 attrs.DisplayName = ua.LocalizedText("Number")298 attrs.DataType = ua.NodeId(ua.ObjectIds.UInt32)299 attrs.ValueRank = -1300 node.NodeAttributes = attrs301 server.add_nodes([node])302 refs = []303 ref = ua.AddReferencesItem()304 ref.IsForward = true305 ref.ReferenceTypeId = ua.NodeId.from_string("i=37")306 ref.SourceNodeId = ua.NodeId.from_string("i=3833")307 ref.TargetNodeClass = ua.NodeClass.DataType308 ref.TargetNodeId = ua.NodeId.from_string("i=78")309 refs.append(ref)310 server.add_references(refs)311 312 node = ua.AddNodesItem()313 node.RequestedNewNodeId = ua.NodeId.from_string("i=3835")314 node.BrowseName = ua.QualifiedName.from_string("LastTransition")315 node.NodeClass = ua.NodeClass.Variable316 node.ParentNodeId = ua.NodeId.from_string("i=2391")317 node.ReferenceTypeId = ua.NodeId.from_string("i=47")318 node.TypeDefinition = ua.NodeId.from_string("i=2767")319 attrs = ua.VariableAttributes()320 attrs.DisplayName = ua.LocalizedText("LastTransition")321 attrs.DataType = ua.NodeId(ua.ObjectIds.LocalizedText)322 attrs.ValueRank = -1323 node.NodeAttributes = attrs324 server.add_nodes([node])325 refs = []326 ref = ua.AddReferencesItem()327 ref.IsForward = true328 ref.ReferenceTypeId = ua.NodeId.from_string("i=46")329 ref.SourceNodeId = ua.NodeId.from_string("i=3835")330 ref.TargetNodeClass = ua.NodeClass.DataType331 ref.TargetNodeId = ua.NodeId.from_string("i=3836")332 refs.append(ref)333 ref = ua.AddReferencesItem()334 ref.IsForward = true335 ref.ReferenceTypeId = ua.NodeId.from_string("i=46")336 ref.SourceNodeId = ua.NodeId.from_string("i=3835")337 ref.TargetNodeClass = ua.NodeClass.DataType338 ref.TargetNodeId = ua.NodeId.from_string("i=3838")339 refs.append(ref)340 ref = ua.AddReferencesItem()341 ref.IsForward = true342 ref.ReferenceTypeId = ua.NodeId.from_string("i=46")343 ref.SourceNodeId = ua.NodeId.from_string("i=3835")344 ref.TargetNodeClass = ua.NodeClass.DataType345 ref.TargetNodeId = ua.NodeId.from_string("i=3839")346 refs.append(ref)347 ref = ua.AddReferencesItem()348 ref.IsForward = true349 ref.ReferenceTypeId = ua.NodeId.from_string("i=37")350 ref.SourceNodeId = ua.NodeId.from_string("i=3835")351 ref.TargetNodeClass = ua.NodeClass.DataType352 ref.TargetNodeId = ua.NodeId.from_string("i=78")353 refs.append(ref)354 server.add_references(refs)355 356 node = ua.AddNodesItem()357 node.RequestedNewNodeId = ua.NodeId.from_string("i=3836")358 node.BrowseName = ua.QualifiedName.from_string("Id")359 node.NodeClass = ua.NodeClass.Variable360 node.ParentNodeId = ua.NodeId.from_string("i=3835")361 node.ReferenceTypeId = ua.NodeId.from_string("i=46")362 node.TypeDefinition = ua.NodeId.from_string("i=68")363 attrs = ua.VariableAttributes()364 attrs.DisplayName = ua.LocalizedText("Id")365 attrs.DataType = ua.NodeId(ua.ObjectIds.NodeId)366 attrs.ValueRank = -1367 node.NodeAttributes = attrs368 server.add_nodes([node])369 refs = []370 ref = ua.AddReferencesItem()371 ref.IsForward = true372 ref.ReferenceTypeId = ua.NodeId.from_string("i=37")373 ref.SourceNodeId = ua.NodeId.from_string("i=3836")374 ref.TargetNodeClass = ua.NodeClass.DataType375 ref.TargetNodeId = ua.NodeId.from_string("i=78")376 refs.append(ref)377 server.add_references(refs)378 379 node = ua.AddNodesItem()380 node.RequestedNewNodeId = ua.NodeId.from_string("i=3838")381 node.BrowseName = ua.QualifiedName.from_string("Number")382 node.NodeClass = ua.NodeClass.Variable383 node.ParentNodeId = ua.NodeId.from_string("i=3835")384 node.ReferenceTypeId = ua.NodeId.from_string("i=46")385 node.TypeDefinition = ua.NodeId.from_string("i=68")386 attrs = ua.VariableAttributes()387 attrs.DisplayName = ua.LocalizedText("Number")388 attrs.DataType = ua.NodeId(ua.ObjectIds.UInt32)389 attrs.ValueRank = -1390 node.NodeAttributes = attrs391 server.add_nodes([node])392 refs = []393 ref = ua.AddReferencesItem()394 ref.IsForward = true395 ref.ReferenceTypeId = ua.NodeId.from_string("i=37")396 ref.SourceNodeId = ua.NodeId.from_string("i=3838")397 ref.TargetNodeClass = ua.NodeClass.DataType398 ref.TargetNodeId = ua.NodeId.from_string("i=78")399 refs.append(ref)400 server.add_references(refs)401 402 node = ua.AddNodesItem()403 node.RequestedNewNodeId = ua.NodeId.from_string("i=3839")404 node.BrowseName = ua.QualifiedName.from_string("TransitionTime")405 node.NodeClass = ua.NodeClass.Variable406 node.ParentNodeId = ua.NodeId.from_string("i=3835")407 node.ReferenceTypeId = ua.NodeId.from_string("i=46")408 node.TypeDefinition = ua.NodeId.from_string("i=68")409 attrs = ua.VariableAttributes()410 attrs.DisplayName = ua.LocalizedText("TransitionTime")411 attrs.DataType = ua.NodeId.from_string("i=294")412 attrs.ValueRank = -1413 node.NodeAttributes = attrs414 server.add_nodes([node])415 refs = []416 ref = ua.AddReferencesItem()417 ref.IsForward = true418 ref.ReferenceTypeId = ua.NodeId.from_string("i=37")419 ref.SourceNodeId = ua.NodeId.from_string("i=3839")420 ref.TargetNodeClass = ua.NodeClass.DataType421 ref.TargetNodeId = ua.NodeId.from_string("i=78")422 refs.append(ref)423 server.add_references(refs)424 425 node = ua.AddNodesItem()426 node.RequestedNewNodeId = ua.NodeId.from_string("i=2392")427 node.BrowseName = ua.QualifiedName.from_string("Creatable")428 node.NodeClass = ua.NodeClass.Variable429 node.ParentNodeId = ua.NodeId.from_string("i=2391")430 node.ReferenceTypeId = ua.NodeId.from_string("i=46")431 node.TypeDefinition = ua.NodeId.from_string("i=68")432 attrs = ua.VariableAttributes()433 attrs.DisplayName = ua.LocalizedText("Creatable")434 attrs.DataType = ua.NodeId(ua.ObjectIds.Boolean)435 attrs.ValueRank = -1436 node.NodeAttributes = attrs437 server.add_nodes([node])438 439 node = ua.AddNodesItem()440 node.RequestedNewNodeId = ua.NodeId.from_string("i=2393")441 node.BrowseName = ua.QualifiedName.from_string("Deletable")442 node.NodeClass = ua.NodeClass.Variable443 node.ParentNodeId = ua.NodeId.from_string("i=2391")444 node.ReferenceTypeId = ua.NodeId.from_string("i=46")445 node.TypeDefinition = ua.NodeId.from_string("i=68")446 attrs = ua.VariableAttributes()447 attrs.DisplayName = ua.LocalizedText("Deletable")448 attrs.DataType = ua.NodeId(ua.ObjectIds.Boolean)449 attrs.ValueRank = -1450 node.NodeAttributes = attrs451 server.add_nodes([node])452 refs = []453 ref = ua.AddReferencesItem()454 ref.IsForward = true455 ref.ReferenceTypeId = ua.NodeId.from_string("i=37")456 ref.SourceNodeId = ua.NodeId.from_string("i=2393")457 ref.TargetNodeClass = ua.NodeClass.DataType458 ref.TargetNodeId = ua.NodeId.from_string("i=78")459 refs.append(ref)460 server.add_references(refs)461 462 node = ua.AddNodesItem()463 node.RequestedNewNodeId = ua.NodeId.from_string("i=2394")464 node.BrowseName = ua.QualifiedName.from_string("AutoDelete")465 node.NodeClass = ua.NodeClass.Variable466 node.ParentNodeId = ua.NodeId.from_string("i=2391")467 node.ReferenceTypeId = ua.NodeId.from_string("i=46")468 node.TypeDefinition = ua.NodeId.from_string("i=68")469 attrs = ua.VariableAttributes()470 attrs.DisplayName = ua.LocalizedText("AutoDelete")471 attrs.DataType = ua.NodeId(ua.ObjectIds.Boolean)472 attrs.ValueRank = -1473 node.NodeAttributes = attrs474 server.add_nodes([node])475 refs = []476 ref = ua.AddReferencesItem()477 ref.IsForward = true478 ref.ReferenceTypeId = ua.NodeId.from_string("i=37")479 ref.SourceNodeId = ua.NodeId.from_string("i=2394")480 ref.TargetNodeClass = ua.NodeClass.DataType481 ref.TargetNodeId = ua.NodeId.from_string("i=79")482 refs.append(ref)483 server.add_references(refs)484 485 node = ua.AddNodesItem()486 node.RequestedNewNodeId = ua.NodeId.from_string("i=2395")487 node.BrowseName = ua.QualifiedName.from_string("RecycleCount")488 node.NodeClass = ua.NodeClass.Variable489 node.ParentNodeId = ua.NodeId.from_string("i=2391")490 node.ReferenceTypeId = ua.NodeId.from_string("i=46")491 node.TypeDefinition = ua.NodeId.from_string("i=68")492 attrs = ua.VariableAttributes()493 attrs.DisplayName = ua.LocalizedText("RecycleCount")494 attrs.DataType = ua.NodeId(ua.ObjectIds.Int32)495 attrs.ValueRank = -1496 node.NodeAttributes = attrs497 server.add_nodes([node])498 refs = []499 ref = ua.AddReferencesItem()500 ref.IsForward = true501 ref.ReferenceTypeId = ua.NodeId.from_string("i=37")502 ref.SourceNodeId = ua.NodeId.from_string("i=2395")503 ref.TargetNodeClass = ua.NodeClass.DataType504 ref.TargetNodeId = ua.NodeId.from_string("i=78")505 refs.append(ref)506 server.add_references(refs)507 508 node = ua.AddNodesItem()509 node.RequestedNewNodeId = ua.NodeId.from_string("i=2396")510 node.BrowseName = ua.QualifiedName.from_string("InstanceCount")511 node.NodeClass = ua.NodeClass.Variable512 node.ParentNodeId = ua.NodeId.from_string("i=2391")513 node.ReferenceTypeId = ua.NodeId.from_string("i=46")514 node.TypeDefinition = ua.NodeId.from_string("i=68")515 attrs = ua.VariableAttributes()516 attrs.DisplayName = ua.LocalizedText("InstanceCount")517 attrs.DataType = ua.NodeId(ua.ObjectIds.UInt32)518 attrs.ValueRank = -1519 node.NodeAttributes = attrs520 server.add_nodes([node])521 522 node = ua.AddNodesItem()523 node.RequestedNewNodeId = ua.NodeId.from_string("i=2397")524 node.BrowseName = ua.QualifiedName.from_string("MaxInstanceCount")525 node.NodeClass = ua.NodeClass.Variable526 node.ParentNodeId = ua.NodeId.from_string("i=2391")527 node.ReferenceTypeId = ua.NodeId.from_string("i=46")528 node.TypeDefinition = ua.NodeId.from_string("i=68")529 attrs = ua.VariableAttributes()530 attrs.DisplayName = ua.LocalizedText("MaxInstanceCount")531 attrs.DataType = ua.NodeId(ua.ObjectIds.UInt32)532 attrs.ValueRank = -1533 node.NodeAttributes = attrs534 server.add_nodes([node])535 536 node = ua.AddNodesItem()537 node.RequestedNewNodeId = ua.NodeId.from_string("i=2398")538 node.BrowseName = ua.QualifiedName.from_string("MaxRecycleCount")539 node.NodeClass = ua.NodeClass.Variable540 node.ParentNodeId = ua.NodeId.from_string("i=2391")541 node.ReferenceTypeId = ua.NodeId.from_string("i=46")542 node.TypeDefinition = ua.NodeId.from_string("i=68")543 attrs = ua.VariableAttributes()544 attrs.DisplayName = ua.LocalizedText("MaxRecycleCount")545 attrs.DataType = ua.NodeId(ua.ObjectIds.UInt32)546 attrs.ValueRank = -1547 node.NodeAttributes = attrs548 server.add_nodes([node])549 550 node = ua.AddNodesItem()551 node.RequestedNewNodeId = ua.NodeId.from_string("i=2399")552 node.BrowseName = ua.QualifiedName.from_string("ProgramDiagnostics")553 node.NodeClass = ua.NodeClass.Variable554 node.ParentNodeId = ua.NodeId.from_string("i=2391")555 node.ReferenceTypeId = ua.NodeId.from_string("i=47")556 node.TypeDefinition = ua.NodeId.from_string("i=2380")557 attrs = ua.VariableAttributes()558 attrs.DisplayName = ua.LocalizedText("ProgramDiagnostics")559 attrs.DataType = ua.NodeId.from_string("i=894")560 attrs.ValueRank = -1561 node.NodeAttributes = attrs562 server.add_nodes([node])563 refs = []564 ref = ua.AddReferencesItem()565 ref.IsForward = true566 ref.ReferenceTypeId = ua.NodeId.from_string("i=46")567 ref.SourceNodeId = ua.NodeId.from_string("i=2399")568 ref.TargetNodeClass = ua.NodeClass.DataType569 ref.TargetNodeId = ua.NodeId.from_string("i=3840")570 refs.append(ref)571 ref = ua.AddReferencesItem()572 ref.IsForward = true573 ref.ReferenceTypeId = ua.NodeId.from_string("i=46")574 ref.SourceNodeId = ua.NodeId.from_string("i=2399")575 ref.TargetNodeClass = ua.NodeClass.DataType576 ref.TargetNodeId = ua.NodeId.from_string("i=3841")577 refs.append(ref)578 ref = ua.AddReferencesItem()579 ref.IsForward = true580 ref.ReferenceTypeId = ua.NodeId.from_string("i=46")581 ref.SourceNodeId = ua.NodeId.from_string("i=2399")582 ref.TargetNodeClass = ua.NodeClass.DataType583 ref.TargetNodeId = ua.NodeId.from_string("i=3842")584 refs.append(ref)585 ref = ua.AddReferencesItem()586 ref.IsForward = true587 ref.ReferenceTypeId = ua.NodeId.from_string("i=46")588 ref.SourceNodeId = ua.NodeId.from_string("i=2399")589 ref.TargetNodeClass = ua.NodeClass.DataType590 ref.TargetNodeId = ua.NodeId.from_string("i=3843")591 refs.append(ref)592 ref = ua.AddReferencesItem()593 ref.IsForward = true594 ref.ReferenceTypeId = ua.NodeId.from_string("i=46")595 ref.SourceNodeId = ua.NodeId.from_string("i=2399")596 ref.TargetNodeClass = ua.NodeClass.DataType597 ref.TargetNodeId = ua.NodeId.from_string("i=3844")598 refs.append(ref)599 ref = ua.AddReferencesItem()600 ref.IsForward = true601 ref.ReferenceTypeId = ua.NodeId.from_string("i=46")602 ref.SourceNodeId = ua.NodeId.from_string("i=2399")603 ref.TargetNodeClass = ua.NodeClass.DataType604 ref.TargetNodeId = ua.NodeId.from_string("i=3845")605 refs.append(ref)606 ref = ua.AddReferencesItem()607 ref.IsForward = true608 ref.ReferenceTypeId = ua.NodeId.from_string("i=46")609 ref.SourceNodeId = ua.NodeId.from_string("i=2399")610 ref.TargetNodeClass = ua.NodeClass.DataType611 ref.TargetNodeId = ua.NodeId.from_string("i=3846")612 refs.append(ref)613 ref = ua.AddReferencesItem()614 ref.IsForward = true615 ref.ReferenceTypeId = ua.NodeId.from_string("i=46")616 ref.SourceNodeId = ua.NodeId.from_string("i=2399")617 ref.TargetNodeClass = ua.NodeClass.DataType618 ref.TargetNodeId = ua.NodeId.from_string("i=3847")619 refs.append(ref)620 ref = ua.AddReferencesItem()621 ref.IsForward = true622 ref.ReferenceTypeId = ua.NodeId.from_string("i=46")623 ref.SourceNodeId = ua.NodeId.from_string("i=2399")624 ref.TargetNodeClass = ua.NodeClass.DataType625 ref.TargetNodeId = ua.NodeId.from_string("i=3848")626 refs.append(ref)627 ref = ua.AddReferencesItem()628 ref.IsForward = true629 ref.ReferenceTypeId = ua.NodeId.from_string("i=46")630 ref.SourceNodeId = ua.NodeId.from_string("i=2399")631 ref.TargetNodeClass = ua.NodeClass.DataType632 ref.TargetNodeId = ua.NodeId.from_string("i=3849")633 refs.append(ref)634 ref = ua.AddReferencesItem()635 ref.IsForward = true636 ref.ReferenceTypeId = ua.NodeId.from_string("i=37")637 ref.SourceNodeId = ua.NodeId.from_string("i=2399")638 ref.TargetNodeClass = ua.NodeClass.DataType639 ref.TargetNodeId = ua.NodeId.from_string("i=80")640 refs.append(ref)641 server.add_references(refs)642 643 node = ua.AddNodesItem()644 node.RequestedNewNodeId = ua.NodeId.from_string("i=3840")645 node.BrowseName = ua.QualifiedName.from_string("CreateSessionId")646 node.NodeClass = ua.NodeClass.Variable647 node.ParentNodeId = ua.NodeId.from_string("i=2399")648 node.ReferenceTypeId = ua.NodeId.from_string("i=46")649 node.TypeDefinition = ua.NodeId.from_string("i=68")650 attrs = ua.VariableAttributes()651 attrs.DisplayName = ua.LocalizedText("CreateSessionId")652 attrs.DataType = ua.NodeId(ua.ObjectIds.NodeId)653 attrs.ValueRank = -1654 node.NodeAttributes = attrs655 server.add_nodes([node])656 refs = []657 ref = ua.AddReferencesItem()658 ref.IsForward = true659 ref.ReferenceTypeId = ua.NodeId.from_string("i=37")660 ref.SourceNodeId = ua.NodeId.from_string("i=3840")661 ref.TargetNodeClass = ua.NodeClass.DataType662 ref.TargetNodeId = ua.NodeId.from_string("i=78")663 refs.append(ref)664 server.add_references(refs)665 666 node = ua.AddNodesItem()667 node.RequestedNewNodeId = ua.NodeId.from_string("i=3841")668 node.BrowseName = ua.QualifiedName.from_string("CreateClientName")669 node.NodeClass = ua.NodeClass.Variable670 node.ParentNodeId = ua.NodeId.from_string("i=2399")671 node.ReferenceTypeId = ua.NodeId.from_string("i=46")672 node.TypeDefinition = ua.NodeId.from_string("i=68")673 attrs = ua.VariableAttributes()674 attrs.DisplayName = ua.LocalizedText("CreateClientName")675 attrs.DataType = ua.NodeId(ua.ObjectIds.String)676 attrs.ValueRank = -1677 node.NodeAttributes = attrs678 server.add_nodes([node])679 refs = []680 ref = ua.AddReferencesItem()681 ref.IsForward = true682 ref.ReferenceTypeId = ua.NodeId.from_string("i=37")683 ref.SourceNodeId = ua.NodeId.from_string("i=3841")684 ref.TargetNodeClass = ua.NodeClass.DataType685 ref.TargetNodeId = ua.NodeId.from_string("i=78")686 refs.append(ref)687 server.add_references(refs)688 689 node = ua.AddNodesItem()690 node.RequestedNewNodeId = ua.NodeId.from_string("i=3842")691 node.BrowseName = ua.QualifiedName.from_string("InvocationCreationTime")692 node.NodeClass = ua.NodeClass.Variable693 node.ParentNodeId = ua.NodeId.from_string("i=2399")694 node.ReferenceTypeId = ua.NodeId.from_string("i=46")695 node.TypeDefinition = ua.NodeId.from_string("i=68")696 attrs = ua.VariableAttributes()697 attrs.DisplayName = ua.LocalizedText("InvocationCreationTime")698 attrs.DataType = ua.NodeId.from_string("i=294")699 attrs.ValueRank = -1700 node.NodeAttributes = attrs701 server.add_nodes([node])702 refs = []703 ref = ua.AddReferencesItem()704 ref.IsForward = true705 ref.ReferenceTypeId = ua.NodeId.from_string("i=37")706 ref.SourceNodeId = ua.NodeId.from_string("i=3842")707 ref.TargetNodeClass = ua.NodeClass.DataType708 ref.TargetNodeId = ua.NodeId.from_string("i=78")709 refs.append(ref)710 server.add_references(refs)711 712 node = ua.AddNodesItem()713 node.RequestedNewNodeId = ua.NodeId.from_string("i=3843")714 node.BrowseName = ua.QualifiedName.from_string("LastTransitionTime")715 node.NodeClass = ua.NodeClass.Variable716 node.ParentNodeId = ua.NodeId.from_string("i=2399")717 node.ReferenceTypeId = ua.NodeId.from_string("i=46")718 node.TypeDefinition = ua.NodeId.from_string("i=68")719 attrs = ua.VariableAttributes()720 attrs.DisplayName = ua.LocalizedText("LastTransitionTime")721 attrs.DataType = ua.NodeId.from_string("i=294")722 attrs.ValueRank = -1723 node.NodeAttributes = attrs724 server.add_nodes([node])725 refs = []726 ref = ua.AddReferencesItem()727 ref.IsForward = true728 ref.ReferenceTypeId = ua.NodeId.from_string("i=37")729 ref.SourceNodeId = ua.NodeId.from_string("i=3843")730 ref.TargetNodeClass = ua.NodeClass.DataType731 ref.TargetNodeId = ua.NodeId.from_string("i=78")732 refs.append(ref)733 server.add_references(refs)734 735 node = ua.AddNodesItem()736 node.RequestedNewNodeId = ua.NodeId.from_string("i=3844")737 node.BrowseName = ua.QualifiedName.from_string("LastMethodCall")738 node.NodeClass = ua.NodeClass.Variable739 node.ParentNodeId = ua.NodeId.from_string("i=2399")740 node.ReferenceTypeId = ua.NodeId.from_string("i=46")741 node.TypeDefinition = ua.NodeId.from_string("i=68")742 attrs = ua.VariableAttributes()743 attrs.DisplayName = ua.LocalizedText("LastMethodCall")744 attrs.DataType = ua.NodeId(ua.ObjectIds.String)745 attrs.ValueRank = -1746 node.NodeAttributes = attrs747 server.add_nodes([node])748 refs = []749 ref = ua.AddReferencesItem()750 ref.IsForward = true751 ref.ReferenceTypeId = ua.NodeId.from_string("i=37")752 ref.SourceNodeId = ua.NodeId.from_string("i=3844")753 ref.TargetNodeClass = ua.NodeClass.DataType754 ref.TargetNodeId = ua.NodeId.from_string("i=78")755 refs.append(ref)756 server.add_references(refs)757 758 node = ua.AddNodesItem()759 node.RequestedNewNodeId = ua.NodeId.from_string("i=3845")760 node.BrowseName = ua.QualifiedName.from_string("LastMethodSessionId")761 node.NodeClass = ua.NodeClass.Variable762 node.ParentNodeId = ua.NodeId.from_string("i=2399")763 node.ReferenceTypeId = ua.NodeId.from_string("i=46")764 node.TypeDefinition = ua.NodeId.from_string("i=68")765 attrs = ua.VariableAttributes()766 attrs.DisplayName = ua.LocalizedText("LastMethodSessionId")767 attrs.DataType = ua.NodeId(ua.ObjectIds.NodeId)768 attrs.ValueRank = -1769 node.NodeAttributes = attrs770 server.add_nodes([node])771 refs = []772 ref = ua.AddReferencesItem()773 ref.IsForward = true774 ref.ReferenceTypeId = ua.NodeId.from_string("i=37")775 ref.SourceNodeId = ua.NodeId.from_string("i=3845")776 ref.TargetNodeClass = ua.NodeClass.DataType777 ref.TargetNodeId = ua.NodeId.from_string("i=78")778 refs.append(ref)779 server.add_references(refs)780 781 node = ua.AddNodesItem()782 node.RequestedNewNodeId = ua.NodeId.from_string("i=3846")783 node.BrowseName = ua.QualifiedName.from_string("LastMethodInputArguments")784 node.NodeClass = ua.NodeClass.Variable785 node.ParentNodeId = ua.NodeId.from_string("i=2399")786 node.ReferenceTypeId = ua.NodeId.from_string("i=46")787 node.TypeDefinition = ua.NodeId.from_string("i=68")788 attrs = ua.VariableAttributes()789 attrs.DisplayName = ua.LocalizedText("LastMethodInputArguments")790 attrs.DataType = ua.NodeId.from_string("i=296")791 attrs.ValueRank = 1792 node.NodeAttributes = attrs793 server.add_nodes([node])794 refs = []795 ref = ua.AddReferencesItem()796 ref.IsForward = true797 ref.ReferenceTypeId = ua.NodeId.from_string("i=37")798 ref.SourceNodeId = ua.NodeId.from_string("i=3846")799 ref.TargetNodeClass = ua.NodeClass.DataType800 ref.TargetNodeId = ua.NodeId.from_string("i=78")801 refs.append(ref)802 server.add_references(refs)803 804 node = ua.AddNodesItem()805 node.RequestedNewNodeId = ua.NodeId.from_string("i=3847")806 node.BrowseName = ua.QualifiedName.from_string("LastMethodOutputArguments")807 node.NodeClass = ua.NodeClass.Variable808 node.ParentNodeId = ua.NodeId.from_string("i=2399")809 node.ReferenceTypeId = ua.NodeId.from_string("i=46")810 node.TypeDefinition = ua.NodeId.from_string("i=68")811 attrs = ua.VariableAttributes()812 attrs.DisplayName = ua.LocalizedText("LastMethodOutputArguments")813 attrs.DataType = ua.NodeId.from_string("i=296")814 attrs.ValueRank = 1815 node.NodeAttributes = attrs816 server.add_nodes([node])817 refs = []818 ref = ua.AddReferencesItem()819 ref.IsForward = true820 ref.ReferenceTypeId = ua.NodeId.from_string("i=37")821 ref.SourceNodeId = ua.NodeId.from_string("i=3847")822 ref.TargetNodeClass = ua.NodeClass.DataType823 ref.TargetNodeId = ua.NodeId.from_string("i=78")824 refs.append(ref)825 server.add_references(refs)826 827 node = ua.AddNodesItem()828 node.RequestedNewNodeId = ua.NodeId.from_string("i=3848")829 node.BrowseName = ua.QualifiedName.from_string("LastMethodCallTime")830 node.NodeClass = ua.NodeClass.Variable831 node.ParentNodeId = ua.NodeId.from_string("i=2399")832 node.ReferenceTypeId = ua.NodeId.from_string("i=46")833 node.TypeDefinition = ua.NodeId.from_string("i=68")834 attrs = ua.VariableAttributes()835 attrs.DisplayName = ua.LocalizedText("LastMethodCallTime")836 attrs.DataType = ua.NodeId.from_string("i=294")837 attrs.ValueRank = -1838 node.NodeAttributes = attrs839 server.add_nodes([node])840 refs = []841 ref = ua.AddReferencesItem()842 ref.IsForward = true843 ref.ReferenceTypeId = ua.NodeId.from_string("i=37")844 ref.SourceNodeId = ua.NodeId.from_string("i=3848")845 ref.TargetNodeClass = ua.NodeClass.DataType846 ref.TargetNodeId = ua.NodeId.from_string("i=78")847 refs.append(ref)848 server.add_references(refs)849 850 node = ua.AddNodesItem()851 node.RequestedNewNodeId = ua.NodeId.from_string("i=3849")852 node.BrowseName = ua.QualifiedName.from_string("LastMethodReturnStatus")853 node.NodeClass = ua.NodeClass.Variable854 node.ParentNodeId = ua.NodeId.from_string("i=2399")855 node.ReferenceTypeId = ua.NodeId.from_string("i=46")856 node.TypeDefinition = ua.NodeId.from_string("i=68")857 attrs = ua.VariableAttributes()858 attrs.DisplayName = ua.LocalizedText("LastMethodReturnStatus")859 attrs.DataType = ua.NodeId.from_string("i=299")860 attrs.ValueRank = -1861 node.NodeAttributes = attrs862 server.add_nodes([node])863 refs = []864 ref = ua.AddReferencesItem()865 ref.IsForward = true866 ref.ReferenceTypeId = ua.NodeId.from_string("i=37")867 ref.SourceNodeId = ua.NodeId.from_string("i=3849")868 ref.TargetNodeClass = ua.NodeClass.DataType869 ref.TargetNodeId = ua.NodeId.from_string("i=78")870 refs.append(ref)871 server.add_references(refs)872 873 node = ua.AddNodesItem()874 node.RequestedNewNodeId = ua.NodeId.from_string("i=3850")875 node.BrowseName = ua.QualifiedName.from_string("FinalResultData")876 node.NodeClass = ua.NodeClass.Object877 node.ParentNodeId = ua.NodeId.from_string("i=2391")878 node.ReferenceTypeId = ua.NodeId.from_string("i=47")879 node.TypeDefinition = ua.NodeId.from_string("i=58")880 attrs = ua.ObjectAttributes()881 attrs.DisplayName = ua.LocalizedText("FinalResultData")882 attrs.EventNotifier = 0883 node.NodeAttributes = attrs884 server.add_nodes([node])885 refs = []886 ref = ua.AddReferencesItem()887 ref.IsForward = true888 ref.ReferenceTypeId = ua.NodeId.from_string("i=37")889 ref.SourceNodeId = ua.NodeId.from_string("i=3850")890 ref.TargetNodeClass = ua.NodeClass.DataType891 ref.TargetNodeId = ua.NodeId.from_string("i=80")892 refs.append(ref)893 server.add_references(refs)894 895 node = ua.AddNodesItem()896 node.RequestedNewNodeId = ua.NodeId.from_string("i=2400")897 node.BrowseName = ua.QualifiedName.from_string("Ready")898 node.NodeClass = ua.NodeClass.Object899 node.ParentNodeId = ua.NodeId.from_string("i=2391")900 node.ReferenceTypeId = ua.NodeId.from_string("i=47")901 node.TypeDefinition = ua.NodeId.from_string("i=2307")902 attrs = ua.ObjectAttributes()903 attrs.Description = ua.LocalizedText("The Program is properly initialized and may be started.")904 attrs.DisplayName = ua.LocalizedText("Ready")905 attrs.EventNotifier = 0906 node.NodeAttributes = attrs907 server.add_nodes([node])908 refs = []909 ref = ua.AddReferencesItem()910 ref.IsForward = true911 ref.ReferenceTypeId = ua.NodeId.from_string("i=46")912 ref.SourceNodeId = ua.NodeId.from_string("i=2400")913 ref.TargetNodeClass = ua.NodeClass.DataType914 ref.TargetNodeId = ua.NodeId.from_string("i=2401")915 refs.append(ref)916 server.add_references(refs)917 918 node = ua.AddNodesItem()919 node.RequestedNewNodeId = ua.NodeId.from_string("i=2401")920 node.BrowseName = ua.QualifiedName.from_string("StateNumber")921 node.NodeClass = ua.NodeClass.Variable922 node.ParentNodeId = ua.NodeId.from_string("i=2400")923 node.ReferenceTypeId = ua.NodeId.from_string("i=46")924 node.TypeDefinition = ua.NodeId.from_string("i=68")925 attrs = ua.VariableAttributes()926 attrs.DisplayName = ua.LocalizedText("StateNumber")927 attrs.DataType = ua.NodeId(ua.ObjectIds.UInt32)928 attrs.Value = ua.Variant(1, ua.VariantType.UInt32)929 attrs.ValueRank = -1930 node.NodeAttributes = attrs931 server.add_nodes([node])932 refs = []933 ref = ua.AddReferencesItem()934 ref.IsForward = true935 ref.ReferenceTypeId = ua.NodeId.from_string("i=37")936 ref.SourceNodeId = ua.NodeId.from_string("i=2401")937 ref.TargetNodeClass = ua.NodeClass.DataType938 ref.TargetNodeId = ua.NodeId.from_string("i=78")939 refs.append(ref)940 server.add_references(refs)941 942 node = ua.AddNodesItem()943 node.RequestedNewNodeId = ua.NodeId.from_string("i=2402")944 node.BrowseName = ua.QualifiedName.from_string("Running")945 node.NodeClass = ua.NodeClass.Object946 node.ParentNodeId = ua.NodeId.from_string("i=2391")947 node.ReferenceTypeId = ua.NodeId.from_string("i=47")948 node.TypeDefinition = ua.NodeId.from_string("i=2307")949 attrs = ua.ObjectAttributes()950 attrs.Description = ua.LocalizedText("The Program is executing making progress towards completion.")951 attrs.DisplayName = ua.LocalizedText("Running")952 attrs.EventNotifier = 0953 node.NodeAttributes = attrs954 server.add_nodes([node])955 refs = []956 ref = ua.AddReferencesItem()957 ref.IsForward = true958 ref.ReferenceTypeId = ua.NodeId.from_string("i=46")959 ref.SourceNodeId = ua.NodeId.from_string("i=2402")960 ref.TargetNodeClass = ua.NodeClass.DataType961 ref.TargetNodeId = ua.NodeId.from_string("i=2403")962 refs.append(ref)963 server.add_references(refs)964 965 node = ua.AddNodesItem()966 node.RequestedNewNodeId = ua.NodeId.from_string("i=2403")967 node.BrowseName = ua.QualifiedName.from_string("StateNumber")968 node.NodeClass = ua.NodeClass.Variable969 node.ParentNodeId = ua.NodeId.from_string("i=2402")970 node.ReferenceTypeId = ua.NodeId.from_string("i=46")971 node.TypeDefinition = ua.NodeId.from_string("i=68")972 attrs = ua.VariableAttributes()973 attrs.DisplayName = ua.LocalizedText("StateNumber")974 attrs.DataType = ua.NodeId(ua.ObjectIds.UInt32)975 attrs.Value = ua.Variant(2, ua.VariantType.UInt32)976 attrs.ValueRank = -1977 node.NodeAttributes = attrs978 server.add_nodes([node])979 refs = []980 ref = ua.AddReferencesItem()981 ref.IsForward = true982 ref.ReferenceTypeId = ua.NodeId.from_string("i=37")983 ref.SourceNodeId = ua.NodeId.from_string("i=2403")984 ref.TargetNodeClass = ua.NodeClass.DataType985 ref.TargetNodeId = ua.NodeId.from_string("i=78")986 refs.append(ref)987 server.add_references(refs)988 989 node = ua.AddNodesItem()990 node.RequestedNewNodeId = ua.NodeId.from_string("i=2404")991 node.BrowseName = ua.QualifiedName.from_string("Suspended")992 node.NodeClass = ua.NodeClass.Object993 node.ParentNodeId = ua.NodeId.from_string("i=2391")994 node.ReferenceTypeId = ua.NodeId.from_string("i=47")995 node.TypeDefinition = ua.NodeId.from_string("i=2307")996 attrs = ua.ObjectAttributes()997 attrs.Description = ua.LocalizedText("The Program has been stopped prior to reaching a terminal state but may be resumed.")998 attrs.DisplayName = ua.LocalizedText("Suspended")999 attrs.EventNotifier = 01000 node.NodeAttributes = attrs1001 server.add_nodes([node])1002 refs = []1003 ref = ua.AddReferencesItem()1004 ref.IsForward = true1005 ref.ReferenceTypeId = ua.NodeId.from_string("i=46")1006 ref.SourceNodeId = ua.NodeId.from_string("i=2404")1007 ref.TargetNodeClass = ua.NodeClass.DataType1008 ref.TargetNodeId = ua.NodeId.from_string("i=2405")1009 refs.append(ref)1010 server.add_references(refs)1011 1012 node = ua.AddNodesItem()1013 node.RequestedNewNodeId = ua.NodeId.from_string("i=2405")1014 node.BrowseName = ua.QualifiedName.from_string("StateNumber")1015 node.NodeClass = ua.NodeClass.Variable1016 node.ParentNodeId = ua.NodeId.from_string("i=2404")1017 node.ReferenceTypeId = ua.NodeId.from_string("i=46")1018 node.TypeDefinition = ua.NodeId.from_string("i=68")1019 attrs = ua.VariableAttributes()1020 attrs.DisplayName = ua.LocalizedText("StateNumber")1021 attrs.DataType = ua.NodeId(ua.ObjectIds.UInt32)1022 attrs.Value = ua.Variant(3, ua.VariantType.UInt32)1023 attrs.ValueRank = -11024 node.NodeAttributes = attrs1025 server.add_nodes([node])1026 refs = []1027 ref = ua.AddReferencesItem()1028 ref.IsForward = true1029 ref.ReferenceTypeId = ua.NodeId.from_string("i=37")1030 ref.SourceNodeId = ua.NodeId.from_string("i=2405")1031 ref.TargetNodeClass = ua.NodeClass.DataType1032 ref.TargetNodeId = ua.NodeId.from_string("i=78")1033 refs.append(ref)1034 server.add_references(refs)1035 1036 node = ua.AddNodesItem()1037 node.RequestedNewNodeId = ua.NodeId.from_string("i=2406")1038 node.BrowseName = ua.QualifiedName.from_string("Halted")1039 node.NodeClass = ua.NodeClass.Object1040 node.ParentNodeId = ua.NodeId.from_string("i=2391")1041 node.ReferenceTypeId = ua.NodeId.from_string("i=47")1042 node.TypeDefinition = ua.NodeId.from_string("i=2307")1043 attrs = ua.ObjectAttributes()1044 attrs.Description = ua.LocalizedText("The Program is in a terminal or failed state, and it cannot be started or resumed without being reset.")1045 attrs.DisplayName = ua.LocalizedText("Halted")1046 attrs.EventNotifier = 01047 node.NodeAttributes = attrs1048 server.add_nodes([node])1049 refs = []1050 ref = ua.AddReferencesItem()1051 ref.IsForward = true1052 ref.ReferenceTypeId = ua.NodeId.from_string("i=46")1053 ref.SourceNodeId = ua.NodeId.from_string("i=2406")1054 ref.TargetNodeClass = ua.NodeClass.DataType1055 ref.TargetNodeId = ua.NodeId.from_string("i=2407")1056 refs.append(ref)1057 server.add_references(refs)1058 1059 node = ua.AddNodesItem()1060 node.RequestedNewNodeId = ua.NodeId.from_string("i=2407")1061 node.BrowseName = ua.QualifiedName.from_string("StateNumber")1062 node.NodeClass = ua.NodeClass.Variable1063 node.ParentNodeId = ua.NodeId.from_string("i=2406")1064 node.ReferenceTypeId = ua.NodeId.from_string("i=46")1065 node.TypeDefinition = ua.NodeId.from_string("i=68")1066 attrs = ua.VariableAttributes()1067 attrs.DisplayName = ua.LocalizedText("StateNumber")1068 attrs.DataType = ua.NodeId(ua.ObjectIds.UInt32)1069 attrs.Value = ua.Variant(4, ua.VariantType.UInt32)1070 attrs.ValueRank = -11071 node.NodeAttributes = attrs1072 server.add_nodes([node])1073 refs = []1074 ref = ua.AddReferencesItem()1075 ref.IsForward = true1076 ref.ReferenceTypeId = ua.NodeId.from_string("i=37")1077 ref.SourceNodeId = ua.NodeId.from_string("i=2407")1078 ref.TargetNodeClass = ua.NodeClass.DataType1079 ref.TargetNodeId = ua.NodeId.from_string("i=78")1080 refs.append(ref)1081 server.add_references(refs)1082 1083 node = ua.AddNodesItem()1084 node.RequestedNewNodeId = ua.NodeId.from_string("i=2408")1085 node.BrowseName = ua.QualifiedName.from_string("HaltedToReady")1086 node.NodeClass = ua.NodeClass.Object1087 node.ParentNodeId = ua.NodeId.from_string("i=2391")1088 node.ReferenceTypeId = ua.NodeId.from_string("i=47")1089 node.TypeDefinition = ua.NodeId.from_string("i=2310")1090 attrs = ua.ObjectAttributes()1091 attrs.DisplayName = ua.LocalizedText("HaltedToReady")1092 attrs.EventNotifier = 01093 node.NodeAttributes = attrs1094 server.add_nodes([node])1095 refs = []1096 ref = ua.AddReferencesItem()1097 ref.IsForward = true1098 ref.ReferenceTypeId = ua.NodeId.from_string("i=46")1099 ref.SourceNodeId = ua.NodeId.from_string("i=2408")1100 ref.TargetNodeClass = ua.NodeClass.DataType1101 ref.TargetNodeId = ua.NodeId.from_string("i=2409")1102 refs.append(ref)1103 ref = ua.AddReferencesItem()1104 ref.IsForward = true1105 ref.ReferenceTypeId = ua.NodeId.from_string("i=51")1106 ref.SourceNodeId = ua.NodeId.from_string("i=2408")1107 ref.TargetNodeClass = ua.NodeClass.DataType1108 ref.TargetNodeId = ua.NodeId.from_string("i=2406")1109 refs.append(ref)1110 ref = ua.AddReferencesItem()1111 ref.IsForward = true1112 ref.ReferenceTypeId = ua.NodeId.from_string("i=52")1113 ref.SourceNodeId = ua.NodeId.from_string("i=2408")1114 ref.TargetNodeClass = ua.NodeClass.DataType1115 ref.TargetNodeId = ua.NodeId.from_string("i=2400")1116 refs.append(ref)1117 ref = ua.AddReferencesItem()1118 ref.IsForward = true1119 ref.ReferenceTypeId = ua.NodeId.from_string("i=53")1120 ref.SourceNodeId = ua.NodeId.from_string("i=2408")1121 ref.TargetNodeClass = ua.NodeClass.DataType1122 ref.TargetNodeId = ua.NodeId.from_string("i=2430")1123 refs.append(ref)1124 ref = ua.AddReferencesItem()1125 ref.IsForward = true1126 ref.ReferenceTypeId = ua.NodeId.from_string("i=54")1127 ref.SourceNodeId = ua.NodeId.from_string("i=2408")1128 ref.TargetNodeClass = ua.NodeClass.DataType1129 ref.TargetNodeId = ua.NodeId.from_string("i=2378")1130 refs.append(ref)1131 server.add_references(refs)1132 1133 node = ua.AddNodesItem()1134 node.RequestedNewNodeId = ua.NodeId.from_string("i=2409")1135 node.BrowseName = ua.QualifiedName.from_string("TransitionNumber")1136 node.NodeClass = ua.NodeClass.Variable1137 node.ParentNodeId = ua.NodeId.from_string("i=2408")1138 node.ReferenceTypeId = ua.NodeId.from_string("i=46")1139 node.TypeDefinition = ua.NodeId.from_string("i=68")1140 attrs = ua.VariableAttributes()1141 attrs.DisplayName = ua.LocalizedText("TransitionNumber")1142 attrs.DataType = ua.NodeId(ua.ObjectIds.UInt32)1143 attrs.Value = ua.Variant(1, ua.VariantType.UInt32)1144 attrs.ValueRank = -11145 node.NodeAttributes = attrs1146 server.add_nodes([node])1147 refs = []1148 ref = ua.AddReferencesItem()1149 ref.IsForward = true1150 ref.ReferenceTypeId = ua.NodeId.from_string("i=37")1151 ref.SourceNodeId = ua.NodeId.from_string("i=2409")1152 ref.TargetNodeClass = ua.NodeClass.DataType1153 ref.TargetNodeId = ua.NodeId.from_string("i=78")1154 refs.append(ref)1155 server.add_references(refs)1156 1157 node = ua.AddNodesItem()1158 node.RequestedNewNodeId = ua.NodeId.from_string("i=2410")1159 node.BrowseName = ua.QualifiedName.from_string("ReadyToRunning")1160 node.NodeClass = ua.NodeClass.Object1161 node.ParentNodeId = ua.NodeId.from_string("i=2391")1162 node.ReferenceTypeId = ua.NodeId.from_string("i=47")1163 node.TypeDefinition = ua.NodeId.from_string("i=2310")1164 attrs = ua.ObjectAttributes()1165 attrs.DisplayName = ua.LocalizedText("ReadyToRunning")1166 attrs.EventNotifier = 01167 node.NodeAttributes = attrs1168 server.add_nodes([node])1169 refs = []1170 ref = ua.AddReferencesItem()1171 ref.IsForward = true1172 ref.ReferenceTypeId = ua.NodeId.from_string("i=46")1173 ref.SourceNodeId = ua.NodeId.from_string("i=2410")1174 ref.TargetNodeClass = ua.NodeClass.DataType1175 ref.TargetNodeId = ua.NodeId.from_string("i=2411")1176 refs.append(ref)1177 ref = ua.AddReferencesItem()1178 ref.IsForward = true1179 ref.ReferenceTypeId = ua.NodeId.from_string("i=51")1180 ref.SourceNodeId = ua.NodeId.from_string("i=2410")1181 ref.TargetNodeClass = ua.NodeClass.DataType1182 ref.TargetNodeId = ua.NodeId.from_string("i=2400")1183 refs.append(ref)1184 ref = ua.AddReferencesItem()1185 ref.IsForward = true1186 ref.ReferenceTypeId = ua.NodeId.from_string("i=52")1187 ref.SourceNodeId = ua.NodeId.from_string("i=2410")1188 ref.TargetNodeClass = ua.NodeClass.DataType1189 ref.TargetNodeId = ua.NodeId.from_string("i=2402")1190 refs.append(ref)1191 ref = ua.AddReferencesItem()1192 ref.IsForward = true1193 ref.ReferenceTypeId = ua.NodeId.from_string("i=53")1194 ref.SourceNodeId = ua.NodeId.from_string("i=2410")1195 ref.TargetNodeClass = ua.NodeClass.DataType1196 ref.TargetNodeId = ua.NodeId.from_string("i=2426")1197 refs.append(ref)1198 ref = ua.AddReferencesItem()1199 ref.IsForward = true1200 ref.ReferenceTypeId = ua.NodeId.from_string("i=54")1201 ref.SourceNodeId = ua.NodeId.from_string("i=2410")1202 ref.TargetNodeClass = ua.NodeClass.DataType1203 ref.TargetNodeId = ua.NodeId.from_string("i=2378")1204 refs.append(ref)1205 server.add_references(refs)1206 1207 node = ua.AddNodesItem()1208 node.RequestedNewNodeId = ua.NodeId.from_string("i=2411")1209 node.BrowseName = ua.QualifiedName.from_string("TransitionNumber")1210 node.NodeClass = ua.NodeClass.Variable1211 node.ParentNodeId = ua.NodeId.from_string("i=2410")1212 node.ReferenceTypeId = ua.NodeId.from_string("i=46")1213 node.TypeDefinition = ua.NodeId.from_string("i=68")1214 attrs = ua.VariableAttributes()1215 attrs.DisplayName = ua.LocalizedText("TransitionNumber")1216 attrs.DataType = ua.NodeId(ua.ObjectIds.UInt32)1217 attrs.Value = ua.Variant(2, ua.VariantType.UInt32)1218 attrs.ValueRank = -11219 node.NodeAttributes = attrs1220 server.add_nodes([node])1221 refs = []1222 ref = ua.AddReferencesItem()1223 ref.IsForward = true1224 ref.ReferenceTypeId = ua.NodeId.from_string("i=37")1225 ref.SourceNodeId = ua.NodeId.from_string("i=2411")1226 ref.TargetNodeClass = ua.NodeClass.DataType1227 ref.TargetNodeId = ua.NodeId.from_string("i=78")1228 refs.append(ref)1229 server.add_references(refs)1230 1231 node = ua.AddNodesItem()1232 node.RequestedNewNodeId = ua.NodeId.from_string("i=2412")1233 node.BrowseName = ua.QualifiedName.from_string("RunningToHalted")1234 node.NodeClass = ua.NodeClass.Object1235 node.ParentNodeId = ua.NodeId.from_string("i=2391")1236 node.ReferenceTypeId = ua.NodeId.from_string("i=47")1237 node.TypeDefinition = ua.NodeId.from_string("i=2310")1238 attrs = ua.ObjectAttributes()1239 attrs.DisplayName = ua.LocalizedText("RunningToHalted")1240 attrs.EventNotifier = 01241 node.NodeAttributes = attrs1242 server.add_nodes([node])1243 refs = []1244 ref = ua.AddReferencesItem()1245 ref.IsForward = true1246 ref.ReferenceTypeId = ua.NodeId.from_string("i=46")1247 ref.SourceNodeId = ua.NodeId.from_string("i=2412")1248 ref.TargetNodeClass = ua.NodeClass.DataType1249 ref.TargetNodeId = ua.NodeId.from_string("i=2413")1250 refs.append(ref)1251 ref = ua.AddReferencesItem()1252 ref.IsForward = true1253 ref.ReferenceTypeId = ua.NodeId.from_string("i=51")1254 ref.SourceNodeId = ua.NodeId.from_string("i=2412")1255 ref.TargetNodeClass = ua.NodeClass.DataType1256 ref.TargetNodeId = ua.NodeId.from_string("i=2402")1257 refs.append(ref)1258 ref = ua.AddReferencesItem()1259 ref.IsForward = true1260 ref.ReferenceTypeId = ua.NodeId.from_string("i=52")1261 ref.SourceNodeId = ua.NodeId.from_string("i=2412")1262 ref.TargetNodeClass = ua.NodeClass.DataType1263 ref.TargetNodeId = ua.NodeId.from_string("i=2406")1264 refs.append(ref)1265 ref = ua.AddReferencesItem()1266 ref.IsForward = true1267 ref.ReferenceTypeId = ua.NodeId.from_string("i=53")1268 ref.SourceNodeId = ua.NodeId.from_string("i=2412")1269 ref.TargetNodeClass = ua.NodeClass.DataType1270 ref.TargetNodeId = ua.NodeId.from_string("i=2429")1271 refs.append(ref)1272 ref = ua.AddReferencesItem()1273 ref.IsForward = true1274 ref.ReferenceTypeId = ua.NodeId.from_string("i=54")1275 ref.SourceNodeId = ua.NodeId.from_string("i=2412")1276 ref.TargetNodeClass = ua.NodeClass.DataType1277 ref.TargetNodeId = ua.NodeId.from_string("i=2378")1278 refs.append(ref)1279 server.add_references(refs)1280 1281 node = ua.AddNodesItem()1282 node.RequestedNewNodeId = ua.NodeId.from_string("i=2413")1283 node.BrowseName = ua.QualifiedName.from_string("TransitionNumber")1284 node.NodeClass = ua.NodeClass.Variable1285 node.ParentNodeId = ua.NodeId.from_string("i=2412")1286 node.ReferenceTypeId = ua.NodeId.from_string("i=46")1287 node.TypeDefinition = ua.NodeId.from_string("i=68")1288 attrs = ua.VariableAttributes()1289 attrs.DisplayName = ua.LocalizedText("TransitionNumber")1290 attrs.DataType = ua.NodeId(ua.ObjectIds.UInt32)1291 attrs.Value = ua.Variant(3, ua.VariantType.UInt32)1292 attrs.ValueRank = -11293 node.NodeAttributes = attrs1294 server.add_nodes([node])1295 refs = []1296 ref = ua.AddReferencesItem()1297 ref.IsForward = true1298 ref.ReferenceTypeId = ua.NodeId.from_string("i=37")1299 ref.SourceNodeId = ua.NodeId.from_string("i=2413")1300 ref.TargetNodeClass = ua.NodeClass.DataType1301 ref.TargetNodeId = ua.NodeId.from_string("i=78")1302 refs.append(ref)1303 server.add_references(refs)1304 1305 node = ua.AddNodesItem()1306 node.RequestedNewNodeId = ua.NodeId.from_string("i=2414")1307 node.BrowseName = ua.QualifiedName.from_string("RunningToReady")1308 node.NodeClass = ua.NodeClass.Object1309 node.ParentNodeId = ua.NodeId.from_string("i=2391")1310 node.ReferenceTypeId = ua.NodeId.from_string("i=47")1311 node.TypeDefinition = ua.NodeId.from_string("i=2310")1312 attrs = ua.ObjectAttributes()1313 attrs.DisplayName = ua.LocalizedText("RunningToReady")1314 attrs.EventNotifier = 01315 node.NodeAttributes = attrs1316 server.add_nodes([node])1317 refs = []1318 ref = ua.AddReferencesItem()1319 ref.IsForward = true1320 ref.ReferenceTypeId = ua.NodeId.from_string("i=46")1321 ref.SourceNodeId = ua.NodeId.from_string("i=2414")1322 ref.TargetNodeClass = ua.NodeClass.DataType1323 ref.TargetNodeId = ua.NodeId.from_string("i=2415")1324 refs.append(ref)1325 ref = ua.AddReferencesItem()1326 ref.IsForward = true1327 ref.ReferenceTypeId = ua.NodeId.from_string("i=51")1328 ref.SourceNodeId = ua.NodeId.from_string("i=2414")1329 ref.TargetNodeClass = ua.NodeClass.DataType1330 ref.TargetNodeId = ua.NodeId.from_string("i=2402")1331 refs.append(ref)1332 ref = ua.AddReferencesItem()1333 ref.IsForward = true1334 ref.ReferenceTypeId = ua.NodeId.from_string("i=52")1335 ref.SourceNodeId = ua.NodeId.from_string("i=2414")1336 ref.TargetNodeClass = ua.NodeClass.DataType1337 ref.TargetNodeId = ua.NodeId.from_string("i=2400")1338 refs.append(ref)1339 ref = ua.AddReferencesItem()1340 ref.IsForward = true1341 ref.ReferenceTypeId = ua.NodeId.from_string("i=54")1342 ref.SourceNodeId = ua.NodeId.from_string("i=2414")1343 ref.TargetNodeClass = ua.NodeClass.DataType1344 ref.TargetNodeId = ua.NodeId.from_string("i=2378")1345 refs.append(ref)1346 server.add_references(refs)1347 1348 node = ua.AddNodesItem()1349 node.RequestedNewNodeId = ua.NodeId.from_string("i=2415")1350 node.BrowseName = ua.QualifiedName.from_string("TransitionNumber")1351 node.NodeClass = ua.NodeClass.Variable1352 node.ParentNodeId = ua.NodeId.from_string("i=2414")1353 node.ReferenceTypeId = ua.NodeId.from_string("i=46")1354 node.TypeDefinition = ua.NodeId.from_string("i=68")1355 attrs = ua.VariableAttributes()1356 attrs.DisplayName = ua.LocalizedText("TransitionNumber")1357 attrs.DataType = ua.NodeId(ua.ObjectIds.UInt32)1358 attrs.Value = ua.Variant(4, ua.VariantType.UInt32)1359 attrs.ValueRank = -11360 node.NodeAttributes = attrs1361 server.add_nodes([node])1362 refs = []1363 ref = ua.AddReferencesItem()1364 ref.IsForward = true1365 ref.ReferenceTypeId = ua.NodeId.from_string("i=37")1366 ref.SourceNodeId = ua.NodeId.from_string("i=2415")1367 ref.TargetNodeClass = ua.NodeClass.DataType1368 ref.TargetNodeId = ua.NodeId.from_string("i=78")1369 refs.append(ref)1370 server.add_references(refs)1371 1372 node = ua.AddNodesItem()1373 node.RequestedNewNodeId = ua.NodeId.from_string("i=2416")1374 node.BrowseName = ua.QualifiedName.from_string("RunningToSuspended")1375 node.NodeClass = ua.NodeClass.Object1376 node.ParentNodeId = ua.NodeId.from_string("i=2391")1377 node.ReferenceTypeId = ua.NodeId.from_string("i=47")1378 node.TypeDefinition = ua.NodeId.from_string("i=2310")1379 attrs = ua.ObjectAttributes()1380 attrs.DisplayName = ua.LocalizedText("RunningToSuspended")1381 attrs.EventNotifier = 01382 node.NodeAttributes = attrs1383 server.add_nodes([node])1384 refs = []1385 ref = ua.AddReferencesItem()1386 ref.IsForward = true1387 ref.ReferenceTypeId = ua.NodeId.from_string("i=46")1388 ref.SourceNodeId = ua.NodeId.from_string("i=2416")1389 ref.TargetNodeClass = ua.NodeClass.DataType1390 ref.TargetNodeId = ua.NodeId.from_string("i=2417")1391 refs.append(ref)1392 ref = ua.AddReferencesItem()1393 ref.IsForward = true1394 ref.ReferenceTypeId = ua.NodeId.from_string("i=51")1395 ref.SourceNodeId = ua.NodeId.from_string("i=2416")1396 ref.TargetNodeClass = ua.NodeClass.DataType1397 ref.TargetNodeId = ua.NodeId.from_string("i=2402")1398 refs.append(ref)1399 ref = ua.AddReferencesItem()1400 ref.IsForward = true1401 ref.ReferenceTypeId = ua.NodeId.from_string("i=52")1402 ref.SourceNodeId = ua.NodeId.from_string("i=2416")1403 ref.TargetNodeClass = ua.NodeClass.DataType1404 ref.TargetNodeId = ua.NodeId.from_string("i=2404")1405 refs.append(ref)1406 ref = ua.AddReferencesItem()1407 ref.IsForward = true1408 ref.ReferenceTypeId = ua.NodeId.from_string("i=53")1409 ref.SourceNodeId = ua.NodeId.from_string("i=2416")1410 ref.TargetNodeClass = ua.NodeClass.DataType1411 ref.TargetNodeId = ua.NodeId.from_string("i=2427")1412 refs.append(ref)1413 ref = ua.AddReferencesItem()1414 ref.IsForward = true1415 ref.ReferenceTypeId = ua.NodeId.from_string("i=54")1416 ref.SourceNodeId = ua.NodeId.from_string("i=2416")1417 ref.TargetNodeClass = ua.NodeClass.DataType1418 ref.TargetNodeId = ua.NodeId.from_string("i=2378")1419 refs.append(ref)1420 server.add_references(refs)1421 1422 node = ua.AddNodesItem()1423 node.RequestedNewNodeId = ua.NodeId.from_string("i=2417")1424 node.BrowseName = ua.QualifiedName.from_string("TransitionNumber")1425 node.NodeClass = ua.NodeClass.Variable1426 node.ParentNodeId = ua.NodeId.from_string("i=2416")1427 node.ReferenceTypeId = ua.NodeId.from_string("i=46")1428 node.TypeDefinition = ua.NodeId.from_string("i=68")1429 attrs = ua.VariableAttributes()1430 attrs.DisplayName = ua.LocalizedText("TransitionNumber")1431 attrs.DataType = ua.NodeId(ua.ObjectIds.UInt32)1432 attrs.Value = ua.Variant(5, ua.VariantType.UInt32)1433 attrs.ValueRank = -11434 node.NodeAttributes = attrs1435 server.add_nodes([node])1436 refs = []1437 ref = ua.AddReferencesItem()1438 ref.IsForward = true1439 ref.ReferenceTypeId = ua.NodeId.from_string("i=37")1440 ref.SourceNodeId = ua.NodeId.from_string("i=2417")1441 ref.TargetNodeClass = ua.NodeClass.DataType1442 ref.TargetNodeId = ua.NodeId.from_string("i=78")1443 refs.append(ref)1444 server.add_references(refs)1445 1446 node = ua.AddNodesItem()1447 node.RequestedNewNodeId = ua.NodeId.from_string("i=2418")1448 node.BrowseName = ua.QualifiedName.from_string("SuspendedToRunning")1449 node.NodeClass = ua.NodeClass.Object1450 node.ParentNodeId = ua.NodeId.from_string("i=2391")1451 node.ReferenceTypeId = ua.NodeId.from_string("i=47")1452 node.TypeDefinition = ua.NodeId.from_string("i=2310")1453 attrs = ua.ObjectAttributes()1454 attrs.DisplayName = ua.LocalizedText("SuspendedToRunning")1455 attrs.EventNotifier = 01456 node.NodeAttributes = attrs1457 server.add_nodes([node])1458 refs = []1459 ref = ua.AddReferencesItem()1460 ref.IsForward = true1461 ref.ReferenceTypeId = ua.NodeId.from_string("i=46")1462 ref.SourceNodeId = ua.NodeId.from_string("i=2418")1463 ref.TargetNodeClass = ua.NodeClass.DataType1464 ref.TargetNodeId = ua.NodeId.from_string("i=2419")1465 refs.append(ref)1466 ref = ua.AddReferencesItem()1467 ref.IsForward = true1468 ref.ReferenceTypeId = ua.NodeId.from_string("i=51")1469 ref.SourceNodeId = ua.NodeId.from_string("i=2418")1470 ref.TargetNodeClass = ua.NodeClass.DataType1471 ref.TargetNodeId = ua.NodeId.from_string("i=2404")1472 refs.append(ref)1473 ref = ua.AddReferencesItem()1474 ref.IsForward = true1475 ref.ReferenceTypeId = ua.NodeId.from_string("i=52")1476 ref.SourceNodeId = ua.NodeId.from_string("i=2418")1477 ref.TargetNodeClass = ua.NodeClass.DataType1478 ref.TargetNodeId = ua.NodeId.from_string("i=2402")1479 refs.append(ref)1480 ref = ua.AddReferencesItem()1481 ref.IsForward = true1482 ref.ReferenceTypeId = ua.NodeId.from_string("i=53")1483 ref.SourceNodeId = ua.NodeId.from_string("i=2418")1484 ref.TargetNodeClass = ua.NodeClass.DataType1485 ref.TargetNodeId = ua.NodeId.from_string("i=2428")1486 refs.append(ref)1487 ref = ua.AddReferencesItem()1488 ref.IsForward = true1489 ref.ReferenceTypeId = ua.NodeId.from_string("i=54")1490 ref.SourceNodeId = ua.NodeId.from_string("i=2418")1491 ref.TargetNodeClass = ua.NodeClass.DataType1492 ref.TargetNodeId = ua.NodeId.from_string("i=2378")1493 refs.append(ref)1494 server.add_references(refs)1495 1496 node = ua.AddNodesItem()1497 node.RequestedNewNodeId = ua.NodeId.from_string("i=2419")1498 node.BrowseName = ua.QualifiedName.from_string("TransitionNumber")1499 node.NodeClass = ua.NodeClass.Variable1500 node.ParentNodeId = ua.NodeId.from_string("i=2418")1501 node.ReferenceTypeId = ua.NodeId.from_string("i=46")1502 node.TypeDefinition = ua.NodeId.from_string("i=68")1503 attrs = ua.VariableAttributes()1504 attrs.DisplayName = ua.LocalizedText("TransitionNumber")1505 attrs.DataType = ua.NodeId(ua.ObjectIds.UInt32)1506 attrs.Value = ua.Variant(6, ua.VariantType.UInt32)1507 attrs.ValueRank = -11508 node.NodeAttributes = attrs1509 server.add_nodes([node])1510 refs = []1511 ref = ua.AddReferencesItem()1512 ref.IsForward = true1513 ref.ReferenceTypeId = ua.NodeId.from_string("i=37")1514 ref.SourceNodeId = ua.NodeId.from_string("i=2419")1515 ref.TargetNodeClass = ua.NodeClass.DataType1516 ref.TargetNodeId = ua.NodeId.from_string("i=78")1517 refs.append(ref)1518 server.add_references(refs)1519 1520 node = ua.AddNodesItem()1521 node.RequestedNewNodeId = ua.NodeId.from_string("i=2420")1522 node.BrowseName = ua.QualifiedName.from_string("SuspendedToHalted")1523 node.NodeClass = ua.NodeClass.Object1524 node.ParentNodeId = ua.NodeId.from_string("i=2391")1525 node.ReferenceTypeId = ua.NodeId.from_string("i=47")1526 node.TypeDefinition = ua.NodeId.from_string("i=2310")1527 attrs = ua.ObjectAttributes()1528 attrs.DisplayName = ua.LocalizedText("SuspendedToHalted")1529 attrs.EventNotifier = 01530 node.NodeAttributes = attrs1531 server.add_nodes([node])1532 refs = []1533 ref = ua.AddReferencesItem()1534 ref.IsForward = true1535 ref.ReferenceTypeId = ua.NodeId.from_string("i=46")1536 ref.SourceNodeId = ua.NodeId.from_string("i=2420")1537 ref.TargetNodeClass = ua.NodeClass.DataType1538 ref.TargetNodeId = ua.NodeId.from_string("i=2421")1539 refs.append(ref)1540 ref = ua.AddReferencesItem()1541 ref.IsForward = true1542 ref.ReferenceTypeId = ua.NodeId.from_string("i=51")1543 ref.SourceNodeId = ua.NodeId.from_string("i=2420")1544 ref.TargetNodeClass = ua.NodeClass.DataType1545 ref.TargetNodeId = ua.NodeId.from_string("i=2404")1546 refs.append(ref)1547 ref = ua.AddReferencesItem()1548 ref.IsForward = true1549 ref.ReferenceTypeId = ua.NodeId.from_string("i=52")1550 ref.SourceNodeId = ua.NodeId.from_string("i=2420")1551 ref.TargetNodeClass = ua.NodeClass.DataType1552 ref.TargetNodeId = ua.NodeId.from_string("i=2406")1553 refs.append(ref)1554 ref = ua.AddReferencesItem()1555 ref.IsForward = true1556 ref.ReferenceTypeId = ua.NodeId.from_string("i=53")1557 ref.SourceNodeId = ua.NodeId.from_string("i=2420")1558 ref.TargetNodeClass = ua.NodeClass.DataType1559 ref.TargetNodeId = ua.NodeId.from_string("i=2429")1560 refs.append(ref)1561 ref = ua.AddReferencesItem()1562 ref.IsForward = true1563 ref.ReferenceTypeId = ua.NodeId.from_string("i=54")1564 ref.SourceNodeId = ua.NodeId.from_string("i=2420")1565 ref.TargetNodeClass = ua.NodeClass.DataType1566 ref.TargetNodeId = ua.NodeId.from_string("i=2378")1567 refs.append(ref)1568 server.add_references(refs)1569 1570 node = ua.AddNodesItem()1571 node.RequestedNewNodeId = ua.NodeId.from_string("i=2421")1572 node.BrowseName = ua.QualifiedName.from_string("TransitionNumber")1573 node.NodeClass = ua.NodeClass.Variable1574 node.ParentNodeId = ua.NodeId.from_string("i=2420")1575 node.ReferenceTypeId = ua.NodeId.from_string("i=46")1576 node.TypeDefinition = ua.NodeId.from_string("i=68")1577 attrs = ua.VariableAttributes()1578 attrs.DisplayName = ua.LocalizedText("TransitionNumber")1579 attrs.DataType = ua.NodeId(ua.ObjectIds.UInt32)1580 attrs.Value = ua.Variant(7, ua.VariantType.UInt32)1581 attrs.ValueRank = -11582 node.NodeAttributes = attrs1583 server.add_nodes([node])1584 refs = []1585 ref = ua.AddReferencesItem()1586 ref.IsForward = true1587 ref.ReferenceTypeId = ua.NodeId.from_string("i=37")1588 ref.SourceNodeId = ua.NodeId.from_string("i=2421")1589 ref.TargetNodeClass = ua.NodeClass.DataType1590 ref.TargetNodeId = ua.NodeId.from_string("i=78")1591 refs.append(ref)1592 server.add_references(refs)1593 1594 node = ua.AddNodesItem()1595 node.RequestedNewNodeId = ua.NodeId.from_string("i=2422")1596 node.BrowseName = ua.QualifiedName.from_string("SuspendedToReady")1597 node.NodeClass = ua.NodeClass.Object1598 node.ParentNodeId = ua.NodeId.from_string("i=2391")1599 node.ReferenceTypeId = ua.NodeId.from_string("i=47")1600 node.TypeDefinition = ua.NodeId.from_string("i=2310")1601 attrs = ua.ObjectAttributes()1602 attrs.DisplayName = ua.LocalizedText("SuspendedToReady")1603 attrs.EventNotifier = 01604 node.NodeAttributes = attrs1605 server.add_nodes([node])1606 refs = []1607 ref = ua.AddReferencesItem()1608 ref.IsForward = true1609 ref.ReferenceTypeId = ua.NodeId.from_string("i=46")1610 ref.SourceNodeId = ua.NodeId.from_string("i=2422")1611 ref.TargetNodeClass = ua.NodeClass.DataType1612 ref.TargetNodeId = ua.NodeId.from_string("i=2423")1613 refs.append(ref)1614 ref = ua.AddReferencesItem()1615 ref.IsForward = true1616 ref.ReferenceTypeId = ua.NodeId.from_string("i=51")1617 ref.SourceNodeId = ua.NodeId.from_string("i=2422")1618 ref.TargetNodeClass = ua.NodeClass.DataType1619 ref.TargetNodeId = ua.NodeId.from_string("i=2404")1620 refs.append(ref)1621 ref = ua.AddReferencesItem()1622 ref.IsForward = true1623 ref.ReferenceTypeId = ua.NodeId.from_string("i=52")1624 ref.SourceNodeId = ua.NodeId.from_string("i=2422")1625 ref.TargetNodeClass = ua.NodeClass.DataType1626 ref.TargetNodeId = ua.NodeId.from_string("i=2400")1627 refs.append(ref)1628 ref = ua.AddReferencesItem()1629 ref.IsForward = true1630 ref.ReferenceTypeId = ua.NodeId.from_string("i=54")1631 ref.SourceNodeId = ua.NodeId.from_string("i=2422")1632 ref.TargetNodeClass = ua.NodeClass.DataType1633 ref.TargetNodeId = ua.NodeId.from_string("i=2378")1634 refs.append(ref)1635 server.add_references(refs)1636 1637 node = ua.AddNodesItem()1638 node.RequestedNewNodeId = ua.NodeId.from_string("i=2423")1639 node.BrowseName = ua.QualifiedName.from_string("TransitionNumber")1640 node.NodeClass = ua.NodeClass.Variable1641 node.ParentNodeId = ua.NodeId.from_string("i=2422")1642 node.ReferenceTypeId = ua.NodeId.from_string("i=46")1643 node.TypeDefinition = ua.NodeId.from_string("i=68")1644 attrs = ua.VariableAttributes()1645 attrs.DisplayName = ua.LocalizedText("TransitionNumber")1646 attrs.DataType = ua.NodeId(ua.ObjectIds.UInt32)1647 attrs.Value = ua.Variant(8, ua.VariantType.UInt32)1648 attrs.ValueRank = -11649 node.NodeAttributes = attrs1650 server.add_nodes([node])1651 refs = []1652 ref = ua.AddReferencesItem()1653 ref.IsForward = true1654 ref.ReferenceTypeId = ua.NodeId.from_string("i=37")1655 ref.SourceNodeId = ua.NodeId.from_string("i=2423")1656 ref.TargetNodeClass = ua.NodeClass.DataType1657 ref.TargetNodeId = ua.NodeId.from_string("i=78")1658 refs.append(ref)1659 server.add_references(refs)1660 1661 node = ua.AddNodesItem()1662 node.RequestedNewNodeId = ua.NodeId.from_string("i=2424")1663 node.BrowseName = ua.QualifiedName.from_string("ReadyToHalted")1664 node.NodeClass = ua.NodeClass.Object1665 node.ParentNodeId = ua.NodeId.from_string("i=2391")1666 node.ReferenceTypeId = ua.NodeId.from_string("i=47")1667 node.TypeDefinition = ua.NodeId.from_string("i=2310")1668 attrs = ua.ObjectAttributes()1669 attrs.DisplayName = ua.LocalizedText("ReadyToHalted")1670 attrs.EventNotifier = 01671 node.NodeAttributes = attrs1672 server.add_nodes([node])1673 refs = []1674 ref = ua.AddReferencesItem()1675 ref.IsForward = true1676 ref.ReferenceTypeId = ua.NodeId.from_string("i=46")1677 ref.SourceNodeId = ua.NodeId.from_string("i=2424")1678 ref.TargetNodeClass = ua.NodeClass.DataType1679 ref.TargetNodeId = ua.NodeId.from_string("i=2425")1680 refs.append(ref)1681 ref = ua.AddReferencesItem()1682 ref.IsForward = true1683 ref.ReferenceTypeId = ua.NodeId.from_string("i=51")1684 ref.SourceNodeId = ua.NodeId.from_string("i=2424")1685 ref.TargetNodeClass = ua.NodeClass.DataType1686 ref.TargetNodeId = ua.NodeId.from_string("i=2400")1687 refs.append(ref)1688 ref = ua.AddReferencesItem()1689 ref.IsForward = true1690 ref.ReferenceTypeId = ua.NodeId.from_string("i=52")1691 ref.SourceNodeId = ua.NodeId.from_string("i=2424")1692 ref.TargetNodeClass = ua.NodeClass.DataType1693 ref.TargetNodeId = ua.NodeId.from_string("i=2406")1694 refs.append(ref)1695 ref = ua.AddReferencesItem()1696 ref.IsForward = true1697 ref.ReferenceTypeId = ua.NodeId.from_string("i=53")1698 ref.SourceNodeId = ua.NodeId.from_string("i=2424")1699 ref.TargetNodeClass = ua.NodeClass.DataType1700 ref.TargetNodeId = ua.NodeId.from_string("i=2429")1701 refs.append(ref)1702 ref = ua.AddReferencesItem()1703 ref.IsForward = true1704 ref.ReferenceTypeId = ua.NodeId.from_string("i=54")1705 ref.SourceNodeId = ua.NodeId.from_string("i=2424")1706 ref.TargetNodeClass = ua.NodeClass.DataType1707 ref.TargetNodeId = ua.NodeId.from_string("i=2378")1708 refs.append(ref)1709 server.add_references(refs)1710 1711 node = ua.AddNodesItem()1712 node.RequestedNewNodeId = ua.NodeId.from_string("i=2425")1713 node.BrowseName = ua.QualifiedName.from_string("TransitionNumber")1714 node.NodeClass = ua.NodeClass.Variable1715 node.ParentNodeId = ua.NodeId.from_string("i=2424")1716 node.ReferenceTypeId = ua.NodeId.from_string("i=46")1717 node.TypeDefinition = ua.NodeId.from_string("i=68")1718 attrs = ua.VariableAttributes()1719 attrs.DisplayName = ua.LocalizedText("TransitionNumber")1720 attrs.DataType = ua.NodeId(ua.ObjectIds.UInt32)1721 attrs.Value = ua.Variant(9, ua.VariantType.UInt32)1722 attrs.ValueRank = -11723 node.NodeAttributes = attrs1724 server.add_nodes([node])1725 refs = []1726 ref = ua.AddReferencesItem()1727 ref.IsForward = true1728 ref.ReferenceTypeId = ua.NodeId.from_string("i=37")1729 ref.SourceNodeId = ua.NodeId.from_string("i=2425")1730 ref.TargetNodeClass = ua.NodeClass.DataType1731 ref.TargetNodeId = ua.NodeId.from_string("i=78")1732 refs.append(ref)1733 server.add_references(refs)1734 1735 node = ua.AddNodesItem()1736 node.RequestedNewNodeId = ua.NodeId.from_string("i=2426")1737 node.BrowseName = ua.QualifiedName.from_string("Start")1738 node.NodeClass = ua.NodeClass.Method1739 node.ParentNodeId = ua.NodeId.from_string("i=2391")1740 node.ReferenceTypeId = ua.NodeId.from_string("i=47")1741 attrs = ua.MethodAttributes()1742 attrs.Description = ua.LocalizedText("Causes the Program to transition from the Ready state to the Running state.")1743 attrs.DisplayName = ua.LocalizedText("Start")1744 node.NodeAttributes = attrs1745 server.add_nodes([node])1746 refs = []1747 ref = ua.AddReferencesItem()1748 ref.IsForward = true1749 ref.ReferenceTypeId = ua.NodeId.from_string("i=37")1750 ref.SourceNodeId = ua.NodeId.from_string("i=2426")1751 ref.TargetNodeClass = ua.NodeClass.DataType1752 ref.TargetNodeId = ua.NodeId.from_string("i=78")1753 refs.append(ref)1754 server.add_references(refs)1755 1756 node = ua.AddNodesItem()1757 node.RequestedNewNodeId = ua.NodeId.from_string("i=2427")1758 node.BrowseName = ua.QualifiedName.from_string("Suspend")1759 node.NodeClass = ua.NodeClass.Method1760 node.ParentNodeId = ua.NodeId.from_string("i=2391")1761 node.ReferenceTypeId = ua.NodeId.from_string("i=47")1762 attrs = ua.MethodAttributes()1763 attrs.Description = ua.LocalizedText("Causes the Program to transition from the Running state to the Suspended state.")1764 attrs.DisplayName = ua.LocalizedText("Suspend")1765 node.NodeAttributes = attrs1766 server.add_nodes([node])1767 refs = []1768 ref = ua.AddReferencesItem()1769 ref.IsForward = true1770 ref.ReferenceTypeId = ua.NodeId.from_string("i=37")1771 ref.SourceNodeId = ua.NodeId.from_string("i=2427")1772 ref.TargetNodeClass = ua.NodeClass.DataType1773 ref.TargetNodeId = ua.NodeId.from_string("i=78")1774 refs.append(ref)1775 server.add_references(refs)1776 1777 node = ua.AddNodesItem()1778 node.RequestedNewNodeId = ua.NodeId.from_string("i=2428")1779 node.BrowseName = ua.QualifiedName.from_string("Resume")1780 node.NodeClass = ua.NodeClass.Method1781 node.ParentNodeId = ua.NodeId.from_string("i=2391")1782 node.ReferenceTypeId = ua.NodeId.from_string("i=47")1783 attrs = ua.MethodAttributes()1784 attrs.Description = ua.LocalizedText("Causes the Program to transition from the Suspended state to the Running state.")1785 attrs.DisplayName = ua.LocalizedText("Resume")1786 node.NodeAttributes = attrs1787 server.add_nodes([node])1788 refs = []1789 ref = ua.AddReferencesItem()1790 ref.IsForward = true1791 ref.ReferenceTypeId = ua.NodeId.from_string("i=37")1792 ref.SourceNodeId = ua.NodeId.from_string("i=2428")1793 ref.TargetNodeClass = ua.NodeClass.DataType1794 ref.TargetNodeId = ua.NodeId.from_string("i=78")1795 refs.append(ref)1796 server.add_references(refs)1797 1798 node = ua.AddNodesItem()1799 node.RequestedNewNodeId = ua.NodeId.from_string("i=2429")1800 node.BrowseName = ua.QualifiedName.from_string("Halt")1801 node.NodeClass = ua.NodeClass.Method1802 node.ParentNodeId = ua.NodeId.from_string("i=2391")1803 node.ReferenceTypeId = ua.NodeId.from_string("i=47")1804 attrs = ua.MethodAttributes()1805 attrs.Description = ua.LocalizedText("Causes the Program to transition from the Ready, Running or Suspended state to the Halted state.")1806 attrs.DisplayName = ua.LocalizedText("Halt")1807 node.NodeAttributes = attrs1808 server.add_nodes([node])1809 refs = []1810 ref = ua.AddReferencesItem()1811 ref.IsForward = true1812 ref.ReferenceTypeId = ua.NodeId.from_string("i=37")1813 ref.SourceNodeId = ua.NodeId.from_string("i=2429")1814 ref.TargetNodeClass = ua.NodeClass.DataType1815 ref.TargetNodeId = ua.NodeId.from_string("i=78")1816 refs.append(ref)1817 server.add_references(refs)1818 1819 node = ua.AddNodesItem()1820 node.RequestedNewNodeId = ua.NodeId.from_string("i=2430")1821 node.BrowseName = ua.QualifiedName.from_string("Reset")1822 node.NodeClass = ua.NodeClass.Method1823 node.ParentNodeId = ua.NodeId.from_string("i=2391")1824 node.ReferenceTypeId = ua.NodeId.from_string("i=47")1825 attrs = ua.MethodAttributes()1826 attrs.Description = ua.LocalizedText("Causes the Program to transition from the Halted state to the Ready state.")1827 attrs.DisplayName = ua.LocalizedText("Reset")1828 node.NodeAttributes = attrs1829 server.add_nodes([node])1830 refs = []1831 ref = ua.AddReferencesItem()1832 ref.IsForward = true1833 ref.ReferenceTypeId = ua.NodeId.from_string("i=37")1834 ref.SourceNodeId = ua.NodeId.from_string("i=2430")1835 ref.TargetNodeClass = ua.NodeClass.DataType1836 ref.TargetNodeId = ua.NodeId.from_string("i=78")1837 refs.append(ref)1838 server.add_references(refs)1839 1840 node = ua.AddNodesItem()1841 node.RequestedNewNodeId = ua.NodeId.from_string("i=2378")1842 node.BrowseName = ua.QualifiedName.from_string("ProgramTransitionEventType")1843 node.NodeClass = ua.NodeClass.ObjectType1844 node.ParentNodeId = ua.NodeId.from_string("i=2311")1845 node.ReferenceTypeId = ua.NodeId.from_string("i=45")1846 attrs = ua.ObjectTypeAttributes()1847 attrs.DisplayName = ua.LocalizedText("ProgramTransitionEventType")1848 attrs.IsAbstract = false1849 node.NodeAttributes = attrs1850 server.add_nodes([node])1851 refs = []1852 ref = ua.AddReferencesItem()1853 ref.IsForward = true1854 ref.ReferenceTypeId = ua.NodeId.from_string("i=46")1855 ref.SourceNodeId = ua.NodeId.from_string("i=2378")1856 ref.TargetNodeClass = ua.NodeClass.DataType1857 ref.TargetNodeId = ua.NodeId.from_string("i=2379")1858 refs.append(ref)1859 server.add_references(refs)1860 1861 node = ua.AddNodesItem()1862 node.RequestedNewNodeId = ua.NodeId.from_string("i=2379")1863 node.BrowseName = ua.QualifiedName.from_string("IntermediateResult")1864 node.NodeClass = ua.NodeClass.Variable1865 node.ParentNodeId = ua.NodeId.from_string("i=2378")1866 node.ReferenceTypeId = ua.NodeId.from_string("i=46")1867 node.TypeDefinition = ua.NodeId.from_string("i=68")1868 attrs = ua.VariableAttributes()1869 attrs.DisplayName = ua.LocalizedText("IntermediateResult")1870 attrs.DataType = ua.NodeId(ua.ObjectIds.String)1871 attrs.ValueRank = -11872 node.NodeAttributes = attrs1873 server.add_nodes([node])1874 refs = []1875 ref = ua.AddReferencesItem()1876 ref.IsForward = true1877 ref.ReferenceTypeId = ua.NodeId.from_string("i=37")1878 ref.SourceNodeId = ua.NodeId.from_string("i=2379")1879 ref.TargetNodeClass = ua.NodeClass.DataType1880 ref.TargetNodeId = ua.NodeId.from_string("i=78")1881 refs.append(ref)1882 server.add_references(refs)1883 1884 node = ua.AddNodesItem()1885 node.RequestedNewNodeId = ua.NodeId.from_string("i=11856")1886 node.BrowseName = ua.QualifiedName.from_string("AuditProgramTransitionEventType")1887 node.NodeClass = ua.NodeClass.ObjectType1888 node.ParentNodeId = ua.NodeId.from_string("i=2315")1889 node.ReferenceTypeId = ua.NodeId.from_string("i=45")1890 attrs = ua.ObjectTypeAttributes()1891 attrs.DisplayName = ua.LocalizedText("AuditProgramTransitionEventType")1892 attrs.IsAbstract = false1893 node.NodeAttributes = attrs1894 server.add_nodes([node])1895 refs = []1896 ref = ua.AddReferencesItem()1897 ref.IsForward = true1898 ref.ReferenceTypeId = ua.NodeId.from_string("i=46")1899 ref.SourceNodeId = ua.NodeId.from_string("i=11856")1900 ref.TargetNodeClass = ua.NodeClass.DataType1901 ref.TargetNodeId = ua.NodeId.from_string("i=11875")1902 refs.append(ref)1903 server.add_references(refs)1904 1905 node = ua.AddNodesItem()1906 node.RequestedNewNodeId = ua.NodeId.from_string("i=11875")1907 node.BrowseName = ua.QualifiedName.from_string("TransitionNumber")1908 node.NodeClass = ua.NodeClass.Variable1909 node.ParentNodeId = ua.NodeId.from_string("i=11856")1910 node.ReferenceTypeId = ua.NodeId.from_string("i=46")1911 node.TypeDefinition = ua.NodeId.from_string("i=68")1912 attrs = ua.VariableAttributes()1913 attrs.DisplayName = ua.LocalizedText("TransitionNumber")1914 attrs.DataType = ua.NodeId(ua.ObjectIds.UInt32)1915 attrs.ValueRank = -11916 node.NodeAttributes = attrs1917 server.add_nodes([node])1918 refs = []1919 ref = ua.AddReferencesItem()1920 ref.IsForward = true1921 ref.ReferenceTypeId = ua.NodeId.from_string("i=37")1922 ref.SourceNodeId = ua.NodeId.from_string("i=11875")1923 ref.TargetNodeClass = ua.NodeClass.DataType1924 ref.TargetNodeId = ua.NodeId.from_string("i=78")1925 refs.append(ref)1926 server.add_references(refs)1927 1928 node = ua.AddNodesItem()1929 node.RequestedNewNodeId = ua.NodeId.from_string("i=3806")1930 node.BrowseName = ua.QualifiedName.from_string("ProgramTransitionAuditEventType")1931 node.NodeClass = ua.NodeClass.ObjectType1932 node.ParentNodeId = ua.NodeId.from_string("i=2315")1933 node.ReferenceTypeId = ua.NodeId.from_string("i=45")1934 attrs = ua.ObjectTypeAttributes()1935 attrs.DisplayName = ua.LocalizedText("ProgramTransitionAuditEventType")1936 attrs.IsAbstract = false1937 node.NodeAttributes = attrs1938 server.add_nodes([node])1939 refs = []1940 ref = ua.AddReferencesItem()1941 ref.IsForward = true1942 ref.ReferenceTypeId = ua.NodeId.from_string("i=47")1943 ref.SourceNodeId = ua.NodeId.from_string("i=3806")1944 ref.TargetNodeClass = ua.NodeClass.DataType1945 ref.TargetNodeId = ua.NodeId.from_string("i=3825")1946 refs.append(ref)1947 server.add_references(refs)1948 1949 node = ua.AddNodesItem()1950 node.RequestedNewNodeId = ua.NodeId.from_string("i=3825")1951 node.BrowseName = ua.QualifiedName.from_string("Transition")1952 node.NodeClass = ua.NodeClass.Variable1953 node.ParentNodeId = ua.NodeId.from_string("i=3806")1954 node.ReferenceTypeId = ua.NodeId.from_string("i=47")1955 node.TypeDefinition = ua.NodeId.from_string("i=2767")1956 attrs = ua.VariableAttributes()1957 attrs.DisplayName = ua.LocalizedText("Transition")1958 attrs.DataType = ua.NodeId(ua.ObjectIds.LocalizedText)1959 attrs.ValueRank = -11960 node.NodeAttributes = attrs1961 server.add_nodes([node])1962 refs = []1963 ref = ua.AddReferencesItem()1964 ref.IsForward = true1965 ref.ReferenceTypeId = ua.NodeId.from_string("i=46")1966 ref.SourceNodeId = ua.NodeId.from_string("i=3825")1967 ref.TargetNodeClass = ua.NodeClass.DataType1968 ref.TargetNodeId = ua.NodeId.from_string("i=3826")1969 refs.append(ref)1970 ref = ua.AddReferencesItem()1971 ref.IsForward = true1972 ref.ReferenceTypeId = ua.NodeId.from_string("i=37")1973 ref.SourceNodeId = ua.NodeId.from_string("i=3825")1974 ref.TargetNodeClass = ua.NodeClass.DataType1975 ref.TargetNodeId = ua.NodeId.from_string("i=78")1976 refs.append(ref)1977 server.add_references(refs)1978 1979 node = ua.AddNodesItem()1980 node.RequestedNewNodeId = ua.NodeId.from_string("i=3826")1981 node.BrowseName = ua.QualifiedName.from_string("Id")1982 node.NodeClass = ua.NodeClass.Variable1983 node.ParentNodeId = ua.NodeId.from_string("i=3825")1984 node.ReferenceTypeId = ua.NodeId.from_string("i=46")1985 node.TypeDefinition = ua.NodeId.from_string("i=68")1986 attrs = ua.VariableAttributes()1987 attrs.DisplayName = ua.LocalizedText("Id")1988 attrs.DataType = ua.NodeId(ua.ObjectIds.NodeId)1989 attrs.ValueRank = -11990 node.NodeAttributes = attrs1991 server.add_nodes([node])1992 refs = []1993 ref = ua.AddReferencesItem()1994 ref.IsForward = true1995 ref.ReferenceTypeId = ua.NodeId.from_string("i=37")1996 ref.SourceNodeId = ua.NodeId.from_string("i=3826")1997 ref.TargetNodeClass = ua.NodeClass.DataType1998 ref.TargetNodeId = ua.NodeId.from_string("i=78")1999 refs.append(ref)2000 server.add_references(refs)2001 2002 node = ua.AddNodesItem()2003 node.RequestedNewNodeId = ua.NodeId.from_string("i=2380")2004 node.BrowseName = ua.QualifiedName.from_string("ProgramDiagnosticType")2005 node.NodeClass = ua.NodeClass.VariableType2006 node.ParentNodeId = ua.NodeId.from_string("i=63")2007 node.ReferenceTypeId = ua.NodeId.from_string("i=45")2008 attrs = ua.VariableTypeAttributes()2009 attrs.DisplayName = ua.LocalizedText("ProgramDiagnosticType")2010 attrs.DataType = ua.NodeId.from_string("i=894")2011 attrs.ValueRank = -12012 attrs.IsAbstract = false2013 node.NodeAttributes = attrs2014 server.add_nodes([node])2015 refs = []2016 ref = ua.AddReferencesItem()2017 ref.IsForward = true2018 ref.ReferenceTypeId = ua.NodeId.from_string("i=46")2019 ref.SourceNodeId = ua.NodeId.from_string("i=2380")2020 ref.TargetNodeClass = ua.NodeClass.DataType2021 ref.TargetNodeId = ua.NodeId.from_string("i=2381")2022 refs.append(ref)2023 ref = ua.AddReferencesItem()2024 ref.IsForward = true2025 ref.ReferenceTypeId = ua.NodeId.from_string("i=46")2026 ref.SourceNodeId = ua.NodeId.from_string("i=2380")2027 ref.TargetNodeClass = ua.NodeClass.DataType2028 ref.TargetNodeId = ua.NodeId.from_string("i=2382")2029 refs.append(ref)2030 ref = ua.AddReferencesItem()2031 ref.IsForward = true2032 ref.ReferenceTypeId = ua.NodeId.from_string("i=46")2033 ref.SourceNodeId = ua.NodeId.from_string("i=2380")2034 ref.TargetNodeClass = ua.NodeClass.DataType2035 ref.TargetNodeId = ua.NodeId.from_string("i=2383")2036 refs.append(ref)2037 ref = ua.AddReferencesItem()2038 ref.IsForward = true2039 ref.ReferenceTypeId = ua.NodeId.from_string("i=46")2040 ref.SourceNodeId = ua.NodeId.from_string("i=2380")2041 ref.TargetNodeClass = ua.NodeClass.DataType2042 ref.TargetNodeId = ua.NodeId.from_string("i=2384")2043 refs.append(ref)2044 ref = ua.AddReferencesItem()2045 ref.IsForward = true2046 ref.ReferenceTypeId = ua.NodeId.from_string("i=46")2047 ref.SourceNodeId = ua.NodeId.from_string("i=2380")2048 ref.TargetNodeClass = ua.NodeClass.DataType2049 ref.TargetNodeId = ua.NodeId.from_string("i=2385")2050 refs.append(ref)2051 ref = ua.AddReferencesItem()2052 ref.IsForward = true2053 ref.ReferenceTypeId = ua.NodeId.from_string("i=46")2054 ref.SourceNodeId = ua.NodeId.from_string("i=2380")2055 ref.TargetNodeClass = ua.NodeClass.DataType2056 ref.TargetNodeId = ua.NodeId.from_string("i=2386")2057 refs.append(ref)2058 ref = ua.AddReferencesItem()2059 ref.IsForward = true2060 ref.ReferenceTypeId = ua.NodeId.from_string("i=46")2061 ref.SourceNodeId = ua.NodeId.from_string("i=2380")2062 ref.TargetNodeClass = ua.NodeClass.DataType2063 ref.TargetNodeId = ua.NodeId.from_string("i=2387")2064 refs.append(ref)2065 ref = ua.AddReferencesItem()2066 ref.IsForward = true2067 ref.ReferenceTypeId = ua.NodeId.from_string("i=46")2068 ref.SourceNodeId = ua.NodeId.from_string("i=2380")2069 ref.TargetNodeClass = ua.NodeClass.DataType2070 ref.TargetNodeId = ua.NodeId.from_string("i=2388")2071 refs.append(ref)2072 ref = ua.AddReferencesItem()2073 ref.IsForward = true2074 ref.ReferenceTypeId = ua.NodeId.from_string("i=46")2075 ref.SourceNodeId = ua.NodeId.from_string("i=2380")2076 ref.TargetNodeClass = ua.NodeClass.DataType2077 ref.TargetNodeId = ua.NodeId.from_string("i=2389")2078 refs.append(ref)2079 ref = ua.AddReferencesItem()2080 ref.IsForward = true2081 ref.ReferenceTypeId = ua.NodeId.from_string("i=46")2082 ref.SourceNodeId = ua.NodeId.from_string("i=2380")2083 ref.TargetNodeClass = ua.NodeClass.DataType2084 ref.TargetNodeId = ua.NodeId.from_string("i=2390")2085 refs.append(ref)2086 server.add_references(refs)2087 2088 node = ua.AddNodesItem()2089 node.RequestedNewNodeId = ua.NodeId.from_string("i=2381")2090 node.BrowseName = ua.QualifiedName.from_string("CreateSessionId")2091 node.NodeClass = ua.NodeClass.Variable2092 node.ParentNodeId = ua.NodeId.from_string("i=2380")2093 node.ReferenceTypeId = ua.NodeId.from_string("i=46")2094 node.TypeDefinition = ua.NodeId.from_string("i=68")2095 attrs = ua.VariableAttributes()2096 attrs.DisplayName = ua.LocalizedText("CreateSessionId")2097 attrs.DataType = ua.NodeId(ua.ObjectIds.NodeId)2098 attrs.ValueRank = -12099 node.NodeAttributes = attrs2100 server.add_nodes([node])2101 refs = []2102 ref = ua.AddReferencesItem()2103 ref.IsForward = true2104 ref.ReferenceTypeId = ua.NodeId.from_string("i=37")2105 ref.SourceNodeId = ua.NodeId.from_string("i=2381")2106 ref.TargetNodeClass = ua.NodeClass.DataType2107 ref.TargetNodeId = ua.NodeId.from_string("i=78")2108 refs.append(ref)2109 server.add_references(refs)2110 2111 node = ua.AddNodesItem()2112 node.RequestedNewNodeId = ua.NodeId.from_string("i=2382")2113 node.BrowseName = ua.QualifiedName.from_string("CreateClientName")2114 node.NodeClass = ua.NodeClass.Variable2115 node.ParentNodeId = ua.NodeId.from_string("i=2380")2116 node.ReferenceTypeId = ua.NodeId.from_string("i=46")2117 node.TypeDefinition = ua.NodeId.from_string("i=68")2118 attrs = ua.VariableAttributes()2119 attrs.DisplayName = ua.LocalizedText("CreateClientName")2120 attrs.DataType = ua.NodeId(ua.ObjectIds.String)2121 attrs.ValueRank = -12122 node.NodeAttributes = attrs2123 server.add_nodes([node])2124 refs = []2125 ref = ua.AddReferencesItem()2126 ref.IsForward = true2127 ref.ReferenceTypeId = ua.NodeId.from_string("i=37")2128 ref.SourceNodeId = ua.NodeId.from_string("i=2382")2129 ref.TargetNodeClass = ua.NodeClass.DataType2130 ref.TargetNodeId = ua.NodeId.from_string("i=78")2131 refs.append(ref)2132 server.add_references(refs)2133 2134 node = ua.AddNodesItem()2135 node.RequestedNewNodeId = ua.NodeId.from_string("i=2383")2136 node.BrowseName = ua.QualifiedName.from_string("InvocationCreationTime")2137 node.NodeClass = ua.NodeClass.Variable2138 node.ParentNodeId = ua.NodeId.from_string("i=2380")2139 node.ReferenceTypeId = ua.NodeId.from_string("i=46")2140 node.TypeDefinition = ua.NodeId.from_string("i=68")2141 attrs = ua.VariableAttributes()2142 attrs.DisplayName = ua.LocalizedText("InvocationCreationTime")2143 attrs.DataType = ua.NodeId.from_string("i=294")2144 attrs.ValueRank = -12145 node.NodeAttributes = attrs2146 server.add_nodes([node])2147 refs = []2148 ref = ua.AddReferencesItem()2149 ref.IsForward = true2150 ref.ReferenceTypeId = ua.NodeId.from_string("i=37")2151 ref.SourceNodeId = ua.NodeId.from_string("i=2383")2152 ref.TargetNodeClass = ua.NodeClass.DataType2153 ref.TargetNodeId = ua.NodeId.from_string("i=78")2154 refs.append(ref)2155 server.add_references(refs)2156 2157 node = ua.AddNodesItem()2158 node.RequestedNewNodeId = ua.NodeId.from_string("i=2384")2159 node.BrowseName = ua.QualifiedName.from_string("LastTransitionTime")2160 node.NodeClass = ua.NodeClass.Variable2161 node.ParentNodeId = ua.NodeId.from_string("i=2380")2162 node.ReferenceTypeId = ua.NodeId.from_string("i=46")2163 node.TypeDefinition = ua.NodeId.from_string("i=68")2164 attrs = ua.VariableAttributes()2165 attrs.DisplayName = ua.LocalizedText("LastTransitionTime")2166 attrs.DataType = ua.NodeId.from_string("i=294")2167 attrs.ValueRank = -12168 node.NodeAttributes = attrs2169 server.add_nodes([node])2170 refs = []2171 ref = ua.AddReferencesItem()2172 ref.IsForward = true2173 ref.ReferenceTypeId = ua.NodeId.from_string("i=37")2174 ref.SourceNodeId = ua.NodeId.from_string("i=2384")2175 ref.TargetNodeClass = ua.NodeClass.DataType2176 ref.TargetNodeId = ua.NodeId.from_string("i=78")2177 refs.append(ref)2178 server.add_references(refs)2179 2180 node = ua.AddNodesItem()2181 node.RequestedNewNodeId = ua.NodeId.from_string("i=2385")2182 node.BrowseName = ua.QualifiedName.from_string("LastMethodCall")2183 node.NodeClass = ua.NodeClass.Variable2184 node.ParentNodeId = ua.NodeId.from_string("i=2380")2185 node.ReferenceTypeId = ua.NodeId.from_string("i=46")2186 node.TypeDefinition = ua.NodeId.from_string("i=68")2187 attrs = ua.VariableAttributes()2188 attrs.DisplayName = ua.LocalizedText("LastMethodCall")2189 attrs.DataType = ua.NodeId(ua.ObjectIds.String)2190 attrs.ValueRank = -12191 node.NodeAttributes = attrs2192 server.add_nodes([node])2193 refs = []2194 ref = ua.AddReferencesItem()2195 ref.IsForward = true2196 ref.ReferenceTypeId = ua.NodeId.from_string("i=37")2197 ref.SourceNodeId = ua.NodeId.from_string("i=2385")2198 ref.TargetNodeClass = ua.NodeClass.DataType2199 ref.TargetNodeId = ua.NodeId.from_string("i=78")2200 refs.append(ref)2201 server.add_references(refs)2202 2203 node = ua.AddNodesItem()2204 node.RequestedNewNodeId = ua.NodeId.from_string("i=2386")2205 node.BrowseName = ua.QualifiedName.from_string("LastMethodSessionId")2206 node.NodeClass = ua.NodeClass.Variable2207 node.ParentNodeId = ua.NodeId.from_string("i=2380")2208 node.ReferenceTypeId = ua.NodeId.from_string("i=46")2209 node.TypeDefinition = ua.NodeId.from_string("i=68")2210 attrs = ua.VariableAttributes()2211 attrs.DisplayName = ua.LocalizedText("LastMethodSessionId")2212 attrs.DataType = ua.NodeId(ua.ObjectIds.NodeId)2213 attrs.ValueRank = -12214 node.NodeAttributes = attrs2215 server.add_nodes([node])2216 refs = []2217 ref = ua.AddReferencesItem()2218 ref.IsForward = true2219 ref.ReferenceTypeId = ua.NodeId.from_string("i=37")2220 ref.SourceNodeId = ua.NodeId.from_string("i=2386")2221 ref.TargetNodeClass = ua.NodeClass.DataType2222 ref.TargetNodeId = ua.NodeId.from_string("i=78")2223 refs.append(ref)2224 server.add_references(refs)2225 2226 node = ua.AddNodesItem()2227 node.RequestedNewNodeId = ua.NodeId.from_string("i=2387")2228 node.BrowseName = ua.QualifiedName.from_string("LastMethodInputArguments")2229 node.NodeClass = ua.NodeClass.Variable2230 node.ParentNodeId = ua.NodeId.from_string("i=2380")2231 node.ReferenceTypeId = ua.NodeId.from_string("i=46")2232 node.TypeDefinition = ua.NodeId.from_string("i=68")2233 attrs = ua.VariableAttributes()2234 attrs.DisplayName = ua.LocalizedText("LastMethodInputArguments")2235 attrs.DataType = ua.NodeId.from_string("i=296")2236 attrs.ValueRank = 12237 node.NodeAttributes = attrs2238 server.add_nodes([node])2239 refs = []2240 ref = ua.AddReferencesItem()2241 ref.IsForward = true2242 ref.ReferenceTypeId = ua.NodeId.from_string("i=37")2243 ref.SourceNodeId = ua.NodeId.from_string("i=2387")2244 ref.TargetNodeClass = ua.NodeClass.DataType2245 ref.TargetNodeId = ua.NodeId.from_string("i=78")2246 refs.append(ref)2247 server.add_references(refs)2248 2249 node = ua.AddNodesItem()2250 node.RequestedNewNodeId = ua.NodeId.from_string("i=2388")2251 node.BrowseName = ua.QualifiedName.from_string("LastMethodOutputArguments")2252 node.NodeClass = ua.NodeClass.Variable2253 node.ParentNodeId = ua.NodeId.from_string("i=2380")2254 node.ReferenceTypeId = ua.NodeId.from_string("i=46")2255 node.TypeDefinition = ua.NodeId.from_string("i=68")2256 attrs = ua.VariableAttributes()2257 attrs.DisplayName = ua.LocalizedText("LastMethodOutputArguments")2258 attrs.DataType = ua.NodeId.from_string("i=296")2259 attrs.ValueRank = 12260 node.NodeAttributes = attrs2261 server.add_nodes([node])2262 refs = []2263 ref = ua.AddReferencesItem()2264 ref.IsForward = true2265 ref.ReferenceTypeId = ua.NodeId.from_string("i=37")2266 ref.SourceNodeId = ua.NodeId.from_string("i=2388")2267 ref.TargetNodeClass = ua.NodeClass.DataType2268 ref.TargetNodeId = ua.NodeId.from_string("i=78")2269 refs.append(ref)2270 server.add_references(refs)2271 2272 node = ua.AddNodesItem()2273 node.RequestedNewNodeId = ua.NodeId.from_string("i=2389")2274 node.BrowseName = ua.QualifiedName.from_string("LastMethodCallTime")2275 node.NodeClass = ua.NodeClass.Variable2276 node.ParentNodeId = ua.NodeId.from_string("i=2380")2277 node.ReferenceTypeId = ua.NodeId.from_string("i=46")2278 node.TypeDefinition = ua.NodeId.from_string("i=68")2279 attrs = ua.VariableAttributes()2280 attrs.DisplayName = ua.LocalizedText("LastMethodCallTime")2281 attrs.DataType = ua.NodeId.from_string("i=294")2282 attrs.ValueRank = -12283 node.NodeAttributes = attrs2284 server.add_nodes([node])2285 refs = []2286 ref = ua.AddReferencesItem()2287 ref.IsForward = true2288 ref.ReferenceTypeId = ua.NodeId.from_string("i=37")2289 ref.SourceNodeId = ua.NodeId.from_string("i=2389")2290 ref.TargetNodeClass = ua.NodeClass.DataType2291 ref.TargetNodeId = ua.NodeId.from_string("i=78")2292 refs.append(ref)2293 server.add_references(refs)2294 2295 node = ua.AddNodesItem()2296 node.RequestedNewNodeId = ua.NodeId.from_string("i=2390")2297 node.BrowseName = ua.QualifiedName.from_string("LastMethodReturnStatus")2298 node.NodeClass = ua.NodeClass.Variable2299 node.ParentNodeId = ua.NodeId.from_string("i=2380")2300 node.ReferenceTypeId = ua.NodeId.from_string("i=46")2301 node.TypeDefinition = ua.NodeId.from_string("i=68")2302 attrs = ua.VariableAttributes()2303 attrs.DisplayName = ua.LocalizedText("LastMethodReturnStatus")2304 attrs.DataType = ua.NodeId.from_string("i=299")2305 attrs.ValueRank = -12306 node.NodeAttributes = attrs2307 server.add_nodes([node])2308 refs = []2309 ref = ua.AddReferencesItem()2310 ref.IsForward = true2311 ref.ReferenceTypeId = ua.NodeId.from_string("i=37")2312 ref.SourceNodeId = ua.NodeId.from_string("i=2390")2313 ref.TargetNodeClass = ua.NodeClass.DataType2314 ref.TargetNodeId = ua.NodeId.from_string("i=78")2315 refs.append(ref)2316 server.add_references(refs)2317 2318 node = ua.AddNodesItem()2319 node.RequestedNewNodeId = ua.NodeId.from_string("i=894")2320 node.BrowseName = ua.QualifiedName.from_string("ProgramDiagnosticDataType")2321 node.NodeClass = ua.NodeClass.DataType2322 node.ParentNodeId = ua.NodeId.from_string("i=22")2323 node.ReferenceTypeId = ua.NodeId.from_string("i=45")2324 attrs = ua.DataTypeAttributes()2325 attrs.DisplayName = ua.LocalizedText("ProgramDiagnosticDataType")2326 attrs.IsAbstract = false2327 node.NodeAttributes = attrs2328 server.add_nodes([node])2329 2330 node = ua.AddNodesItem()2331 node.RequestedNewNodeId = ua.NodeId.from_string("i=895")2332 node.BrowseName = ua.QualifiedName.from_string("Default XML")2333 node.NodeClass = ua.NodeClass.Object2334 node.ParentNodeId = ua.NodeId.from_string("i=894")2335 node.ReferenceTypeId = ua.NodeId.from_string("i=38")2336 node.TypeDefinition = ua.NodeId.from_string("i=76")2337 attrs = ua.ObjectAttributes()2338 attrs.DisplayName = ua.LocalizedText("Default XML")2339 attrs.EventNotifier = 02340 node.NodeAttributes = attrs2341 server.add_nodes([node])2342 refs = []2343 ref = ua.AddReferencesItem()2344 ref.IsForward = true2345 ref.ReferenceTypeId = ua.NodeId.from_string("i=39")2346 ref.SourceNodeId = ua.NodeId.from_string("i=895")2347 ref.TargetNodeClass = ua.NodeClass.DataType2348 ref.TargetNodeId = ua.NodeId.from_string("i=8882")2349 refs.append(ref)2350 server.add_references(refs)2351 2352 node = ua.AddNodesItem()2353 node.RequestedNewNodeId = ua.NodeId.from_string("i=896")2354 node.BrowseName = ua.QualifiedName.from_string("Default Binary")2355 node.NodeClass = ua.NodeClass.Object2356 node.ParentNodeId = ua.NodeId.from_string("i=894")2357 node.ReferenceTypeId = ua.NodeId.from_string("i=38")2358 node.TypeDefinition = ua.NodeId.from_string("i=76")2359 attrs = ua.ObjectAttributes()2360 attrs.DisplayName = ua.LocalizedText("Default Binary")2361 attrs.EventNotifier = 02362 node.NodeAttributes = attrs2363 server.add_nodes([node])2364 refs = []2365 ref = ua.AddReferencesItem()2366 ref.IsForward = true2367 ref.ReferenceTypeId = ua.NodeId.from_string("i=39")2368 ref.SourceNodeId = ua.NodeId.from_string("i=896")2369 ref.TargetNodeClass = ua.NodeClass.DataType2370 ref.TargetNodeId = ua.NodeId.from_string("i=8247")2371 refs.append(ref)...
test_parse.py
Source:test_parse.py
...26 parse_class_selector, parse_keyword, parse_string,27 parse_number, StyleParseError, CharIterator)28from rinoh.table import ColumnWidths, VerticalAlign29from rinoh.text import StyledText, SingleStyledText, MixedStyledText, Tab30def test_optionset_from_string():31 ONE = 'one'32 TWO = 'two'33 THREE = 'three'34 WITH_SPACE = 'with space'35 DOUBLE_SPACE = 'double space'36 class TestSet1(OptionSet):37 values = ONE, TWO, THREE, WITH_SPACE, DOUBLE_SPACE38 assert TestSet1.from_string('one') == ONE39 assert TestSet1.from_string('TWO') == TWO40 assert TestSet1.from_string('tHRee') == THREE41 assert TestSet1.from_string('With Space') == WITH_SPACE42 assert TestSet1.from_string('double SPACE') == DOUBLE_SPACE43 with pytest.raises(ValueError):44 TestSet1.from_string('four')45 with pytest.raises(ValueError):46 TestSet1.from_string('none')47 class TestSet2(OptionSet):48 values = None, TWO49 assert TestSet2.from_string('none') == None50 assert TestSet2.from_string('nONe') == None51 assert TestSet2.from_string('two') == TWO52 with pytest.raises(ValueError):53 TestSet2.from_string('one')54 with pytest.raises(ValueError):55 TestSet2.from_string('False')56def test_classset_from_string():57 class TestClassSet(ClassSet):58 classes = {59 1: ['one', 'uno'],60 3: ['number three', 'tres'],61 4: ['four', 'numero-quattro']62 }63 assert TestClassSet.from_string('one') == 164 assert TestClassSet.from_string('uNo') == 165 assert TestClassSet.from_string('number Three') == 366 assert TestClassSet.from_string('tres') == 367 assert TestClassSet.from_string('fOUr') == 468 assert TestClassSet.from_string('numero-quattro') == 469 assert TestClassSet.from_string('numero quattro') == 470 assert TestClassSet.from_string('Numero Quattro') == 471 assert TestClassSet.from_string('numeroquattro') == 472 assert TestClassSet.from_string('numeroQuattro') == 473 with pytest.raises(ValueError):74 TestClassSet.from_string('number-three')75def test_fontweight_from_string():76 assert FontWeight.from_string('regular') == FontWeight.REGULAR77 assert FontWeight.from_string('normal') == FontWeight.REGULAR78 assert FontWeight.from_string('semibold') == FontWeight.SEMI_BOLD79 assert FontWeight.from_string('semi-bold') == FontWeight.SEMI_BOLD80 assert FontWeight.from_string('semi bold') == FontWeight.SEMI_BOLD81 assert FontWeight.from_string('400') == FontWeight.REGULAR82 assert FontWeight.from_string('123') == 12383 with pytest.raises(ValueError):84 FontWeight.from_string('1299')85def test_fontslant_from_string():86 assert FontSlant.from_string('upright') == FontSlant.UPRIGHT87 assert FontSlant.from_string('obLIQUE') == FontSlant.OBLIQUE88 assert FontSlant.from_string('Italic') == FontSlant.ITALIC89 with pytest.raises(ValueError):90 FontSlant.from_string('somewhat-oblique')91def test_fontwidth_from_string():92 assert FontWidth.from_string('normal') == FontWidth.NORMAL93 assert FontWidth.from_string('Medium') == FontWidth.MEDIUM94 assert FontWidth.from_string('condenSED') == FontWidth.CONDENSED95 assert FontWidth.from_string('semi-expanded') == FontWidth.SEMI_EXPANDED96 assert FontWidth.from_string('ultra eXpanded') == FontWidth.ULTRA_EXPANDED97 assert FontWidth.from_string('UltraCondensed') == FontWidth.ULTRA_CONDENSED98 assert FontWidth.from_string('5') == FontWidth.NORMAL99 with pytest.raises(ValueError):100 FontWidth.from_string('0')101 with pytest.raises(ValueError):102 FontWidth.from_string('11')103def test_numberformat_from_string():104 assert NumberFormat.from_string('none') == None105 assert NumberFormat.from_string('number') == NumberFormat.NUMBER106 assert NumberFormat.from_string('lowercase character') \107 == NumberFormat.LOWERCASE_CHARACTER108 assert NumberFormat.from_string('uppercase CHARACTER') \109 == NumberFormat.UPPERCASE_CHARACTER110 assert NumberFormat.from_string('LOWERCASE ROMAN') \111 == NumberFormat.LOWERCASE_ROMAN112 assert NumberFormat.from_string('uppercase roman') \113 == NumberFormat.UPPERCASE_ROMAN114 assert NumberFormat.from_string('sYMBOl') == NumberFormat.SYMBOL115 assert NumberFormat.from_string("'1'") == SingleStyledText('1')116 assert NumberFormat.from_string("'2' (strong)") \117 == SingleStyledText('2', style='strong')118 assert NumberFormat.from_string("'3' (strong) 'A'") \119 == MixedStyledText([SingleStyledText('3', style='strong'),120 SingleStyledText('A')])121 with pytest.raises(ValueError):122 NumberFormat.from_string('Character')123 with pytest.raises(ValueError):124 NumberFormat.from_string('roMAN')125def test_textalign_from_string():126 assert TextAlign.from_string('left') == TextAlign.LEFT127 assert TextAlign.from_string('cenTER') == TextAlign.CENTER128 assert TextAlign.from_string('RighT') == TextAlign.RIGHT129 assert TextAlign.from_string('justify') == TextAlign.JUSTIFY130 with pytest.raises(ValueError):131 assert TextAlign.from_string('none')132 with pytest.raises(ValueError):133 assert TextAlign.from_string('full')134def test_flowablewidth_from_string():135 assert FlowableWidth.from_string('auto') == FlowableWidth.AUTO136 assert FlowableWidth.from_string('fill') == FlowableWidth.FILL137 assert FlowableWidth.from_string('12 pt') == 12*PT138def test_horizontalalignment_from_string():139 assert HorizontalAlignment.from_string('left') == HorizontalAlignment.LEFT140 assert HorizontalAlignment.from_string('Right') \141 == HorizontalAlignment.RIGHT142 assert HorizontalAlignment.from_string('CENTER') \143 == HorizontalAlignment.CENTER144 with pytest.raises(ValueError):145 HorizontalAlignment.from_string('none')146def test_break_from_string():147 assert Break.from_string('none') == None148 assert Break.from_string('Left') == Break.LEFT149 assert Break.from_string('RIGHT') == Break.RIGHT150 assert Break.from_string('aNY') == Break.ANY151 assert Break.from_string('LEFT restart') == Break.LEFT_RESTART152 assert Break.from_string('riGHt REstarT') == Break.RIGHT_RESTART153 assert Break.from_string('any RESTART') == Break.ANY_RESTART154 with pytest.raises(ValueError):155 assert Break.from_string('center')156def test_tabalign_from_string():157 assert TabAlign.from_string('left') == TabAlign.LEFT158 assert TabAlign.from_string('right') == TabAlign.RIGHT159 assert TabAlign.from_string('center') == TabAlign.CENTER160 with pytest.raises(ValueError):161 assert TabAlign.from_string('none')162 with pytest.raises(ValueError):163 assert TabAlign.from_string('any')164def test_linespacing_from_string():165 assert LineSpacing.from_string('default') == DEFAULT166 assert LineSpacing.from_string('StandarD') == STANDARD167 assert LineSpacing.from_string('SINGLE') == SINGLE168 assert LineSpacing.from_string('Double') == DOUBLE169 assert LineSpacing.from_string('proportional(2)') == ProportionalSpacing(2)170 assert LineSpacing.from_string('fixed(2pt)') == FixedSpacing(2*PT)171 assert LineSpacing.from_string('fixed(1.4 cm)') == FixedSpacing(1.4*CM)172 assert LineSpacing.from_string('fixed(1pT,single)') == FixedSpacing(1*PT)173 assert LineSpacing.from_string('fixed(1pT ,DOUBLE)') \174 == FixedSpacing(1*PT, DOUBLE)175 assert LineSpacing.from_string('leading(3 PT)') == Leading(3*PT)176 with pytest.raises(ParseError):177 assert LineSpacing.from_string('5 pt')178 with pytest.raises(ParseError):179 assert LineSpacing.from_string('proportional')180 with pytest.raises(ParseError):181 assert LineSpacing.from_string('proportional(1 cm)')182 with pytest.raises(ParseError):183 assert LineSpacing.from_string('fixed')184 with pytest.raises(ParseError):185 assert LineSpacing.from_string('fixed(2)')186 with pytest.raises(ParseError):187 assert LineSpacing.from_string('fixed(2pt, badvalue)')188 with pytest.raises(ParseError):189 assert LineSpacing.from_string('leading')190def test_verticalalign_from_string():191 assert VerticalAlign.from_string('top') == VerticalAlign.TOP192 assert VerticalAlign.from_string('miDDLE') == VerticalAlign.MIDDLE193 assert VerticalAlign.from_string('BOTTOM') == VerticalAlign.BOTTOM194 with pytest.raises(ValueError):195 assert VerticalAlign.from_string('none')196 with pytest.raises(ValueError):197 assert VerticalAlign.from_string('center')198def test_bool_from_string():199 assert Bool.from_string('true') == True200 assert Bool.from_string('false') == False201 assert Bool.from_string('TRUE') == True202 assert Bool.from_string('FALSE') == False203 assert Bool.from_string('True') == True204 assert Bool.from_string('FaLSE') == False205 with pytest.raises(ValueError):206 Bool.from_string('1')207 with pytest.raises(ValueError):208 Bool.from_string('0')209 with pytest.raises(ValueError):210 Bool.from_string('T')211 with pytest.raises(ValueError):212 Bool.from_string('f')213def test_integer_from_string():214 assert Integer.from_string('1') == 1215 assert Integer.from_string('873654354') == 873654354216 assert Integer.from_string('-9') == -9217 with pytest.raises(ParseError):218 assert Integer.from_string('1e5')219 with pytest.raises(ParseError):220 assert Integer.from_string('0.5')221def test_dimension_from_string():222 assert Dimension.from_string('none') == None223 assert Dimension.from_string('0') == 0224 assert Dimension.from_string('1pt') == 1*PT225 assert Dimension.from_string('10 pt') == 10*PT226 assert Dimension.from_string('25pc') == 25*PICA227 assert Dimension.from_string('1.5 in') == 1.5*INCH228 assert Dimension.from_string('99999mm') == 99999*MM229 assert Dimension.from_string('-2.1 cm') == -2.1*CM230 assert Dimension.from_string('21%') == 21*PERCENT231 assert Dimension.from_string('-16.12%') == -16.12*PERCENT232 assert Dimension.from_string('1/2') == 1*HALVES233 assert Dimension.from_string('3/2') == 3*HALVES234 assert Dimension.from_string('3/4') == 3*QUARTERS235 with pytest.raises(ParseError):236 assert Dimension.from_string('20inch')237def test_paper_from_string():238 assert Paper.from_string('A4') == A4239 assert Paper.from_string('a5') == A5240 assert Paper.from_string('junIOr legal') == JUNIOR_LEGAL241 assert Paper.from_string('212pt * 5.84in') == Paper('212pt * 5.84in',242 212*PT, 5.84*INCH)243 assert Paper.from_string('2 cm * 4cm') == Paper('2 cm * 4cm', 2*CM, 4*CM)244 assert Paper.from_string('2cm * 4 cm') == Paper('2cm * 4 cm', 2*CM, 4*CM)245 assert Paper.from_string('2cm*4cm') == Paper('2cm*4cm', 2*CM, 4*CM)246 assert Paper.from_string('2 cm*4 cm') == Paper('2 cm*4 cm', 2*CM, 4*CM)247 with pytest.raises(ParseError):248 Paper.from_string('212pt * 5.84in * 6cm')249 with pytest.raises(ParseError):250 Paper.from_string('212pt * 5.84')251def test_color_from_string():252 assert Color.from_string('none') == None253 assert Color.from_string('#ffffff') == HexColor('#FFFFFF')254 assert Color.from_string('#aBc123') == HexColor('#Abc123')255 assert Color.from_string('#123456aa') == HexColor('#123456aa')256 assert Color.from_string('#5e1') == HexColor('#5e1')257 assert Color.from_string('#5e10') == HexColor('#5e10')258def test_stroke_from_string():259 assert Stroke.from_string('1pt,#fff') == Stroke(1*PT, HexColor('#FFF'))260 assert Stroke.from_string('1pt, #fff') == Stroke(1*PT, HexColor('#FFF'))261 assert Stroke.from_string('99cm,#123456aa') == Stroke(99*CM,262 HexColor('#123456aa'))263 with pytest.raises(ParseError):264 assert Stroke.from_string('8,#fff')265 with pytest.raises(ParseError):266 assert Stroke.from_string('1pt,1')267 with pytest.raises(ParseError):268 assert Stroke.from_string('xyz')269def test_styledtext_from_string():270 assert StyledText.from_string("'one'") == SingleStyledText('one')271 assert StyledText.from_string("'on\\'e'") == SingleStyledText("on'e")272 assert StyledText.from_string("'''with\nnewline'''") \273 == SingleStyledText('with\nnewline')274 assert StyledText.from_string("'one' 'two'") \275 == MixedStyledText([SingleStyledText('one'),276 SingleStyledText('two')])277 assert StyledText.from_string("'one''two'") \278 == MixedStyledText([SingleStyledText('one'),279 SingleStyledText('two')])280 assert StyledText.from_string("'one'\n'two'") \281 == MixedStyledText([SingleStyledText('one'),282 SingleStyledText('two')])283 assert StyledText.from_string("'one'(style1)") \284 == SingleStyledText('one', style='style1')285 assert StyledText.from_string("'one' (style1)") \286 == SingleStyledText('one', style='style1')287 assert StyledText.from_string("'one'(style 1)") \288 == SingleStyledText('one', style='style 1')289 assert StyledText.from_string("'one'(style 1)") \290 == SingleStyledText('one', style='style 1')291 assert StyledText.from_string("'one'( style 1 )") \292 == SingleStyledText('one', style='style 1')293 assert StyledText.from_string("'one'(style1) 'two'") \294 == MixedStyledText([SingleStyledText('one', style='style1'),295 SingleStyledText('two')])296 assert StyledText.from_string("'one'\t(style1) 'two'(style2)") \297 == MixedStyledText([SingleStyledText('one', style='style1'),298 SingleStyledText('two', style='style2')])299 assert StyledText.from_string("'one{nbsp}two'") \300 == SingleStyledText('one\N{NO-BREAK SPACE}two')301 assert StyledText.from_string("'one' '{gt}two'(style2)") \302 == MixedStyledText([SingleStyledText('one'),303 SingleStyledText('>two', style='style2')])304def test_styledtext_from_string_field():305 assert StyledText.from_string("'{SECTION_NUMBER(7)}' (style)") \306 == Field(SECTION_NUMBER(7), style='style')307 assert StyledText.from_string("'abc {NUMBER_OF_PAGES}' (style)") \308 == MixedStyledText([SingleStyledText('abc '),309 Field(NUMBER_OF_PAGES)], style='style')310 assert StyledText.from_string("'{PAGE_NUMBER}abc' (style)") \311 == MixedStyledText([Field(PAGE_NUMBER),312 SingleStyledText('abc')], style='style')313 assert StyledText.from_string("'one{nbsp}two{SECTION_TITLE(1)}'") \314 == MixedStyledText([SingleStyledText('one\N{NO-BREAK SPACE}two'),315 Field(SECTION_TITLE(1))])316 assert StyledText.from_string("'one{PAGE_NUMBER}'(style1) 'moh'(style2)") \317 == MixedStyledText([MixedStyledText([SingleStyledText('one'),318 Field(PAGE_NUMBER)],319 style='style1'),320 SingleStyledText('moh', style='style2')])321 assert StyledText.from_string("'{SectionTitles.chapter}abc' (style)") \322 == MixedStyledText([StringField(SectionTitles, 'chapter'),323 SingleStyledText('abc')], style='style')324 assert StyledText.from_string("'1{AdmonitionTitles.warning}2' (style)") \325 == MixedStyledText([SingleStyledText('1'),326 StringField(AdmonitionTitles, 'warning'),327 SingleStyledText('2')], style='style')328 assert StyledText.from_string("'{UserStrings.my_string}abc' (style)") \329 == MixedStyledText([StringField(UserStrings, 'my_string'),330 SingleStyledText('abc')], style='style')331def test_styledtext_from_string_inline_image():332 assert StyledText.from_string("IMAGE('images/image.pdf')") \333 == InlineImage('images/image.pdf')334 assert StyledText.from_string("image('images/image.pdf', scale = 2.3)") \335 == InlineImage('images/image.pdf', scale=2.3)336 assert StyledText.from_string("iMAGe('images/image.pdf' ,baseline=10 %)") \337 == InlineImage('images/image.pdf', baseline=10*PERCENT)338 assert StyledText.from_string("Image('space image.pdf',baseline=10 %, "339 " scale=0.8 , width= 5 in, rotate=45)") \340 == InlineImage('space image.pdf', scale=0.8, baseline=10*PERCENT,341 width=5*INCH, rotate=45)342 assert StyledText.from_string("'Text with an ' (a) IMAGE('image.png') "343 "' in the middle.'(b)") \344 == MixedStyledText([SingleStyledText('Text with an ', style='a'),345 InlineImage('image.png'),346 SingleStyledText(' in the middle.', style='b')])347def test_referencetext_from_string():348 assert ReferenceText.from_string("'{NUMBER}'") == ReferenceField('number')349 assert ReferenceText.from_string("'Chapter {NUMBER}\t{title}'") \350 == MixedStyledText([SingleStyledText('Chapter '),351 ReferenceField('number'), Tab(),352 ReferenceField('title')])353 assert ReferenceText.from_string("'{bull} '(style1)"354 "'{nbsp}{TITLE}\t{PaGE}'(style2)") \355 == MixedStyledText(356 [SingleStyledText('\N{BULLET} ', style='style1'),357 MixedStyledText([SingleStyledText('\N{NO-BREAK SPACE}'),358 ReferenceField('title'), Tab(),359 ReferenceField('page')],360 style='style2')])361def test_scale_from_string():362 assert Scale.from_string("0.1") == 0.1363 assert Scale.from_string("1.0") == 1.0364 assert Scale.from_string("0.5") == 0.5365 assert Scale.from_string("fit") == Scale.FIT366 assert Scale.from_string("fill") == Scale.FILL367 with pytest.raises(ValueError):368 Scale.from_string("unknown")369 with pytest.raises(ParseError):370 Scale.from_string("/")371 with pytest.raises(ParseError):372 Scale.from_string("0")373 with pytest.raises(ParseError):374 assert Scale.from_string("-0.5")375def test_backgroundimage_from_string():376 assert BackgroundImage.from_string("'image.jpg'") \377 == BackgroundImage('image.jpg')378 assert BackgroundImage.from_string("'image.jpg' ") \379 == BackgroundImage('image.jpg')380 assert BackgroundImage.from_string("'image.jpg', scale=0.6 ") \381 == BackgroundImage('image.jpg', scale=0.6)382 assert BackgroundImage.from_string("'image.jpg' ,scale=fit ") \383 == BackgroundImage('image.jpg', scale='fit')384 assert BackgroundImage.from_string("'image.jpg' , width=9 cm ") \385 == BackgroundImage('image.jpg', width=9*CM)386 assert BackgroundImage.from_string("'image.jpg', width=2 cm, height=5cm") \387 == BackgroundImage('image.jpg', width=2*CM, height=5*CM)388 assert BackgroundImage.from_string("'image.jpg', scale=fill, dpi = 56") \389 == BackgroundImage('image.jpg', scale='fill', dpi=56)390 assert BackgroundImage.from_string("'image.jpg', height=2cm, rotate =20, "391 "align= right, limit_width = 5cm") \392 == BackgroundImage('image.jpg', height=2*CM, rotate=20,393 align='right', limit_width=5*CM)394 with pytest.raises(ParseError):395 BackgroundImage.from_string("'image.jpg', unsupported_keyword=5")396 with pytest.raises(ParseError):397 BackgroundImage.from_string("'image.jpg' dpi=60")398 with pytest.raises(ParseError):399 BackgroundImage.from_string('not_a_path')400def test_column_widths_from_string():401 assert ColumnWidths.from_string('none') is None402 assert ColumnWidths.from_string('auto') == [None]403 assert ColumnWidths.from_string('1 2 3') == [1, 2, 3]404 assert ColumnWidths.from_string('1 0 9') == [1, 0, 9]405 assert ColumnWidths.from_string('2 4 6') == [2, 4, 6]406 assert ColumnWidths.from_string('6 5 4 ') == [6, 5, 4]407 assert ColumnWidths.from_string('1pt 2cm 3in') == [1*PT, 2*CM, 3*INCH]408 assert ColumnWidths.from_string('20% 30%') == [20*PERCENT, 30*PERCENT]409 assert ColumnWidths.from_string('1/2 3/4') == [1*HALVES, 3*QUARTERS]410 assert ColumnWidths.from_string('1/2 auto 20%') == [1*HALVES, None,411 20*PERCENT]412 assert ColumnWidths.from_string('4 pt 5 cm 6 in') == [4*PT, 5*CM, 6*INCH]413 assert ColumnWidths.from_string('7pt 8 cm 9in') == [7*PT, 8*CM, 9*INCH]414 assert ColumnWidths.from_string('10 20 1cm 30') == [10, 20, 1*CM, 30]415 assert ColumnWidths.from_string('1 2cm auto') == [1, 2*CM, None]416 assert ColumnWidths.from_string('2 auto 5') == [2, None, 5]417 with pytest.raises(ParseError):418 assert ColumnWidths.from_string('autoo')419 with pytest.raises(ParseError):420 assert ColumnWidths.from_string('1 none')421 with pytest.raises(ParseError):422 assert ColumnWidths.from_string('1.5 3 1cm')423# selectors424def test_parse_keyword():425 def helper(string):426 chars = CharIterator(string)427 keyword, unknown_keyword = parse_keyword(chars)428 return keyword, unknown_keyword, ''.join(chars)429 assert helper('None') == (None, False, '')430 assert helper('trUE =') == (True, False, ' =')431 assert helper('FALSE doh!') == (False, False, ' doh!')432 assert helper('style') == ('style', True, '')433 assert helper('row ') == ('row', True, ' ')434 assert helper('UPPERCASE') == ('UPPERCASE', True, '')435 assert helper('miXeDCaSE') == ('miXeDCaSE', True, '')436 assert helper('key efzef') == ('key', True, ' efzef')...
filters.py
Source:filters.py
...11from jinja2 import Markup, Environment12env = Environment()13class FilterTestCase(JinjaTestCase):14 def test_capitalize(self):15 tmpl = env.from_string('{{ "foo bar"|capitalize }}')16 assert tmpl.render() == 'Foo bar'17 def test_center(self):18 tmpl = env.from_string('{{ "foo"|center(9) }}')19 assert tmpl.render() == ' foo '20 def test_default(self):21 tmpl = env.from_string(22 "{{ missing|default('no') }}|{{ false|default('no') }}|"23 "{{ false|default('no', true) }}|{{ given|default('no') }}"24 )25 assert tmpl.render(given='yes') == 'no|False|no|yes'26 def test_dictsort(self):27 tmpl = env.from_string(28 '{{ foo|dictsort }}|'29 '{{ foo|dictsort(true) }}|'30 '{{ foo|dictsort(false, "value") }}'31 )32 out = tmpl.render(foo={"aa": 0, "b": 1, "c": 2, "AB": 3})33 assert out == ("[('aa', 0), ('AB', 3), ('b', 1), ('c', 2)]|"34 "[('AB', 3), ('aa', 0), ('b', 1), ('c', 2)]|"35 "[('aa', 0), ('b', 1), ('c', 2), ('AB', 3)]")36 def test_batch(self):37 tmpl = env.from_string("{{ foo|batch(3)|list }}|"38 "{{ foo|batch(3, 'X')|list }}")39 out = tmpl.render(foo=range(10))40 assert out == ("[[0, 1, 2], [3, 4, 5], [6, 7, 8], [9]]|"41 "[[0, 1, 2], [3, 4, 5], [6, 7, 8], [9, 'X', 'X']]")42 def test_slice(self):43 tmpl = env.from_string('{{ foo|slice(3)|list }}|'44 '{{ foo|slice(3, "X")|list }}')45 out = tmpl.render(foo=range(10))46 assert out == ("[[0, 1, 2, 3], [4, 5, 6], [7, 8, 9]]|"47 "[[0, 1, 2, 3], [4, 5, 6, 'X'], [7, 8, 9, 'X']]")48 def test_escape(self):49 tmpl = env.from_string('''{{ '<">&'|escape }}''')50 out = tmpl.render()51 assert out == '<">&'52 def test_striptags(self):53 tmpl = env.from_string('''{{ foo|striptags }}''')54 out = tmpl.render(foo=' <p>just a small \n <a href="#">'55 'example</a> link</p>\n<p>to a webpage</p> '56 '<!-- <p>and some commented stuff</p> -->')57 assert out == 'just a small example link to a webpage'58 def test_filesizeformat(self):59 tmpl = env.from_string(60 '{{ 100|filesizeformat }}|'61 '{{ 1000|filesizeformat }}|'62 '{{ 1000000|filesizeformat }}|'63 '{{ 1000000000|filesizeformat }}|'64 '{{ 1000000000000|filesizeformat }}|'65 '{{ 100|filesizeformat(true) }}|'66 '{{ 1000|filesizeformat(true) }}|'67 '{{ 1000000|filesizeformat(true) }}|'68 '{{ 1000000000|filesizeformat(true) }}|'69 '{{ 1000000000000|filesizeformat(true) }}'70 )71 out = tmpl.render()72 assert out == (73 '100 Bytes|0.0 kB|0.0 MB|0.0 GB|0.0 TB|100 Bytes|'74 '1000 Bytes|1.0 KiB|0.9 MiB|0.9 GiB'75 )76 def test_first(self):77 tmpl = env.from_string('{{ foo|first }}')78 out = tmpl.render(foo=range(10))79 assert out == '0'80 def test_float(self):81 tmpl = env.from_string('{{ "42"|float }}|'82 '{{ "ajsghasjgd"|float }}|'83 '{{ "32.32"|float }}')84 out = tmpl.render()85 assert out == '42.0|0.0|32.32'86 def test_format(self):87 tmpl = env.from_string('''{{ "%s|%s"|format("a", "b") }}''')88 out = tmpl.render()89 assert out == 'a|b'90 def test_indent(self):91 tmpl = env.from_string('{{ foo|indent(2) }}|{{ foo|indent(2, true) }}')92 text = '\n'.join([' '.join(['foo', 'bar'] * 2)] * 2)93 out = tmpl.render(foo=text)94 assert out == ('foo bar foo bar\n foo bar foo bar| '95 'foo bar foo bar\n foo bar foo bar')96 def test_int(self):97 tmpl = env.from_string('{{ "42"|int }}|{{ "ajsghasjgd"|int }}|'98 '{{ "32.32"|int }}')99 out = tmpl.render()100 assert out == '42|0|32'101 def test_join(self):102 tmpl = env.from_string('{{ [1, 2, 3]|join("|") }}')103 out = tmpl.render()104 assert out == '1|2|3'105 env2 = Environment(autoescape=True)106 tmpl = env2.from_string('{{ ["<foo>", "<span>foo</span>"|safe]|join }}')107 assert tmpl.render() == '<foo><span>foo</span>'108 def test_join_attribute(self):109 class User(object):110 def __init__(self, username):111 self.username = username112 tmpl = env.from_string('''{{ users|join(', ', 'username') }}''')113 assert tmpl.render(users=map(User, ['foo', 'bar'])) == 'foo, bar'114 def test_last(self):115 tmpl = env.from_string('''{{ foo|last }}''')116 out = tmpl.render(foo=range(10))117 assert out == '9'118 def test_length(self):119 tmpl = env.from_string('''{{ "hello world"|length }}''')120 out = tmpl.render()121 assert out == '11'122 def test_lower(self):123 tmpl = env.from_string('''{{ "FOO"|lower }}''')124 out = tmpl.render()125 assert out == 'foo'126 def test_pprint(self):127 from pprint import pformat128 tmpl = env.from_string('''{{ data|pprint }}''')129 data = range(1000)130 assert tmpl.render(data=data) == pformat(data)131 def test_random(self):132 tmpl = env.from_string('''{{ seq|random }}''')133 seq = range(100)134 for _ in range(10):135 assert int(tmpl.render(seq=seq)) in seq136 def test_reverse(self):137 tmpl = env.from_string('{{ "foobar"|reverse|join }}|'138 '{{ [1, 2, 3]|reverse|list }}')139 assert tmpl.render() == 'raboof|[3, 2, 1]'140 def test_string(self):141 x = [1, 2, 3, 4, 5]142 tmpl = env.from_string('''{{ obj|string }}''')143 assert tmpl.render(obj=x) == unicode(x)144 def test_title(self):145 tmpl = env.from_string('''{{ "foo bar"|title }}''')146 assert tmpl.render() == "Foo Bar"147 def test_truncate(self):148 tmpl = env.from_string(149 '{{ data|truncate(15, true, ">>>") }}|'150 '{{ data|truncate(15, false, ">>>") }}|'151 '{{ smalldata|truncate(15) }}'152 )153 out = tmpl.render(data='foobar baz bar' * 1000,154 smalldata='foobar baz bar')155 assert out == 'foobar baz barf>>>|foobar baz >>>|foobar baz bar'156 def test_upper(self):157 tmpl = env.from_string('{{ "foo"|upper }}')158 assert tmpl.render() == 'FOO'159 def test_urlize(self):160 tmpl = env.from_string('{{ "foo http://www.example.com/ bar"|urlize }}')161 assert tmpl.render() == 'foo <a href="http://www.example.com/">'\162 'http://www.example.com/</a> bar'163 def test_wordcount(self):164 tmpl = env.from_string('{{ "foo bar baz"|wordcount }}')165 assert tmpl.render() == '3'166 def test_block(self):167 tmpl = env.from_string('{% filter lower|escape %}<HEHE>{% endfilter %}')168 assert tmpl.render() == '<hehe>'169 def test_chaining(self):170 tmpl = env.from_string('''{{ ['<foo>', '<bar>']|first|upper|escape }}''')171 assert tmpl.render() == '<FOO>'172 def test_sum(self):173 tmpl = env.from_string('''{{ [1, 2, 3, 4, 5, 6]|sum }}''')174 assert tmpl.render() == '21'175 def test_sum_attributes(self):176 tmpl = env.from_string('''{{ values|sum('value') }}''')177 assert tmpl.render(values=[178 {'value': 23},179 {'value': 1},180 {'value': 18},181 ]) == '42'182 def test_sum_attributes_nested(self):183 tmpl = env.from_string('''{{ values|sum('real.value') }}''')184 assert tmpl.render(values=[185 {'real': {'value': 23}},186 {'real': {'value': 1}},187 {'real': {'value': 18}},188 ]) == '42'189 def test_abs(self):190 tmpl = env.from_string('''{{ -1|abs }}|{{ 1|abs }}''')191 assert tmpl.render() == '1|1', tmpl.render()192 def test_round_positive(self):193 tmpl = env.from_string('{{ 2.7|round }}|{{ 2.1|round }}|'194 "{{ 2.1234|round(3, 'floor') }}|"195 "{{ 2.1|round(0, 'ceil') }}")196 assert tmpl.render() == '3.0|2.0|2.123|3.0', tmpl.render()197 def test_round_negative(self):198 tmpl = env.from_string('{{ 21.3|round(-1)}}|'199 "{{ 21.3|round(-1, 'ceil')}}|"200 "{{ 21.3|round(-1, 'floor')}}")201 assert tmpl.render() == '20.0|30.0|20.0',tmpl.render()202 def test_xmlattr(self):203 tmpl = env.from_string("{{ {'foo': 42, 'bar': 23, 'fish': none, "204 "'spam': missing, 'blub:blub': '<?>'}|xmlattr }}")205 out = tmpl.render().split()206 assert len(out) == 3207 assert 'foo="42"' in out208 assert 'bar="23"' in out209 assert 'blub:blub="<?>"' in out210 def test_sort1(self):211 tmpl = env.from_string('{{ [2, 3, 1]|sort }}|{{ [2, 3, 1]|sort(true) }}')212 assert tmpl.render() == '[1, 2, 3]|[3, 2, 1]'213 def test_sort2(self):214 tmpl = env.from_string('{{ "".join(["c", "A", "b", "D"]|sort) }}')215 assert tmpl.render() == 'AbcD'216 def test_sort3(self):217 tmpl = env.from_string('''{{ ['foo', 'Bar', 'blah']|sort }}''')218 assert tmpl.render() == "['Bar', 'blah', 'foo']"219 def test_sort4(self):220 class Magic(object):221 def __init__(self, value):222 self.value = value223 def __unicode__(self):224 return unicode(self.value)225 tmpl = env.from_string('''{{ items|sort(attribute='value')|join }}''')226 assert tmpl.render(items=map(Magic, [3, 2, 4, 1])) == '1234'227 def test_groupby(self):228 tmpl = env.from_string('''229 {%- for grouper, list in [{'foo': 1, 'bar': 2},230 {'foo': 2, 'bar': 3},231 {'foo': 1, 'bar': 1},232 {'foo': 3, 'bar': 4}]|groupby('foo') -%}233 {{ grouper }}{% for x in list %}: {{ x.foo }}, {{ x.bar }}{% endfor %}|234 {%- endfor %}''')235 assert tmpl.render().split('|') == [236 "1: 1, 2: 1, 1",237 "2: 2, 3",238 "3: 3, 4",239 ""240 ]241 def test_groupby_tuple_index(self):242 tmpl = env.from_string('''243 {%- for grouper, list in [('a', 1), ('a', 2), ('b', 1)]|groupby(0) -%}244 {{ grouper }}{% for x in list %}:{{ x.1 }}{% endfor %}|245 {%- endfor %}''')246 assert tmpl.render() == 'a:1:2|b:1|'247 def test_groupby_multidot(self):248 class Date(object):249 def __init__(self, day, month, year):250 self.day = day251 self.month = month252 self.year = year253 class Article(object):254 def __init__(self, title, *date):255 self.date = Date(*date)256 self.title = title257 articles = [258 Article('aha', 1, 1, 1970),259 Article('interesting', 2, 1, 1970),260 Article('really?', 3, 1, 1970),261 Article('totally not', 1, 1, 1971)262 ]263 tmpl = env.from_string('''264 {%- for year, list in articles|groupby('date.year') -%}265 {{ year }}{% for x in list %}[{{ x.title }}]{% endfor %}|266 {%- endfor %}''')267 assert tmpl.render(articles=articles).split('|') == [268 '1970[aha][interesting][really?]',269 '1971[totally not]',270 ''271 ]272 def test_filtertag(self):273 tmpl = env.from_string("{% filter upper|replace('FOO', 'foo') %}"274 "foobar{% endfilter %}")275 assert tmpl.render() == 'fooBAR'276 def test_replace(self):277 env = Environment()278 tmpl = env.from_string('{{ string|replace("o", 42) }}')279 assert tmpl.render(string='<foo>') == '<f4242>'280 env = Environment(autoescape=True)281 tmpl = env.from_string('{{ string|replace("o", 42) }}')282 assert tmpl.render(string='<foo>') == '<f4242>'283 tmpl = env.from_string('{{ string|replace("<", 42) }}')284 assert tmpl.render(string='<foo>') == '42foo>'285 tmpl = env.from_string('{{ string|replace("o", ">x<") }}')286 assert tmpl.render(string=Markup('foo')) == 'f>x<>x<'287 def test_forceescape(self):288 tmpl = env.from_string('{{ x|forceescape }}')289 assert tmpl.render(x=Markup('<div />')) == u'<div />'290 def test_safe(self):291 env = Environment(autoescape=True)292 tmpl = env.from_string('{{ "<div>foo</div>"|safe }}')293 assert tmpl.render() == '<div>foo</div>'294 tmpl = env.from_string('{{ "<div>foo</div>" }}')295 assert tmpl.render() == '<div>foo</div>'296def suite():297 suite = unittest.TestSuite()298 suite.addTest(unittest.makeSuite(FilterTestCase))...
Learn to execute automation testing from scratch with LambdaTest Learning Hub. Right from setting up the prerequisites to run your first automation test, to following best practices and diving deeper into advanced test scenarios. LambdaTest Learning Hubs compile a list of step-by-step guides to help you be proficient with different test automation frameworks i.e. Selenium, Cypress, TestNG etc.
You could also refer to video tutorials over LambdaTest YouTube channel to get step by step demonstration from industry experts.
Get 100 minutes of automation test minutes FREE!!