else:
self._c['playlist'].add_playlist(playlist)
+ def _postprocess_new_playlist(self, command, args={}, results=None):
+ """Update `self` to show the new playlist.
+ """
+ if not isinstance(results[-1], Success):
+ self._postprocess_text(command, results=results)
+ return
+ assert len(results) == 2, results
+ playlist = results[0]
+ if 'playlist' in self._c:
+ loaded = self._c['playlist'].is_playlist_loaded(playlist)
+ assert loaded == False, loaded
+ self._c['playlist'].add_playlist(playlist)
+
def _postprocess_load_playlist(self, command, args={}, results=None):
"""Update `self` to show the playlist.
"""
return
assert len(results) == 2, results
playlist = results[0]
- self._c['playlist'].update_playlist(playlist)
+ if 'playlist' in self._c:
+ loaded = self._c['playlist'].is_playlist_loaded(playlist)
+ assert loaded == True, loaded
+ self._c['playlist'].update_playlist(playlist)
def _postprocess_get_curve(self, command, args={}, results=[]):
"""Update `self` to show the curve.
else:
raise NotImplementedError()
if 'note' in self._c:
- self._c['note'].set_text(curve.info['note'])
+ self._c['note'].set_text(curve.info.get('note', ''))
if 'playlist' in self._c:
self._c['playlist'].set_selected_curve(
playlist, curve)
"""
pass
+ def _postprocess_glob_curves_to_playlist(
+ self, command, args={}, results=[]):
+ """Update `self` to show new curves.
+ """
+ if not isinstance(results[-1], Success):
+ self._postprocess_text(command, results=results)
+ return
+ if 'playlist' in self._c:
+ if args.get('playlist', None) != None:
+ playlist = args['playlist']
+ pname = playlist.name
+ loaded = self._c['playlist'].is_playlist_name_loaded(pname)
+ assert loaded == True, loaded
+ for curve in results[:-1]:
+ self._c['playlist']._add_curve(pname, curve)
+ else:
+ self.execute_command(
+ command=self._command_by_name('get playlist'))
+
def _postprocess_zero_block_surface_contact_point(
self, command, args={}, results=[]):
"""Update the curve, since the available columns may have changed.