slightly improved version, merged with the new "source" function
:::python
for claim in self.claims:
if claim.getID() in item.get().get('claims'):
for existingclaimwithproperty in item.claims[claim]:
if existingclaimwithproperty.getTarget() == claim.getTarget():
pywikibot.output("item for %s has already property %s with value %s" % (page.title(), claim, existingclaimwithproperty.getTarget()))
break
else:
continue
else:
pywikibot.output('Adding additional %s --> %s' % (claim.getID(), claim.getTarget()))
item.addClaim(claim)
source = self.getSource(page.site.language())
if self.source:
claim.addSource(self.source, bot=True)
# TODO FIXME: We need to check that we aren't adding a
# duplicate source
else:
pywikibot.output('Adding %s --> %s'
% (claim.getID(), claim.getTarget()))
item.addClaim(claim)
source = self.getSource(page.site.language())
if self.source:
claim.addSource(self.source, bot=True)
# TODO FIXME: We need to check that we aren't adding a
# duplicate source
---
** [feature-requests:#349] claimit.py: enable claim with the same property, but different value**
**Status:** open
**Labels:** claimit.py wikidata enhancement python pywikibot
**Created:** Sun Sep 15, 2013 04:15 PM UTC by APAC
**Last Updated:** Sun Sep 15, 2013 04:15 PM UTC
**Owner:** nobody
The below can be added to claimit.py to enable adding statements on items with the same property, but different values.
https://github.com/wikimedia/pywikibot-core/blob/master/scripts/claimit.py
:::python
for claim in self.claims:
if claim.getID() in item.get().get('claims'):
propertytoadd = claim.getID()
for valueofproperty in item.claims[propertytoadd]:
if valueofproperty.getTarget() == claim.getTarget():
pywikibot.output("item for %s has already property %s with value %s" % (page.title(), propertytoadd, valueofproperty.getTarget()))
break
else:
continue
else:
pywikibot.output('Adding additional %s --> %s' % (claim.getID(), claim.getTarget()))
item.addClaim(claim)
else:
pywikibot.output('Adding %s --> %s'
% (claim.getID(), claim.getTarget()))
item.addClaim(claim)
---
Sent from sourceforge.net because Pywikipedia-bugs(a)lists.wikimedia.org is subscribed to https://sourceforge.net/p/pywikipediabot/feature-requests/
To unsubscribe from further messages, a project admin can change settings at https://sourceforge.net/p/pywikipediabot/admin/feature-requests/options. Or, if this is a mailing list, you can unsubscribe from the mailing list.
Bug fixed, see https://gerrit.wikimedia.org/r/#/c/81219/
fix merged:
commit 4e516b587258f08f9947d4a11b2e67fcc1b5d3ea
Date: Tue Aug 27 15:11:43 2013 +0200
Can be closed.
---
** [bugs:#1645] Multi-claim source not parsed correctly**
**Status:** open
**Created:** Tue Jul 23, 2013 04:06 PM UTC by Felix Reimann
**Last Updated:** Tue Jul 23, 2013 04:10 PM UTC
**Owner:** nobody
>From a source with multiple claims, only the first claim is collected by page.py. All other claims of the source are not accessible per claim.sources.
Example:
~~~~~~
:::python
site = pywikibot.getSite('en', 'wikipedia')
repo = site.data_repository()
item = pywikibot.ItemPage(repo, "Q138028")
dictionary = data.get()
print subclaims[0].sources
~~~~~~
results in:
**[Claim(Property:P143), Claim(Property:P248)]**
P577 and P585 from the second source of http://www.wikidata.org/wiki/Q138028 P225 are missing.
With the attached patch the same code results in
**[[Claim(Property:P143)], [Claim(Property:P248), Claim(Property:P577), Claim(Property:P585)]]**
However, backward compatibility is not given, as the data type of Claim.sources is changed from list of Claims to list of list of Claims. This corresponds to the Wikidata layout allowing more than one claim per source.
GIT revision: 96e7c88e2ff03f88b320cc65b729776b80ea5624
---
Sent from sourceforge.net because Pywikipedia-bugs(a)lists.wikimedia.org is subscribed to https://sourceforge.net/p/pywikipediabot/bugs/
To unsubscribe from further messages, a project admin can change settings at https://sourceforge.net/p/pywikipediabot/admin/bugs/options. Or, if this is a mailing list, you can unsubscribe from the mailing list.
- **Group**: --> Next Release (example)
- **Priority**: 5 --> 3
---
** [feature-requests:#214] Reject all**
**Status:** open
**Labels:** interwiki
**Created:** Wed Jul 22, 2009 10:02 AM UTC by JAn
**Last Updated:** Wed Jul 22, 2009 10:02 AM UTC
**Owner:** nobody
When bot asks:
What shoul be done? \(\[A\]ccept, \[r\]eject, \[g\]ive up, accept al\[l\]\)
there might be one or two more possibilities:
\* reje\[c\]t all
\* \[m\]erge
In small wikis \(and in big too\) is sometimes situation when two or more articles are about the same thing, eg na:Fiji and na:Bidji
in these cases would be the best solution merging \(bot include \{\{merge|second article\}\} template
second \(easier\) possible is removing links from one of them
---
Sent from sourceforge.net because Pywikipedia-bugs(a)lists.wikimedia.org is subscribed to https://sourceforge.net/p/pywikipediabot/feature-requests/
To unsubscribe from further messages, a project admin can change settings at https://sourceforge.net/p/pywikipediabot/admin/feature-requests/options. Or, if this is a mailing list, you can unsubscribe from the mailing list.
we have a new logging behaviour
---
** [feature-requests:#175] WARNING messages in a separate log file**
**Status:** closed-fixed
**Labels:** interwiki
**Created:** Fri Jan 30, 2009 05:01 PM UTC by Anonymous
**Last Updated:** Fri Jan 30, 2009 05:01 PM UTC
**Owner:** nobody
May we have interwiki WARNING messages placed in a separate file, e.g. 'warnings.log' into 'log' subfolder? and maybe adapt -log/-nolog options accordingly. And maybe have different logging levels: no log, only warnings \(warnings.log\), only notes \(notes.log\), full log \(interwiki.log\)?
This will help identify obsolete namespaces in family files, for example.
---
Sent from sourceforge.net because Pywikipedia-bugs(a)lists.wikimedia.org is subscribed to https://sourceforge.net/p/pywikipediabot/feature-requests/
To unsubscribe from further messages, a project admin can change settings at https://sourceforge.net/p/pywikipediabot/admin/feature-requests/options. Or, if this is a mailing list, you can unsubscribe from the mailing list.
- **status**: open --> closed-fixed
- **Group**: --> Next Release (example)
---
** [feature-requests:#175] WARNING messages in a separate log file**
**Status:** closed-fixed
**Labels:** interwiki
**Created:** Fri Jan 30, 2009 05:01 PM UTC by Anonymous
**Last Updated:** Fri Jan 30, 2009 05:01 PM UTC
**Owner:** nobody
May we have interwiki WARNING messages placed in a separate file, e.g. 'warnings.log' into 'log' subfolder? and maybe adapt -log/-nolog options accordingly. And maybe have different logging levels: no log, only warnings \(warnings.log\), only notes \(notes.log\), full log \(interwiki.log\)?
This will help identify obsolete namespaces in family files, for example.
---
Sent from sourceforge.net because Pywikipedia-bugs(a)lists.wikimedia.org is subscribed to https://sourceforge.net/p/pywikipediabot/feature-requests/
To unsubscribe from further messages, a project admin can change settings at https://sourceforge.net/p/pywikipediabot/admin/feature-requests/options. Or, if this is a mailing list, you can unsubscribe from the mailing list.
already done long time ago
---
** [feature-requests:#156] truncate log files**
**Status:** closed-fixed
**Labels:** interwiki
**Created:** Wed Aug 13, 2008 01:40 PM UTC by Anonymous
**Last Updated:** Wed Aug 13, 2008 01:40 PM UTC
**Owner:** xqt
it would be helpful if a bot \(namely, interwiki.py\) can be configured to truncate the log file to a certain size. is it possible to implement this feature? thanks.
---
Sent from sourceforge.net because Pywikipedia-bugs(a)lists.wikimedia.org is subscribed to https://sourceforge.net/p/pywikipediabot/feature-requests/
To unsubscribe from further messages, a project admin can change settings at https://sourceforge.net/p/pywikipediabot/admin/feature-requests/options. Or, if this is a mailing list, you can unsubscribe from the mailing list.
- **status**: open --> closed-fixed
- **assigned_to**: xqt
- **Group**: --> Next Release (example)
---
** [feature-requests:#156] truncate log files**
**Status:** closed-fixed
**Labels:** interwiki
**Created:** Wed Aug 13, 2008 01:40 PM UTC by Anonymous
**Last Updated:** Wed Aug 13, 2008 01:40 PM UTC
**Owner:** xqt
it would be helpful if a bot \(namely, interwiki.py\) can be configured to truncate the log file to a certain size. is it possible to implement this feature? thanks.
---
Sent from sourceforge.net because Pywikipedia-bugs(a)lists.wikimedia.org is subscribed to https://sourceforge.net/p/pywikipediabot/feature-requests/
To unsubscribe from further messages, a project admin can change settings at https://sourceforge.net/p/pywikipediabot/admin/feature-requests/options. Or, if this is a mailing list, you can unsubscribe from the mailing list.
- **status**: open --> closed-rejected
- **Group**: --> Unstable (example)
---
** [patches:#454] cosmetic_changes.py to remove bad wikilinks**
**Status:** closed-rejected
**Created:** Thu Jun 17, 2010 09:38 AM UTC by BalaSundaraRaman L
**Last Updated:** Thu Jun 17, 2010 09:38 AM UTC
**Owner:** nobody
Translated articles created using http://translate.google.com/toolkit?hl=en suffer from one complex issue. It creates links to impossible pages in the target wiki. Let's take the example below:
\( Excerpt from http://en.wikipedia.org/wiki/Corporate\_governance \)
A related but separate thread of discussions focuses on the impact of a corporate governance system in \[\[economic efficiency\]\], with a strong emphasis on shareholders' welfare.
This when translated to Tamil, for example, will have a single word for "in economic efficiency" and the tool wrongly links to that phrase. Since article title can't be of the form "in economic efficiency", it'll remain a red link forever. Since articles are littered with such red links, it's hard to read.
In view of the large-scale http://wikimania2010.wikimedia.org/wiki/Submissions/Google\_translation project and the problems we faced \( http://wikimania2010.wikimedia.org/wiki/Submissions/A\_Review\_of\_Google\_… \), I've developed a patch for cosmetic\_changes.py which'll remove red links of the form \[\[some phrase\]\] leaving out cases where the label is different from the target. I've attached the patch as well. The changes by my bot running the modified code is at http://ta.wikipedia.org/wiki/Special:Contributions/SundarBot
If approved, I can give it to a dedicated bot operator with the translation team.
---
Sent from sourceforge.net because Pywikipedia-bugs(a)lists.wikimedia.org is subscribed to https://sourceforge.net/p/pywikipediabot/patches/
To unsubscribe from further messages, a project admin can change settings at https://sourceforge.net/p/pywikipediabot/admin/patches/options. Or, if this is a mailing list, you can unsubscribe from the mailing list.
- **Group**: --> v1.0 (example)
---
** [support-requests:#37] When it will start work archivebot.py and weblinkchecker.py?**
**Status:** open
**Created:** Fri Jan 25, 2013 12:13 PM UTC by Анима
**Last Updated:** Fri Jan 25, 2013 12:13 PM UTC
**Owner:** nobody
1\) archivebot.py
I put in the parameters
|algo = old\(1d\)
Several days have passed, but still appears
Processing 10 threads
There are only 0 Threads. Skipped
When it will be back up?
2\) weblinkchecker.py
I set the parameter-day:1 several days have Passed, but the bot is doing nothing.
And the errors are gone. I think that the problem is not only in my family file, because the same error occurs when I run the bot in Russian Wikipedia.
http://pastebin.com/x1zQipmU
Thanks.
---
Sent from sourceforge.net because pywikipedia-bugs(a)lists.wikimedia.org is subscribed to https://sourceforge.net/p/pywikipediabot/support-requests/
To unsubscribe from further messages, a project admin can change settings at https://sourceforge.net/p/pywikipediabot/admin/support-requests/options. Or, if this is a mailing list, you can unsubscribe from the mailing list.
- **status**: pending-fixed --> closed-fixed
---
** [bugs:#1647] Unicode error with existing page title**
**Status:** closed-fixed
**Created:** Sun Jul 28, 2013 07:54 AM UTC by Adrián Chaves Fernández
**Last Updated:** Thu Aug 15, 2013 03:17 PM UTC
**Owner:** nobody
I have written the following script:
# -*- coding: utf-8 -*-
import pywikibot
site = pywikibot.Site("gl", "wiktionary")
page = pywikibot.Page(site, u"𐌰𐌽𐌳𐌰𐌿𐍂𐌰")
print page.get()
It fails with the following output:
[gallaecio@afonso fontes]$ python2 test.py
Traceback (most recent call last):
File "test.py", line 7, in <module>
print page.get()
File "/usr/lib/python2.7/site-packages/pywikibot/__init__.py", line 249, in wrapper
return method(*__args, **__kw)
File "/usr/lib/python2.7/site-packages/pywikibot/__init__.py", line 249, in wrapper
return method(*__args, **__kw)
File "/usr/lib/python2.7/site-packages/pywikibot/page.py", line 278, in get
self._getInternals(sysop)
File "/usr/lib/python2.7/site-packages/pywikibot/page.py", line 302, in _getInternals
self.site.loadrevisions(self, getText=True, sysop=sysop)
File "/usr/lib/python2.7/site-packages/pywikibot/page.py", line 96, in site
return self._link.site
File "/usr/lib/python2.7/site-packages/pywikibot/page.py", line 3080, in site
self.parse()
File "/usr/lib/python2.7/site-packages/pywikibot/page.py", line 3037, in parse
u"contains illegal char(s) '%s'" % m.group(0))
pywikibot.exceptions.InvalidTitle: contains illegal char(s) '𐌰'
I’m using the **rewrite** branch, built today (2013-07-28).
---
Sent from sourceforge.net because Pywikipedia-bugs(a)lists.wikimedia.org is subscribed to https://sourceforge.net/p/pywikipediabot/bugs/
To unsubscribe from further messages, a project admin can change settings at https://sourceforge.net/p/pywikipediabot/admin/bugs/options. Or, if this is a mailing list, you can unsubscribe from the mailing list.