本文整理汇总了Python中suds.properties.Unskin.update方法的典型用法代码示例。如果您正苦于以下问题:Python Unskin.update方法的具体用法?Python Unskin.update怎么用?Python Unskin.update使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类suds.properties.Unskin
的用法示例。
在下文中一共展示了Unskin.update方法的4个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Python代码示例。
示例1: set_options
# 需要导入模块: from suds.properties import Unskin [as 别名]
# 或者: from suds.properties.Unskin import update [as 别名]
def set_options(self, **kwargs):
"""
Set options.
@param kwargs: keyword arguments.
@see: L{Options}
"""
p = Unskin(self.options)
p.update(kwargs)
示例2: clone
# 需要导入模块: from suds.properties import Unskin [as 别名]
# 或者: from suds.properties.Unskin import update [as 别名]
def clone(self):
"""
Get a shallow clone of this object.
The clone only shares the WSDL. All other attributes are
unique to the cloned object including options.
@return: A shallow clone.
@rtype: L{Client}
"""
class Uninitialized(Client):
def __init__(self):
pass
clone = Uninitialized()
clone.options = Options()
cp = Unskin(clone.options)
mp = Unskin(self.options)
cp.update(deepcopy(mp))
clone.wsdl = self.wsdl
clone.factory = self.factory
clone.service = ServiceSelector(clone, self.wsdl.services)
clone.sd = self.sd
clone.messages = dict(tx=None, rx=None)
return clone
示例3: __deepcopy__
# 需要导入模块: from suds.properties import Unskin [as 别名]
# 或者: from suds.properties.Unskin import update [as 别名]
def __deepcopy__(self, memo={}):
clone = self.__class__()
p = Unskin(self.options)
cp = Unskin(clone.options)
cp.update(p)
return clone
示例4: __init__
# 需要导入模块: from suds.properties import Unskin [as 别名]
# 或者: from suds.properties.Unskin import update [as 别名]
def __init__(self, server=None, username=None, password=None,
wsdl_location="local", timeout=30, init_clone=False, clone=None):
#self._init_logging()
self._logged_in = False
if server is None:
server = _config_value("general", "server")
if username is None:
username = _config_value("general", "username")
if password is None:
password = _config_value("general", "password")
if server is None:
raise ConfigError("server must be set in config file or Client()")
if username is None:
raise ConfigError("username must be set in config file or Client()")
if password is None:
raise ConfigError("password must be set in config file or Client()")
self.server = server
self.username = username
self.password = password
url = "https://%s/sdk" % self.server
if wsdl_location == "local":
current_path = os.path.abspath(os.path.dirname(__file__))
current_path = current_path.replace('\\', '/')
if not current_path.startswith('/') :
current_path = '/' + current_path
if current_path.endswith('/') :
current_path = current_path[:-1]
wsdl_uri = ("file://%s/wsdl/vimService.wsdl" % current_path)
elif wsdl_location == "remote":
wsdl_uri = url + "/vimService.wsdl"
else:
print("FATAL: wsdl_location must be \"local\" or \"remote\"")
sys.exit(1)
# Init the base class
if clone:
self.sd=clone.sd
self.options = Options()
cp = Unskin(self.options)
mp = Unskin(clone.options)
cp.update(deepcopy(mp))
self.wsdl = clone.wsdl
self.factory = clone.factory
self.service = ServiceSelector(self, clone.wsdl.services)
self.messages = dict(tx=None, rx=None)
else:
try:
suds.client.Client.__init__(self, wsdl_uri)
except URLError:
logger.critical("Failed to connect to %s" % self.server)
raise
except IOError:
logger.critical("Failed to load the local WSDL from %s" % wsdl_uri)
raise
except TransportError:
logger.critical("Failed to load the remote WSDL from %s" % wsdl_uri)
raise
if init_clone:
return
self.options.transport.options.timeout = timeout
self.set_options(location=url)
mo_ref = soap.ManagedObjectReference("ServiceInstance",
"ServiceInstance")
self.si = ServiceInstance(mo_ref, self)
try:
self.sc = self.si.RetrieveServiceContent()
except URLError, e:
#print("Failed to connect to %s" % self.server)
#print("urllib2 said: %s" % e.reason)
#sys.exit(1)
raise