chore: format using 'black'
This commit is contained in:
@@ -8,19 +8,24 @@ Pomodoro timer
|
||||
- Notification on break finish
|
||||
"""
|
||||
|
||||
import os
|
||||
import atexit
|
||||
import os
|
||||
from argparse import ArgumentParser
|
||||
from time import sleep
|
||||
|
||||
from plyer import notification
|
||||
|
||||
POMO_PATH = os.path.join(os.getenv("XDG_DATA_HOME", os.path.expanduser("~/.local/share")), "pomo")
|
||||
POMO_PATH = os.path.join(
|
||||
os.getenv("XDG_DATA_HOME", os.path.expanduser("~/.local/share")), "pomo"
|
||||
)
|
||||
|
||||
|
||||
@atexit.register
|
||||
def clear():
|
||||
if os.path.exists(POMO_PATH):
|
||||
os.remove(POMO_PATH)
|
||||
|
||||
|
||||
def format_mins_secs(mins, secs):
|
||||
return f"{mins:02d}:{secs:02d}"
|
||||
|
||||
@@ -34,6 +39,7 @@ def make_countdown():
|
||||
os.system(f'echo -n "{time_str}" > {POMO_PATH}')
|
||||
sleep(1)
|
||||
duration -= 1
|
||||
|
||||
return countdown
|
||||
|
||||
|
||||
@@ -58,21 +64,23 @@ def main(args):
|
||||
def handle_signal(signal, frame):
|
||||
# Wait for clear to finish
|
||||
clear()
|
||||
print('Exiting')
|
||||
print("Exiting")
|
||||
exit(0)
|
||||
|
||||
|
||||
if __name__ == '__main__':
|
||||
if __name__ == "__main__":
|
||||
|
||||
parser = ArgumentParser()
|
||||
parser.add_argument('-w', '--work-duration', type=int,
|
||||
help='Session duration', default=25)
|
||||
parser.add_argument('-b', '--break-duration', type=int,
|
||||
help='Break duration', default=5)
|
||||
parser.add_argument('-r', '--repeats', type=int,
|
||||
help='Numer of sessions', default=1)
|
||||
parser.add_argument('-c', '--clear', action='store_true',
|
||||
help='Clear timer')
|
||||
parser.add_argument(
|
||||
"-w", "--work-duration", type=int, help="Session duration", default=25
|
||||
)
|
||||
parser.add_argument(
|
||||
"-b", "--break-duration", type=int, help="Break duration", default=5
|
||||
)
|
||||
parser.add_argument(
|
||||
"-r", "--repeats", type=int, help="Numer of sessions", default=1
|
||||
)
|
||||
parser.add_argument("-c", "--clear", action="store_true", help="Clear timer")
|
||||
|
||||
args = parser.parse_args()
|
||||
|
||||
|
||||
Reference in New Issue
Block a user