本文整理汇总了Python中Mailman.Utils.mkdir方法的典型用法代码示例。如果您正苦于以下问题:Python Utils.mkdir方法的具体用法?Python Utils.mkdir怎么用?Python Utils.mkdir使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类Mailman.Utils
的用法示例。
在下文中一共展示了Utils.mkdir方法的1个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Python代码示例。
示例1: InitVars
# 需要导入模块: from Mailman import Utils [as 别名]
# 或者: from Mailman.Utils import mkdir [as 别名]
def InitVars(self):
# Configurable
self.archive = mm_cfg.DEFAULT_ARCHIVE
# 0=public, 1=private:
self.archive_private = mm_cfg.DEFAULT_ARCHIVE_PRIVATE
self.archive_volume_frequency = \
mm_cfg.DEFAULT_ARCHIVE_VOLUME_FREQUENCY
# Not configurable
self.clobber_date = 0
# Though the archive file dirs are list-specific, they are not
# settable from the web interface. If you REALLY want to redirect
# something to a different dir, you can set the member vars by
# hand, from the Python interpreter!
#
# The archive file structure by default is:
#
# archives/
# private/
# listname.mbox/
# listname
# listname/
# lots-of-pipermail-stuff
# public/
# [email protected] -> ../private/listname.mbox
# [email protected] -> ../private/listname
#
# IOW, the mbox and pipermail archives are always stored in the
# private archive for the list. This is safe because archives/private
# is always set to o-rx. Public archives have a symlink to get around
# the private directory, pointing directly to the private/listname
# which has o+rx permissions. Private archives do not have the
# symbolic links.
self.public_archive_file_dir = mm_cfg.PUBLIC_ARCHIVE_FILE_DIR
self.private_archive_file_dir = os.path.join(
mm_cfg.PRIVATE_ARCHIVE_FILE_DIR,
self._internal_name + '.mbox')
self.archive_directory = os.path.join(
mm_cfg.PRIVATE_ARCHIVE_FILE_DIR,
self._internal_name)
try:
Utils.mkdir(self.private_archive_file_dir)
except os.error, e:
code, msg = e
if code <> errno.EEXIST:
raise