trackma 0.8.6__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 (79) hide show
  1. trackma-0.8.6/PKG-INFO +264 -0
  2. trackma-0.8.6/README.md +219 -0
  3. trackma-0.8.6/pyproject.toml +63 -0
  4. trackma-0.8.6/trackma/__init__.py +0 -0
  5. trackma-0.8.6/trackma/accounts.py +149 -0
  6. trackma-0.8.6/trackma/data/anilist.jpg +0 -0
  7. trackma-0.8.6/trackma/data/icon.ico +0 -0
  8. trackma-0.8.6/trackma/data/icon.png +0 -0
  9. trackma-0.8.6/trackma/data/kitsu.png +0 -0
  10. trackma-0.8.6/trackma/data/mal.jpg +0 -0
  11. trackma-0.8.6/trackma/data/shikimori.jpg +0 -0
  12. trackma-0.8.6/trackma/data/vndb.jpg +0 -0
  13. trackma-0.8.6/trackma/data.py +620 -0
  14. trackma-0.8.6/trackma/engine.py +1094 -0
  15. trackma-0.8.6/trackma/extras/AnimeInfoExtractor.py +333 -0
  16. trackma-0.8.6/trackma/extras/__init__.py +1 -0
  17. trackma-0.8.6/trackma/extras/redirections.py +114 -0
  18. trackma-0.8.6/trackma/lib/__init__.py +0 -0
  19. trackma-0.8.6/trackma/lib/lib.py +163 -0
  20. trackma-0.8.6/trackma/lib/libanilist.py +545 -0
  21. trackma-0.8.6/trackma/lib/libkitsu.py +611 -0
  22. trackma-0.8.6/trackma/lib/libmal.py +410 -0
  23. trackma-0.8.6/trackma/lib/libshikimori.py +384 -0
  24. trackma-0.8.6/trackma/lib/libvndb.py +397 -0
  25. trackma-0.8.6/trackma/messenger.py +65 -0
  26. trackma-0.8.6/trackma/tracker/__init__.py +0 -0
  27. trackma-0.8.6/trackma/tracker/inotify.py +84 -0
  28. trackma-0.8.6/trackma/tracker/inotifyBase.py +147 -0
  29. trackma-0.8.6/trackma/tracker/jellyfin.py +120 -0
  30. trackma-0.8.6/trackma/tracker/kodi.py +164 -0
  31. trackma-0.8.6/trackma/tracker/mpris.py +204 -0
  32. trackma-0.8.6/trackma/tracker/plex.py +197 -0
  33. trackma-0.8.6/trackma/tracker/polling.py +57 -0
  34. trackma-0.8.6/trackma/tracker/pyinotify.py +105 -0
  35. trackma-0.8.6/trackma/tracker/tracker.py +289 -0
  36. trackma-0.8.6/trackma/tracker/win32.py +86 -0
  37. trackma-0.8.6/trackma/trackma.kdev4 +3 -0
  38. trackma-0.8.6/trackma/ui/__init__.py +0 -0
  39. trackma-0.8.6/trackma/ui/cli.py +1088 -0
  40. trackma-0.8.6/trackma/ui/curses.py +1236 -0
  41. trackma-0.8.6/trackma/ui/gtk/__init__.py +32 -0
  42. trackma-0.8.6/trackma/ui/gtk/__main__.py +20 -0
  43. trackma-0.8.6/trackma/ui/gtk/accountswindow.py +393 -0
  44. trackma-0.8.6/trackma/ui/gtk/application.py +110 -0
  45. trackma-0.8.6/trackma/ui/gtk/data/accountrow.ui +75 -0
  46. trackma-0.8.6/trackma/ui/gtk/data/accountswindow.ui +461 -0
  47. trackma-0.8.6/trackma/ui/gtk/data/app-menu.ui +123 -0
  48. trackma-0.8.6/trackma/ui/gtk/data/mainview.ui +367 -0
  49. trackma-0.8.6/trackma/ui/gtk/data/searchwindow.ui +142 -0
  50. trackma-0.8.6/trackma/ui/gtk/data/settingswindow.ui +1984 -0
  51. trackma-0.8.6/trackma/ui/gtk/data/shortcuts.ui +127 -0
  52. trackma-0.8.6/trackma/ui/gtk/data/showinfobox.ui +89 -0
  53. trackma-0.8.6/trackma/ui/gtk/data/showinfowindow.ui +57 -0
  54. trackma-0.8.6/trackma/ui/gtk/data/window.ui +71 -0
  55. trackma-0.8.6/trackma/ui/gtk/imagebox.py +137 -0
  56. trackma-0.8.6/trackma/ui/gtk/mainview.py +773 -0
  57. trackma-0.8.6/trackma/ui/gtk/searchwindow.py +228 -0
  58. trackma-0.8.6/trackma/ui/gtk/settingswindow.py +508 -0
  59. trackma-0.8.6/trackma/ui/gtk/showeventtype.py +35 -0
  60. trackma-0.8.6/trackma/ui/gtk/showinfobox.py +116 -0
  61. trackma-0.8.6/trackma/ui/gtk/showinfowindow.py +52 -0
  62. trackma-0.8.6/trackma/ui/gtk/showtreeview.py +482 -0
  63. trackma-0.8.6/trackma/ui/gtk/statusicon.py +77 -0
  64. trackma-0.8.6/trackma/ui/gtk/window.py +670 -0
  65. trackma-0.8.6/trackma/ui/qt/__init__.py +66 -0
  66. trackma-0.8.6/trackma/ui/qt/__main__.py +19 -0
  67. trackma-0.8.6/trackma/ui/qt/accounts.py +319 -0
  68. trackma-0.8.6/trackma/ui/qt/add.py +215 -0
  69. trackma-0.8.6/trackma/ui/qt/delegates.py +279 -0
  70. trackma-0.8.6/trackma/ui/qt/details.py +40 -0
  71. trackma-0.8.6/trackma/ui/qt/mainwindow.py +1478 -0
  72. trackma-0.8.6/trackma/ui/qt/models.py +408 -0
  73. trackma-0.8.6/trackma/ui/qt/settings.py +829 -0
  74. trackma-0.8.6/trackma/ui/qt/themedcolorpicker.py +68 -0
  75. trackma-0.8.6/trackma/ui/qt/thumbs.py +67 -0
  76. trackma-0.8.6/trackma/ui/qt/util.py +47 -0
  77. trackma-0.8.6/trackma/ui/qt/widgets.py +280 -0
  78. trackma-0.8.6/trackma/ui/qt/workers.py +187 -0
  79. trackma-0.8.6/trackma/utils.py +722 -0
