当前位置:网站首页>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
边栏推荐
- Markdown tricks
- MRAM高速缓存的组成
- STM32F030F4P6兼容灵动微MM32F031F4P6
- How to use Gantt chart layers and filters
- Zhou Jie: database system of East China Normal University
- Event monitoring problem
- 上海巨微专用蓝牙广播芯片
- Detailed software engineering -- the necessary graphs in each stage
- 条形码识别性能低,如何优化Dynamsoft Barcode Reader解码性能
- Jenkins installation and deployment process
猜你喜欢

心理咨询app开发所具备的优点与功能

Gantt chart grouping activities tutorial

Common mathematical basic formulas of recursive and backtracking algorithms

条形码识别性能低,如何优化Dynamsoft Barcode Reader解码性能

图像处理工具包ImagXpress使用教程,如何查看事件

The memorandum model of behavior model

Exclusive interview with Alibaba cloud database for 2020 PostgreSQL Asia Conference: Zeng Wenjing

Plug in bilibilibili new version 0.5.5

Nanjing logo design and production, guide VI system design

September 9, 2020: naked writing algorithm: two threads print numbers 1-100 in turn.
随机推荐
如何才能快速正确的部署甘特图
超高频RFID医疗血液管理系统应用
The Interpreter pattern of behavior pattern
Utility class functions (continuous update)
STM32F030F4P6兼容灵动微MM32F031F4P6
The isolation level of transaction and its problems
Reserved battery interface, built-in charge and discharge circuit and electricity meter, quickly help easily handle hand-held applications
2020-08-17: how to solve data skew in detail?
Mobile pixel adaptation scheme
August 18, 2020: introduce Mr process?
Application layer software development Godfather teaches you how to refactor, senior programmers must professional skills
2020-08-15: under what circumstances should data tasks be optimized?
Application insights application insights use application maps to build request link views
Big data processing black Technology: revealing the parallel computing technology of Pb level data warehouse gaussdb (DWS)
win7 APPCRASH(解决方法)(转)
Stm32f030k6t6 compatible replacement smart mm32f031k6t6
2020-08-19: what mechanism does TCP ensure reliability?
Method of code refactoring -- Analysis of method refactoring
磁存储芯片STT-MRAM的特点
C language I blog assignment 03