Skip to content

Commit

Permalink
adjust for the sorter being blank
Browse files Browse the repository at this point in the history
if appealtime is not found, it's going to be blank, and for every such appeal, it's going to overwrite the blank key in the master table
  • Loading branch information
dqwiki committed Apr 13, 2024
1 parent b5efd7c commit 0a38879
Showing 1 changed file with 11 additions and 2 deletions.
13 changes: 11 additions & 2 deletions globalfunc.py
Expand Up @@ -159,26 +159,35 @@ def runCategory(cat,type,table):
for item in table.values():
if user in item:
continue
#else:print("Keep: "+user)
i = i+1
blockinfo = findblock(user)
appealtime = findunblocktime(page['title'],page['pageid'])
lastedit = getLastEdit(page['title'])
specialappeallist[str(appealtime)] = formatrow(blockinfo,appealtime,lastedit,type)
currentrow = formatrow(blockinfo,appealtime,lastedit,type)

if not appealtime:appealtime="Placeholder "+str(i)
specialappeallist[str(appealtime)] = currentrow
### for item in specialappealarray:
### alltable += item[1]
### Old: alltable += formatrow(blockinfo,appealtime,lastedit,type)
#print(specialappeallist[specialtime])
return specialappeallist
tableheader = """
{|class="wikitable sortable" width="100%"
!Request time!!User!!Block info!!Last user edit!!Timestamp
"""
tablefooter="|}"
table = {}

table=runCategory("Requests for username changes when blocked‎","username",table)
time.sleep(2)
table.update(runCategory("Requests for unblock","normal",table))
time.sleep(2)
table.update(runCategory("Requests for unblock-auto‎","auto",table))
time.sleep(2)
table.update(runCategory("Unblock on hold‎","hold",table))
time.sleep(2)

result = sorted(table.items(), key=lambda appeals: appeals[0])
#r"([0-2]|)[0-9]:[0-5][0-9], ([0-3]|)[0-9] .* 20[0-9][0-9] \(UTC\)"
wikitable=""
Expand Down

0 comments on commit 0a38879

Please sign in to comment.