예제 #1
0
def show_sources(kind):
    path = "{}/{}/".format(MesosConfig.source_dir(), kind)
    for name in os.listdir(path):
        full_path  = os.path.join(path, name)
        git_config = "{}/.git/config".format(full_path)
        if os.path.isfile(git_config):
            file = open(git_config, 'r')
            data = Utils.parse_git_config( file.readlines() )
            file.close()
            if 'remote "origin"' in data:
                if 'url' in data['remote "origin"']:
                    print "{} in directory {}".format(
                        data['remote "origin"']['url'],
                        full_path )