move MONTHS to page_shares, add weekday dict

This commit is contained in:
veclav talica 2023-05-22 18:29:58 +05:00
parent 5cc4ff44a6
commit 6a9f8572c9
4 changed files with 29 additions and 19 deletions

View File

@ -1,20 +1,5 @@
import time, subprocess import time, subprocess
MONTHS = {
1: "January",
2: "February",
3: "March",
4: "April",
5: "May",
6: "June",
7: "July",
8: "August",
9: "September",
10: "October",
11: "November",
12: "December"
}
def the_line_after_metadata(lines: []) -> int: def the_line_after_metadata(lines: []) -> int:
i = 0 i = 0
while lines[i].strip(): while lines[i].strip():

View File

@ -5,8 +5,8 @@
from sys import argv, exit from sys import argv, exit
import time import time
from article_utils import the_line_after_metadata, parse_metadata, MONTHS from article_utils import the_line_after_metadata, parse_metadata
from page_shares import wrap_page from page_shares import wrap_page, MONTHS
if len(argv) <= 1: if len(argv) <= 1:
print("No file was supplied") print("No file was supplied")

View File

@ -5,8 +5,8 @@ from os import walk, path
from random import choice, seed from random import choice, seed
import time, urllib.parse import time, urllib.parse
from article_utils import parse_metadata, MONTHS from article_utils import parse_metadata
from page_shares import wrap_page, ADJECTIVES from page_shares import wrap_page, ADJECTIVES, MONTHS
if len(argv) <= 1: if len(argv) <= 1:
print("No directory was supplied") print("No directory was supplied")

View File

@ -28,5 +28,30 @@ TAIL_EMBED = """
ADJECTIVES = ["*wild*", "**wacky**", "very humble", "**most serious**"] ADJECTIVES = ["*wild*", "**wacky**", "very humble", "**most serious**"]
MONTHS = {
1: "January",
2: "February",
3: "March",
4: "April",
5: "May",
6: "June",
7: "July",
8: "August",
9: "September",
10: "October",
11: "November",
12: "December"
}
WEEKDAYS = {
0: "Monday",
1: "Tuesday",
2: "Wednesday",
3: "Thursday",
4: "Friday",
5: "Saturday",
6: "Sunday"
}
def wrap_page(page: str) -> str: def wrap_page(page: str) -> str:
return HEAD_EMBED + page + TAIL_EMBED return HEAD_EMBED + page + TAIL_EMBED