Skip to content

Commit a8dbe96

Browse files
committed
v0.2.0 - split out functionality of 'sup' command into 'sup' and 'did', UI cleanup, 'nvm' and 'info' not implemented yet.
1 parent 6ab66f0 commit a8dbe96

File tree

10 files changed

+32
-32
lines changed

10 files changed

+32
-32
lines changed

pyproject.toml

Lines changed: 4 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -1,21 +1,14 @@
11
[project]
22
name = "fob"
3-
version = "0.1.0"
3+
version = "0.2.0"
44
description = "Focus Blocks: Simple and elegant daily time management tool."
55
readme = "README.md"
6-
authors = [
7-
{ name = "tensorturtle", email = "[email protected]" }
8-
]
6+
authors = [{ name = "tensorturtle", email = "[email protected]" }]
97
requires-python = ">=3.12"
10-
dependencies = [
11-
"rich>=13.9.4",
12-
"tinydb>=4.8.2",
13-
]
8+
dependencies = ["rich>=13.9.4", "tinydb>=4.8.2"]
149

1510
[project.scripts]
1611
fob = "fob:main"
1712

1813
[tool.uv]
19-
dev-dependencies = [
20-
"nuitka>=2.4.11",
21-
]
14+
dev-dependencies = ["nuitka>=2.4.11"]

