trackma 0.6__py3.5.egg → 0.6.1__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.
EGG-INFO/PKG-INFO CHANGED
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 1.1
2
2
  Name: Trackma
3
- Version: 0.6
3
+ Version: 0.6.1
4
4
  Summary: Open multi-site list manager
5
5
  Home-page: https://github.com/z411/trackma
6
6
  Author: z411
Binary file
Binary file
trackma/engine.py CHANGED
@@ -305,7 +305,7 @@ class Engine:
305
305
  list of show dictionaries with all the matches.
306
306
  """
307
307
  showlist = self.data_handler.get()
308
- return list(v for k, v in showlist.items() if re.match(regex, v['title'], re.I))
308
+ return list(v for k, v in showlist.items() if re.search(regex, v['title'], re.I))
309
309
 
310
310
  def regex_list_titles(self, pattern):
311
311
  # TODO : Temporal hack for the client autocomplete function
Binary file
Binary file
trackma/ui/cli.py CHANGED
@@ -109,7 +109,7 @@ class Trackma_cmd(cmd.Cmd):
109
109
  # otherwise use title
110
110
  try:
111
111
  index = int(title)-1
112
- return self.sortedlist[index]
112
+ return self.sortedlist[index][1]
113
113
  except (ValueError, AttributeError, IndexError):
114
114
  return self.engine.get_show_info_title(title)
115
115
 
@@ -316,7 +316,7 @@ class Trackma_cmd(cmd.Cmd):
316
316
  :param pattern Regex pattern to search for.
317
317
  :usage search <pattern>
318
318
  """
319
- sortedlist = list(v for v in self.sortedlist if re.match(args[0], v[1]['title'], re.I))
319
+ sortedlist = list(v for v in self.sortedlist if re.search(args[0], v[1]['title'], re.I))
320
320
  self._make_list(sortedlist)
321
321
 
322
322
  def do_add(self, args):
trackma/ui/curses.py CHANGED
@@ -58,29 +58,15 @@ class Trackma_urwid():
58
58
 
59
59
  def __init__(self):
60
60
  """Creates main widgets and creates mainloop"""
61
-
62
- palette = [
63
- ('body','', ''),
64
- ('focus','standout', ''),
65
- ('head','light red', 'black'),
66
- ('header','bold', ''),
67
- ('status', 'white', 'dark blue'),
68
- ('error', 'light red', 'dark blue'),
69
- ('window', 'white', 'dark blue'),
70
- ('button', 'black', 'light gray'),
71
- ('button hilight', 'white', 'dark red'),
72
- ('item_airing', 'dark blue', ''),
73
- ('item_notaired', 'yellow', ''),
74
- ('item_neweps', 'white', 'brown'),
75
- ('item_updated', 'white', 'dark green'),
76
- ('item_playing', 'white', 'dark blue'),
77
- ('info_title', 'light red', ''),
78
- ('info_section', 'dark blue', ''),
79
- ]
80
-
81
- keymap = utils.parse_config(utils.get_root_filename('keymap.json'), utils.curses_defaults['keymap'])
61
+ self.config = utils.parse_config(utils.get_root_filename('ui-curses.json'), utils.curses_defaults)
62
+ keymap = self.config['keymap']
63
+ self.keymap_str = self.get_keymap_str(keymap)
82
64
  self.keymapping = self.map_key_to_func(keymap)
83
65
 
66
+ palette = []
67
+ for k, color in self.config['palette'].items():
68
+ palette.append( (k, color[0], color[1]) )
69
+
84
70
  sys.stdout.write("\x1b]0;Trackma-curses "+utils.VERSION+"\x07");
85
71
  self.header_title = urwid.Text('Trackma-curses ' + utils.VERSION)
86
72
  self.header_api = urwid.Text('API:')
@@ -93,15 +79,17 @@ class Trackma_urwid():
93
79
  ('fixed', 17, self.header_sort),
94
80
  ('fixed', 16, self.header_api)]), 'status')
95
81
 
82
+ top_pile = [self.header]
96
83
 
