Skip to content

Commit

Permalink
Fix formatting and imports
Browse files Browse the repository at this point in the history
  • Loading branch information
cpbotha committed Jul 2, 2024
1 parent b781df8 commit ca80297
Showing 1 changed file with 7 additions and 3 deletions.
10 changes: 7 additions & 3 deletions org_roam_canvas/utils_emacs.py
Original file line number Diff line number Diff line change
Expand Up @@ -2,11 +2,13 @@
import re
import subprocess
import tempfile
import time
from pathlib import Path
from threading import Lock
import time
from typing import Dict

from fastapi import HTTPException

from .utils import rewrite_links

mutex = Lock()
Expand Down Expand Up @@ -69,7 +71,9 @@ def ask_emacs(elisp: str, create_frame=False) -> str:
with mutex:
start_ns = time.perf_counter_ns()
ret = subprocess.run(cmd, capture_output=True, text=True)
logging.info(f"emacsclient took {(time.perf_counter_ns() - start_ns)/1e6:.1f} ms")
logging.info(
f"emacsclient took {(time.perf_counter_ns() - start_ns)/1e6:.1f} ms"
)

if ret.stderr:
raise HTTPException(status_code=404, detail=ret.stderr)
Expand Down Expand Up @@ -176,7 +180,7 @@ def select_node():
"""


def get_or_node_details(or_node_id: str):
def get_or_node_details(or_node_id: str) -> Dict[str, str]:
"""Given an org-roam node ID, find its title and contents."""
# execute emacsclient to ask it for details about the org-roam node with or_node_id
output = ask_emacs(ELISP_GND.format(node_id=or_node_id))
Expand Down

0 comments on commit ca80297

Please sign in to comment.