本文整理汇总了Python中pykolab.imap.IMAP.list_acls方法的典型用法代码示例。如果您正苦于以下问题:Python IMAP.list_acls方法的具体用法?Python IMAP.list_acls怎么用?Python IMAP.list_acls使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类pykolab.imap.IMAP
的用法示例。
在下文中一共展示了IMAP.list_acls方法的2个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Python代码示例。
示例1: execute
# 需要导入模块: from pykolab.imap import IMAP [as 别名]
# 或者: from pykolab.imap.IMAP import list_acls [as 别名]
def execute(*args, **kw):
"""
List mailboxes
"""
try:
aci_subject = conf.cli_args.pop(0)
except:
aci_subject = None
imap = IMAP()
imap.connect()
folders = imap.lm()
for folder in folders:
acls = imap.list_acls(folder)
if not aci_subject == None:
if aci_subject in acls.keys():
log.debug(_("Deleting ACL %s for subject %s on folder %s") % (
acls[aci_subject],
aci_subject,
folder
), level=8)
imap.set_acl(folder, aci_subject, '')
#else:
#for _aci_subject in acls.keys():
# connect to auth(!)
# find recipient result_attr=aci_subject
# if no entry, expire acl
示例2: description
# 需要导入模块: from pykolab.imap import IMAP [as 别名]
# 或者: from pykolab.imap.IMAP import list_acls [as 别名]
def description():
return """Obtain a list of ACL entries on a folder."""
def execute(*args, **kw):
try:
folder = conf.cli_args.pop(0)
except IndexError, errmsg:
folder = utils.ask_question(_("Folder name"))
if len(folder.split('@')) > 1:
domain = folder.split('@')[1]
else:
domain = conf.get('kolab', 'primary_domain')
imap = IMAP()
imap.connect(domain=domain)
if not imap.has_folder(folder):
print >> sys.stderr, _("No such folder %r") % (folder)
else:
acls = []
folders = imap.list_folders(folder)
for folder in folders:
print "Folder", folder
acls = imap.list_acls(folder)
for acl in acls.keys():
print " %-13s %s" %(acls[acl], acl)