opc_ua/client.py
branchwxPython4
changeset 3643 c6068b674b30
parent 3612 428fb2472f43
child 3652 b5c6bb72bfc9
equal deleted inserted replaced
3642:cd3d15e8ef42 3643:c6068b674b30
    65                           </xsd:complexType>
    65                           </xsd:complexType>
    66                         </xsd:element>
    66                         </xsd:element>
    67                       </xsd:sequence>
    67                       </xsd:sequence>
    68                       <xsd:attribute name="Certificate" type="xsd:string" use="optional" default="certificate.pem"/>
    68                       <xsd:attribute name="Certificate" type="xsd:string" use="optional" default="certificate.pem"/>
    69                       <xsd:attribute name="PrivateKey" type="xsd:string" use="optional" default="private_key.pem"/>
    69                       <xsd:attribute name="PrivateKey" type="xsd:string" use="optional" default="private_key.pem"/>
       
    70                       <xsd:attribute name="ApplicationUri" type="xsd:string" use="optional"/>
    70                     </xsd:complexType>
    71                     </xsd:complexType>
    71                   </xsd:element>
    72                   </xsd:element>
    72                   <xsd:element name="UserPassword">
    73                   <xsd:element name="UserPassword">
    73                     <xsd:complexType>
    74                     <xsd:complexType>
    74                       <xsd:attribute name="User" type="xsd:string" use="optional"/>
    75                       <xsd:attribute name="User" type="xsd:string" use="optional"/>
   112                 if value == "" or value is None:
   113                 if value == "" or value is None:
   113                     value = default
   114                     value = default
   114                 # cryptomaterial is expected to be in project's user provide file directory
   115                 # cryptomaterial is expected to be in project's user provide file directory
   115                 if name in ["Certificate","PrivateKey"]:
   116                 if name in ["Certificate","PrivateKey"]:
   116                     value = os.path.join(self.GetCTRoot()._getProjectFilesPath(), value)
   117                     value = os.path.join(self.GetCTRoot()._getProjectFilesPath(), value)
       
   118                 # ApplicationUri defaults to URI if not set
       
   119                 if name == "ApplicationUri" and not value:
       
   120                         value = res["URI"]
   117                 res[name] = value
   121                 res[name] = value
   118 
   122 
   119         return res
   123         return res
   120 
   124 
   121     def GetFileName(self):
   125     def GetFileName(self):