src/fob/__init__.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -61,7 +61,7 @@ def run_app():
6161
type=str,
6262
help="ID of the block to check off (int)",
6363
)
64-
subparsers.add_parser("nvm", help="Revise block assignment for today and change a non-Buffer block into a Buffer block, and mark that new Buffer block as complete."
64+
subparsers.add_parser("nvm", help="Revise block assignment for today and change a non-Buffer block into a Buffer block, and mark that new Buffer block as complete.")
6565
args = parser.parse_args()
6666

6767
command_func = None

src/fob/commands/__init__.py

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -5,3 +5,4 @@
55
from fob.commands.new_month import new_month
66
from fob.commands.reset import reset
77
from fob.commands.did import did
8+
from fob.commands.nvm import nvm

src/fob/commands/gm.py

Lines changed: 6 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -1,19 +1,13 @@
11
from argparse import Namespace
22
from datetime import date
3-
from calendar import monthrange
43

5-
from rich.pretty import pprint, Pretty
4+
from rich.pretty import Pretty
65
from rich import print
7-
from rich.layout import Layout
86
from rich.panel import Panel
9-
from rich.progress import Progress, TextColumn, BarColumn, TaskProgressColumn, ProgressColumn
10-
from rich.console import Console, Group
11-
from rich.rule import Rule
127
from rich.prompt import Prompt
13-
from rich.text import Text
148
from tinydb import where, Query
159

16-
from fob.db import MonthBlockData, TinyDBWrapper, checklist_complete
10+
from fob.db import TinyDBWrapper, checklist_complete
1711
from fob.commands.overviews import month_overview, display_checklist
1812

1913
class InvalidUserInput(Exception):
@@ -36,7 +30,7 @@ def gm(args: Namespace, db: TinyDBWrapper) -> None:
3630
print("In the meantime, consider running [bold][cyan]fob reset[/cyan][/bold].")
3731
return
3832

39-
print(f"Good morning! \N{SUNRISE}")
33+
print("Good morning! \N{SUNRISE}")
4034
month_overview(args, db)
4135
try:
4236
new_day(args, db, data[0]) # can raise InvalidUserInput
@@ -94,11 +88,11 @@ def new_day(args: Namespace, db: TinyDBWrapper, data) -> None:
9488
blocks_assigned = int(Prompt.ask(f"({blocks_per_day - blocks_remaining_to_assign + 1}/{blocks_per_day}) How many blocks for [bold]{area_name}[/bold]? (max: [bold][cyan]{max_blocks}[/bold][/cyan])", default=0))
9589

9690
if blocks_assigned > blocks_remaining_to_assign:
97-
print(f"[red][bold]Error![/red] You have assigned more blocks than you have available today. Please try again.")
91+
print("[red][bold]Error![/red] You have assigned more blocks than you have available today. Please try again.")
9892
raise InvalidUserInput
9993

10094
if blocks_assigned > blocks['allocated'] - blocks['completed']:
101-
print(f"[red][bold]Error![/red][/bold] You have assigned more blocks than are remaining in this area. Please try again.")
95+
print("[red][bold]Error![/red][/bold] You have assigned more blocks than are remaining in this area. Please try again.")
10296
raise InvalidUserInput
10397

10498
blocks_remaining_to_assign -= blocks_assigned
@@ -110,7 +104,7 @@ def new_day(args: Namespace, db: TinyDBWrapper, data) -> None:
110104
today_areas[area_name] = blocks_assigned
111105

112106
if blocks_remaining_to_assign > 0:
113-
print(f"[red][bold]Error![/red][/bold] You have not assigned all your blocks. Please try again.")
107+
print("[red][bold]Error![/red][/bold] You have not assigned all your blocks. Please try again.")
114108
raise InvalidUserInput
115109

116110
if args.debug:

src/fob/commands/info.py

Lines changed: 14 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,14 @@
1+
from argparse import Namespace
2+
3+
from fob.db.wrapper import TinyDBWrapper
4+
5+
6+
def info(args: Namespace, db: TinyDBWrapper):
7+
'''
8+
'info' command displays basic metadata about this program.
9+
10+
+ Version
11+
+ Author
12+
+ License
13+
'''
14+
raise NotImplementedError("This command has not been implemented yet.")

src/fob/commands/new_month.py

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,6 @@
1-
from datetime import date, time
1+
from datetime import date
22
from calendar import monthrange
33
from argparse import Namespace
4-
from dataclasses import dataclass
54

65
from rich.prompt import Prompt
76
from rich import print

src/fob/commands/overviews/day_checklist.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -9,7 +9,7 @@
99
def display_checklist(args: Namespace, db: TinyDBWrapper) -> None:
1010
try:
1111
checklist = db.all()[0]['checklist']
12-
except KeyError:
12+
except (IndexError, KeyError):
1313
print("[red][bold]No day data found.[/red][/bold]")
1414
print("Run [cyan][bold]fob gm[/cyan][/bold] to start a new day.")
1515
return

src/fob/commands/overviews/month_overview.py

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,6 @@
33
from calendar import monthrange
44

55
from tinydb import where
6-
from rich.pretty import pprint
76
from rich.console import Console, Group
87
from rich.panel import Panel
98
from rich.progress import Progress, BarColumn, TaskProgressColumn, TextColumn, ProgressColumn
@@ -49,10 +48,10 @@ def month_overview(args: Namespace, db: TinyDBWrapper) -> None:
4948
days_in_month = monthrange(today.year, today.month)[1]
5049

5150
with m_progress:
52-
task = m_progress.add_task(f"Month", total=days_in_month)
51+
task = m_progress.add_task("Month", total=days_in_month)
5352
m_progress.update(task, completed=today.day)
5453

55-
task = m_progress.add_task(f"Work Days", total=data['work_days_allocated'])
54+
task = m_progress.add_task("Work Days", total=data['work_days_allocated'])
5655
m_progress.update(task, completed=data['work_days_completed'])
5756

5857
with progress:

src/fob/commands/reset.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -10,7 +10,7 @@
1010

1111

1212
def reset(args: Namespace, db: TinyDBWrapper) -> None:
13-
print(f"[red bold]Warning![/red bold] This will delete the database at the default path.")
13+
print("[red bold]Warning![/red bold] This will delete the database at the default path.")
1414
if Prompt.ask("Are you sure?", choices=["yes", "no"], default="no") == "no":
1515
print("Reset cancelled.")
1616
return

uv.lock

Lines changed: 1 addition & 1 deletion
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

0 commit comments

Comments
 (0)