Skip to content

Commit

Permalink
asdf
Browse files Browse the repository at this point in the history
  • Loading branch information
Zanger67 committed Jul 27, 2024
1 parent f5c4370 commit 465654c
Show file tree
Hide file tree
Showing 2 changed files with 34 additions and 4 deletions.
19 changes: 17 additions & 2 deletions main.ipynb
Original file line number Diff line number Diff line change
Expand Up @@ -794,6 +794,7 @@
" if qNo in questionData and questionData[qNo]['date_done'] <= date + timedelta(days=1, hours=12) :\n",
" dailiesDict[date] = questionData[qNo].copy()\n",
" dailiesDict[date]['date_done'] = date\n",
" questionData[qNo]['categories'].add('Daily')\n",
" # print(f'{dailiesDict[date] = }')\n",
"\n",
" # print(f'{dailiesDict = }')\n",
Expand Down Expand Up @@ -826,6 +827,7 @@
" if qNo in questionData and questionData[qNo]['date_done'] <= date + timedelta(days=8) :\n",
" weekliesDict[date] = questionData[qNo].copy()\n",
" weekliesDict[date]['date_done'] = date\n",
" questionData[qNo]['categories'].add('Weekly Premium')\n",
"\n",
" return weekliesDict"
]
Expand Down Expand Up @@ -1657,7 +1659,8 @@
" *,\n",
" code_length: bool = False,\n",
" recent: bool = False,\n",
" daily: bool = False) -> str : # output path\n",
" daily: bool = False,\n",
" weekly: bool = False) -> str : # output path\n",
" \n",
" df = None\n",
" fileName = None\n",
Expand Down Expand Up @@ -1690,6 +1693,16 @@
" details = 'Dates are for the date I completed the ' + \\\n",
" 'question so due to the my time zone and how it lines up with ' + \\\n",
" 'UTC, it may be off by a day.\\n\\n'\n",
" elif weekly :\n",
" weeklyQuestionData = parseQuestionsForWeeklies(questionData)\n",
" \n",
" df = byRecentQuestionDataDataframe(weekly)\n",
" fileName = 'Weekly_Questions.md'\n",
" # header_data = f'# [Daily Questions](<{DAILY_URL}>)\\n\\n'\n",
" header_data = f'# Weekly Premium Questions\\n\\n'\n",
" details = 'Dates are for the date I completed the ' + \\\n",
" 'question so due to the my time zone and how it lines up with ' + \\\n",
" 'UTC, it may be off by a day.\\n\\n'\n",
" else :\n",
" print('Error. No markdown generation specified.')\n",
" print()\n",
Expand Down Expand Up @@ -1888,10 +1901,12 @@
" # written for the question\n",
" # code_length_md_path = exportCodeLengthMarkdown(questionData)\n",
" print('Generating category lists...')\n",
" dailyQuestions = miscMarkdownGenerations(questionData, daily=True)\n",
" weeklyQuestions = miscMarkdownGenerations(questionData, weekly=True)\n",
" byCodeLength = miscMarkdownGenerations(questionData, code_length=True)\n",
" byRecentlySolved = miscMarkdownGenerations(questionData, recent=True)\n",
" dailyQuestions = miscMarkdownGenerations(questionData, daily=True)\n",
" altSorts = [f'- [Daily Questions](<{dailyQuestions}>)',\n",
" f'- [Weekly Questions](<{weeklyQuestions}>)',\n",
" f'- [Questions By Code Length](<{byCodeLength}>)',\n",
" f'- [Questions By Recent](<{byRecentlySolved}>)']\n",
" \n",
Expand Down
19 changes: 17 additions & 2 deletions main.py
Original file line number Diff line number Diff line change
Expand Up @@ -675,6 +675,7 @@ def parseQuestionsForDailies(questionData: dict) -> Dict[int, Question] :
if qNo in questionData and questionData[qNo]['date_done'] <= date + timedelta(days=1, hours=12) :
dailiesDict[date] = questionData[qNo].copy()
dailiesDict[date]['date_done'] = date
questionData[qNo]['categories'].add('Daily')
# print(f'{dailiesDict[date] = }')

# print(f'{dailiesDict = }')
Expand Down Expand Up @@ -704,6 +705,7 @@ def parseQuestionsForWeeklies(questionData: dict) -> Dict[int, Question] :
if qNo in questionData and questionData[qNo]['date_done'] <= date + timedelta(days=8) :
weekliesDict[date] = questionData[qNo].copy()
weekliesDict[date]['date_done'] = date
questionData[qNo]['categories'].add('Weekly Premium')

return weekliesDict

Expand Down Expand Up @@ -1410,7 +1412,8 @@ def miscMarkdownGenerations(questionData: dict,
*,
code_length: bool = False,
recent: bool = False,
daily: bool = False) -> str : # output path
daily: bool = False,
weekly: bool = False) -> str : # output path

df = None
fileName = None
Expand Down Expand Up @@ -1443,6 +1446,16 @@ def miscMarkdownGenerations(questionData: dict,
details = 'Dates are for the date I completed the ' + \
'question so due to the my time zone and how it lines up with ' + \
'UTC, it may be off by a day.\n\n'
elif weekly :
weeklyQuestionData = parseQuestionsForWeeklies(questionData)

df = byRecentQuestionDataDataframe(weekly)
fileName = 'Weekly_Questions.md'
# header_data = f'# [Daily Questions](<{DAILY_URL}>)\n\n'
header_data = f'# Weekly Premium Questions\n\n'
details = 'Dates are for the date I completed the ' + \
'question so due to the my time zone and how it lines up with ' + \
'UTC, it may be off by a day.\n\n'
else :
print('Error. No markdown generation specified.')
print()
Expand Down Expand Up @@ -1630,10 +1643,12 @@ def main(*, recalculateAll: bool = False, noRecord: bool = False) -> None :
# written for the question
# code_length_md_path = exportCodeLengthMarkdown(questionData)
print('Generating category lists...')
dailyQuestions = miscMarkdownGenerations(questionData, daily=True)
weeklyQuestions = miscMarkdownGenerations(questionData, weekly=True)
byCodeLength = miscMarkdownGenerations(questionData, code_length=True)
byRecentlySolved = miscMarkdownGenerations(questionData, recent=True)
dailyQuestions = miscMarkdownGenerations(questionData, daily=True)
altSorts = [f'- [Daily Questions](<{dailyQuestions}>)',
f'- [Weekly Questions](<{weeklyQuestions}>)',
f'- [Questions By Code Length](<{byCodeLength}>)',
f'- [Questions By Recent](<{byRecentlySolved}>)']

Expand Down

0 comments on commit 465654c

Please sign in to comment.