Compare commits

...

2 Commits

@ -0,0 +1,49 @@
#! /usr/bin/env python3
"""Glue together the matrix and org-mode!"""
from orgparse import load, loads
import argparse
import sys
def idb_excepthook(type, value, tb):
"""Call an interactive debugger in post-mortem mode
If you do "sys.excepthook = idb_excepthook", then an interactive debugger
will be spawned at an unhandled exception
"""
if hasattr(sys, "ps1") or not sys.stderr.isatty():
sys.__excepthook__(type, value, tb)
else:
import pdb
import traceback
traceback.print_exception(type, value, tb)
print
pdb.pm()
def main(*args, **kwargs):
parser = argparse.ArgumentParser(description="")
parser.add_argument(
"--debug", "-d", action="store_true", help="Include debugging output"
)
parsed = parser.parse_args()
if parsed.debug:
sys.excepthook = idb_excepthook
load("PATH/TO/FILE.org")
# load(file_like_object)
loads(
"""
* This is org-mode contents
You can load org object from string.
** Second header
"""
)
if __name__ == "__main__":
sys.exit(main(*sys.argv))

@ -30,8 +30,9 @@ Matrix Orgmode ListenER.
- [X] Pylint / Flake8; feel free to tweak line settings
- [X] Pipenv (bluh. I guess this is what work is using, so, fine.)
- append installs with `-d` to add them as a dev dependency
- [ ] Pytest + unittest.
- [ ] Add on pydantic to mypy
- [ ] Futz with mypy's config to require declaring types
- [X] Python versions with pyenv
- This is pretty easy, though its a very stupid curl | bash. Fuckers.
- Also some annoying prereqs that you need to be careful about; some Mac specific fuckery.
@ -41,3 +42,4 @@ Matrix Orgmode ListenER.
- auto detect pyvenv
- resolve imports
- etc
- [ ] make magit play nice with pre-commit hooks

@ -1,6 +1,6 @@
[tool.black]
line-length = 88
target-version = ['py39']
target-version = ['py38']
include = '\.pyi?$'
exclude = '''