Allow basic integration between orgmode and the matrix.
- Doesn't add meta data yet. - Isn't very smart, will assume you did a bunch of stuff right instead - of verifying itself.
This commit is contained in:
parent
873bc174a3
commit
1f992fe981
@ -46,6 +46,8 @@ class Command:
|
|||||||
await self._react()
|
await self._react()
|
||||||
elif self.command.startswith("help"):
|
elif self.command.startswith("help"):
|
||||||
await self._show_help()
|
await self._show_help()
|
||||||
|
elif self.command.startswith("scribe"):
|
||||||
|
await self._new_org_todo()
|
||||||
else:
|
else:
|
||||||
await self._unknown_command()
|
await self._unknown_command()
|
||||||
|
|
||||||
@ -87,6 +89,16 @@ class Command:
|
|||||||
text = "Unknown help topic!"
|
text = "Unknown help topic!"
|
||||||
await send_text_to_room(self.client, self.room.room_id, text)
|
await send_text_to_room(self.client, self.room.room_id, text)
|
||||||
|
|
||||||
|
async def _new_org_todo(self):
|
||||||
|
"""Given a plaintext string, return org-formatted todo line."""
|
||||||
|
formatted_string = " ".join(self.args)
|
||||||
|
new_string = f"* {formatted_string} \n"
|
||||||
|
await send_text_to_room(self.client, self.room.room_id, f"creating new todo with {new_string}")
|
||||||
|
print(dir(self.config))
|
||||||
|
with open(self.config.orgmode_refile_path, "a") as orgfile:
|
||||||
|
orgfile.write(new_string)
|
||||||
|
# return new_string
|
||||||
|
|
||||||
async def _unknown_command(self):
|
async def _unknown_command(self):
|
||||||
await send_text_to_room(
|
await send_text_to_room(
|
||||||
self.client,
|
self.client,
|
||||||
|
@ -70,6 +70,9 @@ class Config:
|
|||||||
f"storage.store_path '{self.store_path}' is not a directory"
|
f"storage.store_path '{self.store_path}' is not a directory"
|
||||||
)
|
)
|
||||||
|
|
||||||
|
# Orgmode setup
|
||||||
|
self.orgmode_refile_path = self._get_cfg(["orgmode", "refile"], required=True)
|
||||||
|
|
||||||
# Database setup
|
# Database setup
|
||||||
database_path = self._get_cfg(["storage", "database"], required=True)
|
database_path = self._get_cfg(["storage", "database"], required=True)
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user