Skip to content

Commit

Permalink
Add type hints
Browse files Browse the repository at this point in the history
  • Loading branch information
lulunac27a committed Jan 20, 2025
1 parent fdf7315 commit 476742b
Showing 1 changed file with 6 additions and 4 deletions.
10 changes: 6 additions & 4 deletions app.py
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@

import math
from typing import Union
from datetime import datetime
from datetime import datetime, timedelta
from flask import Flask, render_template, redirect, url_for, request
from flask_migrate import Migrate as MigrateClass
from flask_sqlalchemy import SQLAlchemy
Expand Down Expand Up @@ -59,9 +59,11 @@ def add_xp(self, amount: float) -> None: # add XP
Add XP (experience points) to the user.
amount - the amount to add XP.
"""
current_time = datetime.utcnow() # get current time
time_difference = current_time - self.last_time_clicked # get time difference
time_difference_seconds = (
current_time: datetime = datetime.utcnow() # get current time
time_difference: timedelta = (
current_time - self.last_time_clicked
) # get time difference
time_difference_seconds: float = (
time_difference.total_seconds()
) # get time difference in seconds
if (
Expand Down

0 comments on commit 476742b

Please sign in to comment.