killtimer 0.4.0__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.
@@ -1,31 +1,32 @@
1
- Metadata-Version: 2.1
1
+ Metadata-Version: 2.4
2
2
  Name: killtimer
3
- Version: 0.4.0
3
+ Version: 0.5.0
4
4
  Summary: Closes application after specified work interval
5
- Home-page: https://github.com/idle-code/killtimer
6
- License: GPL-3.0-or-later
5
+ License-Expression: GPL-3.0-or-later
7
6
  Author: Paweł Żukowski
8
7
  Author-email: p.z.idlecode@gmail.com
9
- Requires-Python: >=3.8,<4.0
8
+ Requires-Python: >=3.11
10
9
  Classifier: Environment :: Console
11
10
  Classifier: Intended Audience :: End Users/Desktop
12
- Classifier: License :: OSI Approved :: GNU General Public License v3 or later (GPLv3+)
13
11
  Classifier: Natural Language :: English
14
12
  Classifier: Operating System :: POSIX
15
13
  Classifier: Operating System :: POSIX :: Linux
16
14
  Classifier: Operating System :: Unix
17
15
  Classifier: Programming Language :: Python :: 3
18
- Classifier: Programming Language :: Python :: 3.8
19
- Classifier: Programming Language :: Python :: 3.9
20
- Classifier: Programming Language :: Python :: 3.10
16
+ Classifier: Programming Language :: Python :: 3 :: Only
21
17
  Classifier: Programming Language :: Python :: 3.11
22
18
  Classifier: Programming Language :: Python :: 3.12
19
+ Classifier: Programming Language :: Python :: 3.13
20
+ Classifier: Programming Language :: Python :: 3.14
23
21
  Classifier: Topic :: Utilities
24
- Requires-Dist: PyAudio (>=0.2.13,<0.3.0)
25
- Requires-Dist: desktop-notifier (>=3.4.0,<4.0.0)
26
- Requires-Dist: humanfriendly (>=10.0,<11.0)
27
- Requires-Dist: pytimeparse (>=1.1.8,<2.0.0)
28
- Requires-Dist: rich (>=12.4.3,<13.0.0)
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)
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
29
30
  Description-Content-Type: text/markdown
30
31
 
31
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 DesktopNotifier, Urgency
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,8 +128,9 @@ def parse_configuration(args: [str]) -> RuntimeConfiguration:
129
128
  )
130
129
 
131
130
 
132
- notify = DesktopNotifier(app_name="Killtimer")
133
- event_loop = asyncio.get_event_loop()
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")
134
134
 
135
135
  console = Console()
136
136
 
@@ -149,11 +149,7 @@ def play_notification_sound():
149
149
  rate=wf.getframerate(),
150
150
  output=True)
151
151
 
152
- # TODO: For Python 3.8 use while len(data := wf.readframes(AUDIO_CHUNK_SIZE))
153
- while True:
154
- data = wf.readframes(AUDIO_CHUNK_SIZE)
155
- if not data:
156
- break
152
+ while data := wf.readframes(AUDIO_CHUNK_SIZE):
157
153
  stream.write(data)
158
154
 
159
155
  stream.close()
@@ -162,7 +158,7 @@ def play_notification_sound():
162
158
 
163
159
  def show_notification(message: str, icon_name: str, stay_visible: bool = False):
164
160
  urgency = Urgency.Critical if stay_visible else Urgency.Normal
165
- event_loop.run_until_complete(notify.send(title="", message=message, icon=icon_name, sound=True, urgency=urgency))
161
+ notify.send(title="", message=message, icon=Icon(name=icon_name), sound=NOTIFICATION_SOUND, urgency=urgency)
166
162
 
167
163
 
168
164
  def finished_minimal_effort_notification():
@@ -195,7 +191,7 @@ def main() -> int:
195
191
  os.killpg(os.getpgid(user_command.pid), signal.SIGTERM)
196
192
  # CHECK: wait a bit and kill it if still running?
197
193
 
198
- event_loop.run_until_complete(notify.clear_all())
194
+ notify.clear_all()
199
195
 
200
196
  # Show total time spent
201
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"
@@ -1,36 +0,0 @@
1
- [tool.poetry]
2
- name = "killtimer"
3
- version = "0.4.0"
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