summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorjaseg <git@jaseg.net>2017-05-07 15:58:58 +0200
committerjaseg <git@jaseg.net>2017-05-07 15:58:58 +0200
commit28fdc21a2444c3d8005405bb4df369b7552ca244 (patch)
tree82a860924b502a09efc3c65c8e23a4bf7c01d541
parent9a9a8bb2c9b39b61992fe01b2d4fcaf5bfcc5e7e (diff)
downloadpython-mpv-28fdc21a2444c3d8005405bb4df369b7552ca244.tar.gz
python-mpv-28fdc21a2444c3d8005405bb4df369b7552ca244.tar.bz2
python-mpv-28fdc21a2444c3d8005405bb4df369b7552ca244.zip
Organize convenience functions
-rw-r--r--mpv.py14
1 files changed, 7 insertions, 7 deletions
diff --git a/mpv.py b/mpv.py
index 56bb47c..19124d1 100644
--- a/mpv.py
+++ b/mpv.py
@@ -530,10 +530,6 @@ class MPV(object):
def playlist_prev(self, mode='weak'):
self.command('playlist_prev', mode)
- @property
- def playlist_filenames(self):
- return [element['filename'] for element in self.playlist]
-
@staticmethod
def _encode_options(options):
return ','.join('{}={}'.format(str(key), str(val)) for key, val in options.items())
@@ -544,9 +540,6 @@ class MPV(object):
def loadlist(self, playlist, mode='replace'):
self.command('loadlist', playlist.encode(fs_enc), mode)
- def playlist_append(self, filename, **options):
- self.loadfile(self, filename, 'append', **options)
-
def playlist_clear(self):
self.command('playlist_clear')
@@ -671,6 +664,13 @@ class MPV(object):
def play(self, filename):
self.loadfile(filename)
+ @property
+ def playlist_filenames(self):
+ return [element['filename'] for element in self.playlist]
+
+ def playlist_append(self, filename, **options):
+ self.loadfile(filename, 'append', **options)
+
# Property accessors
def _get_property(self, name, proptype=str, decode_str=False):
fmt = {int: MpvFormat.INT64,