trackma 0.7.1__py3.4.egg → 0.7.3__py3.4.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.
EGG-INFO/PKG-INFO CHANGED
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 1.1
2
2
  Name: Trackma
3
- Version: 0.7.1
3
+ Version: 0.7.3
4
4
  Summary: Open multi-site list manager
5
5
  Home-page: https://github.com/z411/trackma
6
6
  Author: z411
EGG-INFO/entry_points.txt CHANGED
@@ -5,5 +5,5 @@ trackma-curses = trackma.ui.curses:main [curses]
5
5
  [gui_scripts]
6
6
  trackma-gtk = trackma.ui.gtkui:main [gtk]
7
7
  trackma-qt = trackma.ui.qtui:main [qt]
8
- trackma-qt4 = trackma.ui.qt4ui [qt]
8
+ trackma-qt4 = trackma.ui.qt4ui:main [qt]
9
9
 
Binary file
Binary file
trackma/lib/libanilist.py CHANGED
@@ -304,7 +304,7 @@ class libanilist(lib):
304
304
 
305
305
  self.msg.info(self.name, "Searching for {}...".format(criteria))
306
306
  param = {'access_token': self._get_userconfig('access_token')}
307
- data = self._request("GET", "{0}/search/{1}".format(self.mediatype, criteria), get=param)
307
+ data = self._request("GET", "{0}/search/{1}".format(self.mediatype, urllib.parse.quote_plus(criteria)), get=param)
308
308
 
309
309
  if type(data) == dict:
310
310
  # In case of error API returns a small JSON payload
@@ -38,6 +38,7 @@ class inotifyBase(tracker.TrackerBase):
38
38
  thus we should be safe.
