move data files out of repo
This commit is contained in:
@@ -17,11 +17,11 @@ target_page = journal_path / f'{current_date}.md'
|
||||
script_path = Path(__file__).parent
|
||||
|
||||
habits = '\n'.join([f'[-] {x}'
|
||||
for x in (script_path / 'habits').read_text().strip().split('\n')])
|
||||
for x in (journal_path / 'habits').read_text().strip().split('\n')])
|
||||
|
||||
words = (script_path / 'godword').read_text().strip().split('\n')
|
||||
words = (journal_path / 'godword').read_text().strip().split('\n')
|
||||
godword = '\n'.join(' '.join(random.choice(words)
|
||||
for a in range(10)) for _ in range(2))
|
||||
for __ in range(10)) for _ in range(2))
|
||||
|
||||
if not target_page.exists():
|
||||
Popen(
|
||||
@@ -43,23 +43,22 @@ if not target_page.exists():
|
||||
block['message']
|
||||
))
|
||||
|
||||
notifications_rendered = '\n'.join(
|
||||
f'[[{entry}]] {message}'
|
||||
for entry, message in notifications
|
||||
)
|
||||
parts = [
|
||||
f'# {target_page.stem}',
|
||||
f'Godword:\n{godword}',
|
||||
f'Habits:\n{habits}',
|
||||
]
|
||||
|
||||
target_page.write_text(f'''\
|
||||
# {target_page.stem}
|
||||
if notifications:
|
||||
notifications_rendered = '\n'.join(
|
||||
f'[[{entry}]] {message}'
|
||||
for entry, message in notifications
|
||||
)
|
||||
|
||||
Godword:
|
||||
{godword}
|
||||
parts.append(f'Notifications:\n{notifications_rendered}')
|
||||
|
||||
Habits:
|
||||
{habits}
|
||||
|
||||
Notifications:
|
||||
{notifications_rendered}
|
||||
''')
|
||||
header = '\n\n'.join(parts)
|
||||
target_page.write_text(header)
|
||||
|
||||
with open(target_page, 'a') as fp:
|
||||
fp.write(f'\n{current_date} {current_time} ')
|
||||
|
||||
Reference in New Issue
Block a user