Sha256: 1e7567da14da52e58be967bb5edd88c4a5d6d7874e5821152d78afa42d3f97c0
Contents?: true
Size: 1.23 KB
Versions: 12
Compression:
Stored size: 1.23 KB
Contents
#!/usr/bin/python # Copyright (c) 2013-2016 SUSE LLC # # This program is free software; you can redistribute it and/or # modify it under the terms of version 3 of the GNU General Public License as # published by the Free Software Foundation. # # This program is distributed in the hope that it will be useful, # but WITHOUT ANY WARRANTY; without even the implied warranty of # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the # GNU General Public License for more details. # # You should have received a copy of the GNU General Public License # along with this program; if not, contact SUSE LLC. # # To contact SUSE about this file by physical or electronic mail, # you may find current contact information at www.suse.com import yum try: import json except: import simplejson as json yb = yum.YumBase() repositories = [] for repo in yb.repos.sort(): repo_dict = dict() repo_dict["alias"] = repo.id repo_dict["name"] = repo.name repo_dict["type"] = "rpm-md" repo_dict["url"] = repo.baseurl or [] repo_dict["mirrorlist"] = repo.mirrorlist or "" repo_dict["enabled"] = repo.enabled repo_dict["gpgcheck"] = repo.gpgcheck repo_dict["gpgkey"] = repo.gpgkey repositories.append(repo_dict) print(json.dumps(repositories))
Version data entries
12 entries across 12 versions & 1 rubygems