cplay-ng

simple curses audio player
git clone https://git.ce9e.org/cplay-ng.git

commit
0368417d3f7027ed47e91e19081df119acde0809
parent
664cdd102d9fdd9611ed1c71dcb5ee22d2b6536c
Author
Tobias Bengfort <tobias.bengfort@posteo.de>
Date
2020-09-05 13:39
always use verbose format

Diffstat

M cplay.py 14 +++-----------

1 files changed, 3 insertions, 11 deletions


diff --git a/cplay.py b/cplay.py

@@ -31,7 +31,6 @@ Left, Right  : seek backward/forward
   31    31 C-s, C-r     : next/previous search match
   32    32 Esc          : cancel
   33    33 0..9         : volume control
   34    -1 l            : list mode
   35    34 h            : help
   36    35 q, Q         : quit
   37    36 
@@ -266,12 +265,8 @@ class List:
  266   265                 return True
  267   266         return False
  268   267 
  269    -1     def format_item(self, item, force_verbose=False):
  270    -1         if app.verbose or force_verbose:
  271    -1             name = os.path.relpath(item)
  272    -1         else:
  273    -1             name = os.path.basename(item)
  274    -1         return name
   -1   268     def format_item(self, item):
   -1   269         return os.path.relpath(item)
  275   270 
  276   271     def render(self):
  277   272         items = self.items[self.position:self.position + self.rows]
@@ -346,7 +341,7 @@ class Filelist(List):
  346   341         return title
  347   342 
  348   343     def format_item(self, item):
  349    -1         s = super().format_item(item, force_verbose=self.rsearch_str)
   -1   344         s = super().format_item(item)
  350   345         ext = get_ext(item)
  351   346         if not (ext in AUDIO_EXTENSIONS or ext == 'm3u'):
  352   347             s += '/'
@@ -583,7 +578,6 @@ class Playlist(List):
  583   578 class Application:
  584   579     def __init__(self):
  585   580         self.tabs = [filelist, playlist]
  586    -1         self.verbose = False
  587   581         self.help = False
  588   582         self.input = Input()
  589   583         self.old_lines = []
@@ -661,8 +655,6 @@ class Application:
  661   655             sys.exit(0)
  662   656         elif key == '\t':
  663   657             app.toggle_tabs()
  664    -1         elif key == 'l':
  665    -1             self.verbose = not self.verbose
  666   658         else:
  667   659             return False
  668   660         return True