当前位置:网站首页>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
边栏推荐
- 非易失性MRAM存储器应用于各级高速缓存
- 关于DevOps的七大误解,99%的人都曾中过招!
- Python 100 cases
- September 3, 2020: naked writing algorithm: loop matrix traversal.
- [byte jumps, autumn recruitment Posts open] ohayoo! Don't leave after school, I want to ask you to play games!!!
- Git SSH bad permissions
- Stm32f030k6t6 compatible replacement smart mm32f031k6t6
- 2020-08-15:什么情况下数据任务需要优化?
- Es create a new index database and copy the old index library, practice pro test effective!
- 打工人好物——磨炼钢铁意志就要这样高效的电脑
猜你喜欢

What are the highlights of Huawei mate 40 series with HMS?

Two dimensional code location and alarm system of Expressway

Nodejs中使用jsonwebtoken(JWT)生成token的场景使用
![[self taught unity2d legendary game development] map editor](/img/3b/00bc81122d330c9d59909994e61027.jpg)
[self taught unity2d legendary game development] map editor

小程序商城系统插件代码该如何写?怎么用代码检查添加插件是否成功?

Detect certificate expiration script

2020-08-15:什么情况下数据任务需要优化?

【涂鸦物联网足迹】涂鸦云平台全景介绍

The memorandum model of behavior model

Application of UHF RFID medical blood management system
随机推荐
细数软件工程----各阶段必不可少的那些图
Hdu3974 assign the task segment tree DFS order
Two dimensional code location and alarm system of Expressway
Practice of Xiaoxiong school development board: real equipment access of smart street lamp sandbox experiment
Method of code refactoring -- Analysis of method refactoring
Interviewer: how about shardingsphere
September 9, 2020: naked writing algorithm: two threads print numbers 1-100 in turn.
[learning] interface test case writing and testing concerns
Stickinengine architecture 12 communication protocol
The isolation level of transaction and its problems
Jenkins installation and deployment process
The role of theme music in games
WebAPI接口设计:SwaggerUI文档 / 统一响应格式 / 统一异常处理 / 统一权限验证
JVM memory allocation - xms128m - xmx512m - XX: permsize = 128M - XX: maxpermsize = 512M
如何创建交互式内核密度图表
南京标志设计,logo设计公司
LEADTOOLS如何检测,读取和写入条形码
2020-08-20: the difference between go and python?
To solve the problem that the data interface is not updated after WPF binding set
A concise tutorial for Nacos, ribbon and feign