[gimp-web] WIP Python script for mirror url parsing
- From: Pat David <patdavid src gnome org>
- To: commits-list gnome org
- Cc:
- Subject: [gimp-web] WIP Python script for mirror url parsing
- Date: Mon, 22 May 2017 20:33:50 +0000 (UTC)
commit 28b32e127e3ff2531af0d7f21a9bd09843d4f492
Author: Michael Schumacher <schumaml gmx de>
Date: Sun May 14 19:17:27 2017 +0200
WIP Python script for mirror url parsing
Future goals are mirror pinging, check for HTTPS support, file verification
tools/downloads/mirrors-extract-urls.py | 17 +++++++++++++++++
1 files changed, 17 insertions(+), 0 deletions(-)
---
diff --git a/tools/downloads/mirrors-extract-urls.py b/tools/downloads/mirrors-extract-urls.py
new file mode 100755
index 0000000..5ffd2b9
--- /dev/null
+++ b/tools/downloads/mirrors-extract-urls.py
@@ -0,0 +1,17 @@
+#!/usr/bin/env python
+# -*- coding: utf-8 -*- #
+
+import json
+import urllib
+import urlparse
+from collections import OrderedDict
+
+with open('../../content/downloads/mirrors2.json') as data:
+ MIRRORS = json.load(data, object_pairs_hook=OrderedDict)
+
+ for mirror, urls in MIRRORS.iteritems() :
+ for url in urls:
+ u = urlparse.urlparse(url)
+ print u.scheme + '\t: ' + u.hostname
+
+
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]