当前位置:网站首页>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
边栏推荐
猜你喜欢
The use of Xunwei imx6 development board device tree kernel menuconfig
WebAPI接口设计:SwaggerUI文档 / 统一响应格式 / 统一异常处理 / 统一权限验证
How does varhart xgantt represent working days on a calendar
Empty test suite appears in JUnit test
Code generator plug-in and creator preform file analysis
The role of theme music in games
How to deploy Gantt chart quickly and correctly
迅为iMX6开发板-设备树内核-menuconfig的使用
2020-08-29: process thread differences, in addition to the inclusion relationship, the underlying details?
Message queue - Analysis
随机推荐
Zhou Jie: database system of East China Normal University
ado.net and asp.net The relationship between
Gantt chart grouping activities tutorial
“非洲用户的付费意愿并不低”——专访四达时代研发总监张亮
QT audio and video development 46 video transmission UDP version
Nanjing logo design and production, guide VI system design
Count the number of project code lines
The Interpreter pattern of behavior pattern
Jenkins入门(二)声明式流水线Jenkins Pipeline
[byte jumps, autumn recruitment Posts open] ohayoo! Don't leave after school, I want to ask you to play games!!!
10000! Ideal car recalls all defective cars: 97 accidents have occurred and losses will be expanded
FreeSWITCH视频会议“标准”解决方案
The memorandum model of behavior model
如何创建交互式内核密度图表
Getting started with varhart xgantt
Stm32f030k6t6 compatible replacement smart mm32f031k6t6
The advantages and functions of psychological counseling app
非易失性MRAM存储器应用于各级高速缓存
Epu360: all the H5 templates you want are here, e-book, big turntable, red envelope rain, questionnaire survey
如何才能快速正确的部署甘特图