trackma 0.6__py3.5.egg

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 (60) hide show
  1. EGG-INFO/PKG-INFO +19 -0
  2. EGG-INFO/SOURCES.txt +37 -0
  3. EGG-INFO/dependency_links.txt +1 -0
  4. EGG-INFO/entry_points.txt +8 -0
  5. EGG-INFO/not-zip-safe +1 -0
  6. EGG-INFO/requires.txt +10 -0
  7. EGG-INFO/top_level.txt +1 -0
  8. trackma/__init__.py +0 -0
  9. trackma/__pycache__/__init__.cpython-35.pyc +0 -0
  10. trackma/__pycache__/accounts.cpython-35.pyc +0 -0
  11. trackma/__pycache__/data.cpython-35.pyc +0 -0
  12. trackma/__pycache__/engine.cpython-35.pyc +0 -0
  13. trackma/__pycache__/messenger.cpython-35.pyc +0 -0
  14. trackma/__pycache__/tracker.cpython-35.pyc +0 -0
  15. trackma/__pycache__/utils.cpython-35.pyc +0 -0
  16. trackma/accounts.py +145 -0
  17. trackma/data/anilist.jpg +0 -0
  18. trackma/data/hb.jpg +0 -0
  19. trackma/data/icon.png +0 -0
  20. trackma/data/mal.jpg +0 -0
  21. trackma/data/melative.jpg +0 -0
  22. trackma/data/shikimori.jpg +0 -0
  23. trackma/data/vndb.jpg +0 -0
  24. trackma/data.py +597 -0
  25. trackma/engine.py +818 -0
  26. trackma/extras/AnimeInfoExtractor.py +308 -0
  27. trackma/extras/__init__.py +1 -0
  28. trackma/extras/__pycache__/AnimeInfoExtractor.cpython-35.pyc +0 -0
  29. trackma/extras/__pycache__/__init__.cpython-35.pyc +0 -0
  30. trackma/extras/__pycache__/plex.cpython-35.pyc +0 -0
  31. trackma/extras/plex.py +101 -0
  32. trackma/lib/__init__.py +0 -0
  33. trackma/lib/__pycache__/__init__.cpython-35.pyc +0 -0
  34. trackma/lib/__pycache__/lib.cpython-35.pyc +0 -0
  35. trackma/lib/__pycache__/libanilist.cpython-35.pyc +0 -0
  36. trackma/lib/__pycache__/libhb.cpython-35.pyc +0 -0
  37. trackma/lib/__pycache__/libmal.cpython-35.pyc +0 -0
  38. trackma/lib/__pycache__/libmelative.cpython-35.pyc +0 -0
  39. trackma/lib/__pycache__/libshikimori.cpython-35.pyc +0 -0
  40. trackma/lib/__pycache__/libvndb.cpython-35.pyc +0 -0
  41. trackma/lib/lib.py +162 -0
  42. trackma/lib/libanilist.py +406 -0
  43. trackma/lib/libhb.py +237 -0
  44. trackma/lib/libmal.py +707 -0
  45. trackma/lib/libmelative.py +204 -0
  46. trackma/lib/libshikimori.py +340 -0
  47. trackma/lib/libvndb.py +375 -0
  48. trackma/messenger.py +42 -0
  49. trackma/tracker.py +390 -0
  50. trackma/ui/__init__.py +0 -0
  51. trackma/ui/__pycache__/__init__.cpython-35.pyc +0 -0
  52. trackma/ui/__pycache__/cli.cpython-35.pyc +0 -0
  53. trackma/ui/__pycache__/curses.cpython-35.pyc +0 -0
  54. trackma/ui/__pycache__/gtkui.cpython-35.pyc +0 -0
  55. trackma/ui/__pycache__/qtui.cpython-35.pyc +0 -0
  56. trackma/ui/cli.py +835 -0
  57. trackma/ui/curses.py +1061 -0
  58. trackma/ui/gtkui.py +2647 -0
  59. trackma/ui/qtui.py +3046 -0
  60. trackma/utils.py +379 -0
