mirror of
https://github.com/SoongNoonien/mpdevil.git
synced 2023-08-10 21:12:44 +03:00
removed unnecessary try, except
This commit is contained in:
parent
2b861bb6d8
commit
495634c254
@ -3124,17 +3124,14 @@ class SeekBar(Gtk.Box):
|
||||
self.enable()
|
||||
|
||||
def refresh(self, emitter, elapsed, duration):
|
||||
try:
|
||||
if elapsed > duration: # fix display error
|
||||
elapsed=duration
|
||||
fraction=(elapsed/duration)*100
|
||||
if self.update:
|
||||
self.scale.set_value(fraction)
|
||||
self.elapsed.set_text(str(datetime.timedelta(seconds=int(elapsed))).lstrip("0").lstrip(":"))
|
||||
self.rest.set_text("-"+str(datetime.timedelta(seconds=int(duration-elapsed))).lstrip("0").lstrip(":"))
|
||||
self.scale.set_fill_level(fraction)
|
||||
except:
|
||||
self.disable()
|
||||
if elapsed > duration: # fix display error
|
||||
elapsed=duration
|
||||
fraction=(elapsed/duration)*100
|
||||
if self.update:
|
||||
self.scale.set_value(fraction)
|
||||
self.elapsed.set_text(str(datetime.timedelta(seconds=int(elapsed))).lstrip("0").lstrip(":"))
|
||||
self.rest.set_text("-"+str(datetime.timedelta(seconds=int(duration-elapsed))).lstrip("0").lstrip(":"))
|
||||
self.scale.set_fill_level(fraction)
|
||||
|
||||
class PlaybackOptions(Gtk.Box):
|
||||
def __init__(self, client, settings):
|
||||
|
Loading…
Reference in New Issue
Block a user