本文整理汇总了Python中Client.call方法的典型用法代码示例。如果您正苦于以下问题:Python Client.call方法的具体用法?Python Client.call怎么用?Python Client.call使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类Client
的用法示例。
在下文中一共展示了Client.call方法的1个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Python代码示例。
示例1: openList
# 需要导入模块: import Client [as 别名]
# 或者: from Client import call [as 别名]
def openList(self, root = None):
url = self.buildUrl()+self.itemsSubPath
if url[-1] == '/':
url = url[:-1]
self.server = self.getResource(url)
try:
self.entries, self.entryIds = self.server.zoa.items()
except xmlrpclib.Fault, error:
#print str(error)
# see if zoa object is installed
try:
Client.call('http://%s/zoa'%self.buildUrl(),
self.properties['username'], self.properties['passwd'],
function='version')
except Client.NotFound:
if wx.MessageBox(
'The zoa object not found in the root of your Zope tree.\n\n'
'Do you want to install it?', 'Install zoa',
wx.YES_NO | wx.ICON_QUESTION) == wx.YES:
import ZoaClient
conninfo = ('http://%s'%self.buildUrl(),
self.properties['username'], self.properties['passwd'])
ZoaClient.installFromFS(conninfo,
os.path.join(Preferences.pyPath, 'ZopeLib', 'zoa', ))
# try again, if this fails the real error should break thru
self.entries, self.entryIds = self.server.zoa.items()
else:
err = error.faultString
raise zopeHtmlErr2Strs(err)