trackma 0.3__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.
- Trackma-0.3/PKG-INFO +19 -0
- Trackma-0.3/Trackma.egg-info/PKG-INFO +19 -0
- Trackma-0.3/Trackma.egg-info/SOURCES.txt +35 -0
- Trackma-0.3/Trackma.egg-info/dependency_links.txt +1 -0
- Trackma-0.3/Trackma.egg-info/entry_points.txt +8 -0
- Trackma-0.3/Trackma.egg-info/requires.txt +10 -0
- Trackma-0.3/Trackma.egg-info/top_level.txt +1 -0
- Trackma-0.3/setup.cfg +5 -0
- Trackma-0.3/setup.py +55 -0
- Trackma-0.3/trackma/__init__.py +0 -0
- Trackma-0.3/trackma/accounts.py +110 -0
- Trackma-0.3/trackma/data/anilist.jpg +0 -0
- Trackma-0.3/trackma/data/hb.jpg +0 -0
- Trackma-0.3/trackma/data/icon.png +0 -0
- Trackma-0.3/trackma/data/mal.jpg +0 -0
- Trackma-0.3/trackma/data/melative.jpg +0 -0
- Trackma-0.3/trackma/data/vndb.jpg +0 -0
- Trackma-0.3/trackma/data.py +549 -0
- Trackma-0.3/trackma/engine.py +668 -0
- Trackma-0.3/trackma/lib/__init__.py +0 -0
- Trackma-0.3/trackma/lib/lib.py +152 -0
- Trackma-0.3/trackma/lib/libanilist.py +131 -0
- Trackma-0.3/trackma/lib/libhb.py +245 -0
- Trackma-0.3/trackma/lib/libmal.py +681 -0
- Trackma-0.3/trackma/lib/libmelative.py +213 -0
- Trackma-0.3/trackma/lib/libvndb.py +368 -0
- Trackma-0.3/trackma/messenger.py +42 -0
- Trackma-0.3/trackma/tracker.py +502 -0
- Trackma-0.3/trackma/ui/__init__.py +0 -0
- Trackma-0.3/trackma/ui/cli.py +622 -0
- Trackma-0.3/trackma/ui/curses.py +1032 -0
- Trackma-0.3/trackma/ui/gtkui.py +2037 -0
- Trackma-0.3/trackma/ui/qtui.py +1844 -0
- Trackma-0.3/trackma/ui/remote/__init__.py +0 -0
- Trackma-0.3/trackma/ui/remote/client.py +16 -0
- Trackma-0.3/trackma/ui/remote/daemon.py +53 -0
- Trackma-0.3/trackma/utils.py +220 -0
Trackma-0.3/PKG-INFO
ADDED
|
@@ -0,0 +1,19 @@
|
|
|
1
|
+
Metadata-Version: 1.1
|
|
2
|
+
Name: Trackma
|
|
3
|
+
Version: 0.3
|
|
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 :: 2
|
|
16
|
+
Classifier: Programming Language :: Python :: 2.6
|
|
17
|
+
Classifier: Programming Language :: Python :: 2.7
|
|
18
|
+
Classifier: Operating System :: POSIX
|
|
19
|
+
Classifier: License :: OSI Approved :: GNU General Public License v3 (GPLv3)
|
|
@@ -0,0 +1,19 @@
|
|
|
1
|
+
Metadata-Version: 1.1
|
|
2
|
+
Name: Trackma
|
|
3
|
+
Version: 0.3
|
|
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 :: 2
|
|
16
|
+
Classifier: Programming Language :: Python :: 2.6
|
|
17
|
+
Classifier: Programming Language :: Python :: 2.7
|
|
18
|
+
Classifier: Operating System :: POSIX
|
|
19
|
+
Classifier: License :: OSI Approved :: GNU General Public License v3 (GPLv3)
|
|
@@ -0,0 +1,35 @@
|
|
|
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/vndb.jpg
|
|
21
|
+
trackma/lib/__init__.py
|
|
22
|
+
trackma/lib/lib.py
|
|
23
|
+
trackma/lib/libanilist.py
|
|
24
|
+
trackma/lib/libhb.py
|
|
25
|
+
trackma/lib/libmal.py
|
|
26
|
+
trackma/lib/libmelative.py
|
|
27
|
+
trackma/lib/libvndb.py
|
|
28
|
+
trackma/ui/__init__.py
|
|
29
|
+
trackma/ui/cli.py
|
|
30
|
+
trackma/ui/curses.py
|
|
31
|
+
trackma/ui/gtkui.py
|
|
32
|
+
trackma/ui/qtui.py
|
|
33
|
+
trackma/ui/remote/__init__.py
|
|
34
|
+
trackma/ui/remote/client.py
|
|
35
|
+
trackma/ui/remote/daemon.py
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
trackma
|
Trackma-0.3/setup.cfg
ADDED
Trackma-0.3/setup.py
ADDED
|
@@ -0,0 +1,55 @@
|
|
|
1
|
+
#!/usr/bin/env python
|
|
2
|
+
|
|
3
|
+
from setuptools import setup, find_packages
|
|
4
|
+
from trackma import utils
|
|
5
|
+
|
|
6
|
+
try:
|
|
7
|
+
LONG_DESCRIPTION = open("README.rst").read()
|
|
8
|
+
except IOError:
|
|
9
|
+
LONG_DESCRIPTION = __doc__
|
|
10
|
+
|
|
11
|
+
NAME = "Trackma"
|
|
12
|
+
REQUIREMENTS = []
|
|
13
|
+
EXTRA_REQUIREMENTS = {
|
|
14
|
+
'curses': ['urwid'],
|
|
15
|
+
'GTK' : ['PyGTK', 'Pillow'],
|
|
16
|
+
'Qt': ['Pillow'],
|
|
17
|
+
}
|
|
18
|
+
|
|
19
|
+
setup(
|
|
20
|
+
name=NAME,
|
|
21
|
+
version=utils.VERSION,
|
|
22
|
+
packages=find_packages(),
|
|
23
|
+
|
|
24
|
+
install_requires=REQUIREMENTS,
|
|
25
|
+
extras_require=EXTRA_REQUIREMENTS,
|
|
26
|
+
package_data={'trackma': ['data/*']},
|
|
27
|
+
|
|
28
|
+
author='z411',
|
|
29
|
+
author_email='z411@krutt.org',
|
|
30
|
+
description='Open multi-site list manager',
|
|
31
|
+
long_description=LONG_DESCRIPTION,
|
|
32
|
+
url='https://github.com/z411/trackma',
|
|
33
|
+
keywords='list manager, curses, gtk, qt, myanimelist, hummingbird, vndb',
|
|
34
|
+
license="GPL-3",
|
|
35
|
+
entry_points={
|
|
36
|
+
'console_scripts': [
|
|
37
|
+
'trackma = trackma.ui.cli:main',
|
|
38
|
+
'trackma-curses = trackma.ui.curses:main',
|
|
39
|
+
],
|
|
40
|
+
'gui_scripts': [
|
|
41
|
+
'trackma-gtk = trackma.ui.gtkui:main',
|
|
42
|
+
'trackma-qt = trackma.ui.qtui:main',
|
|
43
|
+
]
|
|
44
|
+
},
|
|
45
|
+
classifiers=[
|
|
46
|
+
'Development Status :: 3 - Alpha',
|
|
47
|
+
'Intended Audience :: End Users/Desktop',
|
|
48
|
+
'Topic :: Internet',
|
|
49
|
+
'Programming Language :: Python :: 2',
|
|
50
|
+
'Programming Language :: Python :: 2.6',
|
|
51
|
+
'Programming Language :: Python :: 2.7',
|
|
52
|
+
'Operating System :: POSIX',
|
|
53
|
+
'License :: OSI Approved :: GNU General Public License v3 (GPLv3)',
|
|
54
|
+
]
|
|
55
|
+
)
|
|
File without changes
|
|
@@ -0,0 +1,110 @@
|
|
|
1
|
+
import utils
|
|
2
|
+
import cPickle
|
|
3
|
+
|
|
4
|
+
class AccountManager(object):
|
|
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 = cPickle.load(f)
|
|
25
|
+
|
|
26
|
+
def _save(self):
|
|
27
|
+
with open(self.filename, 'wb') as f:
|
|
28
|
+
cPickle.dump(self.accounts, f)
|
|
29
|
+
|
|
30
|
+
def add_account(self, username, password, api):
|
|
31
|
+
"""
|
|
32
|
+
Registers a new account with the specified
|
|
33
|
+
*username*, *password* and *api*.
|
|
34
|
+
|
|
35
|
+
The *api* must be one of the available APIs
|
|
36
|
+
found in the utils.available_libs dict.
|
|
37
|
+
"""
|
|
38
|
+
|
|
39
|
+
available_libs = utils.available_libs.keys()
|
|
40
|
+
|
|
41
|
+
if not username:
|
|
42
|
+
raise utils.AccountError('Empty username.')
|
|
43
|
+
if not password:
|
|
44
|
+
raise utils.AccountError('Empty password.')
|
|
45
|
+
if api not in available_libs:
|
|
46
|
+
raise utils.AccountError('That API doesn\'t exist.')
|
|
47
|
+
|
|
48
|
+
account = {'username': username,
|
|
49
|
+
'password': password,
|
|
50
|
+
'api': api,
|
|
51
|
+
}
|
|
52
|
+
|
|
53
|
+
nextnum = self.accounts['next']
|
|
54
|
+
self.accounts['accounts'][nextnum] = account
|
|
55
|
+
self.accounts['next'] += 1
|
|
56
|
+
self._save()
|
|
57
|
+
|
|
58
|
+
def delete_account(self, num):
|
|
59
|
+
"""
|
|
60
|
+
Deletes the account number **num**.
|
|
61
|
+
"""
|
|
62
|
+
self.accounts['default'] = None
|
|
63
|
+
del self.accounts['accounts'][num]
|
|
64
|
+
|
|
65
|
+
# Reset index if there are no accounts left
|
|
66
|
+
if not self.accounts['accounts']:
|
|
67
|
+
self.accounts['next'] = 1
|
|
68
|
+
|
|
69
|
+
self._save()
|
|
70
|
+
|
|
71
|
+
def get_account(self, num):
|
|
72
|
+
"""
|
|
73
|
+
Returns the account dict **num**.
|
|
74
|
+
"""
|
|
75
|
+
return self.accounts['accounts'][num]
|
|
76
|
+
|
|
77
|
+
def get_accounts(self):
|
|
78
|
+
"""
|
|
79
|
+
Returns an iterator of available accounts.
|
|
80
|
+
"""
|
|
81
|
+
return self.accounts['accounts'].iteritems()
|
|
82
|
+
|
|
83
|
+
def get_default(self):
|
|
84
|
+
"""
|
|
85
|
+
Returns the default account number, if set.
|
|
86
|
+
Otherwise returns None.
|
|
87
|
+
"""
|
|
88
|
+
num = self.accounts['default']
|
|
89
|
+
if num is not None:
|
|
90
|
+
try:
|
|
91
|
+
return self.accounts['accounts'][num]
|
|
92
|
+
except KeyError:
|
|
93
|
+
return None
|
|
94
|
+
else:
|
|
95
|
+
return None
|
|
96
|
+
|
|
97
|
+
def set_default(self, val):
|
|
98
|
+
"""
|
|
99
|
+
Sets a new default account number.
|
|
100
|
+
"""
|
|
101
|
+
self.accounts['default'] = val
|
|
102
|
+
self._save()
|
|
103
|
+
|
|
104
|
+
def unset_default(self):
|
|
105
|
+
"""
|
|
106
|
+
Unsets the default account number.
|
|
107
|
+
"""
|
|
108
|
+
self.accounts['default'] = None
|
|
109
|
+
|
|
110
|
+
|
|
Binary file
|
|
Binary file
|
|
Binary file
|
|
Binary file
|
|
Binary file
|
|
Binary file
|