39
39
  """
40
40
 
41
+ time.sleep(0.01)
41
42
  for p in os.listdir("/proc/"):
42
43
  if not p.isdigit(): continue
43
44
  d = "/proc/%s/fd/" % p
@@ -65,16 +66,13 @@ class inotifyBase(tracker.TrackerBase):
65
66
  def _closed_handle(self, pid, fd):
66
67
  """ Check if this pid has closed this handle (or never opened it) """
67
68
  d = "/proc/%s/fd/%s" % (pid, fd)
69
+ time.sleep(0.01) # TODO : If we don't wait the filehandle will still be there
68
70
  return not os.path.islink(d)
69
71
 
70
72
  def _proc_open(self, path, name):
71
73
  self.msg.debug(self.name, 'Got OPEN event: {} {}'.format(path, name))
72
74
  pathname = os.path.join(path, name)
73
75
 
74
- if self.open_file[0]:
75
- self.msg.debug(self.name, "There's already a tracked open file.")
76
- return
77
-
78
76
  pid, fd = self._is_being_played(pathname)
79
77
 
80
78
  if pid:
@@ -92,7 +90,6 @@ class inotifyBase(tracker.TrackerBase):
92
90
  pathname = os.path.join(path, name)
93
91
 
94
92
  open_pathname, pid, fd = self.open_file
95
- time.sleep(0.1) # TODO : If we don't wait the filehandle will still be there
96
93
 
97
94
  if pathname != open_pathname:
98
95
  self.msg.debug(self.name, "A different file was closed.")
trackma/tracker/plex.py CHANGED
@@ -32,6 +32,7 @@ class PlexTracker(tracker.TrackerBase):
32
32
 
33
33
  def __init__(self, messenger, tracker_list, process_name, watch_dir, interval, update_wait, update_close, not_found_prompt):
34
34
  self.config = utils.parse_config(utils.get_root_filename('config.json'), utils.config_defaults)
35
+ self.host_port = self.config['plex_host']+":"+self.config['plex_port']
35
36
  self.update_wait = update_wait
36
37
  self.status_log = [None, None]
37
38
  super().__init__(messenger, tracker_list, process_name, watch_dir, interval, update_wait, update_close, not_found_prompt)
@@ -53,8 +54,11 @@ class PlexTracker(tracker.TrackerBase):
53
54
  if self.get_plex_status() == IDLE:
54
55
  return None
55
56
 
56
- attr = self._get_xml_info("Part", "file")
57
- name = urllib.parse.unquote(ntpath.basename(attr))
57
+ meta = self._get_xml_info("Video", "key")
58
+ meta_url = "http://"+self.host_port+meta
59
+ mdoc = xdmd.parse(urllib.request.urlopen(meta_url))
60
+ mres = mdoc.getElementsByTagName("Part")[0].getAttribute("file")
61
+ name = urllib.parse.unquote(ntpath.basename(mres))
58
62
 
59
63
  return name
60
64
 
@@ -96,9 +100,7 @@ class PlexTracker(tracker.TrackerBase):
96
100
 
97
101
  def _get_xml_info(self, tag, attr):
98
102
  # Get the required info from the /status/sessions url
99
- host_port = self.config['plex_host']+":"+self.config['plex_port']
100
-
101
- session_url = "http://"+host_port+"/status/sessions"
103
+ session_url = "http://"+self.host_port+"/status/sessions"
102
104
  sdoc = xdmd.parse(urllib.request.urlopen(session_url))
103
105
 
104
106
  res = sdoc.getElementsByTagName(tag)[0].getAttribute(attr)
@@ -125,6 +125,7 @@ class TrackerBase(object):
125
125
  # Stops attempt to update current episode
126
126
  self.last_updated = True
127
127
  self.last_state = utils.TRACKER_IGNORED
128
+ self.timer = None
128
129
  self._emit_signal('state', utils.TRACKER_IGNORED, None)
129
130
 
130
131
  def _update_state(self, state):
@@ -148,6 +149,7 @@ class TrackerBase(object):
148
149
  self._update_state(state)
149
150
  # There's a new show/ep detected, so let's save the show information
150
151
  self.last_show_tuple = show_tuple
152
+ self.last_updated = False
151
153
  if state == utils.TRACKER_PLAYING:
152
154
  self._emit_signal('playing', show['id'], True, episode)
153
155
  # Check if we shouldn't update the show
Binary file
Binary file
Binary file
trackma/ui/gtkui.py CHANGED
@@ -1754,7 +1754,7 @@ class InfoWidget(Gtk.VBox):
1754
1754
  self.w_image.image_show(imagefile)
1755
1755
  else:
1756
1756
  self.w_image.pholder_show('Loading...')
1757
- self.image_thread = ImageTask(self.w_image, show['image'], imagefile)
1757
+ self.image_thread = ImageTask(self.w_image, show['image'], imagefile, (200, 298))
1758
1758
  self.image_thread.start()
1759
1759
 
1760
1760
  # Start info loading thread
@@ -2322,9 +2322,11 @@ class AccountSelectAdd(Gtk.Window):
2322
2322
  # Entries
2323
2323
  self.txt_user = Gtk.Entry()
2324
2324
  self.txt_user.set_max_length(128)
2325
+ self.txt_user.set_activates_default(True)
2325
2326
  self.txt_passwd = Gtk.Entry()
2326
2327
  self.txt_passwd.set_max_length(128)
2327
2328
  self.txt_passwd.set_visibility(False)
2329
+ self.txt_passwd.set_activates_default(True)
2328
2330
 
2329
2331
  # Combobox
2330
2332
  self.model_api = Gtk.ListStore(str, str, GdkPixbuf.Pixbuf)
@@ -2348,6 +2350,8 @@ class AccountSelectAdd(Gtk.Window):
2348
2350
  alignment = Gtk.Alignment(xalign=0.5, xscale=0)
2349
2351
  bottombar = Gtk.HBox(False, 5)
2350
2352
  self.add_button = Gtk.Button(stock=Gtk.STOCK_APPLY)
2353
+ self.add_button.set_can_default(True)
2354
+ self.add_button.grab_default()
2351
2355
  close_button = Gtk.Button(stock=Gtk.STOCK_CLOSE)
2352
2356
  close_button.connect("clicked", self.__do_close)
2353
2357
  bottombar.pack_start(self.add_button, False, False, 0)
trackma/ui/qt4ui.py CHANGED
@@ -17,4 +17,9 @@
17
17
  import os
18
18
  os.environ['PYQT4'] = 'True'
19
19
  from trackma.ui import qtui
20
- qtui.main()
20
+
21
+ def main():
22
+ qtui.main()
23
+
24
+ if __name__ == '__main__':
25
+ main()
trackma/ui/qtui.py CHANGED
@@ -145,7 +145,7 @@ class Trackma(QMainWindow):
145
145
  self.start(default)
146
146
  else:
147
147
  self.accountman_create()
148
- accountman_widget.show()
148
+ self.accountman_widget.show()
149
149
 
150
150
  def accountman_create(self):
151
151
  self.accountman_widget = AccountDialog(None, self.accountman)
@@ -1595,7 +1595,7 @@ class DetailsWidget(QWidget):
1595
1595
  self.s_show_image(filename)
1596
1596
  else:
1597
1597
  self.show_image.setText('Downloading...')
1598
- self.image_worker = Image_Worker(show['image'], filename)
1598
+ self.image_worker = Image_Worker(show['image'], filename, (200, 280))
1599
1599
  self.image_worker.finished.connect(self.s_show_image)
1600
1600
  self.image_worker.start()
1601
1601
 
@@ -2423,6 +2423,7 @@ class AccountDialog(QDialog):
2423
2423
  self.edit_btns.activated.connect(self.s_edit)
2424
2424
  select_btn = QPushButton('Select')
2425
2425
  select_btn.clicked.connect(self.select)
2426
+ select_btn.setDefault(True)
2426
2427
  bottom_layout.addWidget(self.remember_chk)
2427
2428
  bottom_layout.addWidget(cancel_btn)
2428
2429
  bottom_layout.addWidget(add_btn)
trackma/utils.py CHANGED
@@ -21,7 +21,7 @@ import json
21
21
  import difflib
22
22
  import pickle
23
23
 
24
- VERSION = '0.7.1'
24
+ VERSION = '0.7.3'
25
25
 
26
26
  datadir = os.path.dirname(__file__)
27
27
  LOGIN_PASSWD = 1