97
- top_text = keymap['help'] + ':Help ' + keymap['sort'] +':Sort ' + \
98
- keymap['update'] + ':Update ' + keymap['play'] + ':Play ' + \
99
- keymap['status'] + ':Status ' + keymap['score'] + ':Score ' + \
100
- keymap['quit'] + ':Quit'
101
- self.top_pile = urwid.Pile([self.header,
102
- urwid.AttrMap(urwid.Text(top_text), 'status')
103
- ])
84
+ if self.config['show_help']:
85
+ top_text = "{help}:Help {sort}:Sort " + \
86
+ "{update}:Update {play}:Play " + \
87
+ "{status}:Status {score}:Score " + \
88
+ "{quit}:Quit"
89
+ top_text = top_text.format(**self.keymap_str)
90
+ top_pile.append(urwid.AttrMap(urwid.Text(top_text), 'status'))
104
91
 
92
+ self.top_pile = urwid.Pile(top_pile)
105
93
  self.statusbar = urwid.AttrMap(urwid.Text('Trackma-curses '+utils.VERSION), 'status')
106
94
 
107
95
  self.listheader = urwid.AttrMap(
@@ -149,14 +137,27 @@ class Trackma_urwid():
149
137
  'open_web': self.do_open_web,
150
138
  }
151
139
 
152
- for key, value in keymap.items():
140
+ for func, keybind in keymap.items():
153
141
  try:
154
- keymapping.update({value: funcmap[key]})
142
+ if isinstance(keybind, list):
143
+ for keybindm in keybind:
144
+ keymapping[keybindm] = funcmap[func]
145
+ else:
146
+ keymapping[keybind] = funcmap[func]
155
147
  except KeyError:
156
148
  # keymap.json requested an action not available in funcmap
157
149
  pass
158
150
  return keymapping
159
151
 
152
+ def get_keymap_str(self, keymap):
153
+ stringed = {}
154
+ for k, keybind in keymap.items():
155
+ if isinstance(keybind, list):
156
+ stringed[k] = ','.join(keybind)
157
+ else:
158
+ stringed[k] = keybind
159
+ return stringed
160
+
160
161
  def _rebuild(self):
161
162
  self.header_api.set_text('API:%s' % self.engine.api_info['name'])
162
163
  self.lists = dict()
@@ -317,8 +318,9 @@ class Trackma_urwid():
317
318
  helptext += "Trackma is an open source client for media tracking websites.\n"
318
319
  helptext += "http://github.com/z411/trackma\n\n"
319
320
  helptext += "This program is licensed under the GPLv3,\nfor more information read COPYING file.\n\n"
320
- helptext += "More controls:\n Left/Right:Change Filter\n /:Search\n a:Add\n c:Change API/Mediatype\n"
321
- helptext += " d:Delete\n s:Send changes\n r:Change sort order\n R:Retrieve list\n Enter: View details\n O: Open website\n A:Set alternative title\n N:Search for new episodes\n F9: Change account"
321
+ helptext += "More controls:\n {prev_filter}/{next_filter}:Change Filter\n {search}:Search\n {addsearch}:Add\n {reload}:Change API/Mediatype\n"
322
+ helptext += " {delete}:Delete\n {send}:Send changes\n {sort_order}:Change sort order\n {retrieve}:Retrieve list\n {details}: View details\n {open_web}: Open website\n {altname}:Set alternative title\n {neweps}:Search for new episodes\n {switch_account}: Change account"
323
+ helptext = helptext.format(**self.keymap_str)
322
324
  ok_button = urwid.Button('OK', self.help_close)
323
325
  ok_button_wrap = urwid.Padding(urwid.AttrMap(ok_button, 'button', 'button hilight'), 'center', 6)
324
326
  pile = urwid.Pile([urwid.Text(helptext), ok_button_wrap])
trackma/ui/qtui.py CHANGED
@@ -362,7 +362,7 @@ class Trackma(QMainWindow):
362
362
  self.show_filter_casesens = QCheckBox()
363
363
  self.show_filter_casesens.stateChanged.connect(self.s_filter_changed)
364
364
 
365
- self.setMinimumSize(740, 480)
365
+ #self.setMinimumSize(740, 480)
366
366
  if self.config['remember_geometry']:
367
367
  self.setGeometry(self.config['last_x'], self.config['last_y'],
368
368
  self.config['last_width'], self.config['last_height'])
@@ -372,7 +372,7 @@ class Trackma(QMainWindow):
372
372
  self.show_image.setFixedWidth( 100 )
