本文整理汇总了Python中Products.ATContentTypes.content.base.ATCTContent.manage_afterPUT方法的典型用法代码示例。如果您正苦于以下问题:Python ATCTContent.manage_afterPUT方法的具体用法?Python ATCTContent.manage_afterPUT怎么用?Python ATCTContent.manage_afterPUT使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类Products.ATContentTypes.content.base.ATCTContent
的用法示例。
在下文中一共展示了ATCTContent.manage_afterPUT方法的2个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Python代码示例。
示例1: manage_afterPUT
# 需要导入模块: from Products.ATContentTypes.content.base import ATCTContent [as 别名]
# 或者: from Products.ATContentTypes.content.base.ATCTContent import manage_afterPUT [as 别名]
def manage_afterPUT(self, data, marshall_data, file, context, mimetype, filename, REQUEST, RESPONSE):
# After webdav/ftp PUT method.
# Set title according to the id on webdav/ftp PUTs.
if "" == data:
file.seek(0)
content = file.read(65536)
else:
content = data
if -1 != content.lower().find("<html"):
parser = etree.HTMLParser()
tree = etree.fromstring(content, parser=parser)
titletag = tree.xpath("//title")
if titletag:
self.setTitle(titletag[0].text)
return
ATCTContent.manage_afterPUT(self, data, marshall_data, file, context, mimetype, filename, REQUEST, RESPONSE)
示例2: manage_afterPUT
# 需要导入模块: from Products.ATContentTypes.content.base import ATCTContent [as 别名]
# 或者: from Products.ATContentTypes.content.base.ATCTContent import manage_afterPUT [as 别名]
def manage_afterPUT(self, data, marshall_data, file, context, mimetype,
filename, REQUEST, RESPONSE):
# After webdav/ftp PUT method.
# Set title according to the id on webdav/ftp PUTs.
if '' == data:
file.seek(0)
content = file.read(65536)
else:
content = data
if -1 != content.lower().find("<html"):
parser = SimpleHTMLParser()
parser.feed(content)
if parser.title:
self.setTitle(parser.title)
return
ATCTContent.manage_afterPUT(self, data, marshall_data, file,
context, mimetype, filename, REQUEST,
RESPONSE)