当前位置:网站首页>python3操作gitlab
python3操作gitlab
2020-11-06 22:38:00 【落叶刀】
#coding=utf-8
import base64
#导入python-gitlab库
import gitlab
url = 'http://192.168.x.xxx'
token = 'D98-t7HJpXxwhq8qbXcJ'
# 登录
gl = gitlab.Gitlab(url, token)
#获取项目
project = gl.projects.get('ZEP-BACKEND/ZEP-BACKEND-JAVA')
#获取javademo/config目录下文件列表,版本为master
items = project.repository_tree(path='javademo', ref='master')
def get_all_files(path=None, ref='master'):
items = project.repository_tree(path=path, ref=ref)
for item in items:
if item['mode'] == '040000':
# 调用递归,实现目录递归输出
get_all_files(item['path'], ref)
if item['mode'] == '100644':
print("===({})===".format(item['path']))
get_all_files(path='javademo', ref='master')
版权声明
本文为[落叶刀]所创,转载请带上原文链接,感谢
https://my.oschina.net/luoyedao/blog/4698416
边栏推荐
- September 9, 2020: naked writing algorithm: two threads print numbers 1-100 in turn.
- 汽车维修app开发的好处与功能
- 2020-08-15:什么情况下数据任务需要优化?
- The 4th China BIM (digital construction) manager Summit Forum will be held in Hangzhou in 2020
- The use of Xunwei imx6 development board device tree kernel menuconfig
- C calls SendMessage to refresh the taskbar icon (the icon does not disappear at the end of forcing)
- 【涂鸦物联网足迹】物联网基础介绍篇
- 20个XR项目路演,近20个资本机构出席!诚邀您参加2020 Qualcomm XR生态合作伙伴大会
- Benefits and functions of auto maintenance app development
- 实验一
猜你喜欢
VARCHART XGantt如何在日历上表示工作日
The use of Xunwei imx6 development board device tree kernel menuconfig
南京标志设计,logo设计公司
The essence of transaction and the principle of deadlock
To solve the problem that the data interface is not updated after WPF binding set
ado.net and asp.net The relationship between
细数软件工程----各阶段必不可少的那些图
ImageMagick - 添加水印
August 18, 2020: introduce Mr process?
Ora-02292: complete constraint violation (midbjdev2.sys_ C0020757) - subrecord found
随机推荐
Introduction to the development of small game cloud
大佬们如何在nginx镜像里面增加模块?
What are the highlights of Huawei mate 40 series with HMS?
测试攻城狮必备技能点!一文带你解读DevOps下的测试技术
The role of theme music in games
August 18, 2020: introduce Mr process?
The first choice for lightweight GPU applications is the NVIDIA vgpu instance launched by Jingdong Zhilian cloud
STM32F030C6T6兼容替换MM32SPIN05PF
Count the number of project code lines
Experiment one
2020-09-04: do you understand the function call convention?
Using JSON webtoken (JWT) to generate token in nodejs
September 3, 2020: naked writing algorithm: loop matrix traversal.
消防器材RFID固定资产管理系统
How to deploy Gantt chart quickly and correctly
Python 100 cases
Unexpected element.. required element
Utility class functions (continuous update)
2020-08-14:数据任务的执行引擎用的哪些?
The memorandum model of behavior model