Bugs item #3605830, was opened at 2013-02-24 11:21
Message generated for change (Comment added) made by nobody
You can respond by visiting:
https://sourceforge.net/tracker/?func=detail&atid=603138&aid=3605830&group_…
Please note that this message will contain a full copy of the comment thread,
including the initial issue submission, for this request,
not just the latest update.
Category: None
Group: None
Status: Open
Resolution: None
Priority: 5
Private: No
Submitted By: reza (reza1615)
Assigned to: Nobody/Anonymous (nobody)
Summary: setitem for wikidata doesn't work!
Initial Comment:
I used this code
#!/usr/bin/python
# -*- coding: utf-8 -*-
import wikipedia,login
summary=u'آبشار لاتون,آبشار لاتون'
site=wikipedia.getSite('fa',fam='wikipedia')
fapage=wikipedia.Page(site,u'آبشار_لاتون')
data=wikipedia.DataPage(fapage)
list=data.get()
id=list['entity'].replace('q','')
data = wikipedia.DataPage(site.data_repository(), "Q"+id)
data.setitem(summary,items={'type': u'item', 'label': 'glk', 'value':u'آبشار_لاتون'})
data.setitem(summary,items={'type': u'sitelink', 'site': 'glk', 'title':u'آبشار_لاتون_(بارزاو)'})
it shows
Updating page [[wikidata:Q5058182]] via API
Updating page [[wikidata:Q5058182]] via API
but it doesn't update the page!
also please add
def getIdFromPage(data)
id=data.get() ['entity'].replace('q','')
return id
and add
data = DataPage(site.data_repository(), "Q"+id)
to first line of setitem()
----------------------------------------------------------------------
Comment By: Nobody/Anonymous (nobody)
Date: 2013-02-26 05:05
Message:
The line is not useless. If the item doesn't exist you will have an error
instead of doing nothing
----------------------------------------------------------------------
Comment By: reza (reza1615)
Date: 2013-02-26 05:02
Message:
we can load or get data inside setitem()
it is not normal that we type a code that it's variable ( gett=data.get()
) doesn't need! (visually)
it is logic that users only type this code
site=wikipedia.getSite('fa',fam='wikipedia')
fapage=wikipedia.Page(site,u'آبشار_لاتون')
data=wikipedia.DataPage(fapage)
data.setitem(summary,items={'type': u'item', 'label':
'glk','value':u'آبشار_لاتون'})
Library should be let user to type minimal code.
----------------------------------------------------------------------
Comment By: Nobody/Anonymous (nobody)
Date: 2013-02-26 04:45
Message:
I tested it and it worked:
http://www.wikidata.org/w/index.php?title=Q5058182&diff=prev&oldid=7790985
We have showing problem. the code works well
I think xqt means if you run this way the showing problem will be solved.
something like this notice i just add one line:
#!/usr/bin/python
# -*- coding: utf-8 -*-
import wikipedia,login
summary=u'test bot'
site=wikipedia.getSite('fa',fam='wikipedia')
fapage=wikipedia.Page(site,u'آبشار_لاتون')
data=wikipedia.DataPage(fapage)
gett=data.get()
data.setitem(summary,items={'type': u'item', 'label': 'glk',
'value':u'آبشار_لاتون'})
data.setitem(summary,items={'type': u'sitelink', 'site': 'glk',
'title':u'آبشار_لاتون_(بارزاو)'})
----------------------------------------------------------------------
Comment By: reza (reza1615)
Date: 2013-02-26 04:32
Message:
please run this code and you will see the none title error !
#!/usr/bin/python
# -*- coding: utf-8 -*-
import wikipedia,login
summary=u'test bot'
site=wikipedia.getSite('fa',fam='wikipedia')
fapage=wikipedia.Page(site,u'آبشار_لاتون')
data=wikipedia.DataPage(fapage)
data.setitem(summary,items={'type': u'item', 'label': 'glk',
'value':u'آبشار_لاتون'})
data.setitem(summary,items={'type': u'sitelink', 'site': 'glk',
'title':u'آبشار_لاتون_(بارزاو)'})
----------------------------------------------------------------------
Comment By: xqt (xqt)
Date: 2013-02-25 23:38
Message:
This error looks like you haven't made a DataPage.get() before you tried to
update the page. In this cas the title is None as shown. If you recreate
the datapage with the entity id you make a explicit get call to retrieve
the items data. But this will be enough to get the data's id i.e. the
DataPage.title().
----------------------------------------------------------------------
Comment By: reza (reza1615)
Date: 2013-02-25 04:40
Message:
If I don't make in DataPage a second time it will show this error
Updating page [[wikidata:None]] via API
----------------------------------------------------------------------
Comment By: xqt (xqt)
Date: 2013-02-25 03:43
Message:
You don't need to create the DataPage a second time with the 'entity' item.
Look at this sample which shows that data == d but they are different
objects in this sample:
>>> import wikipedia as wp
>>> s = wp.getSite()
>>> p = wp.Page(s, 'Helium')
>>> d = wp.DataPage(p)
>>> i = d.get()
>>> t = i['entity'].title()
>>> data = wp.DataPage(s.data_repository(), t)
>>> data
DataPage{[[wikidata:Q560]]}
>>> d
DataPage{[[wikidata:Q560]]}
>>> d is data
False
>>> d == data
True
>>>
----------------------------------------------------------------------
Comment By: reza (reza1615)
Date: 2013-02-25 02:35
Message:
three :)
----------------------------------------------------------------------
Comment By: reza (reza1615)
Date: 2013-02-25 02:34
Message:
Thank you now it works.
please add these tree lines to setitem()
list=data.get()
id=list['entity'].replace('q','')
data = wikipedia.DataPage(site.data_repository(), "Q"+id)
now we should write these tree lines for every DataPage()
----------------------------------------------------------------------
Comment By: Amir (amird)
Date: 2013-02-24 21:58
Message:
fixed in r11114
http://www.wikidata.org/w/index.php?title=Q5058182&diff=prev&oldid=7673026http://www.wikidata.org/w/index.php?title=Q5058182&diff=prev&oldid=7673011
----------------------------------------------------------------------
You can respond by visiting:
https://sourceforge.net/tracker/?func=detail&atid=603138&aid=3605830&group_…
Bugs item #3605830, was opened at 2013-02-24 11:21
Message generated for change (Comment added) made by reza1615
You can respond by visiting:
https://sourceforge.net/tracker/?func=detail&atid=603138&aid=3605830&group_…
Please note that this message will contain a full copy of the comment thread,
including the initial issue submission, for this request,
not just the latest update.
Category: None
Group: None
Status: Open
Resolution: None
Priority: 5
Private: No
Submitted By: reza (reza1615)
Assigned to: Nobody/Anonymous (nobody)
Summary: setitem for wikidata doesn't work!
Initial Comment:
I used this code
#!/usr/bin/python
# -*- coding: utf-8 -*-
import wikipedia,login
summary=u'آبشار لاتون,آبشار لاتون'
site=wikipedia.getSite('fa',fam='wikipedia')
fapage=wikipedia.Page(site,u'آبشار_لاتون')
data=wikipedia.DataPage(fapage)
list=data.get()
id=list['entity'].replace('q','')
data = wikipedia.DataPage(site.data_repository(), "Q"+id)
data.setitem(summary,items={'type': u'item', 'label': 'glk', 'value':u'آبشار_لاتون'})
data.setitem(summary,items={'type': u'sitelink', 'site': 'glk', 'title':u'آبشار_لاتون_(بارزاو)'})
it shows
Updating page [[wikidata:Q5058182]] via API
Updating page [[wikidata:Q5058182]] via API
but it doesn't update the page!
also please add
def getIdFromPage(data)
id=data.get() ['entity'].replace('q','')
return id
and add
data = DataPage(site.data_repository(), "Q"+id)
to first line of setitem()
----------------------------------------------------------------------
Comment By: reza (reza1615)
Date: 2013-02-26 05:02
Message:
we can load or get data inside setitem()
it is not normal that we type a code that it's variable ( gett=data.get()
) doesn't need! (visually)
it is logic that users only type this code
site=wikipedia.getSite('fa',fam='wikipedia')
fapage=wikipedia.Page(site,u'آبشار_لاتون')
data=wikipedia.DataPage(fapage)
data.setitem(summary,items={'type': u'item', 'label':
'glk','value':u'آبشار_لاتون'})
Library should be let user to type minimal code.
----------------------------------------------------------------------
Comment By: Nobody/Anonymous (nobody)
Date: 2013-02-26 04:45
Message:
I tested it and it worked:
http://www.wikidata.org/w/index.php?title=Q5058182&diff=prev&oldid=7790985
We have showing problem. the code works well
I think xqt means if you run this way the showing problem will be solved.
something like this notice i just add one line:
#!/usr/bin/python
# -*- coding: utf-8 -*-
import wikipedia,login
summary=u'test bot'
site=wikipedia.getSite('fa',fam='wikipedia')
fapage=wikipedia.Page(site,u'آبشار_لاتون')
data=wikipedia.DataPage(fapage)
gett=data.get()
data.setitem(summary,items={'type': u'item', 'label': 'glk',
'value':u'آبشار_لاتون'})
data.setitem(summary,items={'type': u'sitelink', 'site': 'glk',
'title':u'آبشار_لاتون_(بارزاو)'})
----------------------------------------------------------------------
Comment By: reza (reza1615)
Date: 2013-02-26 04:32
Message:
please run this code and you will see the none title error !
#!/usr/bin/python
# -*- coding: utf-8 -*-
import wikipedia,login
summary=u'test bot'
site=wikipedia.getSite('fa',fam='wikipedia')
fapage=wikipedia.Page(site,u'آبشار_لاتون')
data=wikipedia.DataPage(fapage)
data.setitem(summary,items={'type': u'item', 'label': 'glk',
'value':u'آبشار_لاتون'})
data.setitem(summary,items={'type': u'sitelink', 'site': 'glk',
'title':u'آبشار_لاتون_(بارزاو)'})
----------------------------------------------------------------------
Comment By: xqt (xqt)
Date: 2013-02-25 23:38
Message:
This error looks like you haven't made a DataPage.get() before you tried to
update the page. In this cas the title is None as shown. If you recreate
the datapage with the entity id you make a explicit get call to retrieve
the items data. But this will be enough to get the data's id i.e. the
DataPage.title().
----------------------------------------------------------------------
Comment By: reza (reza1615)
Date: 2013-02-25 04:40
Message:
If I don't make in DataPage a second time it will show this error
Updating page [[wikidata:None]] via API
----------------------------------------------------------------------
Comment By: xqt (xqt)
Date: 2013-02-25 03:43
Message:
You don't need to create the DataPage a second time with the 'entity' item.
Look at this sample which shows that data == d but they are different
objects in this sample:
>>> import wikipedia as wp
>>> s = wp.getSite()
>>> p = wp.Page(s, 'Helium')
>>> d = wp.DataPage(p)
>>> i = d.get()
>>> t = i['entity'].title()
>>> data = wp.DataPage(s.data_repository(), t)
>>> data
DataPage{[[wikidata:Q560]]}
>>> d
DataPage{[[wikidata:Q560]]}
>>> d is data
False
>>> d == data
True
>>>
----------------------------------------------------------------------
Comment By: reza (reza1615)
Date: 2013-02-25 02:35
Message:
three :)
----------------------------------------------------------------------
Comment By: reza (reza1615)
Date: 2013-02-25 02:34
Message:
Thank you now it works.
please add these tree lines to setitem()
list=data.get()
id=list['entity'].replace('q','')
data = wikipedia.DataPage(site.data_repository(), "Q"+id)
now we should write these tree lines for every DataPage()
----------------------------------------------------------------------
Comment By: Amir (amird)
Date: 2013-02-24 21:58
Message:
fixed in r11114
http://www.wikidata.org/w/index.php?title=Q5058182&diff=prev&oldid=7673026http://www.wikidata.org/w/index.php?title=Q5058182&diff=prev&oldid=7673011
----------------------------------------------------------------------
You can respond by visiting:
https://sourceforge.net/tracker/?func=detail&atid=603138&aid=3605830&group_…
Bugs item #3605830, was opened at 2013-02-24 11:21
Message generated for change (Comment added) made by nobody
You can respond by visiting:
https://sourceforge.net/tracker/?func=detail&atid=603138&aid=3605830&group_…
Please note that this message will contain a full copy of the comment thread,
including the initial issue submission, for this request,
not just the latest update.
Category: None
Group: None
Status: Open
Resolution: None
Priority: 5
Private: No
Submitted By: reza (reza1615)
Assigned to: Nobody/Anonymous (nobody)
Summary: setitem for wikidata doesn't work!
Initial Comment:
I used this code
#!/usr/bin/python
# -*- coding: utf-8 -*-
import wikipedia,login
summary=u'آبشار لاتون,آبشار لاتون'
site=wikipedia.getSite('fa',fam='wikipedia')
fapage=wikipedia.Page(site,u'آبشار_لاتون')
data=wikipedia.DataPage(fapage)
list=data.get()
id=list['entity'].replace('q','')
data = wikipedia.DataPage(site.data_repository(), "Q"+id)
data.setitem(summary,items={'type': u'item', 'label': 'glk', 'value':u'آبشار_لاتون'})
data.setitem(summary,items={'type': u'sitelink', 'site': 'glk', 'title':u'آبشار_لاتون_(بارزاو)'})
it shows
Updating page [[wikidata:Q5058182]] via API
Updating page [[wikidata:Q5058182]] via API
but it doesn't update the page!
also please add
def getIdFromPage(data)
id=data.get() ['entity'].replace('q','')
return id
and add
data = DataPage(site.data_repository(), "Q"+id)
to first line of setitem()
----------------------------------------------------------------------
Comment By: Nobody/Anonymous (nobody)
Date: 2013-02-26 04:45
Message:
I tested it and it worked:
http://www.wikidata.org/w/index.php?title=Q5058182&diff=prev&oldid=7790985
We have showing problem. the code works well
I think xqt means if you run this way the showing problem will be solved.
something like this notice i just add one line:
#!/usr/bin/python
# -*- coding: utf-8 -*-
import wikipedia,login
summary=u'test bot'
site=wikipedia.getSite('fa',fam='wikipedia')
fapage=wikipedia.Page(site,u'آبشار_لاتون')
data=wikipedia.DataPage(fapage)
gett=data.get()
data.setitem(summary,items={'type': u'item', 'label': 'glk',
'value':u'آبشار_لاتون'})
data.setitem(summary,items={'type': u'sitelink', 'site': 'glk',
'title':u'آبشار_لاتون_(بارزاو)'})
----------------------------------------------------------------------
Comment By: reza (reza1615)
Date: 2013-02-26 04:32
Message:
please run this code and you will see the none title error !
#!/usr/bin/python
# -*- coding: utf-8 -*-
import wikipedia,login
summary=u'test bot'
site=wikipedia.getSite('fa',fam='wikipedia')
fapage=wikipedia.Page(site,u'آبشار_لاتون')
data=wikipedia.DataPage(fapage)
data.setitem(summary,items={'type': u'item', 'label': 'glk',
'value':u'آبشار_لاتون'})
data.setitem(summary,items={'type': u'sitelink', 'site': 'glk',
'title':u'آبشار_لاتون_(بارزاو)'})
----------------------------------------------------------------------
Comment By: xqt (xqt)
Date: 2013-02-25 23:38
Message:
This error looks like you haven't made a DataPage.get() before you tried to
update the page. In this cas the title is None as shown. If you recreate
the datapage with the entity id you make a explicit get call to retrieve
the items data. But this will be enough to get the data's id i.e. the
DataPage.title().
----------------------------------------------------------------------
Comment By: reza (reza1615)
Date: 2013-02-25 04:40
Message:
If I don't make in DataPage a second time it will show this error
Updating page [[wikidata:None]] via API
----------------------------------------------------------------------
Comment By: xqt (xqt)
Date: 2013-02-25 03:43
Message:
You don't need to create the DataPage a second time with the 'entity' item.
Look at this sample which shows that data == d but they are different
objects in this sample:
>>> import wikipedia as wp
>>> s = wp.getSite()
>>> p = wp.Page(s, 'Helium')
>>> d = wp.DataPage(p)
>>> i = d.get()
>>> t = i['entity'].title()
>>> data = wp.DataPage(s.data_repository(), t)
>>> data
DataPage{[[wikidata:Q560]]}
>>> d
DataPage{[[wikidata:Q560]]}
>>> d is data
False
>>> d == data
True
>>>
----------------------------------------------------------------------
Comment By: reza (reza1615)
Date: 2013-02-25 02:35
Message:
three :)
----------------------------------------------------------------------
Comment By: reza (reza1615)
Date: 2013-02-25 02:34
Message:
Thank you now it works.
please add these tree lines to setitem()
list=data.get()
id=list['entity'].replace('q','')
data = wikipedia.DataPage(site.data_repository(), "Q"+id)
now we should write these tree lines for every DataPage()
----------------------------------------------------------------------
Comment By: Amir (amird)
Date: 2013-02-24 21:58
Message:
fixed in r11114
http://www.wikidata.org/w/index.php?title=Q5058182&diff=prev&oldid=7673026http://www.wikidata.org/w/index.php?title=Q5058182&diff=prev&oldid=7673011
----------------------------------------------------------------------
You can respond by visiting:
https://sourceforge.net/tracker/?func=detail&atid=603138&aid=3605830&group_…
Bugs item #3605830, was opened at 2013-02-24 11:21
Message generated for change (Comment added) made by reza1615
You can respond by visiting:
https://sourceforge.net/tracker/?func=detail&atid=603138&aid=3605830&group_…
Please note that this message will contain a full copy of the comment thread,
including the initial issue submission, for this request,
not just the latest update.
Category: None
Group: None
Status: Open
Resolution: None
Priority: 5
Private: No
Submitted By: reza (reza1615)
Assigned to: Nobody/Anonymous (nobody)
Summary: setitem for wikidata doesn't work!
Initial Comment:
I used this code
#!/usr/bin/python
# -*- coding: utf-8 -*-
import wikipedia,login
summary=u'آبشار لاتون,آبشار لاتون'
site=wikipedia.getSite('fa',fam='wikipedia')
fapage=wikipedia.Page(site,u'آبشار_لاتون')
data=wikipedia.DataPage(fapage)
list=data.get()
id=list['entity'].replace('q','')
data = wikipedia.DataPage(site.data_repository(), "Q"+id)
data.setitem(summary,items={'type': u'item', 'label': 'glk', 'value':u'آبشار_لاتون'})
data.setitem(summary,items={'type': u'sitelink', 'site': 'glk', 'title':u'آبشار_لاتون_(بارزاو)'})
it shows
Updating page [[wikidata:Q5058182]] via API
Updating page [[wikidata:Q5058182]] via API
but it doesn't update the page!
also please add
def getIdFromPage(data)
id=data.get() ['entity'].replace('q','')
return id
and add
data = DataPage(site.data_repository(), "Q"+id)
to first line of setitem()
----------------------------------------------------------------------
>Comment By: reza (reza1615)
Date: 2013-02-26 04:32
Message:
please run this code and you will see the none title error !
#!/usr/bin/python
# -*- coding: utf-8 -*-
import wikipedia,login
summary=u'test bot'
site=wikipedia.getSite('fa',fam='wikipedia')
fapage=wikipedia.Page(site,u'آبشار_لاتون')
data=wikipedia.DataPage(fapage)
data.setitem(summary,items={'type': u'item', 'label': 'glk',
'value':u'آبشار_لاتون'})
data.setitem(summary,items={'type': u'sitelink', 'site': 'glk',
'title':u'آبشار_لاتون_(بارزاو)'})
----------------------------------------------------------------------
Comment By: xqt (xqt)
Date: 2013-02-25 23:38
Message:
This error looks like you haven't made a DataPage.get() before you tried to
update the page. In this cas the title is None as shown. If you recreate
the datapage with the entity id you make a explicit get call to retrieve
the items data. But this will be enough to get the data's id i.e. the
DataPage.title().
----------------------------------------------------------------------
Comment By: reza (reza1615)
Date: 2013-02-25 04:40
Message:
If I don't make in DataPage a second time it will show this error
Updating page [[wikidata:None]] via API
----------------------------------------------------------------------
Comment By: xqt (xqt)
Date: 2013-02-25 03:43
Message:
You don't need to create the DataPage a second time with the 'entity' item.
Look at this sample which shows that data == d but they are different
objects in this sample:
>>> import wikipedia as wp
>>> s = wp.getSite()
>>> p = wp.Page(s, 'Helium')
>>> d = wp.DataPage(p)
>>> i = d.get()
>>> t = i['entity'].title()
>>> data = wp.DataPage(s.data_repository(), t)
>>> data
DataPage{[[wikidata:Q560]]}
>>> d
DataPage{[[wikidata:Q560]]}
>>> d is data
False
>>> d == data
True
>>>
----------------------------------------------------------------------
Comment By: reza (reza1615)
Date: 2013-02-25 02:35
Message:
three :)
----------------------------------------------------------------------
Comment By: reza (reza1615)
Date: 2013-02-25 02:34
Message:
Thank you now it works.
please add these tree lines to setitem()
list=data.get()
id=list['entity'].replace('q','')
data = wikipedia.DataPage(site.data_repository(), "Q"+id)
now we should write these tree lines for every DataPage()
----------------------------------------------------------------------
Comment By: Amir (amird)
Date: 2013-02-24 21:58
Message:
fixed in r11114
http://www.wikidata.org/w/index.php?title=Q5058182&diff=prev&oldid=7673026http://www.wikidata.org/w/index.php?title=Q5058182&diff=prev&oldid=7673011
----------------------------------------------------------------------
You can respond by visiting:
https://sourceforge.net/tracker/?func=detail&atid=603138&aid=3605830&group_…
Bugs item #3605830, was opened at 2013-02-24 11:21
Message generated for change (Comment added) made by xqt
You can respond by visiting:
https://sourceforge.net/tracker/?func=detail&atid=603138&aid=3605830&group_…
Please note that this message will contain a full copy of the comment thread,
including the initial issue submission, for this request,
not just the latest update.
Category: None
Group: None
Status: Open
Resolution: None
Priority: 5
Private: No
Submitted By: reza (reza1615)
Assigned to: Nobody/Anonymous (nobody)
Summary: setitem for wikidata doesn't work!
Initial Comment:
I used this code
#!/usr/bin/python
# -*- coding: utf-8 -*-
import wikipedia,login
summary=u'آبشار لاتون,آبشار لاتون'
site=wikipedia.getSite('fa',fam='wikipedia')
fapage=wikipedia.Page(site,u'آبشار_لاتون')
data=wikipedia.DataPage(fapage)
list=data.get()
id=list['entity'].replace('q','')
data = wikipedia.DataPage(site.data_repository(), "Q"+id)
data.setitem(summary,items={'type': u'item', 'label': 'glk', 'value':u'آبشار_لاتون'})
data.setitem(summary,items={'type': u'sitelink', 'site': 'glk', 'title':u'آبشار_لاتون_(بارزاو)'})
it shows
Updating page [[wikidata:Q5058182]] via API
Updating page [[wikidata:Q5058182]] via API
but it doesn't update the page!
also please add
def getIdFromPage(data)
id=data.get() ['entity'].replace('q','')
return id
and add
data = DataPage(site.data_repository(), "Q"+id)
to first line of setitem()
----------------------------------------------------------------------
>Comment By: xqt (xqt)
Date: 2013-02-25 23:38
Message:
This error looks like you haven't made a DataPage.get() before you tried to
update the page. In this cas the title is None as shown. If you recreate
the datapage with the entity id you make a explicit get call to retrieve
the items data. But this will be enough to get the data's id i.e. the
DataPage.title().
----------------------------------------------------------------------
Comment By: reza (reza1615)
Date: 2013-02-25 04:40
Message:
If I don't make in DataPage a second time it will show this error
Updating page [[wikidata:None]] via API
----------------------------------------------------------------------
Comment By: xqt (xqt)
Date: 2013-02-25 03:43
Message:
You don't need to create the DataPage a second time with the 'entity' item.
Look at this sample which shows that data == d but they are different
objects in this sample:
>>> import wikipedia as wp
>>> s = wp.getSite()
>>> p = wp.Page(s, 'Helium')
>>> d = wp.DataPage(p)
>>> i = d.get()
>>> t = i['entity'].title()
>>> data = wp.DataPage(s.data_repository(), t)
>>> data
DataPage{[[wikidata:Q560]]}
>>> d
DataPage{[[wikidata:Q560]]}
>>> d is data
False
>>> d == data
True
>>>
----------------------------------------------------------------------
Comment By: reza (reza1615)
Date: 2013-02-25 02:35
Message:
three :)
----------------------------------------------------------------------
Comment By: reza (reza1615)
Date: 2013-02-25 02:34
Message:
Thank you now it works.
please add these tree lines to setitem()
list=data.get()
id=list['entity'].replace('q','')
data = wikipedia.DataPage(site.data_repository(), "Q"+id)
now we should write these tree lines for every DataPage()
----------------------------------------------------------------------
Comment By: Amir (amird)
Date: 2013-02-24 21:58
Message:
fixed in r11114
http://www.wikidata.org/w/index.php?title=Q5058182&diff=prev&oldid=7673026http://www.wikidata.org/w/index.php?title=Q5058182&diff=prev&oldid=7673011
----------------------------------------------------------------------
You can respond by visiting:
https://sourceforge.net/tracker/?func=detail&atid=603138&aid=3605830&group_…
Bugs item #3605830, was opened at 2013-02-24 11:21
Message generated for change (Comment added) made by reza1615
You can respond by visiting:
https://sourceforge.net/tracker/?func=detail&atid=603138&aid=3605830&group_…
Please note that this message will contain a full copy of the comment thread,
including the initial issue submission, for this request,
not just the latest update.
Category: None
Group: None
Status: Open
Resolution: None
Priority: 5
Private: No
Submitted By: reza (reza1615)
Assigned to: Nobody/Anonymous (nobody)
Summary: setitem for wikidata doesn't work!
Initial Comment:
I used this code
#!/usr/bin/python
# -*- coding: utf-8 -*-
import wikipedia,login
summary=u'آبشار لاتون,آبشار لاتون'
site=wikipedia.getSite('fa',fam='wikipedia')
fapage=wikipedia.Page(site,u'آبشار_لاتون')
data=wikipedia.DataPage(fapage)
list=data.get()
id=list['entity'].replace('q','')
data = wikipedia.DataPage(site.data_repository(), "Q"+id)
data.setitem(summary,items={'type': u'item', 'label': 'glk', 'value':u'آبشار_لاتون'})
data.setitem(summary,items={'type': u'sitelink', 'site': 'glk', 'title':u'آبشار_لاتون_(بارزاو)'})
it shows
Updating page [[wikidata:Q5058182]] via API
Updating page [[wikidata:Q5058182]] via API
but it doesn't update the page!
also please add
def getIdFromPage(data)
id=data.get() ['entity'].replace('q','')
return id
and add
data = DataPage(site.data_repository(), "Q"+id)
to first line of setitem()
----------------------------------------------------------------------
>Comment By: reza (reza1615)
Date: 2013-02-25 04:40
Message:
If I don't make in DataPage a second time it will show this error
Updating page [[wikidata:None]] via API
----------------------------------------------------------------------
Comment By: xqt (xqt)
Date: 2013-02-25 03:43
Message:
You don't need to create the DataPage a second time with the 'entity' item.
Look at this sample which shows that data == d but they are different
objects in this sample:
>>> import wikipedia as wp
>>> s = wp.getSite()
>>> p = wp.Page(s, 'Helium')
>>> d = wp.DataPage(p)
>>> i = d.get()
>>> t = i['entity'].title()
>>> data = wp.DataPage(s.data_repository(), t)
>>> data
DataPage{[[wikidata:Q560]]}
>>> d
DataPage{[[wikidata:Q560]]}
>>> d is data
False
>>> d == data
True
>>>
----------------------------------------------------------------------
Comment By: reza (reza1615)
Date: 2013-02-25 02:35
Message:
three :)
----------------------------------------------------------------------
Comment By: reza (reza1615)
Date: 2013-02-25 02:34
Message:
Thank you now it works.
please add these tree lines to setitem()
list=data.get()
id=list['entity'].replace('q','')
data = wikipedia.DataPage(site.data_repository(), "Q"+id)
now we should write these tree lines for every DataPage()
----------------------------------------------------------------------
Comment By: Amir (amird)
Date: 2013-02-24 21:58
Message:
fixed in r11114
http://www.wikidata.org/w/index.php?title=Q5058182&diff=prev&oldid=7673026http://www.wikidata.org/w/index.php?title=Q5058182&diff=prev&oldid=7673011
----------------------------------------------------------------------
You can respond by visiting:
https://sourceforge.net/tracker/?func=detail&atid=603138&aid=3605830&group_…
Bugs item #3605830, was opened at 2013-02-24 11:21
Message generated for change (Comment added) made by xqt
You can respond by visiting:
https://sourceforge.net/tracker/?func=detail&atid=603138&aid=3605830&group_…
Please note that this message will contain a full copy of the comment thread,
including the initial issue submission, for this request,
not just the latest update.
Category: None
Group: None
Status: Open
Resolution: None
Priority: 5
Private: No
Submitted By: reza (reza1615)
Assigned to: Nobody/Anonymous (nobody)
Summary: setitem for wikidata doesn't work!
Initial Comment:
I used this code
#!/usr/bin/python
# -*- coding: utf-8 -*-
import wikipedia,login
summary=u'آبشار لاتون,آبشار لاتون'
site=wikipedia.getSite('fa',fam='wikipedia')
fapage=wikipedia.Page(site,u'آبشار_لاتون')
data=wikipedia.DataPage(fapage)
list=data.get()
id=list['entity'].replace('q','')
data = wikipedia.DataPage(site.data_repository(), "Q"+id)
data.setitem(summary,items={'type': u'item', 'label': 'glk', 'value':u'آبشار_لاتون'})
data.setitem(summary,items={'type': u'sitelink', 'site': 'glk', 'title':u'آبشار_لاتون_(بارزاو)'})
it shows
Updating page [[wikidata:Q5058182]] via API
Updating page [[wikidata:Q5058182]] via API
but it doesn't update the page!
also please add
def getIdFromPage(data)
id=data.get() ['entity'].replace('q','')
return id
and add
data = DataPage(site.data_repository(), "Q"+id)
to first line of setitem()
----------------------------------------------------------------------
>Comment By: xqt (xqt)
Date: 2013-02-25 03:43
Message:
You don't need to create the DataPage a second time with the 'entity' item.
Look at this sample which shows that data == d but they are different
objects in this sample:
>>> import wikipedia as wp
>>> s = wp.getSite()
>>> p = wp.Page(s, 'Helium')
>>> d = wp.DataPage(p)
>>> i = d.get()
>>> t = i['entity'].title()
>>> data = wp.DataPage(s.data_repository(), t)
>>> data
DataPage{[[wikidata:Q560]]}
>>> d
DataPage{[[wikidata:Q560]]}
>>> d is data
False
>>> d == data
True
>>>
----------------------------------------------------------------------
Comment By: reza (reza1615)
Date: 2013-02-25 02:35
Message:
three :)
----------------------------------------------------------------------
Comment By: reza (reza1615)
Date: 2013-02-25 02:34
Message:
Thank you now it works.
please add these tree lines to setitem()
list=data.get()
id=list['entity'].replace('q','')
data = wikipedia.DataPage(site.data_repository(), "Q"+id)
now we should write these tree lines for every DataPage()
----------------------------------------------------------------------
Comment By: Amir (amird)
Date: 2013-02-24 21:58
Message:
fixed in r11114
http://www.wikidata.org/w/index.php?title=Q5058182&diff=prev&oldid=7673026http://www.wikidata.org/w/index.php?title=Q5058182&diff=prev&oldid=7673011
----------------------------------------------------------------------
You can respond by visiting:
https://sourceforge.net/tracker/?func=detail&atid=603138&aid=3605830&group_…
Bugs item #3605830, was opened at 2013-02-24 11:21
Message generated for change (Comment added) made by reza1615
You can respond by visiting:
https://sourceforge.net/tracker/?func=detail&atid=603138&aid=3605830&group_…
Please note that this message will contain a full copy of the comment thread,
including the initial issue submission, for this request,
not just the latest update.
Category: None
Group: None
Status: Open
Resolution: None
Priority: 5
Private: No
Submitted By: reza (reza1615)
Assigned to: Nobody/Anonymous (nobody)
Summary: setitem for wikidata doesn't work!
Initial Comment:
I used this code
#!/usr/bin/python
# -*- coding: utf-8 -*-
import wikipedia,login
summary=u'آبشار لاتون,آبشار لاتون'
site=wikipedia.getSite('fa',fam='wikipedia')
fapage=wikipedia.Page(site,u'آبشار_لاتون')
data=wikipedia.DataPage(fapage)
list=data.get()
id=list['entity'].replace('q','')
data = wikipedia.DataPage(site.data_repository(), "Q"+id)
data.setitem(summary,items={'type': u'item', 'label': 'glk', 'value':u'آبشار_لاتون'})
data.setitem(summary,items={'type': u'sitelink', 'site': 'glk', 'title':u'آبشار_لاتون_(بارزاو)'})
it shows
Updating page [[wikidata:Q5058182]] via API
Updating page [[wikidata:Q5058182]] via API
but it doesn't update the page!
also please add
def getIdFromPage(data)
id=data.get() ['entity'].replace('q','')
return id
and add
data = DataPage(site.data_repository(), "Q"+id)
to first line of setitem()
----------------------------------------------------------------------
>Comment By: reza (reza1615)
Date: 2013-02-25 02:35
Message:
three :)
----------------------------------------------------------------------
Comment By: reza (reza1615)
Date: 2013-02-25 02:34
Message:
Thank you now it works.
please add these tree lines to setitem()
list=data.get()
id=list['entity'].replace('q','')
data = wikipedia.DataPage(site.data_repository(), "Q"+id)
now we should write these tree lines for every DataPage()
----------------------------------------------------------------------
Comment By: Amir (amird)
Date: 2013-02-24 21:58
Message:
fixed in r11114
http://www.wikidata.org/w/index.php?title=Q5058182&diff=prev&oldid=7673026http://www.wikidata.org/w/index.php?title=Q5058182&diff=prev&oldid=7673011
----------------------------------------------------------------------
You can respond by visiting:
https://sourceforge.net/tracker/?func=detail&atid=603138&aid=3605830&group_…
Bugs item #3605830, was opened at 2013-02-24 11:21
Message generated for change (Comment added) made by reza1615
You can respond by visiting:
https://sourceforge.net/tracker/?func=detail&atid=603138&aid=3605830&group_…
Please note that this message will contain a full copy of the comment thread,
including the initial issue submission, for this request,
not just the latest update.
Category: None
Group: None
Status: Open
Resolution: None
Priority: 5
Private: No
Submitted By: reza (reza1615)
Assigned to: Nobody/Anonymous (nobody)
Summary: setitem for wikidata doesn't work!
Initial Comment:
I used this code
#!/usr/bin/python
# -*- coding: utf-8 -*-
import wikipedia,login
summary=u'آبشار لاتون,آبشار لاتون'
site=wikipedia.getSite('fa',fam='wikipedia')
fapage=wikipedia.Page(site,u'آبشار_لاتون')
data=wikipedia.DataPage(fapage)
list=data.get()
id=list['entity'].replace('q','')
data = wikipedia.DataPage(site.data_repository(), "Q"+id)
data.setitem(summary,items={'type': u'item', 'label': 'glk', 'value':u'آبشار_لاتون'})
data.setitem(summary,items={'type': u'sitelink', 'site': 'glk', 'title':u'آبشار_لاتون_(بارزاو)'})
it shows
Updating page [[wikidata:Q5058182]] via API
Updating page [[wikidata:Q5058182]] via API
but it doesn't update the page!
also please add
def getIdFromPage(data)
id=data.get() ['entity'].replace('q','')
return id
and add
data = DataPage(site.data_repository(), "Q"+id)
to first line of setitem()
----------------------------------------------------------------------
>Comment By: reza (reza1615)
Date: 2013-02-25 02:34
Message:
Thank you now it works.
please add these tree lines to setitem()
list=data.get()
id=list['entity'].replace('q','')
data = wikipedia.DataPage(site.data_repository(), "Q"+id)
now we should write these tree lines for every DataPage()
----------------------------------------------------------------------
Comment By: Amir (amird)
Date: 2013-02-24 21:58
Message:
fixed in r11114
http://www.wikidata.org/w/index.php?title=Q5058182&diff=prev&oldid=7673026http://www.wikidata.org/w/index.php?title=Q5058182&diff=prev&oldid=7673011
----------------------------------------------------------------------
You can respond by visiting:
https://sourceforge.net/tracker/?func=detail&atid=603138&aid=3605830&group_…
Bugs item #3605891, was opened at 2013-02-24 22:35
Message generated for change (Comment added) made by
You can respond by visiting:
https://sourceforge.net/tracker/?func=detail&atid=603138&aid=3605891&group_…
Please note that this message will contain a full copy of the comment thread,
including the initial issue submission, for this request,
not just the latest update.
Category: login
Group: None
Status: Open
Resolution: None
Priority: 5
Private: No
Submitted By: Nobody/Anonymous (nobody)
Assigned to: Nobody/Anonymous (nobody)
Summary: Login-data raising EOFError
Initial Comment:
The script is being run from a cronjob with saved login data. When retrieving a password I get the following error:
Password for user RileyBot on wiktionary:en:
/usr/lib/python2.7/getpass.py:83: GetPassWarning: Can not control echo on the terminal.
passwd = fallback_getpass(prompt, stream)
Warning: Password input may be echoed.
Traceback (most recent call last):
File "globalfunc1.py", line 250, in <module>
main()
File "globalfunc1.py", line 244, in main
bot.run()
File "globalfunc1.py", line 197, in run
sandboxPage.put(translatedContent, translatedMsg)
File "/home/riley/pywikipedia/wikipedia.py", line 1990, in put
sysop=sysop)
File "/home/riley/pywikipedia/wikipedia.py", line 1863, in _getActionUser
self.site().forceLogin(sysop = sysop)
File "/home/riley/pywikipedia/wikipedia.py", line 5861, in forceLogin
if loginMan.login(retry = True):
File "/home/riley/pywikipedia/login.py", line 307, in login
password = True)
File "/home/riley/pywikipedia/wikipedia.py", line 8927, in input
data = ui.input(question, password)
File "/home/riley/pywikipedia/userinterfaces/terminal_interface_base.py", line 129, in input
text = getpass.getpass('')
File "/usr/lib/python2.7/getpass.py", line 83, in unix_getpass
passwd = fallback_getpass(prompt, stream)
File "/usr/lib/python2.7/getpass.py", line 118, in fallback_getpass
return _raw_input(prompt, stream)
File "/usr/lib/python2.7/getpass.py", line 135, in _raw_input
raise EOFError
EOFError
Python people told me "your problem is in the pywikipedia code"
----------------------------------------------------------------------
Comment By: Riley ()
Date: 2013-02-24 22:39
Message:
Another note; I am receiving this error as an email from cron.
----------------------------------------------------------------------
Comment By: Riley ()
Date: 2013-02-24 22:36
Message:
Forgot to login; I posted this.
----------------------------------------------------------------------
You can respond by visiting:
https://sourceforge.net/tracker/?func=detail&atid=603138&aid=3605891&group_…