Skip to content
This repository has been archived by the owner on Jul 11, 2023. It is now read-only.

Commit

Permalink
{{sjp.pl}} -> {{importSJP.pl}}
Browse files Browse the repository at this point in the history
  • Loading branch information
alkamid committed Feb 14, 2016
1 parent 98c0d48 commit 86e4778
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 3 deletions.
3 changes: 1 addition & 2 deletions importsjp.py
Expand Up @@ -4,7 +4,6 @@
import codecs
import pywikibot
import urllib.request, urllib.parse, urllib.error
import urllib.request, urllib.error, urllib.parse
import http.client
import re
import collections
Expand Down Expand Up @@ -763,7 +762,7 @@ def wikipage(hasloSJP, obrazki):
if ref_sjp or synTemp[1]:
zrodla += '\n<references>'
if ref_sjp:
zrodla += '\n<ref name=sjp.pl>{{sjp.pl|%s}}</ref>' % (firstWord.title)
zrodla += '\n<ref name=sjp.pl>{{importSJP.pl|%s}}</ref>' % (firstWord.title)
if synTemp[1]:
zrodla += '\n<ref name=synonimy>{{synonimy.ux.pl}}</ref>'
zrodla += '\n</references>'
Expand Down
5 changes: 4 additions & 1 deletion sjpClass.py
Expand Up @@ -17,14 +17,17 @@ def addLimit(self, limit):

def checkHistory(pagename):
#returns 1, if AlkamidBot or Olafbot were the last authors, 0 if someone is verifying the page (=it was last edited by someone else)

bots = ('AlkamidBot', 'Olafbot', 'PBbot')

site = pywikibot.getSite()
page = pywikibot.Page(site, pagename)
try: page.get()
except pywikibot.NoPage:
return 1
else:
history = page.getVersionHistory()
if history[0][2] == 'AlkamidBot' or history[0][2] == 'Olafbot':
if history[0][2] in bots:
return 1
else:
return 0

0 comments on commit 86e4778

Please sign in to comment.