wrkmon 1.0.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.
Files changed (48) hide show
  1. wrkmon-1.0.0/LICENSE.txt +21 -0
  2. wrkmon-1.0.0/PKG-INFO +193 -0
  3. wrkmon-1.0.0/README.md +156 -0
  4. wrkmon-1.0.0/pyproject.toml +68 -0
  5. wrkmon-1.0.0/setup.cfg +4 -0
  6. wrkmon-1.0.0/tests/test_core.py +105 -0
  7. wrkmon-1.0.0/tests/test_utils.py +63 -0
  8. wrkmon-1.0.0/wrkmon/__init__.py +4 -0
  9. wrkmon-1.0.0/wrkmon/__main__.py +6 -0
  10. wrkmon-1.0.0/wrkmon/app.py +568 -0
  11. wrkmon-1.0.0/wrkmon/cli.py +289 -0
  12. wrkmon-1.0.0/wrkmon/core/__init__.py +8 -0
  13. wrkmon-1.0.0/wrkmon/core/cache.py +208 -0
  14. wrkmon-1.0.0/wrkmon/core/player.py +301 -0
  15. wrkmon-1.0.0/wrkmon/core/queue.py +264 -0
  16. wrkmon-1.0.0/wrkmon/core/youtube.py +178 -0
  17. wrkmon-1.0.0/wrkmon/data/__init__.py +6 -0
  18. wrkmon-1.0.0/wrkmon/data/database.py +426 -0
  19. wrkmon-1.0.0/wrkmon/data/migrations.py +134 -0
  20. wrkmon-1.0.0/wrkmon/data/models.py +144 -0
  21. wrkmon-1.0.0/wrkmon/ui/__init__.py +5 -0
  22. wrkmon-1.0.0/wrkmon/ui/components.py +211 -0
  23. wrkmon-1.0.0/wrkmon/ui/messages.py +89 -0
  24. wrkmon-1.0.0/wrkmon/ui/screens/__init__.py +8 -0
  25. wrkmon-1.0.0/wrkmon/ui/screens/history.py +142 -0
  26. wrkmon-1.0.0/wrkmon/ui/screens/player.py +222 -0
  27. wrkmon-1.0.0/wrkmon/ui/screens/playlist.py +278 -0
  28. wrkmon-1.0.0/wrkmon/ui/screens/search.py +165 -0
  29. wrkmon-1.0.0/wrkmon/ui/theme.py +326 -0
  30. wrkmon-1.0.0/wrkmon/ui/views/__init__.py +8 -0
  31. wrkmon-1.0.0/wrkmon/ui/views/history.py +138 -0
  32. wrkmon-1.0.0/wrkmon/ui/views/playlists.py +259 -0
  33. wrkmon-1.0.0/wrkmon/ui/views/queue.py +191 -0
  34. wrkmon-1.0.0/wrkmon/ui/views/search.py +150 -0
  35. wrkmon-1.0.0/wrkmon/ui/widgets/__init__.py +7 -0
  36. wrkmon-1.0.0/wrkmon/ui/widgets/header.py +59 -0
  37. wrkmon-1.0.0/wrkmon/ui/widgets/player_bar.py +115 -0
  38. wrkmon-1.0.0/wrkmon/ui/widgets/result_item.py +98 -0
  39. wrkmon-1.0.0/wrkmon/utils/__init__.py +6 -0
  40. wrkmon-1.0.0/wrkmon/utils/config.py +172 -0
  41. wrkmon-1.0.0/wrkmon/utils/mpv_installer.py +190 -0
  42. wrkmon-1.0.0/wrkmon/utils/stealth.py +124 -0
  43. wrkmon-1.0.0/wrkmon.egg-info/PKG-INFO +193 -0
  44. wrkmon-1.0.0/wrkmon.egg-info/SOURCES.txt +46 -0
  45. wrkmon-1.0.0/wrkmon.egg-info/dependency_links.txt +1 -0
  46. wrkmon-1.0.0/wrkmon.egg-info/entry_points.txt +2 -0
  47. wrkmon-1.0.0/wrkmon.egg-info/requires.txt +11 -0
  48. wrkmon-1.0.0/wrkmon.egg-info/top_level.txt +1 -0