373
373
  self.show_image.setAlignment( QtCore.Qt.AlignCenter )
374
374
  self.show_image.setStyleSheet("border: 1px solid #777;background-color:#999;text-align:center")
375
- show_progress_label = QLabel('Progress')
375
+ show_progress_label = QLabel('Progress:')
376
376
  self.show_progress = QSpinBox()
377
377
  self.show_progress_bar = QProgressBar()
378
378
  self.show_progress_btn = QPushButton('Update')
@@ -393,7 +393,7 @@ class Trackma(QMainWindow):
393
393
  self.show_dec_btn.clicked.connect(self.s_rem_episode)
394
394
  self.show_dec_btn.setShortcut('Ctrl+Left')
395
395
  self.show_dec_btn.setToolTip('Decrement number of episodes watched')
396
- show_score_label = QLabel('Score')
396
+ show_score_label = QLabel('Score:')
397
397
  self.show_score = QDoubleSpinBox()
398
398
  self.show_score_btn = QPushButton('Set')
399
399
  self.show_score_btn.setToolTip('Set score to the value entered above')
@@ -413,10 +413,10 @@ class Trackma(QMainWindow):
413
413
  left_box.addRow(self.show_image)
414
414
  left_box.addRow(self.show_progress_bar)
415
415
  left_box.addRow(small_btns_hbox)
416
- left_box.addRow(show_progress_label, self.show_progress)
417
- left_box.addRow(self.show_progress_btn)
418
- left_box.addRow(show_score_label, self.show_score)
419
- left_box.addRow(self.show_score_btn)
416
+ left_box.addRow(show_progress_label)
417
+ left_box.addRow(self.show_progress, self.show_progress_btn)
418
+ left_box.addRow(show_score_label)
419
+ left_box.addRow(self.show_score, self.show_score_btn)
420
420
  left_box.addRow(self.show_status)
421
421
  left_box.addRow(self.show_tags_btn)
422
422
 
@@ -723,7 +723,7 @@ class Trackma(QMainWindow):
723
723
 
724
724
  tooltip += "Total: %d" % show['total']
725
725
  percent_widget.setToolTip(tooltip)
726
- percent = percent_widget.value() * 100 / percent_widget.maximum()
726
+ percent = "{}%".format( percent_widget.value() * 100 / percent_widget.maximum() )
727
727
 
728
728
  widget.setRowHeight(row, QtGui.QFontMetrics(widget.font()).height() + 2);
729
729
  widget.setItem(row, 0, ShowItem( str(show['id']), color ))
trackma/utils.py CHANGED
@@ -21,7 +21,7 @@ import json
21
21
  import difflib
22
22
  import pickle
23
23
 
24
- VERSION = '0.6'
24
+ VERSION = '0.6.1'
25
25
 
26
26
  datadir = os.path.dirname(__file__)
27
27
  LOGIN_PASSWD = 1
@@ -287,6 +287,7 @@ userconfig_defaults = {
287
287
  'username': '',
288
288
  }
289
289
  curses_defaults = {
290
+ 'show_help': True,
290
291
  'keymap': {
291
292
  'help': 'f1',
292
293
  'prev_filter': 'left',
@@ -312,7 +313,22 @@ curses_defaults = {
312
313
  'open_web': 'O',
313
314
  },
314
315
  'palette': {
315
-
316
+ 'body': ('', ''),
317
+ 'focus': ('standout', ''),
318
+ 'head': ('light red', 'black'),
319
+ 'header': ('bold', ''),
320
+ 'status': ('white', 'dark blue'),
321
+ 'error': ('light red', 'dark blue'),
322
+ 'window': ('white', 'dark blue'),
323
+ 'button': ('black', 'light gray'),
324
+ 'button hilight': ('white', 'dark red'),
325
+ 'item_airing': ('dark blue', ''),
326
+ 'item_notaired': ('yellow', ''),
327
+ 'item_neweps': ('white', 'brown'),
328
+ 'item_updated': ('white', 'dark green'),
329
+ 'item_playing': ('white', 'dark blue'),
330
+ 'info_title': ('light red', ''),
331
+ 'info_section': ('dark blue', ''),
316
332
  }
317
333
  }
318
334