https://bugzilla.wikimedia.org/show_bug.cgi?id=55149

--- Comment #14 from Kunal Mehta (Legoktm) <[email protected]> ---
in this report I don't want to make an item\!
I know about making an item amir solved it in last report 
\(https://www.mediawiki.org/wiki/Special:Code/pywikipedia/11103\)

Now I want update an item with wikipedia.py
for updating an item we should call data object with .get\(\) or .exists\(\) or
other functions to let wikipedia.py load that data object and it is not good
because user should write 4 lines in every part of his code
you can add these lines to library to not repeating.

for setitem\(\) you can add 

if  d.exists\(\):
pass \# pass or doing next lines
else:
print 'page not exist do you want creat it? '\# or it can call creatitem\(\)
function if user allowed bot to create not existed item

for  createitem\(\) you can add 

if  d.exists\(\):
print 'page  exists so creating process is aborted?'\# or we can ask user do
you want overwrite?
else:
pass \# pass or doing next lines

it should be done by library not users. because minimal coding is much better
than writing repeated lines\!
if I want to create or edit an item I should add these 4 lines to my code but
if they are inside wikipedia.py we don't need to write them.

it makes easy for  coding . now calling    .get\(\) or .exists\(\)  is tricky
and every user don't know and they will have problem with this\!

-- 
You are receiving this mail because:
You are on the CC list for the bug.
_______________________________________________
Wikibugs-l mailing list
[email protected]
https://lists.wikimedia.org/mailman/listinfo/wikibugs-l

Reply via email to