[MediaWiki-commits] [Gerrit] Correctly identify qualifier from JSON - change (pywikibot/core)

2015-10-02 Thread jenkins-bot (Code Review)
jenkins-bot has submitted this change and it was merged.

Change subject: Correctly identify qualifier from JSON
..


Correctly identify qualifier from JSON

Identifies any qualifier or reference if initialised through fromJSON()
on parent claim

Bug: T113212
Change-Id: I7255cf50b21bac19f44f152ddd4a189825dd7eab
(cherry picked from commit eb9d3a80b84c237740152b7ffd1957aacea6fb26)
---
M pywikibot/page.py
1 file changed, 6 insertions(+), 6 deletions(-)

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



diff --git a/pywikibot/page.py b/pywikibot/page.py
index 3f4f1be..33bbace 100644
--- a/pywikibot/page.py
+++ b/pywikibot/page.py
@@ -3918,7 +3918,7 @@
 """
 A Claim on a Wikibase entity.
 
-Claims are standard claims as well as references.
+Claims are standard claims as well as references and qualifiers.
 """
 
 TARGET_CONVERTER = {
@@ -3975,10 +3975,7 @@
 if 'id' in data:
 claim.snak = data['id']
 elif 'hash' in data:
-claim.isReference = True
 claim.hash = data['hash']
-else:
-claim.isQualifier = True
 claim.snaktype = data['mainsnak']['snaktype']
 if claim.getSnakType() == 'value':
 value = data['mainsnak']['datavalue']['value']
@@ -4020,6 +4017,7 @@
 for claimsnak in data['snaks'][prop]:
 claim = cls.fromJSON(site, {'mainsnak': claimsnak,
 'hash': data['hash']})
+claim.isReference = True
 if claim.getID() not in source:
 source[claim.getID()] = []
 source[claim.getID()].append(claim)
@@ -4036,8 +4034,10 @@
 
 @return: Claim
 """
-return cls.fromJSON(site, {'mainsnak': data,
-   'hash': data['hash']})
+claim = cls.fromJSON(site, {'mainsnak': data,
+'hash': data['hash']})
+claim.isQualifier = True
+return claim
 
 def toJSON(self):
 data = {

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

Gerrit-MessageType: merged
Gerrit-Change-Id: I7255cf50b21bac19f44f152ddd4a189825dd7eab
Gerrit-PatchSet: 1
Gerrit-Project: pywikibot/core
Gerrit-Branch: 2.0
Gerrit-Owner: John Vandenberg 
Gerrit-Reviewer: John Vandenberg 
Gerrit-Reviewer: Ladsgroup 
Gerrit-Reviewer: Lokal Profil 
Gerrit-Reviewer: jenkins-bot <>

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


[MediaWiki-commits] [Gerrit] Correctly identify qualifier from JSON - change (pywikibot/core)

2015-10-01 Thread John Vandenberg (Code Review)
John Vandenberg has uploaded a new change for review.

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

Change subject: Correctly identify qualifier from JSON
..

Correctly identify qualifier from JSON

Identifies any qualifier or reference if initialised through fromJSON()
on parent claim

Bug: T113212
Change-Id: I7255cf50b21bac19f44f152ddd4a189825dd7eab
(cherry picked from commit eb9d3a80b84c237740152b7ffd1957aacea6fb26)
---
M pywikibot/page.py
1 file changed, 6 insertions(+), 6 deletions(-)


  git pull ssh://gerrit.wikimedia.org:29418/pywikibot/core 
refs/changes/43/243043/1

diff --git a/pywikibot/page.py b/pywikibot/page.py
index 3f4f1be..33bbace 100644
--- a/pywikibot/page.py
+++ b/pywikibot/page.py
@@ -3918,7 +3918,7 @@
 """
 A Claim on a Wikibase entity.
 
-Claims are standard claims as well as references.
+Claims are standard claims as well as references and qualifiers.
 """
 
 TARGET_CONVERTER = {
@@ -3975,10 +3975,7 @@
 if 'id' in data:
 claim.snak = data['id']
 elif 'hash' in data:
-claim.isReference = True
 claim.hash = data['hash']
-else:
-claim.isQualifier = True
 claim.snaktype = data['mainsnak']['snaktype']
 if claim.getSnakType() == 'value':
 value = data['mainsnak']['datavalue']['value']
@@ -4020,6 +4017,7 @@
 for claimsnak in data['snaks'][prop]:
 claim = cls.fromJSON(site, {'mainsnak': claimsnak,
 'hash': data['hash']})
+claim.isReference = True
 if claim.getID() not in source:
 source[claim.getID()] = []
 source[claim.getID()].append(claim)
@@ -4036,8 +4034,10 @@
 
 @return: Claim
 """
-return cls.fromJSON(site, {'mainsnak': data,
-   'hash': data['hash']})
+claim = cls.fromJSON(site, {'mainsnak': data,
+'hash': data['hash']})
+claim.isQualifier = True
+return claim
 
 def toJSON(self):
 data = {

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

Gerrit-MessageType: newchange
Gerrit-Change-Id: I7255cf50b21bac19f44f152ddd4a189825dd7eab
Gerrit-PatchSet: 1
Gerrit-Project: pywikibot/core
Gerrit-Branch: 2.0
Gerrit-Owner: John Vandenberg 
Gerrit-Reviewer: Lokal Profil 

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


[MediaWiki-commits] [Gerrit] Correctly identify qualifier from JSON - change (pywikibot/core)

2015-09-21 Thread Lokal Profil (Code Review)
Lokal Profil has uploaded a new change for review.

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

Change subject: Correctly identify qualifier from JSON
..

Correctly identify qualifier from JSON

Identifies any qualifier or reference if initialised through fromJSON()
on parent claim

Bug: T113212
Change-Id: I7255cf50b21bac19f44f152ddd4a189825dd7eab
---
M pywikibot/page.py
1 file changed, 6 insertions(+), 6 deletions(-)


  git pull ssh://gerrit.wikimedia.org:29418/pywikibot/core 
refs/changes/80/239780/1

diff --git a/pywikibot/page.py b/pywikibot/page.py
index 97c881c..a6069c1 100644
--- a/pywikibot/page.py
+++ b/pywikibot/page.py
@@ -4055,7 +4055,7 @@
 """
 A Claim on a Wikibase entity.
 
-Claims are standard claims as well as references.
+Claims are standard claims as well as references and qualifiers.
 """
 
 TARGET_CONVERTER = {
@@ -4114,10 +4114,7 @@
 if 'id' in data:
 claim.snak = data['id']
 elif 'hash' in data:
-claim.isReference = True
 claim.hash = data['hash']
-else:
-claim.isQualifier = True
 claim.snaktype = data['mainsnak']['snaktype']
 if claim.getSnakType() == 'value':
 value = data['mainsnak']['datavalue']['value']
@@ -4159,6 +4156,7 @@
 for claimsnak in data['snaks'][prop]:
 claim = cls.fromJSON(site, {'mainsnak': claimsnak,
 'hash': data['hash']})
+claim.isReference = True
 if claim.getID() not in source:
 source[claim.getID()] = []
 source[claim.getID()].append(claim)
@@ -4175,8 +4173,10 @@
 
 @return: Claim
 """
-return cls.fromJSON(site, {'mainsnak': data,
-   'hash': data['hash']})
+claim = cls.fromJSON(site, {'mainsnak': data,
+'hash': data['hash']})
+claim.isQualifier = True
+return claim
 
 def toJSON(self):
 """

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

Gerrit-MessageType: newchange
Gerrit-Change-Id: I7255cf50b21bac19f44f152ddd4a189825dd7eab
Gerrit-PatchSet: 1
Gerrit-Project: pywikibot/core
Gerrit-Branch: master
Gerrit-Owner: Lokal Profil 

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


[MediaWiki-commits] [Gerrit] Correctly identify qualifier from JSON - change (pywikibot/core)

2015-09-21 Thread jenkins-bot (Code Review)
jenkins-bot has submitted this change and it was merged.

Change subject: Correctly identify qualifier from JSON
..


Correctly identify qualifier from JSON

Identifies any qualifier or reference if initialised through fromJSON()
on parent claim

Bug: T113212
Change-Id: I7255cf50b21bac19f44f152ddd4a189825dd7eab
---
M pywikibot/page.py
1 file changed, 6 insertions(+), 6 deletions(-)

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



diff --git a/pywikibot/page.py b/pywikibot/page.py
index 97c881c..a6069c1 100644
--- a/pywikibot/page.py
+++ b/pywikibot/page.py
@@ -4055,7 +4055,7 @@
 """
 A Claim on a Wikibase entity.
 
-Claims are standard claims as well as references.
+Claims are standard claims as well as references and qualifiers.
 """
 
 TARGET_CONVERTER = {
@@ -4114,10 +4114,7 @@
 if 'id' in data:
 claim.snak = data['id']
 elif 'hash' in data:
-claim.isReference = True
 claim.hash = data['hash']
-else:
-claim.isQualifier = True
 claim.snaktype = data['mainsnak']['snaktype']
 if claim.getSnakType() == 'value':
 value = data['mainsnak']['datavalue']['value']
@@ -4159,6 +4156,7 @@
 for claimsnak in data['snaks'][prop]:
 claim = cls.fromJSON(site, {'mainsnak': claimsnak,
 'hash': data['hash']})
+claim.isReference = True
 if claim.getID() not in source:
 source[claim.getID()] = []
 source[claim.getID()].append(claim)
@@ -4175,8 +4173,10 @@
 
 @return: Claim
 """
-return cls.fromJSON(site, {'mainsnak': data,
-   'hash': data['hash']})
+claim = cls.fromJSON(site, {'mainsnak': data,
+'hash': data['hash']})
+claim.isQualifier = True
+return claim
 
 def toJSON(self):
 """

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

Gerrit-MessageType: merged
Gerrit-Change-Id: I7255cf50b21bac19f44f152ddd4a189825dd7eab
Gerrit-PatchSet: 1
Gerrit-Project: pywikibot/core
Gerrit-Branch: master
Gerrit-Owner: Lokal Profil 
Gerrit-Reviewer: John Vandenberg 
Gerrit-Reviewer: Ladsgroup 
Gerrit-Reviewer: Lokal Profil 
Gerrit-Reviewer: jenkins-bot <>

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