@@ -0,0 +1,21 @@
1
+ MIT License
2
+
3
+ Copyright (c) 2024 Umar Khan Yousafzai
4
+
5
+ Permission is hereby granted, free of charge, to any person obtaining a copy
6
+ of this software and associated documentation files (the "Software"), to deal
7
+ in the Software without restriction, including without limitation the rights
8
+ to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
9
+ copies of the Software, and to permit persons to whom the Software is
10
+ furnished to do so, subject to the following conditions:
11
+
12
+ The above copyright notice and this permission notice shall be included in all
13
+ copies or substantial portions of the Software.
14
+
15
+ THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
16
+ IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
17
+ FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
18
+ AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
19
+ LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
20
+ OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
21
+ SOFTWARE.
wrkmon-1.0.0/PKG-INFO ADDED
@@ -0,0 +1,193 @@
1
+ Metadata-Version: 2.4
2
+ Name: wrkmon
3
+ Version: 1.0.0
4
+ Summary: Stealth TUI YouTube audio player - stream music while looking productive
5
+ Author-email: Umar Khan Yousafzai <umar@example.com>
6
+ License-Expression: MIT
7
+ Project-URL: Homepage, https://github.com/Umar-Khan-Yousafzai/Wrkmon-TUI-Youtube
8
+ Project-URL: Documentation, https://github.com/Umar-Khan-Yousafzai/Wrkmon-TUI-Youtube#readme
9
+ Project-URL: Repository, https://github.com/Umar-Khan-Yousafzai/Wrkmon-TUI-Youtube
10
+ Project-URL: Issues, https://github.com/Umar-Khan-Yousafzai/Wrkmon-TUI-Youtube/issues
11
+ Keywords: youtube,audio,player,tui,music,stealth,productivity,terminal
12
+ Classifier: Development Status :: 4 - Beta
13
+ Classifier: Environment :: Console
14
+ Classifier: Intended Audience :: Developers
15
+ Classifier: Intended Audience :: End Users/Desktop
16
+ Classifier: Operating System :: OS Independent
17
+ Classifier: Operating System :: Microsoft :: Windows
18
+ Classifier: Operating System :: POSIX :: Linux
19
+ Classifier: Operating System :: MacOS
20
+ Classifier: Programming Language :: Python :: 3
21
+ Classifier: Programming Language :: Python :: 3.10
22
+ Classifier: Programming Language :: Python :: 3.11
23
+ Classifier: Programming Language :: Python :: 3.12
24
+ Classifier: Topic :: Multimedia :: Sound/Audio :: Players
25
+ Requires-Python: >=3.10
26
+ Description-Content-Type: text/markdown
27
+ License-File: LICENSE.txt
28
+ Requires-Dist: textual>=0.50.0
29
+ Requires-Dist: typer>=0.9.0
30
+ Requires-Dist: yt-dlp>=2024.0.0
31
+ Requires-Dist: rich>=13.0.0
32
+ Requires-Dist: pywin32>=306; sys_platform == "win32"
33
+ Provides-Extra: dev
34
+ Requires-Dist: pytest>=8.0.0; extra == "dev"
35
+ Requires-Dist: ruff>=0.3.0; extra == "dev"
36
+ Dynamic: license-file
37
+
38
+ # wrkmon 🎵
39
+
40
+ **Stealth TUI YouTube Audio Player** - Stream music while looking productive!
41
+
42
+ A terminal-based YouTube audio player that runs completely hidden in the background. No visible windows, no distractions - just music.
43
+
44
+ ![License](https://img.shields.io/badge/license-MIT-blue.svg)
45
+ ![Python](https://img.shields.io/badge/python-3.10%2B-blue.svg)
46
+ ![Platform](https://img.shields.io/badge/platform-Windows%20%7C%20macOS%20%7C%20Linux-lightgrey.svg)
47
+
48
+ ## Features
49
+
50
+ - 🔍 **YouTube Search** - Search and stream any YouTube audio
51
+ - 👻 **Stealth Mode** - No visible windows, completely hidden playback
52
+ - 🎨 **Beautiful TUI** - Clean terminal interface with keyboard controls
53
+ - 📋 **Queue Management** - Add tracks, shuffle, repeat
54
+ - 📜 **History & Playlists** - Track your listening history
55
+ - ⌨️ **Keyboard Driven** - Full control without touching the mouse
56
+ - 🖥️ **Cross-Platform** - Works on Windows, macOS, and Linux
57
+
58
+ ## Installation
59
+
60
+ ### Quick Install (Recommended)
61
+
62
+ **Windows (PowerShell):**
63
+ ```powershell
64
+ irm https://raw.githubusercontent.com/Umar-Khan-Yousafzai/Wrkmon-TUI-Youtube/main/install.ps1 | iex
65
+ ```
66
+
67
+ **macOS / Linux:**
68
+ ```bash
69
+ curl -sSL https://raw.githubusercontent.com/Umar-Khan-Yousafzai/Wrkmon-TUI-Youtube/main/install.sh | bash
70
+ ```
71
+
72
+ ### Package Managers
73
+
74
+ **Windows (Chocolatey):**
75
+ ```powershell
76
+ choco install wrkmon
77
+ ```
78
+
79
+ **Windows (winget):**
80
+ ```powershell
81
+ winget install wrkmon
82
+ ```
83
+
84
+ **macOS (Homebrew):**
85
+ ```bash
86
+ brew install wrkmon
87
+ ```
88
+
89
+ **Linux (Snap):**
90
+ ```bash
91
+ sudo snap install wrkmon
92
+ ```
93
+
94
+ **Linux (apt):**
95
+ ```bash
96
+ sudo apt install wrkmon
97
+ ```
98
+
99
+ ### pip (All Platforms)
100
+
101
+ ```bash
102
+ pip install wrkmon
103
+ ```
104
+
105
+ > **Note:** If using pip, you need to install mpv separately:
106
+ > - Windows: `winget install mpv` or `choco install mpv`
107
+ > - macOS: `brew install mpv`
108
+ > - Linux: `sudo apt install mpv`
109
+
110
+ ## Usage
111
+
112
+ ```bash
113
+ wrkmon # Launch the TUI
114
+ wrkmon search "q" # Quick search from terminal
115
+ wrkmon play <id> # Play a specific video
116
+ wrkmon history # View play history
117
+ ```
118
+
119
+ ## Keyboard Controls
120
+
121
+ | Key | Action |
122
+ |-----|--------|
123
+ | `F1` | Search view |
124
+ | `F2` | Queue view |
125
+ | `F3` | History view |
126
+ | `F4` | Playlists view |
127
+ | `F5` | Play / Pause |
128
+ | `F6` | Volume down |
129
+ | `F7` | Volume up |
130
+ | `F8` | Next track |
131
+ | `F9` | Stop |
132
+ | `F10` | Add to queue |
133
+ | `/` | Focus search |
134
+ | `Enter` | Play selected |
135
+ | `a` | Add to queue (in list) |
136
+ | `Ctrl+C` | Quit |
137
+
138
+ ## Screenshots
139
+
140
+ ```
141
+ ┌─────────────────────────────────────────────────────────┐
142
+ │ wrkmon [Search] │
143
+ ├─────────────────────────────────────────────────────────┤
144
+ │ Search: lofi hip hop │
145
+ ├─────────────────────────────────────────────────────────┤
146
+ │ # Process PID Duration │
147
+ │ 1 node_worker_847291 8472 3:24:15 │
148
+ │ 2 webpack_compile_process 9123 2:45:00 │
149
+ │ 3 eslint_daemon_runner 7834 1:30:22 │
150
+ ├─────────────────────────────────────────────────────────┤
151
+ │ ▶ Now Playing: lofi hip hop beats advancement █████░░░░░ 1:23:45 │
152
+ │ F1 Search F2 Queue F5 Play/Pause F9 Stop │
153
+ └─────────────────────────────────────────────────────────┘
154
+ ```
155
+
156
+ ## Why wrkmon?
157
+
158
+ Ever wanted to listen to music at work but worried about monitoring software catching you? wrkmon disguises itself as a legitimate development process while streaming your favorite tunes in the background. The TUI looks like a process monitor, and the audio plays through mpv with no visible windows.
159
+
160
+ ## Requirements
161
+
162
+ - Python 3.10+
163
+ - mpv (automatically installed with package managers)
164
+
165
+ ## Development
166
+
167
+ ```bash
168
+ # Clone the repo
169
+ git clone https://github.com/Umar-Khan-Yousafzai/Wrkmon-TUI-Youtube.git
170
+ cd Wrkmon-TUI-Youtube
171
+
172
+ # Install in development mode
173
+ pip install -e ".[dev]"
174
+
175
+ # Run tests
176
+ pytest
177
+ ```
178
+
179
+ ## License
180
+
181
+ MIT License - see [LICENSE](LICENSE) for details.
182
+
183
+ ## Contributing
184
+
185
+ Contributions are welcome! Please feel free to submit a Pull Request.
186
+
187
+ ## Author
188
+
189
+ **Umar Khan Yousafzai**
190
+
191
+ ---
192
+
193
+ *Made with ❤️ for productive procrastinators everywhere*
wrkmon-1.0.0/README.md ADDED
@@ -0,0 +1,156 @@
1
+ # wrkmon 🎵
2
+
3
+ **Stealth TUI YouTube Audio Player** - Stream music while looking productive!
4
+
5
+ A terminal-based YouTube audio player that runs completely hidden in the background. No visible windows, no distractions - just music.
6
+
7
+ ![License](https://img.shields.io/badge/license-MIT-blue.svg)
8
+ ![Python](https://img.shields.io/badge/python-3.10%2B-blue.svg)
9
+ ![Platform](https://img.shields.io/badge/platform-Windows%20%7C%20macOS%20%7C%20Linux-lightgrey.svg)
10
+
11
+ ## Features
12
+
13
+ - 🔍 **YouTube Search** - Search and stream any YouTube audio
14
+ - 👻 **Stealth Mode** - No visible windows, completely hidden playback
15
+ - 🎨 **Beautiful TUI** - Clean terminal interface with keyboard controls
16
+ - 📋 **Queue Management** - Add tracks, shuffle, repeat
17
+ - 📜 **History & Playlists** - Track your listening history
18
+ - ⌨️ **Keyboard Driven** - Full control without touching the mouse
19
+ - 🖥️ **Cross-Platform** - Works on Windows, macOS, and Linux
20
+
21
+ ## Installation
22
+
23
+ ### Quick Install (Recommended)
24
+
25
+ **Windows (PowerShell):**
26
+ ```powershell
27
+ irm https://raw.githubusercontent.com/Umar-Khan-Yousafzai/Wrkmon-TUI-Youtube/main/install.ps1 | iex
28
+ ```
29
+
30
+ **macOS / Linux:**
31
+ ```bash
32
+ curl -sSL https://raw.githubusercontent.com/Umar-Khan-Yousafzai/Wrkmon-TUI-Youtube/main/install.sh | bash
33
+ ```
34
+
35
+ ### Package Managers
36
+
37
+ **Windows (Chocolatey):**
38
+ ```powershell
39
+ choco install wrkmon
40
+ ```
41
+
42
+ **Windows (winget):**
43
+ ```powershell
44
+ winget install wrkmon
45
+ ```
46
+
47
+ **macOS (Homebrew):**
48
+ ```bash
49
+ brew install wrkmon
50
+ ```
51
+
52
+ **Linux (Snap):**
53
+ ```bash
54
+ sudo snap install wrkmon
55
+ ```
56
+
57
+ **Linux (apt):**
58
+ ```bash
59
+ sudo apt install wrkmon
60
+ ```
61
+
62
+ ### pip (All Platforms)
63
+
64
+ ```bash
65
+ pip install wrkmon
66
+ ```
67
+
68
+ > **Note:** If using pip, you need to install mpv separately:
69
+ > - Windows: `winget install mpv` or `choco install mpv`
70
+ > - macOS: `brew install mpv`
71
+ > - Linux: `sudo apt install mpv`
72
+
73
+ ## Usage
74
+
75
+ ```bash
76
+ wrkmon # Launch the TUI
77
+ wrkmon search "q" # Quick search from terminal
78
+ wrkmon play <id> # Play a specific video
79
+ wrkmon history # View play history
80
+ ```
81
+
82
+ ## Keyboard Controls
83
+
84
+ | Key | Action |
85
+ |-----|--------|
86
+ | `F1` | Search view |
87
+ | `F2` | Queue view |
88
+ | `F3` | History view |
89
+ | `F4` | Playlists view |
90
+ | `F5` | Play / Pause |
91
+ | `F6` | Volume down |
92
+ | `F7` | Volume up |
93
+ | `F8` | Next track |
94
+ | `F9` | Stop |
95
+ | `F10` | Add to queue |
96
+ | `/` | Focus search |
97
+ | `Enter` | Play selected |
98
+ | `a` | Add to queue (in list) |
99
+ | `Ctrl+C` | Quit |
100
+
101
+ ## Screenshots
102
+
103
+ ```
104
+ ┌─────────────────────────────────────────────────────────┐
105
+ │ wrkmon [Search] │
106
+ ├─────────────────────────────────────────────────────────┤
107
+ │ Search: lofi hip hop │
108
+ ├─────────────────────────────────────────────────────────┤
109
+ │ # Process PID Duration │
110
+ │ 1 node_worker_847291 8472 3:24:15 │
111
+ │ 2 webpack_compile_process 9123 2:45:00 │
112
+ │ 3 eslint_daemon_runner 7834 1:30:22 │
113
+ ├─────────────────────────────────────────────────────────┤
114
+ │ ▶ Now Playing: lofi hip hop beats advancement █████░░░░░ 1:23:45 │
115
+ │ F1 Search F2 Queue F5 Play/Pause F9 Stop │
116
+ └─────────────────────────────────────────────────────────┘
117
+ ```
118
+
119
+ ## Why wrkmon?
120
+
121
+ Ever wanted to listen to music at work but worried about monitoring software catching you? wrkmon disguises itself as a legitimate development process while streaming your favorite tunes in the background. The TUI looks like a process monitor, and the audio plays through mpv with no visible windows.
122
+
123
+ ## Requirements
124
+
125
+ - Python 3.10+
126
+ - mpv (automatically installed with package managers)
127
+
128
+ ## Development
129
+
130
+ ```bash
131
+ # Clone the repo
132
+ git clone https://github.com/Umar-Khan-Yousafzai/Wrkmon-TUI-Youtube.git
133
+ cd Wrkmon-TUI-Youtube
134
+
135
+ # Install in development mode
136
+ pip install -e ".[dev]"
137
+
138
+ # Run tests
139
+ pytest
140
+ ```
141
+
142
+ ## License
143
+
144
+ MIT License - see [LICENSE](LICENSE) for details.
145
+
146
+ ## Contributing
147
+
148
+ Contributions are welcome! Please feel free to submit a Pull Request.
149
+
150
+ ## Author
151
+
152
+ **Umar Khan Yousafzai**
153
+
154
+ ---
155
+
156
+ *Made with ❤️ for productive procrastinators everywhere*
@@ -0,0 +1,68 @@
1
+ [build-system]
2
+ requires = ["setuptools>=61.0", "wheel"]
3
+ build-backend = "setuptools.build_meta"
4
+
5
+ [project]
6
+ name = "wrkmon"
7
+ version = "1.0.0"
8
+ description = "Stealth TUI YouTube audio player - stream music while looking productive"
9
+ readme = "README.md"
10
+ requires-python = ">=3.10"
11
+ license = "MIT"
12
+ authors = [
13
+ { name = "Umar Khan Yousafzai", email = "umar@example.com" }
14
+ ]
15
+ keywords = ["youtube", "audio", "player", "tui", "music", "stealth", "productivity", "terminal"]
16
+ classifiers = [
17
+ "Development Status :: 4 - Beta",
18
+ "Environment :: Console",
19
+ "Intended Audience :: Developers",
20
+ "Intended Audience :: End Users/Desktop",
21
+ "Operating System :: OS Independent",
22
+ "Operating System :: Microsoft :: Windows",
23
+ "Operating System :: POSIX :: Linux",
24
+ "Operating System :: MacOS",
25
+ "Programming Language :: Python :: 3",
26
+ "Programming Language :: Python :: 3.10",
27
+ "Programming Language :: Python :: 3.11",
28
+ "Programming Language :: Python :: 3.12",
29
+ "Topic :: Multimedia :: Sound/Audio :: Players",
30
+ ]
31
+ dependencies = [
32
+ "textual>=0.50.0",
33
+ "typer>=0.9.0",
34
+ "yt-dlp>=2024.0.0",
35
+ "rich>=13.0.0",
36
+ "pywin32>=306; sys_platform == 'win32'",
37
+ ]
38
+
39
+ [project.optional-dependencies]
40
+ dev = [
41
+ "pytest>=8.0.0",
42
+ "ruff>=0.3.0",
43
+ ]
44
+
45
+ [project.scripts]
46
+ wrkmon = "wrkmon.cli:app"
47
+
48
+ [project.urls]
49
+ Homepage = "https://github.com/Umar-Khan-Yousafzai/Wrkmon-TUI-Youtube"
50
+ Documentation = "https://github.com/Umar-Khan-Yousafzai/Wrkmon-TUI-Youtube#readme"
51
+ Repository = "https://github.com/Umar-Khan-Yousafzai/Wrkmon-TUI-Youtube"
52
+ Issues = "https://github.com/Umar-Khan-Yousafzai/Wrkmon-TUI-Youtube/issues"
53
+
54
+ [tool.setuptools.packages.find]
55
+ where = ["."]
56
+ include = ["wrkmon*"]
57
+
58
+ [tool.ruff]
59
+ line-length = 100
60
+ target-version = "py310"
61
+
62
+ [tool.ruff.lint]
63
+ select = ["E", "F", "I", "W"]
64
+ ignore = ["E501"]
65
+
66
+ [tool.pytest.ini_options]
67
+ testpaths = ["tests"]
68
+ python_files = ["test_*.py"]
wrkmon-1.0.0/setup.cfg ADDED
@@ -0,0 +1,4 @@
1
+ [egg_info]
2
+ tag_build =
3
+ tag_date = 0
4
+
@@ -0,0 +1,105 @@
1
+ """Tests for core modules."""
2
+
3
+ import pytest
4
+ from wrkmon.core.queue import PlayQueue, QueueItem
5
+
6
+
7
+ class TestPlayQueue:
8
+ """Tests for PlayQueue."""
9
+
10
+ def test_empty_queue(self):
11
+ queue = PlayQueue()
12
+ assert queue.is_empty
13
+ assert queue.length == 0
14
+ assert queue.current is None
15
+
16
+ def test_add_item(self):
17
+ queue = PlayQueue()
18
+ item = QueueItem(
19
+ video_id="test123",
20
+ title="Test Track",
21
+ channel="Test Channel",
22
+ duration=180,
23
+ )
24
+ pos = queue.add(item)
25
+ assert pos == 0
26
+ assert queue.length == 1
27
+ assert not queue.is_empty
28
+
29
+ def test_next_previous(self):
30
+ queue = PlayQueue()
31
+ for i in range(3):
32
+ queue.add(QueueItem(
33
+ video_id=f"test{i}",
34
+ title=f"Track {i}",
35
+ channel="Channel",
36
+ duration=100,
37
+ ))
38
+
39
+ # Start at beginning
40
+ queue.jump_to(0)
41
+ assert queue.current.video_id == "test0"
42
+
43
+ # Next
44
+ queue.next()
45
+ assert queue.current.video_id == "test1"
46
+
47
+ # Previous
48
+ queue.previous()
49
+ assert queue.current.video_id == "test0"
50
+
51
+ def test_shuffle(self):
52
+ queue = PlayQueue()
53
+ for i in range(5):
54
+ queue.add(QueueItem(
55
+ video_id=f"test{i}",
56
+ title=f"Track {i}",
57
+ channel="Channel",
58
+ duration=100,
59
+ ))
60
+
61
+ queue.shuffle()
62
+ assert queue.shuffle_mode
63
+ assert len(queue._shuffle_order) == 5
64
+
65
+ queue.unshuffle()
66
+ assert not queue.shuffle_mode
67
+
68
+ def test_repeat_modes(self):
69
+ queue = PlayQueue()
70
+ assert queue.repeat_mode == "none"
71
+
72
+ queue.cycle_repeat()
73
+ assert queue.repeat_mode == "one"
74
+
75
+ queue.cycle_repeat()
76
+ assert queue.repeat_mode == "all"
77
+
78
+ queue.cycle_repeat()
79
+ assert queue.repeat_mode == "none"
80
+
81
+ def test_clear(self):
82
+ queue = PlayQueue()
83
+ queue.add(QueueItem(
84
+ video_id="test",
85
+ title="Track",
86
+ channel="Channel",
87
+ duration=100,
88
+ ))
89
+ assert queue.length == 1
90
+
91
+ queue.clear()
92
+ assert queue.is_empty
93
+
94
+
95
+ class TestQueueItem:
96
+ """Tests for QueueItem."""
97
+
98
+ def test_url_property(self):
99
+ item = QueueItem(
100
+ video_id="abc123",
101
+ title="Test",
102
+ channel="Channel",
103
+ duration=60,
104
+ )
105
+ assert item.url == "https://www.youtube.com/watch?v=abc123"
@@ -0,0 +1,63 @@
1
+ """Tests for utility modules."""
2
+
3
+ import pytest
4
+ from wrkmon.utils.stealth import StealthManager
5
+
6
+
7
+ class TestStealthManager:
8
+ """Tests for StealthManager."""
9
+
10
+ def test_get_fake_process_name(self):
11
+ stealth = StealthManager()
12
+
13
+ # Normal title
14
+ name = stealth.get_fake_process_name("Lofi Hip Hop Beats")
15
+ assert name == "lofi-hip-hop-beats"
16
+
17
+ # Title with special characters
18
+ name = stealth.get_fake_process_name("Track [Official Video] (HD)")
19
+ assert "-" in name
20
+ assert "[" not in name
21
+ assert "]" not in name
22
+
23
+ # Long title should be truncated
24
+ name = stealth.get_fake_process_name("A" * 50)
25
+ assert len(name) <= 30
26
+
27
+ def test_get_fake_pid(self):
28
+ stealth = StealthManager()
29
+ pid = stealth.get_fake_pid()
30
+ assert 1000 <= pid <= 65535
31
+
32
+ def test_get_fake_stats(self):
33
+ stealth = StealthManager()
34
+
35
+ cpu = stealth.get_fake_cpu()
36
+ assert stealth.CPU_RANGE[0] <= cpu <= stealth.CPU_RANGE[1]
37
+
38
+ mem = stealth.get_fake_memory()
39
+ assert stealth.MEM_RANGE[0] <= mem <= stealth.MEM_RANGE[1]
40
+
41
+ def test_format_status(self):
42
+ stealth = StealthManager()
43
+
44
+ assert stealth.format_status("playing") == "RUNNING"
45
+ assert stealth.format_status("paused") == "SUSPENDED"
46
+ assert stealth.format_status("stopped") == "STOPPED"
47
+ assert stealth.format_status("unknown") == "UNKNOWN"
48
+
49
+ def test_format_duration(self):
50
+ stealth = StealthManager()
51
+
52
+ assert stealth.format_duration(0) == "0:00"
53
+ assert stealth.format_duration(65) == "1:05"
54
+ assert stealth.format_duration(3661) == "1:01:01"
55
+ assert stealth.format_duration(-1) == "--:--"
56
+
57
+ def test_get_mpv_args(self):
58
+ stealth = StealthManager()
59
+ args = stealth.get_mpv_args()
60
+
61
+ assert "--no-video" in args
62
+ assert "--idle=yes" in args
63
+ assert any("input-ipc-server" in arg for arg in args)
@@ -0,0 +1,4 @@
1
+ """wrkmon - Work Monitor: A developer productivity tool."""
2
+
3
+ __version__ = "1.0.0"
4
+ __app_name__ = "wrkmon"
@@ -0,0 +1,6 @@
1
+ """Entry point for running wrkmon as a module."""
2
+
3
+ from wrkmon.cli import app
4
+
5
+ if __name__ == "__main__":
6
+ app()