Skip to content

Commit

Permalink
fixup! Add construct_data_page() to essayassesment
Browse files Browse the repository at this point in the history
  • Loading branch information
AntiCompositeNumber committed May 19, 2020
1 parent 47f043d commit 34b10ee
Showing 1 changed file with 6 additions and 6 deletions.
12 changes: 6 additions & 6 deletions src/essayassesment.py
Original file line number Diff line number Diff line change
Expand Up @@ -137,7 +137,7 @@ def data_row(self, key: str, rank: int = 0) -> str:
wikitext = "".join(
str(o)
for o in (
" |",
" |",
self.page.title(insite=site),
" = ",
rank if (key == "rank") else getattr(self, key, ""),
Expand Down Expand Up @@ -206,7 +206,7 @@ def construct_table(data: Iterable[Essay], intro_r: str) -> str:

def construct_data_page(data: Iterable[Essay]) -> str:
keys = ["rank", "score"]
key_line = "|%s={{#switch:{{{2|{{{page|}}}}}}"
key_line = " |%s={{#switch:{{{2|{{{page|}}}}}}"
lines = list(itertools.chain(
["{{#switch:{{{1|{{{key|}}}}}}"],
list(itertools.chain.from_iterable(
Expand All @@ -218,13 +218,13 @@ def construct_data_page(data: Iterable[Essay]) -> str:
for key in keys
)),
[
f"|lastupdate = {datetime.utcnow().isoformat(timespec='minutes')}",
"|¬ =",
"|#default = {{error|Key does not exist}}",
f" |lastupdate = {datetime.utcnow().isoformat(timespec='minutes')}",
" |¬ =",
" |#default = {{error|Key does not exist}}",
"}}",
],
))
return "\n ".join(lines)
return "\n".join(lines)


def check_runpage() -> None:
Expand Down

0 comments on commit 34b10ee

Please sign in to comment.