本文整理汇总了Python中github.GitHub.list_files方法的典型用法代码示例。如果您正苦于以下问题:Python GitHub.list_files方法的具体用法?Python GitHub.list_files怎么用?Python GitHub.list_files使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类github.GitHub
的用法示例。
在下文中一共展示了GitHub.list_files方法的4个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Python代码示例。
示例1: lp_layout_list
# 需要导入模块: from github import GitHub [as 别名]
# 或者: from github.GitHub import list_files [as 别名]
def lp_layout_list(self, upstream=None):
"""
search_order : list layouts from upstream if mentioned
list layouts from core package
"""
if upstream is None:
l_files = list_files(self.base_path + "/inventory_layouts")
return l_files
else:
g = GitHub(upstream)
l_files = []
files = g.list_files("inventory_layouts")
return files
示例2: lp_topo_list
# 需要导入模块: from github import GitHub [as 别名]
# 或者: from github.GitHub import list_files [as 别名]
def lp_topo_list(self, upstream=None):
"""
search_order : list topologies from upstream if mentioned
list topologies from current folder
"""
if upstream is None:
t_files = list_files(self.base_path + "/ex_topo")
return t_files
else:
print "getting from upstream"
g = GitHub(upstream)
t_files = []
files = g.list_files("ex_topo")
return files
示例3: lp_layout_get
# 需要导入模块: from github import GitHub [as 别名]
# 或者: from github.GitHub import list_files [as 别名]
def lp_layout_get(self, layout, upstream=None):
"""
search_order : get layouts from upstream if mentioned
get layouts from core package
"""
if upstream is None:
get_file(self.base_path + "/inventory_layouts/" + layout,
"./layouts/")
else:
g = GitHub(upstream)
files = g.list_files("inventory_layouts")
link = filter(lambda link: link['name'] == layout, files)
link = link[0]["download_url"]
get_file(link, "./layouts", True)
return link
示例4: lp_topo_get
# 需要导入模块: from github import GitHub [as 别名]
# 或者: from github.GitHub import list_files [as 别名]
def lp_topo_get(self, topo, upstream=None):
"""
search_order : get topologies from upstream if mentioned
get topologies from core package
# need to add checks for ./topologies
"""
if upstream is None:
get_file(self.base_path + "/ex_topo/" + topo, "./topologies/")
else:
g = GitHub(upstream)
files = g.list_files("ex_topo")
link = filter(lambda link: link['name'] == topo, files)
link = link[0]["download_url"]
get_file(link, "./topologies", True)
return link