Skip to content

Commit

Permalink
Added python-dateutil to setup.py requirements.
Browse files Browse the repository at this point in the history
  • Loading branch information
dagraham committed Dec 25, 2024
1 parent 93f97cf commit d118008
Show file tree
Hide file tree
Showing 2 changed files with 12 additions and 13 deletions.
24 changes: 11 additions & 13 deletions modules/timemate.py
Original file line number Diff line number Diff line change
Expand Up @@ -17,11 +17,14 @@
from rich.table import Table
from rich.tree import Tree

from . import (CONFIG_FILE, backup_dir, db_path, log_dir, pos_to_id,
timemate_home)
from . import CONFIG_FILE, backup_dir, db_path, log_dir, pos_to_id, timemate_home
from .__version__ import version
from .common import (datetime_to_seconds, seconds_to_datetime, seconds_to_time,
time_to_seconds)
from .common import (
datetime_to_seconds,
seconds_to_datetime,
seconds_to_time,
time_to_seconds,
)

AllowedMinutes = Literal[1, 6, 12, 30, 60]
MINUTES = 1
Expand Down Expand Up @@ -387,17 +390,14 @@ def timer_new():
default=default,
)
new_datetime = (
datetime_to_seconds(
new_datetime_input
)
datetime_to_seconds(new_datetime_input)
if new_datetime_input.strip()
else default
)
except (ValueError, KeyboardInterrupt):
console.print("[red]Invalid datetime format or operation cancelled.[/red]")
conn.close()
return

return

cursor.execute(
"INSERT INTO Times (account_id, memo, status, timedelta, datetime) VALUES (?, ?, 'paused', ?, ?)",
Expand Down Expand Up @@ -634,16 +634,14 @@ def timer_update(position):
default=current_datetime_str,
)
new_datetime = (
datetime_to_seconds(
new_datetime_input
)
datetime_to_seconds(new_datetime_input)
if new_datetime_input.strip()
else current_datetime
)
except (ValueError, KeyboardInterrupt):
console.print("[red]Invalid datetime format or operation cancelled.[/red]")
conn.close()
return
return

# Update the timer record
cursor.execute(
Expand Down
1 change: 1 addition & 0 deletions setup.py
Original file line number Diff line number Diff line change
Expand Up @@ -52,6 +52,7 @@ def run(self):
"click",
"click-shell",
"prompt_toolkit",
"python-dateutil",
"rich",
"pyyaml",
"pytz",
Expand Down

0 comments on commit d118008

Please sign in to comment.