Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Remove redundant state marker from logseq task description #1082

Open
wants to merge 1 commit into
base: develop
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
3 changes: 2 additions & 1 deletion bugwarrior/services/logseq.py
Original file line number Diff line number Diff line change
Expand Up @@ -168,10 +168,11 @@ def _compress_tag_format(self, tag):

# get an optimized and formatted title
def get_formatted_title(self):
# use first line only and remove priority
# use first line only and remove state and priority
first_line = (
self.record["content"]
.split("\n")[0] # only use first line
.split(self.get_logseq_state() + " ")[1] # remove state marker
.replace("[#A] ", "") # remove priority markers
.replace("[#B] ", "")
.replace("[#C] ", "")
Expand Down
6 changes: 3 additions & 3 deletions tests/test_logseq.py
Original file line number Diff line number Diff line change
Expand Up @@ -67,7 +67,7 @@ def test_to_taskwarrior(self):
issue.ID: int(self.test_record["id"]),
issue.UUID: self.test_record["uuid"],
issue.STATE: self.test_record["marker"],
issue.TITLE: "DOING Do something",
issue.TITLE: "Do something",
issue.URI: "logseq://graph/Test?block-id=66699a83-3ee0-4edc-81c6-a24c9b80bec6",
}

Expand All @@ -83,7 +83,7 @@ def test_issues(self):
expected = {
"annotations": [],
"description": f"(bw)Is#{self.test_record['id']}"
+ " - DOING Do something"
+ " - Do something"
+ " .. logseq://graph/Test?block-id=66699a83-3ee0-4edc-81c6-a24c9b80bec6",
"due": None,
"scheduled": None,
Expand All @@ -95,7 +95,7 @@ def test_issues(self):
issue.ID: int(self.test_record["id"]),
issue.UUID: self.test_record["uuid"],
issue.STATE: self.test_record["marker"],
issue.TITLE: "DOING Do something",
issue.TITLE: "Do something",
issue.URI: "logseq://graph/Test?block-id=66699a83-3ee0-4edc-81c6-a24c9b80bec6",
}

Expand Down