EGG-INFO/PKG-INFO ADDED
@@ -0,0 +1,19 @@
1
+ Metadata-Version: 1.1
2
+ Name: Trackma
3
+ Version: 0.6
4
+ Summary: Open multi-site list manager
5
+ Home-page: https://github.com/z411/trackma
6
+ Author: z411
7
+ Author-email: z411@krutt.org
8
+ License: GPL-3
9
+ Description: UNKNOWN
10
+ Keywords: list manager,curses,gtk,qt,myanimelist,hummingbird,vndb
11
+ Platform: UNKNOWN
12
+ Classifier: Development Status :: 3 - Alpha
13
+ Classifier: Intended Audience :: End Users/Desktop
14
+ Classifier: Topic :: Internet
15
+ Classifier: Programming Language :: Python :: 3
16
+ Classifier: Programming Language :: Python :: 3.4
17
+ Classifier: Programming Language :: Python :: 3.5
18
+ Classifier: Operating System :: POSIX
19
+ Classifier: License :: OSI Approved :: GNU General Public License v3 (GPLv3)
EGG-INFO/SOURCES.txt ADDED
@@ -0,0 +1,37 @@
1
+ setup.py
2
+ Trackma.egg-info/PKG-INFO
3
+ Trackma.egg-info/SOURCES.txt
4
+ Trackma.egg-info/dependency_links.txt
5
+ Trackma.egg-info/entry_points.txt
6
+ Trackma.egg-info/requires.txt
7
+ Trackma.egg-info/top_level.txt
8
+ trackma/__init__.py
9
+ trackma/accounts.py
10
+ trackma/data.py
11
+ trackma/engine.py
12
+ trackma/messenger.py
13
+ trackma/tracker.py
14
+ trackma/utils.py
15
+ trackma/data/anilist.jpg
16
+ trackma/data/hb.jpg
17
+ trackma/data/icon.png
18
+ trackma/data/mal.jpg
19
+ trackma/data/melative.jpg
20
+ trackma/data/shikimori.jpg
21
+ trackma/data/vndb.jpg
22
+ trackma/extras/AnimeInfoExtractor.py
23
+ trackma/extras/__init__.py
24
+ trackma/extras/plex.py
25
+ trackma/lib/__init__.py
26
+ trackma/lib/lib.py
27
+ trackma/lib/libanilist.py
28
+ trackma/lib/libhb.py
29
+ trackma/lib/libmal.py
30
+ trackma/lib/libmelative.py
31
+ trackma/lib/libshikimori.py
32
+ trackma/lib/libvndb.py
33
+ trackma/ui/__init__.py
34
+ trackma/ui/cli.py
35
+ trackma/ui/curses.py
36
+ trackma/ui/gtkui.py
37
+ trackma/ui/qtui.py
@@ -0,0 +1 @@
1
+
@@ -0,0 +1,8 @@
1
+ [console_scripts]
2
+ trackma = trackma.ui.cli:main
3
+ trackma-curses = trackma.ui.curses:main
4
+
5
+ [gui_scripts]
6
+ trackma-gtk = trackma.ui.gtkui:main
7
+ trackma-qt = trackma.ui.qtui:main
8
+
EGG-INFO/not-zip-safe ADDED
@@ -0,0 +1 @@
1
+
EGG-INFO/requires.txt ADDED
@@ -0,0 +1,10 @@
1
+
2
+ [GTK]
3
+ PyGTK
4
+ Pillow
5
+
6
+ [Qt]
7
+ Pillow
8
+
9
+ [curses]
10
+ urwid
EGG-INFO/top_level.txt ADDED
@@ -0,0 +1 @@
1
+ trackma
trackma/__init__.py ADDED
File without changes
Binary file
Binary file
trackma/accounts.py ADDED
@@ -0,0 +1,145 @@
1
+ import pickle
2
+ from trackma import utils
3
+
4
+ class AccountManager():
5
+ """
6
+ This is the account manager.
7
+
8
+ It provides a generic way for the user interface to query for the
9
+ available registered accounts, and add or delete accounts.
10
+
11
+ This class returns an Account Dictionary used by
12
+ the :class:`Engine` to start.
13
+ """
14
+ accounts = {'default': None, 'next': 1, 'accounts': dict()}
15
+
16
+ def __init__(self):
17
+ utils.make_dir('')
18
+ self.filename = utils.get_root_filename('accounts.dict')
19
+ self._load()
20
+
21
+ def _load(self):
22
+ if utils.file_exists(self.filename):
23
+ with open(self.filename, 'rb') as f:
24
+ self.accounts = pickle.load(f)
25
+
26
+ def _save(self):
27
+ is_new = not utils.file_exists(self.filename)
28
+ with open(self.filename, 'wb') as f:
29
+ if is_new:
30
+ utils.change_permissions(self.filename, 0o600)
31
+ pickle.dump(self.accounts, f, protocol=2)
32
+
33
+ def add_account(self, username, password, api):
34
+ """
35
+ Registers a new account with the specified
36
+ *username*, *password*, and *api*.
37
+
38
+ The *api* must be one of the available APIs
39
+ found in the utils.available_libs dict.
40
+ """
41
+
42
+ available_libs = utils.available_libs.keys()
43
+
44
+ if not username:
45
+ raise utils.AccountError('Empty username.')
46
+ if not password:
47
+ raise utils.AccountError('Empty password.')
48
+ if api not in available_libs:
49
+ raise utils.AccountError('That API doesn\'t exist.')
50
+
51
+ account = {'username': username,
52
+ 'password': password,
53
+ 'api': api,
54
+ }
55
+
56
+ nextnum = self.accounts['next']
57
+ self.accounts['accounts'][nextnum] = account
58
+ self.accounts['next'] += 1
59
+ self._save()
60
+
61
+ def edit_account(self, num, username, password, api, friends=[]):
62
+ """
63
+ Updates data for account *num* with the specified
64
+ *username*, *password*, and *api*.
65
+ """
66
+
67
+ available_libs = utils.available_libs.keys()
68
+
69
+ if not username:
70
+ raise utils.AccountError('Empty username.')
71
+ if not password:
72
+ raise utils.AccountError('Empty password.')
73
+ if api not in available_libs:
74
+ raise utils.AccountError('That API doesn\'t exist.')
75
+
76
+ account = {'username': username,
77
+ 'password': password,
78
+ 'api': api,
79
+ }
80
+
81
+ self.accounts['accounts'][num].update(account)
82
+ self._save()
83
+
84
+ def delete_account(self, num):
85
+ """
86
+ Deletes the account number **num**.
87
+ """
88
+ self.accounts['default'] = None
89
+ del self.accounts['accounts'][num]
90
+
91
+ # Reset index if there are no accounts left
92
+ if not self.accounts['accounts']:
93
+ self.accounts['next'] = 1
94
+
95
+ self._save()
96
+
97
+ def purge_account(self, num):
98
+ """
99
+ Renames stale cache files for account number **num**.
100
+ """
101
+ account = self.accounts['accounts'][num]
102
+ userfolder = "%s.%s" % (account['username'], account['api'])
103
+ utils.make_dir(userfolder + '.old')
104
+ utils.regex_rename_files('(.*.queue)|(.*.info)|(.*.list)|(.*.meta)', userfolder, userfolder + '.old')
105
+
106
+ def get_account(self, num):
107
+ """
108
+ Returns the account dict **num**.
109
+ """
110
+ return self.accounts['accounts'][num]
111
+
112
+ def get_accounts(self):
113
+ """
114
+ Returns an iterator of available accounts.
115
+ """
116
+ return self.accounts['accounts'].items()
117
+
118
+ def get_default(self):
119
+ """
120
+ Returns the default account number, if set.
121
+ Otherwise returns None.
122
+ """
123
+ num = self.accounts['default']
124
+ if num is not None:
125
+ try:
126
+ return self.accounts['accounts'][num]
127
+ except KeyError:
128
+ return None
129
+ else:
130
+ return None
131
+
132
+ def set_default(self, val):
133
+ """
134
+ Sets a new default account number.
135
+ """
136
+ self.accounts['default'] = val
137
+ self._save()
138
+
139
+ def unset_default(self):
140
+ """
141
+ Unsets the default account number.
142
+ """
143
+ self.accounts['default'] = None
144
+
145
+
Binary file
trackma/data/hb.jpg ADDED
Binary file
trackma/data/icon.png ADDED
Binary file
trackma/data/mal.jpg ADDED
Binary file
Binary file
Binary file
trackma/data/vndb.jpg ADDED
Binary file