trackma-0.8.6/PKG-INFO ADDED
@@ -0,0 +1,264 @@
1
+ Metadata-Version: 2.1
2
+ Name: trackma
3
+ Version: 0.8.6
4
+ Summary: Open multi-site list manager
5
+ Home-page: https://z411.github.io/trackma/
6
+ License: GPL-3.0-or-later
7
+ Keywords: list manager,curses,gtk,qt,myanimelist,kitsu,anilist,shikimori,vndb
8
+ Author: z411
9
+ Author-email: z411@omaera.org
10
+ Requires-Python: >=3.7,<4.0
11
+ Classifier: Development Status :: 5 - Production/Stable
12
+ Classifier: Intended Audience :: End Users/Desktop
13
+ Classifier: License :: OSI Approved :: GNU General Public License v3 or later (GPLv3+)
14
+ Classifier: Operating System :: POSIX
15
+ Classifier: Programming Language :: Python :: 3
16
+ Classifier: Programming Language :: Python :: 3.7
17
+ Classifier: Programming Language :: Python :: 3.8
18
+ Classifier: Programming Language :: Python :: 3.9
19
+ Classifier: Programming Language :: Python :: 3.10
20
+ Classifier: Programming Language :: Python :: 3.11
21
+ Classifier: Topic :: Internet
22
+ Classifier: Topic :: Multimedia
23
+ Provides-Extra: curses
24
+ Provides-Extra: discord-rpc
25
+ Provides-Extra: gtk
26
+ Provides-Extra: qt
27
+ Provides-Extra: trackers
28
+ Provides-Extra: twitter
29
+ Provides-Extra: ui
30
+ Requires-Dist: inotify (>=0.2.10,<0.3.0) ; extra == "trackers"
31
+ Requires-Dist: pillow (>=9.2.0,<10.0.0) ; extra == "gtk" or extra == "qt" or extra == "ui"
32
+ Requires-Dist: pycairo (>=1.21.0,<2.0.0) ; extra == "gtk" or extra == "ui"
33
+ Requires-Dist: pydbus (>=0.6.0,<0.7.0) ; extra == "trackers"
34
+ Requires-Dist: pygobject (>=3.42.1,<4.0.0) ; extra == "gtk" or extra == "ui"
35
+ Requires-Dist: pyinotify (>=0.9.6,<0.10.0) ; extra == "trackers"
36
+ Requires-Dist: pypresence (>=4.2.1,<5.0.0) ; extra == "discord-rpc"
37
+ Requires-Dist: pyqt5 (>=5.15.7,<6.0.0) ; extra == "qt" or extra == "ui"
38
+ Requires-Dist: requests (>=2.28.1,<3.0.0)
39
+ Requires-Dist: requests-oauthlib (>=1.3.1,<2.0.0) ; extra == "twitter"
40
+ Requires-Dist: twitter (>=1.19.3,<2.0.0) ; extra == "twitter"
41
+ Requires-Dist: urwid (>=2.1.2,<3.0.0) ; extra == "curses" or extra == "ui"
42
+ Project-URL: Repository, https://github.com/z411/trackma
43
+ Description-Content-Type: text/markdown
44
+
45
+ Trackma
46
+ =======
47
+
48
+ Trackma aims to be a lightweight and simple but feature-rich program for Unix based systems
49
+ for fetching, updating and using data from personal lists hosted in several media tracking websites.
50
+
51
+ Features
52
+ --------
53
+
54
+ - Manage local list and synchronize when necessary, useful when offline
55
+ - Manage multiple accounts on different media tracking sites
56
+ - Support for several media types (as supported by the site)
57
+ - Multiple user interfaces (Qt, GTK, curses, command-line)
58
+ - Detection of running media player, updates list if necessary
59
+ - Ability to launch media player for a requested media in the list and update list if necessary
60
+ - Highly scalable, easy to code new interfaces and support for other sites
61
+ - Secure, uses HTTPS wherever possible.
62
+
63
+ Currently supported websites
64
+ ----------------------------
65
+
66
+ - [Anilist](https://anilist.co/) (Anime, Manga)
67
+ - [Kitsu](https://kitsu.io/) (Anime, Manga, Drama)
68
+ - [MyAnimeList](https://myanimelist.net/) (Anime, Manga)
69
+ - [Shikimori](http://shikimori.org/) (Anime, Manga)
70
+ - [VNDB](https://vndb.org/) (VNs)
71
+
72
+ Screenshots
73
+ -----------
74
+
75
+ Qt interface
76
+
77
+ ![Qt](https://z411.github.io/trackma/images/screen_qt.png)
78
+
79
+ GTK interface
80
+
81
+ ![GTK](https://z411.github.io/trackma/images/screen_gtk.png)
82
+
83
+ Curses interface
84
+
85
+ ![Curses](https://z411.github.io/trackma/images/screen_curses.png)
86
+
87
+ CLI
88
+
89
+ ![CLI](https://z411.github.io/trackma/images/screen_cli.png)
90
+
91
+ Dependencies
92
+ ------------
93
+
94
+ The only required dependency to run Trackma is:
95
+
96
+ - Python 3.7+
97
+ - `python3-pip` (to install through `pip`) *or* `python3-poetry` (to install through `poetry`)
98
+
99
+ But only basic features will work (only CLI interface and no tracker). Everything else is optional.
100
+
101
+ The following user interfaces are available and their requirements are as follows:
102
+
103
+ | UI | Dependencies |
104
+ | --- | --- |
105
+ | Qt | PyQt5 (`python-pyqt5`) |
106
+ | GTK 3 | PyGI (`python3-gi` and `python3-cairo`) |
107
+ | curses | Urwid (`python3-urwid`) |
108
+ | CLI | None |
109
+
110
+ The following media recognition trackers are available and their requirements are as follows:
111
+
112
+ | Tracker | Description | Dependencies |
113
+ | --- | --- | --- |
114
+ | inotify | Instant, but only supported in Linux. Uses it whenever possible. | `inotify` *or* `pyinotify` |
115
+ | Polling | Slow, but supported in every POSIX platform. Fallback. | `lsof` |
116
+ | Plex | Connects to Plex server. Enabled manually. | None |
117
+ | Kodi | Connects to Kodi server. Enabled manually. | None |
118
+ | Jellyfin | Connects to Jellyfin server. Enabled manually. | None |
119
+ | MPRIS | Connects to running MPRIS capable media players. | `dbus-python` |
120
+ | Win32 | Recognition for Windows platforms. | None |
121
+
122
+ Additional optional dependencies:
123
+
124
+ - PIL (`python3-pil`) - for showing preview images in the Qt/GTK interfaces.
125
+
126
+ Installation
127
+ ------------
128
+
129
+ Trackma has user-provided packages for several distributions.
130
+
131
+ - **Arch Linux:** <https://aur.archlinux.org/packages/trackma>, <http://aur.archlinux.org/packages/trackma-git>
132
+ - **Fedora:** <https://copr.fedoraproject.org/coprs/dyskette/trackma/>
133
+ - **Gentoo Linux:** <http://gpo.zugaina.org/net-misc/trackma>
134
+ - **NixOS:** <https://github.com/NixOS/nixpkgs/blob/master/pkgs/tools/misc/trackma/default.nix>
135
+ - **Void Linux:** <https://github.com/void-linux/void-packages/blob/master/srcpkgs/trackma/template>
136
+
137
+ A user from the community also is providing a Docker image:
138
+
139
+ - **Docker:** <https://hub.docker.com/r/frosty5689/trackma/>
140
+
141
+ ### Manual installation
142
+
143
+ Make sure you've installed the proper dependencies (listed above)
144
+ according to the user interface you plan to use, and then run the
145
+ following command:
146
+
147
+ ```sh
148
+ $ pip3 install Trackma
149
+ ```
150
+
151
+ You can also install the git (probably unstable, but newer) version like this:
152
+
153
+ ```sh
154
+ $ pip3 install -U git+https://github.com/z411/trackma.git
155
+ ```
156
+
157
+ Or download the source code and install:
158
+
159
+ ```sh
160
+ $ git clone --recursive https://github.com/z411/trackma.git
161
+ $ cd trackma
162
+ $ poetry build
163
+ $ pip3 install dist/trackma-0.8.5-py3-none-any.whl
164
+ ```
165
+
166
+ ### Extras (User Interfaces)
167
+
168
+ All user interfaces except for the default CLI mode require additional dependencies to function.
169
+ You may specify these as "extras" to be installed by the Python package manager.
170
+
171
+ The following extras are available:
172
+
173
+ | Extra | Description |
174
+ | --- | --- |
175
+ | `gtk` | The GTK interface. |
176
+ | `qt` | The GTK interface. |
177
+ | `curses` | The curses-based TUI. |
178
+ | `ui` | All user interfaces. |
179
+ | `trackers` | All tracker libraries. |
180
+ | `discord_rpc` | Set your watching activity in Discord. |
181
+ | `twitter` | Announce your watching activity on Twitter. |
182
+
183
+ If you want to install any of the extras be sure to specify them during installation:
184
+
185
+ #### pip
186
+
187
+ ```sh
188
+ # With pip
189
+ $ pip3 install Trackma[gtk,trackers,curses]
190
+ $ pip3 install Trackma[ui,twitter,discord_rpc]
191
+ ```
192
+
193
+ Note that pip does not have a way to install all available extras,
194
+ so you'll have to provide them all manually if desired.
195
+
196
+ Then you can run the program with the interface you like.
197
+
198
+ ```sh
199
+ $ trackma
200
+ $ trackma-curses
201
+ $ trackma-gtk
202
+ $ trackma-qt
203
+ ```
204
+
205
+ #### poetry
206
+
207
+ When using poetry on the cloned repository (see above),
208
+ you can install your desired extras as follows:
209
+
210
+ ```sh
211
+ $ poetry install -E gtk -E trackers -E curses
212
+ $ poetry install -E ui -E twitter -E discord_rpc
213
+ $ poetry install --all-extras
214
+ ```
215
+
216
+ Then you can run the interface you like in your virtual environment managed by poetry:
217
+
218
+ ```sh
219
+ $ poetry run trackma
220
+ $ poetry run trackma-curses
221
+ $ poetry run trackma-gtk
222
+ $ poetry run trackma-qt
223
+ ```
224
+
225
+ Configuration
226
+ -------------
227
+
228
+ A configuration file will be created in `~/.config/trackma/config.json`, make sure to fill in the directory
229
+ where you store your video files and other settings. Details about what each option does can be done here:
230
+
231
+ <https://github.com/z411/trackma/wiki/Configuration-File>
232
+
233
+ Alternatively, the GTK and Qt interfaces provide a visual Settings panel.
234
+
235
+ Development
236
+ -----------
237
+
238
+ The code is hosted as a git repository on [GitHub](https://github.com/z411/trackma).
239
+
240
+ Clone the repo and create the virtual environment using `poetry`:
241
+
242
+ ```sh
243
+ $ git clone --recursive https://github.com/z411/trackma.git
244
+ $ cd trackma
245
+ $ poetry install --all-extras
246
+ $ poetry shell
247
+ ```
248
+
249
+ Use the above commands from the [poetry](#poetry) section
250
+ for how to run your desired interface.
251
+
252
+ If you encounter any problems or have anything to suggest, please don't
253
+ hesitate to submit an issue in the GitHub [issue tracker](https://github.com/z411/trackma/issues).
254
+
255
+ License
256
+ -------
257
+
258
+ Trackma is licensed under the GPLv3 license, please see [LICENSE](../COPYING) for details.
259
+
260
+ Authors
261
+ -------
262
+
263
+ Trackma was originally written by z411 <z411@omaera.org>. For other contributors see AUTHORS file. GTK icon designed by shuuichi.
264
+
@@ -0,0 +1,219 @@
1
+ Trackma
2
+ =======
3
+
4
+ Trackma aims to be a lightweight and simple but feature-rich program for Unix based systems
5
+ for fetching, updating and using data from personal lists hosted in several media tracking websites.
6
+
7
+ Features
8
+ --------
9
+
10
+ - Manage local list and synchronize when necessary, useful when offline
11
+ - Manage multiple accounts on different media tracking sites
12
+ - Support for several media types (as supported by the site)
13
+ - Multiple user interfaces (Qt, GTK, curses, command-line)
14
+ - Detection of running media player, updates list if necessary
15
+ - Ability to launch media player for a requested media in the list and update list if necessary
16
+ - Highly scalable, easy to code new interfaces and support for other sites
17
+ - Secure, uses HTTPS wherever possible.
18
+
19
+ Currently supported websites
20
+ ----------------------------
21
+
22
+ - [Anilist](https://anilist.co/) (Anime, Manga)
23
+ - [Kitsu](https://kitsu.io/) (Anime, Manga, Drama)
24
+ - [MyAnimeList](https://myanimelist.net/) (Anime, Manga)
25
+ - [Shikimori](http://shikimori.org/) (Anime, Manga)
26
+ - [VNDB](https://vndb.org/) (VNs)
27
+
28
+ Screenshots
29
+ -----------
30
+
31
+ Qt interface
32
+
33
+ ![Qt](https://z411.github.io/trackma/images/screen_qt.png)
34
+
35
+ GTK interface
36
+
37
+ ![GTK](https://z411.github.io/trackma/images/screen_gtk.png)
38
+
39
+ Curses interface
40
+
41
+ ![Curses](https://z411.github.io/trackma/images/screen_curses.png)
42
+
43
+ CLI
44
+
45
+ ![CLI](https://z411.github.io/trackma/images/screen_cli.png)
46
+
47
+ Dependencies
48
+ ------------
49
+
50
+ The only required dependency to run Trackma is:
51
+
52
+ - Python 3.7+
53
+ - `python3-pip` (to install through `pip`) *or* `python3-poetry` (to install through `poetry`)
54
+
55
+ But only basic features will work (only CLI interface and no tracker). Everything else is optional.
56
+
57
+ The following user interfaces are available and their requirements are as follows:
58
+
59
+ | UI | Dependencies |
60
+ | --- | --- |
61
+ | Qt | PyQt5 (`python-pyqt5`) |
62
+ | GTK 3 | PyGI (`python3-gi` and `python3-cairo`) |
63
+ | curses | Urwid (`python3-urwid`) |
64
+ | CLI | None |
65
+
66
+ The following media recognition trackers are available and their requirements are as follows:
67
+
68
+ | Tracker | Description | Dependencies |
69
+ | --- | --- | --- |
70
+ | inotify | Instant, but only supported in Linux. Uses it whenever possible. | `inotify` *or* `pyinotify` |
71
+ | Polling | Slow, but supported in every POSIX platform. Fallback. | `lsof` |
72
+ | Plex | Connects to Plex server. Enabled manually. | None |
73
+ | Kodi | Connects to Kodi server. Enabled manually. | None |
74
+ | Jellyfin | Connects to Jellyfin server. Enabled manually. | None |
75
+ | MPRIS | Connects to running MPRIS capable media players. | `dbus-python` |
76
+ | Win32 | Recognition for Windows platforms. | None |
77
+
78
+ Additional optional dependencies:
79
+
80
+ - PIL (`python3-pil`) - for showing preview images in the Qt/GTK interfaces.
81
+
82
+ Installation
83
+ ------------
84
+
85
+ Trackma has user-provided packages for several distributions.
86
+
87
+ - **Arch Linux:** <https://aur.archlinux.org/packages/trackma>, <http://aur.archlinux.org/packages/trackma-git>
88
+ - **Fedora:** <https://copr.fedoraproject.org/coprs/dyskette/trackma/>
89
+ - **Gentoo Linux:** <http://gpo.zugaina.org/net-misc/trackma>
90
+ - **NixOS:** <https://github.com/NixOS/nixpkgs/blob/master/pkgs/tools/misc/trackma/default.nix>
91
+ - **Void Linux:** <https://github.com/void-linux/void-packages/blob/master/srcpkgs/trackma/template>
92
+
93
+ A user from the community also is providing a Docker image:
94
+
95
+ - **Docker:** <https://hub.docker.com/r/frosty5689/trackma/>
96
+
97
+ ### Manual installation
98
+
99
+ Make sure you've installed the proper dependencies (listed above)
100
+ according to the user interface you plan to use, and then run the
101
+ following command:
102
+
103
+ ```sh
104
+ $ pip3 install Trackma
105
+ ```
106
+
107
+ You can also install the git (probably unstable, but newer) version like this:
108
+
109
+ ```sh
110
+ $ pip3 install -U git+https://github.com/z411/trackma.git
111
+ ```
112
+
113
+ Or download the source code and install:
114
+
115
+ ```sh
116
+ $ git clone --recursive https://github.com/z411/trackma.git
117
+ $ cd trackma
118
+ $ poetry build
119
+ $ pip3 install dist/trackma-0.8.5-py3-none-any.whl
120
+ ```
121
+
122
+ ### Extras (User Interfaces)
123
+
124
+ All user interfaces except for the default CLI mode require additional dependencies to function.
125
+ You may specify these as "extras" to be installed by the Python package manager.
126
+
127
+ The following extras are available:
128
+
129
+ | Extra | Description |
130
+ | --- | --- |
131
+ | `gtk` | The GTK interface. |
132
+ | `qt` | The GTK interface. |
133
+ | `curses` | The curses-based TUI. |
134
+ | `ui` | All user interfaces. |
135
+ | `trackers` | All tracker libraries. |
136
+ | `discord_rpc` | Set your watching activity in Discord. |
137
+ | `twitter` | Announce your watching activity on Twitter. |
138
+
139
+ If you want to install any of the extras be sure to specify them during installation:
140
+
141
+ #### pip
142
+
143
+ ```sh
144
+ # With pip
145
+ $ pip3 install Trackma[gtk,trackers,curses]
146
+ $ pip3 install Trackma[ui,twitter,discord_rpc]
147
+ ```
148
+
149
+ Note that pip does not have a way to install all available extras,
150
+ so you'll have to provide them all manually if desired.
151
+
152
+ Then you can run the program with the interface you like.
153
+
154
+ ```sh
155
+ $ trackma
156
+ $ trackma-curses
157
+ $ trackma-gtk
158
+ $ trackma-qt
159
+ ```
160
+
161
+ #### poetry
162
+
163
+ When using poetry on the cloned repository (see above),
164
+ you can install your desired extras as follows:
165
+
166
+ ```sh
167
+ $ poetry install -E gtk -E trackers -E curses
168
+ $ poetry install -E ui -E twitter -E discord_rpc
169
+ $ poetry install --all-extras
170
+ ```
171
+
172
+ Then you can run the interface you like in your virtual environment managed by poetry:
173
+
174
+ ```sh
175
+ $ poetry run trackma
176
+ $ poetry run trackma-curses
177
+ $ poetry run trackma-gtk
178
+ $ poetry run trackma-qt
179
+ ```
180
+
181
+ Configuration
182
+ -------------
183
+
184
+ A configuration file will be created in `~/.config/trackma/config.json`, make sure to fill in the directory
185
+ where you store your video files and other settings. Details about what each option does can be done here:
186
+
187
+ <https://github.com/z411/trackma/wiki/Configuration-File>
188
+
189
+ Alternatively, the GTK and Qt interfaces provide a visual Settings panel.
190
+
191
+ Development
192
+ -----------
193
+
194
+ The code is hosted as a git repository on [GitHub](https://github.com/z411/trackma).
195
+
196
+ Clone the repo and create the virtual environment using `poetry`:
197
+
198
+ ```sh
199
+ $ git clone --recursive https://github.com/z411/trackma.git
200
+ $ cd trackma
201
+ $ poetry install --all-extras
202
+ $ poetry shell
203
+ ```
204
+
205
+ Use the above commands from the [poetry](#poetry) section
206
+ for how to run your desired interface.
207
+
208
+ If you encounter any problems or have anything to suggest, please don't
209
+ hesitate to submit an issue in the GitHub [issue tracker](https://github.com/z411/trackma/issues).
210
+
211
+ License
212
+ -------
213
+
214
+ Trackma is licensed under the GPLv3 license, please see [LICENSE](../COPYING) for details.
215
+
216
+ Authors
217
+ -------
218
+
219
+ Trackma was originally written by z411 <z411@omaera.org>. For other contributors see AUTHORS file. GTK icon designed by shuuichi.
@@ -0,0 +1,63 @@
1
+ [tool.poetry]
2
+ name = "trackma"
3
+ version = "0.8.6"
4
+ description = "Open multi-site list manager"
5
+ authors = ["z411 <z411@omaera.org>"]
6
+ license = "GPL-3.0-or-later"
7
+ readme = "README.md"
8
+ homepage = "https://z411.github.io/trackma/"
9
+ repository = "https://github.com/z411/trackma"
10
+ keywords = [
11
+ "list manager", "curses", "gtk", "qt", "myanimelist",
12
+ "kitsu", "anilist", "shikimori", "vndb"
13
+ ]
14
+ classifiers = [
15
+ "Development Status :: 5 - Production/Stable",
16
+ "Intended Audience :: End Users/Desktop",
17
+ "Topic :: Internet",
18
+ "Topic :: Multimedia",
19
+ "Programming Language :: Python :: 3",
20
+ "Programming Language :: Python :: 3.7",
21
+ "Programming Language :: Python :: 3.8",
22
+ "Programming Language :: Python :: 3.9",
23
+ "Programming Language :: Python :: 3.10",
24
+ "Programming Language :: Python :: 3.11",
25
+ "Operating System :: POSIX",
26
+ "License :: OSI Approved :: GNU General Public License v3 or later (GPLv3+)",
27
+ ]
28
+
29
+
30
+ [tool.poetry.dependencies]
31
+ python = "^3.7"
32
+ requests = "^2.28.1"
33
+ inotify = { version = "^0.2.10", optional = true }
34
+ pillow = { version = "^9.2.0", optional = true }
35
+ pycairo = { version = "^1.21.0", optional = true }
36
+ pydbus = { version = "^0.6.0", optional = true }
37
+ pygobject = { version = "^3.42.1", optional = true }
38
+ pyinotify = { version = "^0.9.6", optional = true }
39
+ pypresence = { version = "^4.2.1", optional = true }
40
+ pyqt5 = { version = "^5.15.7", optional = true }
41
+ requests-oauthlib = { version = "^1.3.1", optional = true }
42
+ twitter = { version = "^1.19.3", optional = true }
43
+ urwid = { version = "^2.1.2", optional = true }
44
+
45
+ [tool.poetry.extras]
46
+ gtk = ["pygobject", "pycairo", "pillow"]
47
+ qt = ["pyqt5", "pillow"]
48
+ curses = ["urwid"]
49
+ ui = ["pygobject", "pycairo", "pillow", "pyqt5", "urwid"]
50
+ trackers = ["inotify", "pyinotify", "pydbus"]
51
+ discord_rpc = ["pypresence"]
52
+ twitter = ["twitter", "requests-oauthlib"]
53
+
54
+ [tool.poetry.scripts]
55
+ trackma = "trackma.ui.cli:main"
56
+ trackma-curses = { callable = "trackma.ui.curses:main", extras= ["curses"] }
57
+ trackma-gtk = { callable = "trackma.ui.gtk:main", extras = ["gtk"] }
58
+ trackma-qt = { callable = "trackma.ui.qt:main", extras = ["qt"] }
59
+
60
+
61
+ [build-system]
62
+ requires = ["poetry-core"]
63
+ build-backend = "poetry.core.masonry.api"
File without changes
@@ -0,0 +1,149 @@
1
+ import pickle
2
+
3
+ from trackma import utils
4
+
5
+
6
+ class AccountManager:
7
+ """
8
+ This is the account manager.
9
+
10
+ It provides a generic way for the user interface to query for the
11
+ available registered accounts, and add or delete accounts.
12
+
13
+ This class returns an Account Dictionary used by
14
+ the :class:`Engine` to start.
15
+ """
16
+ accounts = {'default': None, 'next': 1, 'accounts': dict()}
17
+
18
+ def __init__(self):
19
+ utils.make_dir(utils.to_config_path())
20
+ self.filename = utils.to_config_path('accounts.dict')
21
+ self._load()
22
+
23
+ def _load(self):
24
+ if utils.file_exists(self.filename):
25
+ with open(self.filename, 'rb') as f:
26
+ self.accounts = pickle.load(f)
27
+
28
+ def _save(self):
29
+ is_new = not utils.file_exists(self.filename)
30
+ with open(self.filename, 'wb') as f:
31
+ if is_new:
32
+ utils.change_permissions(self.filename, 0o600)
33
+ pickle.dump(self.accounts, f, protocol=2)
34
+
35
+ def add_account(self, username, password, api, extra={}):
36
+ """
37
+ Registers a new account with the specified
38
+ *username*, *password*, and *api*.
39
+
40
+ The *api* must be one of the available APIs
41
+ found in the utils.available_libs dict.
42
+ """
43
+
44
+ available_libs = utils.available_libs.keys()
45
+
46
+ if not username:
47
+ raise utils.AccountError('Empty username.')
48
+ if not password:
49
+ raise utils.AccountError('Empty password.')
50
+ if api not in available_libs:
51
+ raise utils.AccountError('That API doesn\'t exist.')
52
+
53
+ account = {'username': username,
54
+ 'password': password,
55
+ 'api': api,
56
+ 'extra': extra,
57
+ }
58
+
59
+ nextnum = self.accounts['next']
60
+ self.accounts['accounts'][nextnum] = account
61
+ self.accounts['next'] += 1
62
+ self._save()
63
+
64
+ def edit_account(self, num, username, password, api, extra={}):
65
+ """
66
+ Updates data for account *num* with the specified
67
+ *username*, *password*, and *api*.
68
+ """
69
+
70
+ available_libs = utils.available_libs.keys()
71
+
72
+ if not username:
73
+ raise utils.AccountError('Empty username.')
74
+ if not password:
75
+ raise utils.AccountError('Empty password.')
76
+ if api not in available_libs:
77
+ raise utils.AccountError('That API doesn\'t exist.')
78
+
79
+ account = {'username': username,
80
+ 'password': password,
81
+ 'api': api,
82
+ 'extra': extra,
83
+ }
84
+
85
+ self.accounts['accounts'][num].update(account)
86
+ self._save()
87
+
88
+ def delete_account(self, num):
89
+ """
90
+ Deletes the account number **num**.
91
+ """
92
+ self.accounts['default'] = None
93
+ del self.accounts['accounts'][num]
94
+
95
+ # Reset index if there are no accounts left
96
+ if not self.accounts['accounts']:
97
+ self.accounts['next'] = 1
98
+
99
+ self._save()
100
+
101
+ def purge_account(self, num):
102
+ """
103
+ Renames stale cache files for account number **num**.
104
+ """
105
+ account = self.accounts['accounts'][num]
106
+ userfolder = utils.to_data_path(
107
+ "%s.%s" % (account['username'], account['api']))
108
+ utils.make_dir(userfolder + '.old')
109
+ utils.regex_rename_files(
110
+ '(.*.queue)|(.*.info)|(.*.list)|(.*.meta)', userfolder, userfolder + '.old')
111
+
112
+ def get_account(self, num):
113
+ """
114
+ Returns the account dict **num**.
115
+ """
116
+ return self.accounts['accounts'][num]
117
+
118
+ def get_accounts(self):
119
+ """
120
+ Returns an iterator of available accounts.
121
+ """
122
+ return self.accounts['accounts'].items()
123
+
124
+ def get_default(self):
125
+ """
126
+ Returns the default account number, if set.
127
+ Otherwise returns None.
128
+ """
129
+ num = self.accounts['default']
130
+ if num is not None:
131
+ try:
132
+ return self.accounts['accounts'][num]
133
+ except KeyError:
134
+ return None
135
+ else:
136
+ return None
137
+
138
+ def set_default(self, val):
139
+ """
140
+ Sets a new default account number.
141
+ """
142
+ self.accounts['default'] = val
143
+ self._save()
144
+
145
+ def unset_default(self):
146
+ """
147
+ Unsets the default account number.
148
+ """
149
+ self.accounts['default'] = None
Binary file
Binary file
Binary file