当前位置:网站首页>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
边栏推荐
- August 30, 2020: naked write algorithm: the nearest common ancestor of two nodes in a binary tree.
- Stm32f030k6t6 compatible replacement smart mm32f031k6t6
- Js字符串-String字符串对象方法
- How to start the hidden preferences in coda 2 on the terminal?
- 2020-08-15:什么情况下数据任务需要优化?
- confd
- What the hell is fastthreadlocal? The existence of ThreadLocal!!
- 2020-08-17: how to solve data skew in detail?
- Method of code refactoring -- Analysis of method refactoring
- 南京标识标牌设计制作,导视VI系统设计
猜你喜欢

2020-08-29: process thread differences, in addition to the inclusion relationship, the underlying details?

JVM class loading mechanism

September 9, 2020: naked writing algorithm: two threads print numbers 1-100 in turn.

超高频RFID医疗血液管理系统应用

List to map (split the list according to the key, and the value of the same key is a list)

Configuration of AP hotspot on xunwei-imx6ull development board

The 4th China BIM (digital construction) manager Summit Forum will be held in Hangzhou in 2020

Es create a new index database and copy the old index library, practice pro test effective!

细数软件工程----各阶段必不可少的那些图

Experiment one
随机推荐
VARCHART XGantt入门教程
“非洲用户的付费意愿并不低”——专访四达时代研发总监张亮
Nodejs中使用jsonwebtoken(JWT)生成token的场景使用
Practice of Xiaoxiong school development board: real equipment access of smart street lamp sandbox experiment
南京标识标牌设计制作,导视VI系统设计
Points to be considered when deleting mapping field of index in ES
The advantages and functions of psychological counseling app
Stm32f030c6t6 compatible to replace mm32spin05pf
Hdu3974 assign the task segment tree DFS order
Utility class functions (continuous update)
How to start the hidden preferences in coda 2 on the terminal?
VARCHART XGantt如何在日历上表示工作日
打工人好物——磨炼钢铁意志就要这样高效的电脑
Application insights application insights use application maps to build request link views
预留电池接口,内置充放电电路及电量计,迅为助力轻松搞定手持应用
Novice guidance and event management system in game development
Plug in bilibilibili new version 0.5.5
JS string - string string object method
Application of UHF RFID medical blood management system
What grammar is it? ]