当前位置:网站首页>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
边栏推荐
- 如何才能快速正确的部署甘特图
- FreeSWITCH视频会议“标准”解决方案
- 2020-08-29: process thread differences, in addition to the inclusion relationship, the underlying details?
- Application of UHF RFID medical blood management system
- Erd-online free online database modeling tool
- 关于DevOps的七大误解,99%的人都曾中过招!
- 小熊派开发板实践:智慧路灯沙箱实验之真实设备接入
- Two dimensional code location and alarm system of Expressway
- win7 APPCRASH(解决方法)(转)
- Web API interface design: swaggerui document / unified response format / unified exception handling / unified authority verification
猜你喜欢
Gantt chart grouping activities tutorial
2020-08-15:什么情况下数据任务需要优化?
Configuration of AP hotspot on xunwei-imx6ull development board
Composition of MRAM cache
How to start the hidden preferences in coda 2 on the terminal?
Countdown | 2020 PostgreSQL Asia Conference - agenda arrangement of Chinese sub Forum
南京标志设计,logo设计公司
Nonvolatile MRAM memory used in all levels of cache
2020-08-20: the difference between go and python?
Detect certificate expiration script
随机推荐
Novice guidance and event management system in game development
How to use Gantt chart layers and filters
2020 database technology conference helps technology upgrade
C language I blog assignment 03
打工人好物——磨炼钢铁意志就要这样高效的电脑
Stickinengine architecture 11 message queue
Nanjing logo design and production, guide VI system design
FreeSWITCH视频会议“标准”解决方案
Common syntax corresponding table of mongodb and SQL
The 4th China BIM (digital construction) manager Summit Forum will be held in Hangzhou in 2020
Qt音视频开发46-视频传输UDP版
Stm32f030k6t6 compatible replacement smart mm32f031k6t6
Jenkins installation and deployment process
[graffiti Internet of things footprints] panoramic introduction of graffiti cloud platform
ImageMagick - add watermark
JS array the usage of array is all here (array method reconstruction, array traversal, array de duplication, array judgment and conversion)
JVM class loading mechanism
The Interpreter pattern of behavior pattern
STM32F030K6T6兼容替换灵动MM32F031K6T6
“非洲用户的付费意愿并不低”——专访四达时代研发总监张亮