本文整理汇总了Python中catalog.Catalog.insertEntry方法的典型用法代码示例。如果您正苦于以下问题:Python Catalog.insertEntry方法的具体用法?Python Catalog.insertEntry怎么用?Python Catalog.insertEntry使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类catalog.Catalog
的用法示例。
在下文中一共展示了Catalog.insertEntry方法的1个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Python代码示例。
示例1: extractUrls
# 需要导入模块: from catalog import Catalog [as 别名]
# 或者: from catalog.Catalog import insertEntry [as 别名]
PROJECTPATH = [
"/work/cvsvap",
"/work/cvsapp",
"/work/blossom",
"/work/cvsoag",
"/opt/projects",
os.environ["HOME"] + "/projects",
]
SPECIAL = ["CVS", ".svn"]
for dir in args:
if os.path.isfile(dir) and dir.endswith(".html"):
for url, label in extractUrls(dir):
print "insert entry; %s %s" % (url, label)
catalog.insertEntry(path=url, display_name=label, command=url_cmd)
catalog.commit()
else:
for root, dirs, files in os.walk(dir):
if isforbidden(root):
continue
for projectpath in PROJECTPATH:
if root.startswith(projectpath):
for dir in dirs:
for special in SPECIAL:
if not special in dirs and os.path.exists(os.path.join(root, dir, special)):
addProject(projectpath, os.path.join(root, dir))
for file in files:
if isinteresting(root, file):
file = os.path.join(root, file)
add(file)