在VCS中搜索文件

Repo-Scout的Python项目详细描述


Repo scoutrepo scout在VCS中搜索文件


用法

在脚本中

>>>fromservice.repo_scoutimportRepoScout>>>scout=RepoScout('GitHub')>>>scout.find('Parcks','plugins','Laravel.ppl')u'https://raw.githubusercontent.com/Parcks/plugins/master/debian/Laravel.ppl'

从cli

参数

-h, --help           show this help message and exit
-p, --provider PROV  The name of the VCS provider (Default: GitHub)
-o, --owner OWNER    The name of the owner of the repository
-n, --name NAME      The name of the repository to search in
-m, --method METHOD  Indicates if the file should be searched in a directory
                     or just retrieve the first occurrence (Default: First)
-f, --file FILE      The name of the file to find
-d, --directory DIR  The path in the repository where the file should be
                     searched

示例

查找第一个匹配项
jvalck@Setarit-DTP:~/repo_scout$ python main.py -o Parcks -n plugins -f Laravel.ppl
https://raw.githubusercontent.com/Parcks/plugins/master/debian/Laravel.ppl
在目录中查找
  • 示例1:一级深度

    jvalck@Setarit-DTP:~/repo_scout$ rscout -o Parcks -n plugins -f Laravel.ppl -m InDirectory -d debian
    https://raw.githubusercontent.com/Parcks/plugins/master/debian/Laravel.ppl
    
  • 示例2:两层深度

    jvalck@Setarit-DTP:~/repo_scout$ rscout -o Parcks -n core -f user_input.py -m InDirectory -d src/cli
    https://raw.githubusercontent.com/Parcks/core/master/src/cli/user_input.py
    

欢迎加入QQ群-->: 979659372 Python中文网_新手群

推荐PyPI第三方库


热门话题
为@Nonnull注释参数编写java单元测试   对于JAVA,如何从它自己的类调用插入排序来将数组分类到一个单独的类中?   Java中嵌套SQL查询的字符串解析   java在所有带有特定注释的方法上调用带注释的方面   在Java中将base64转换为PDF   无法在Android上强制转换java getApplicationContext()   雅加达ee Java ee:如何获取我的应用程序的URL?   IntelliJ:如何导入的文件夹。java文件作为库?   多线程Java(FX)在播放一种声音的同时,播放另一种声音   网络爬虫我需要将proto3版本中protobuf生成的java代码添加到nutch 1.7中   使用JAXRS注释资源的java Restlet客户端   java如何查找给定月份的日期范围   java Minecraft Bukkit插件:我的小游戏传送机不工作   Java Excel搜索和数组列表工作不正常