killtimer 0.4.1__tar.gz → 0.5.0__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.
- {killtimer-0.4.1 → killtimer-0.5.0}/PKG-INFO +11 -13
- {killtimer-0.4.1 → killtimer-0.5.0}/killtimer/main.py +7 -12
- killtimer-0.5.0/pyproject.toml +45 -0
- killtimer-0.4.1/pyproject.toml +0 -36
- {killtimer-0.4.1 → killtimer-0.5.0}/README.md +0 -0
- {killtimer-0.4.1 → killtimer-0.5.0}/killtimer/__init__.py +0 -0
- {killtimer-0.4.1 → killtimer-0.5.0}/killtimer/alsa_utils.py +0 -0
- {killtimer-0.4.1 → killtimer-0.5.0}/killtimer/stats.py +0 -0
|
@@ -1,34 +1,32 @@
|
|
|
1
1
|
Metadata-Version: 2.4
|
|
2
2
|
Name: killtimer
|
|
3
|
-
Version: 0.
|
|
3
|
+
Version: 0.5.0
|
|
4
4
|
Summary: Closes application after specified work interval
|
|
5
|
-
License: GPL-3.0-or-later
|
|
5
|
+
License-Expression: GPL-3.0-or-later
|
|
6
6
|
Author: Paweł Żukowski
|
|
7
7
|
Author-email: p.z.idlecode@gmail.com
|
|
8
|
-
Requires-Python: >=3.
|
|
8
|
+
Requires-Python: >=3.11
|
|
9
9
|
Classifier: Environment :: Console
|
|
10
10
|
Classifier: Intended Audience :: End Users/Desktop
|
|
11
|
-
Classifier: License :: OSI Approved :: GNU General Public License v3 or later (GPLv3+)
|
|
12
11
|
Classifier: Natural Language :: English
|
|
13
12
|
Classifier: Operating System :: POSIX
|
|
14
13
|
Classifier: Operating System :: POSIX :: Linux
|
|
15
14
|
Classifier: Operating System :: Unix
|
|
16
15
|
Classifier: Programming Language :: Python :: 3
|
|
17
|
-
Classifier: Programming Language :: Python :: 3
|
|
18
|
-
Classifier: Programming Language :: Python :: 3.9
|
|
19
|
-
Classifier: Programming Language :: Python :: 3.10
|
|
16
|
+
Classifier: Programming Language :: Python :: 3 :: Only
|
|
20
17
|
Classifier: Programming Language :: Python :: 3.11
|
|
21
18
|
Classifier: Programming Language :: Python :: 3.12
|
|
22
19
|
Classifier: Programming Language :: Python :: 3.13
|
|
23
20
|
Classifier: Programming Language :: Python :: 3.14
|
|
24
|
-
Classifier: Programming Language :: Python :: 3.15
|
|
25
21
|
Classifier: Topic :: Utilities
|
|
26
|
-
Requires-Dist: PyAudio (>=0.2.
|
|
27
|
-
Requires-Dist: desktop-notifier (>=
|
|
28
|
-
Requires-Dist: humanfriendly (>=10.0,<11
|
|
29
|
-
Requires-Dist: pytimeparse (>=1.1.8,<2
|
|
30
|
-
Requires-Dist: rich (>=
|
|
22
|
+
Requires-Dist: PyAudio (>=0.2.14,<0.3)
|
|
23
|
+
Requires-Dist: desktop-notifier (>=6.2.0,<7)
|
|
24
|
+
Requires-Dist: humanfriendly (>=10.0,<11)
|
|
25
|
+
Requires-Dist: pytimeparse (>=1.1.8,<2)
|
|
26
|
+
Requires-Dist: rich (>=15.0.0,<16)
|
|
31
27
|
Project-URL: Homepage, https://github.com/idle-code/killtimer
|
|
28
|
+
Project-URL: Issues, https://github.com/idle-code/killtimer/issues
|
|
29
|
+
Project-URL: Repository, https://github.com/idle-code/killtimer
|
|
32
30
|
Description-Content-Type: text/markdown
|
|
33
31
|
|
|
34
32
|
# Killtimer - do more working less!
|
|
@@ -1,6 +1,5 @@
|
|
|
1
1
|
#!/usr/bin/env python
|
|
2
2
|
import argparse
|
|
3
|
-
import asyncio
|
|
4
3
|
import csv
|
|
5
4
|
import datetime
|
|
6
5
|
import math
|
|
@@ -16,7 +15,7 @@ import wave
|
|
|
16
15
|
import pyaudio
|
|
17
16
|
from dataclasses import dataclass
|
|
18
17
|
from typing import Optional, List, Callable
|
|
19
|
-
from desktop_notifier import
|
|
18
|
+
from desktop_notifier import DesktopNotifierSync, Icon, Sound, Urgency
|
|
20
19
|
from rich.progress import Progress, SpinnerColumn, TextColumn, BarColumn, TaskProgressColumn
|
|
21
20
|
from rich.console import Console
|
|
22
21
|
from rich import print as rprint
|
|
@@ -129,9 +128,9 @@ def parse_configuration(args: [str]) -> RuntimeConfiguration:
|
|
|
129
128
|
)
|
|
130
129
|
|
|
131
130
|
|
|
132
|
-
notify =
|
|
133
|
-
|
|
134
|
-
|
|
131
|
+
notify = DesktopNotifierSync(app_name="Killtimer")
|
|
132
|
+
# Same sound that desktop-notifier < 4 used for sound=True
|
|
133
|
+
NOTIFICATION_SOUND = Sound(name="message-new-instant")
|
|
135
134
|
|
|
136
135
|
console = Console()
|
|
137
136
|
|
|
@@ -150,11 +149,7 @@ def play_notification_sound():
|
|
|
150
149
|
rate=wf.getframerate(),
|
|
151
150
|
output=True)
|
|
152
151
|
|
|
153
|
-
|
|
154
|
-
while True:
|
|
155
|
-
data = wf.readframes(AUDIO_CHUNK_SIZE)
|
|
156
|
-
if not data:
|
|
157
|
-
break
|
|
152
|
+
while data := wf.readframes(AUDIO_CHUNK_SIZE):
|
|
158
153
|
stream.write(data)
|
|
159
154
|
|
|
160
155
|
stream.close()
|
|
@@ -163,7 +158,7 @@ def play_notification_sound():
|
|
|
163
158
|
|
|
164
159
|
def show_notification(message: str, icon_name: str, stay_visible: bool = False):
|
|
165
160
|
urgency = Urgency.Critical if stay_visible else Urgency.Normal
|
|
166
|
-
|
|
161
|
+
notify.send(title="", message=message, icon=Icon(name=icon_name), sound=NOTIFICATION_SOUND, urgency=urgency)
|
|
167
162
|
|
|
168
163
|
|
|
169
164
|
def finished_minimal_effort_notification():
|
|
@@ -196,7 +191,7 @@ def main() -> int:
|
|
|
196
191
|
os.killpg(os.getpgid(user_command.pid), signal.SIGTERM)
|
|
197
192
|
# CHECK: wait a bit and kill it if still running?
|
|
198
193
|
|
|
199
|
-
|
|
194
|
+
notify.clear_all()
|
|
200
195
|
|
|
201
196
|
# Show total time spent
|
|
202
197
|
rprint(f"Total work duration: {format_duration(total_work_duration)}")
|
|
@@ -0,0 +1,45 @@
|
|
|
1
|
+
[project]
|
|
2
|
+
name = "killtimer"
|
|
3
|
+
version = "0.5.0"
|
|
4
|
+
description = "Closes application after specified work interval"
|
|
5
|
+
license = "GPL-3.0-or-later"
|
|
6
|
+
readme = "README.md"
|
|
7
|
+
authors = [
|
|
8
|
+
{ name = "Paweł Żukowski", email = "p.z.idlecode@gmail.com" },
|
|
9
|
+
]
|
|
10
|
+
requires-python = ">=3.11"
|
|
11
|
+
classifiers = [
|
|
12
|
+
"Environment :: Console",
|
|
13
|
+
"Intended Audience :: End Users/Desktop",
|
|
14
|
+
"Natural Language :: English",
|
|
15
|
+
"Operating System :: POSIX",
|
|
16
|
+
"Operating System :: POSIX :: Linux",
|
|
17
|
+
"Operating System :: Unix",
|
|
18
|
+
"Programming Language :: Python :: 3",
|
|
19
|
+
"Programming Language :: Python :: 3 :: Only",
|
|
20
|
+
"Programming Language :: Python :: 3.11",
|
|
21
|
+
"Programming Language :: Python :: 3.12",
|
|
22
|
+
"Programming Language :: Python :: 3.13",
|
|
23
|
+
"Programming Language :: Python :: 3.14",
|
|
24
|
+
"Topic :: Utilities",
|
|
25
|
+
]
|
|
26
|
+
dependencies = [
|
|
27
|
+
"rich>=15.0.0,<16",
|
|
28
|
+
"desktop-notifier>=6.2.0,<7",
|
|
29
|
+
"pytimeparse>=1.1.8,<2",
|
|
30
|
+
"humanfriendly>=10.0,<11",
|
|
31
|
+
"PyAudio>=0.2.14,<0.3",
|
|
32
|
+
]
|
|
33
|
+
|
|
34
|
+
[project.urls]
|
|
35
|
+
Homepage = "https://github.com/idle-code/killtimer"
|
|
36
|
+
Repository = "https://github.com/idle-code/killtimer"
|
|
37
|
+
Issues = "https://github.com/idle-code/killtimer/issues"
|
|
38
|
+
|
|
39
|
+
[project.scripts]
|
|
40
|
+
killtimer = "killtimer.main:main"
|
|
41
|
+
killtimer-stats = "killtimer.stats:main"
|
|
42
|
+
|
|
43
|
+
[build-system]
|
|
44
|
+
requires = ["poetry-core>=2.0.0,<3.0.0"]
|
|
45
|
+
build-backend = "poetry.core.masonry.api"
|
killtimer-0.4.1/pyproject.toml
DELETED
|
@@ -1,36 +0,0 @@
|
|
|
1
|
-
[tool.poetry]
|
|
2
|
-
name = "killtimer"
|
|
3
|
-
version = "0.4.1"
|
|
4
|
-
description = "Closes application after specified work interval"
|
|
5
|
-
license = "GPL-3.0-or-later"
|
|
6
|
-
homepage = "https://github.com/idle-code/killtimer"
|
|
7
|
-
readme = "README.md"
|
|
8
|
-
authors = ["Paweł Żukowski <p.z.idlecode@gmail.com>"]
|
|
9
|
-
classifiers = [
|
|
10
|
-
"Environment :: Console",
|
|
11
|
-
"Intended Audience :: End Users/Desktop",
|
|
12
|
-
"Natural Language :: English",
|
|
13
|
-
"Operating System :: POSIX",
|
|
14
|
-
"Operating System :: POSIX :: Linux",
|
|
15
|
-
"Operating System :: Unix",
|
|
16
|
-
"Programming Language :: Python :: 3",
|
|
17
|
-
"Topic :: Utilities"
|
|
18
|
-
]
|
|
19
|
-
|
|
20
|
-
[tool.poetry.dependencies]
|
|
21
|
-
python = "^3.8"
|
|
22
|
-
rich = "^12.4.3"
|
|
23
|
-
desktop-notifier = "^3.4.0"
|
|
24
|
-
pytimeparse = "^1.1.8"
|
|
25
|
-
humanfriendly = "^10.0"
|
|
26
|
-
PyAudio = "^0.2.13"
|
|
27
|
-
|
|
28
|
-
[tool.poetry.dev-dependencies]
|
|
29
|
-
|
|
30
|
-
[tool.poetry.scripts]
|
|
31
|
-
killtimer = "killtimer.main:main"
|
|
32
|
-
killtimer-stats = "killtimer.stats:main"
|
|
33
|
-
|
|
34
|
-
[build-system]
|
|
35
|
-
requires = ["poetry-core>=1.0.0"]
|
|
36
|
-
build-backend = "poetry.core.masonry.api"
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|