[MediaWiki-commits] [Gerrit] Fetch list of extensions from API list=extdistrepos - change (labs...extdist)

2014-10-27 Thread Legoktm (Code Review)
Legoktm has submitted this change and it was merged.

Change subject: Fetch list of extensions from API list=extdistrepos
..


Fetch list of extensions from API list=extdistrepos

Change-Id: I41a993d80d23acf8cd45dc69f81c2f1325b47735
---
M nightly.py
1 file changed, 8 insertions(+), 9 deletions(-)

Approvals:
  Legoktm: Looks good to me, approved
  jenkins-bot: Verified



diff --git a/nightly.py b/nightly.py
index 313a405..ec0a6a6 100644
--- a/nightly.py
+++ b/nightly.py
@@ -93,10 +93,15 @@
 should not be called directly
 """
 logging.debug('Fetching list of all extensions...')
-req = urllib.urlopen(get_extension_list())
-text = req.read()
+data = {
+'action': 'query',
+'list': 'extdistrepos',
+'format': 'json'
+}
+req = urllib.urlopen(conf.API_URL, urllib.urlencode(data))
+j = json.loads(req.read())
 req.close()
-return text
+return '\n'.join(j['query']['extdistrepos']['extensions'])
 
 
 def get_all_extensions(update=False):
@@ -121,12 +126,6 @@
 if conf.get('SUPPORTED_VERSIONS') is None:
 conf.SUPPORTED_VERSIONS = get_extension_config()['versions']
 return conf.SUPPORTED_VERSIONS
-
-
-def get_extension_list():
-if conf.get('EXT_LIST') is None:
-conf.EXT_LIST = get_extension_config()['extension-list']
-return conf.EXT_LIST
 
 
 def fetch_extension_config():

-- 
To view, visit https://gerrit.wikimedia.org/r/168819
To unsubscribe, visit https://gerrit.wikimedia.org/r/settings

Gerrit-MessageType: merged
Gerrit-Change-Id: I41a993d80d23acf8cd45dc69f81c2f1325b47735
Gerrit-PatchSet: 1
Gerrit-Project: labs/tools/extdist
Gerrit-Branch: master
Gerrit-Owner: Legoktm 
Gerrit-Reviewer: Legoktm 
Gerrit-Reviewer: jenkins-bot <>

___
MediaWiki-commits mailing list
MediaWiki-commits@lists.wikimedia.org
https://lists.wikimedia.org/mailman/listinfo/mediawiki-commits


[MediaWiki-commits] [Gerrit] Fetch list of extensions from API list=extdistrepos - change (labs...extdist)

2014-10-26 Thread Legoktm (Code Review)
Legoktm has uploaded a new change for review.

  https://gerrit.wikimedia.org/r/168819

Change subject: Fetch list of extensions from API list=extdistrepos
..

Fetch list of extensions from API list=extdistrepos

Change-Id: I41a993d80d23acf8cd45dc69f81c2f1325b47735
---
M nightly.py
1 file changed, 8 insertions(+), 9 deletions(-)


  git pull ssh://gerrit.wikimedia.org:29418/labs/tools/extdist 
refs/changes/19/168819/1

diff --git a/nightly.py b/nightly.py
index 313a405..ec0a6a6 100644
--- a/nightly.py
+++ b/nightly.py
@@ -93,10 +93,15 @@
 should not be called directly
 """
 logging.debug('Fetching list of all extensions...')
-req = urllib.urlopen(get_extension_list())
-text = req.read()
+data = {
+'action': 'query',
+'list': 'extdistrepos',
+'format': 'json'
+}
+req = urllib.urlopen(conf.API_URL, urllib.urlencode(data))
+j = json.loads(req.read())
 req.close()
-return text
+return '\n'.join(j['query']['extdistrepos']['extensions'])
 
 
 def get_all_extensions(update=False):
@@ -121,12 +126,6 @@
 if conf.get('SUPPORTED_VERSIONS') is None:
 conf.SUPPORTED_VERSIONS = get_extension_config()['versions']
 return conf.SUPPORTED_VERSIONS
-
-
-def get_extension_list():
-if conf.get('EXT_LIST') is None:
-conf.EXT_LIST = get_extension_config()['extension-list']
-return conf.EXT_LIST
 
 
 def fetch_extension_config():

-- 
To view, visit https://gerrit.wikimedia.org/r/168819
To unsubscribe, visit https://gerrit.wikimedia.org/r/settings

Gerrit-MessageType: newchange
Gerrit-Change-Id: I41a993d80d23acf8cd45dc69f81c2f1325b47735
Gerrit-PatchSet: 1
Gerrit-Project: labs/tools/extdist
Gerrit-Branch: master
Gerrit-Owner: Legoktm 

___
MediaWiki-commits mailing list
MediaWiki-commits@lists.wikimedia.org
https://lists.wikimedia.org/mailman/listinfo/mediawiki-commits