worklogs 0.3.3__tar.gz → 0.3.4__tar.gz

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.4
2
2
  Name: worklogs
3
- Version: 0.3.3
3
+ Version: 0.3.4
4
4
  Summary: Local markdown worklog helpers for developer workflows.
5
5
  Project-URL: Homepage, https://github.com/alik-git/worklogs
6
6
  Project-URL: Repository, https://github.com/alik-git/worklogs
@@ -4,7 +4,7 @@ build-backend = "hatchling.build"
4
4
 
5
5
  [project]
6
6
  name = "worklogs"
7
- version = "0.3.3"
7
+ version = "0.3.4"
8
8
  description = "Local markdown worklog helpers for developer workflows."
9
9
  readme = "README.md"
10
10
  requires-python = ">=3.11"
@@ -2,6 +2,6 @@
2
2
 
3
3
  from __future__ import annotations
4
4
 
5
- __version__ = "0.3.3"
5
+ __version__ = "0.3.4"
6
6
 
7
7
  __all__ = ["__version__"]
@@ -140,6 +140,7 @@ def _configure_logging() -> None:
140
140
  if use_color:
141
141
  try:
142
142
  import colorlog
143
+
143
144
  handler.setFormatter(
144
145
  colorlog.ColoredFormatter(_COLOR_FORMAT, log_colors=_LOG_COLORS)
145
146
  )
@@ -282,7 +283,7 @@ def _run_find(args: argparse.Namespace) -> int:
282
283
 
283
284
  def _find_plan_by_name(name: str, root: Path) -> Path:
284
285
  """Find a plan file by name slug, erroring on zero or multiple matches."""
285
- pattern = f"*/*/*/*/[0-9][0-9][0-9][0-9]--{name}--plan.md"
286
+ pattern = f"*/*/*/*/[0-9]*--{name}--plan.md"
286
287
  matches = sorted(root.glob(pattern))
287
288
  if not matches:
288
289
  raise WorklogsError(
@@ -534,14 +535,17 @@ def _build_entries(
534
535
  def _entry_path(
535
536
  *, identity: WorklogIdentity, config: WorklogConfig, now: datetime
536
537
  ) -> Path:
537
- """Compute the file path: root/scope/YYYY/MM/DD/HHMM--name--kind.md."""
538
+ """Compute the file path for a worklog entry."""
539
+ hour12 = int(now.strftime("%I"))
540
+ period = "a" if now.hour < 12 else "p"
541
+ time_prefix = f"{now:%H%M}-{hour12}{period}"
538
542
  return (
539
543
  config.root
540
544
  / config.scope
541
545
  / f"{now:%Y}"
542
- / f"{now:%m}"
543
- / f"{now:%d}"
544
- / f"{now:%H%M}--{identity.name}--{identity.kind}.md"
546
+ / f"{now:%m}-{now:%B}".lower()
547
+ / f"{now:%d}-{now:%A}".lower()
548
+ / f"{time_prefix}--{identity.name}--{identity.kind}.md"
545
549
  )
546
550
 
547
551
 
@@ -1,4 +1,4 @@
1
- """Tests for worklogs CLI — HHMM--name--kind.md format."""
1
+ """Tests for worklogs CLI — HHMM-Hp/a--name--kind.md format."""
2
2
 
3
3
  from __future__ import annotations
4
4
 
@@ -57,7 +57,7 @@ def test_parse_identity_token_rejects_unknown_kind() -> None:
57
57
 
58
58
 
59
59
  def test_entry_path_format(tmp_path: Path) -> None:
60
- """Path uses HHMM--name--kind.md format."""
60
+ """Path uses HHMM-Hp/a--name--kind.md format with human-readable dirs."""
61
61
  tz = ZoneInfo("America/Toronto")
62
62
  config = WorklogConfig(
63
63
  root=tmp_path / "worklog",
@@ -78,9 +78,9 @@ def test_entry_path_format(tmp_path: Path) -> None:
78
78
  / "worklog"
79
79
  / "work"
80
80
  / "2026"
81
- / "06"
82
- / "12"
83
- / "1421--leansim2sim--plan.md"
81
+ / "06-june"
82
+ / "12-friday"
83
+ / "1421-2p--leansim2sim--plan.md"
84
84
  )
85
85
 
86
86
 
@@ -106,8 +106,8 @@ def test_plan_creates_companion_with_same_name(tmp_path: Path) -> None:
106
106
  )
107
107
 
108
108
  assert len(entries) == 2
109
- assert entries[0].path.name == "1421--leansim2sim--plan.md"
110
- assert entries[1].path.name == "1421--leansim2sim--note.md"
109
+ assert entries[0].path.name == "1421-2p--leansim2sim--plan.md"
110
+ assert entries[1].path.name == "1421-2p--leansim2sim--note.md"
111
111
  assert "leansim2sim--note.md" in entries[0].content
112
112
  assert "leansim2sim--plan.md" in entries[1].content
113
113
 
@@ -134,7 +134,7 @@ def test_note_creates_single_file(tmp_path: Path) -> None:
134
134
  )
135
135
 
136
136
  assert len(entries) == 1
137
- assert entries[0].path.name == "1000--quick-observation--note.md"
137
+ assert entries[0].path.name == "1000-10a--quick-observation--note.md"
138
138
 
139
139
 
140
140
  def test_new_creates_new_format_files(
@@ -149,7 +149,7 @@ def test_new_creates_new_format_files(
149
149
 
150
150
  created = sorted((root / "work").glob("*/*/*/*.md"))
151
151
  assert len(created) == 2
152
- names = {p.name[6:] for p in created} # strip HHMM-- prefix
152
+ names = {p.name.split("--", 1)[1] for p in created} # strip HHMM-Hp/a-- prefix
153
153
  assert names == {"leansim2sim--plan.md", "leansim2sim--note.md"}
154
154
 
155
155
 
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes