mirror of
https://github.com/SoongNoonien/mpdevil.git
synced 2023-08-10 21:12:44 +03:00
removed some simple "except:"
This commit is contained in:
14
bin/mpdevil
14
bin/mpdevil
@@ -473,11 +473,11 @@ class Format():
|
|||||||
bits="32fp"
|
bits="32fp"
|
||||||
try:
|
try:
|
||||||
int_chan=int(channels)
|
int_chan=int(channels)
|
||||||
except:
|
except ValueError:
|
||||||
int_chan=0
|
int_chan=0
|
||||||
try:
|
try:
|
||||||
freq=locale.str(int(samplerate)/1000)
|
freq=locale.str(int(samplerate)/1000)
|
||||||
except:
|
except ValueError:
|
||||||
freq=samplerate
|
freq=samplerate
|
||||||
channels=ngettext("{channels} channel", "{channels} channels", int_chan).format(channels=int_chan)
|
channels=ngettext("{channels} channel", "{channels} channels", int_chan).format(channels=int_chan)
|
||||||
return f"{freq} kHz • {bits} bit • {channels}"
|
return f"{freq} kHz • {bits} bit • {channels}"
|
||||||
@@ -595,7 +595,7 @@ class Client(MPDClient):
|
|||||||
self.connect(self._settings.get_value("hosts")[active], self._settings.get_value("ports")[active])
|
self.connect(self._settings.get_value("hosts")[active], self._settings.get_value("ports")[active])
|
||||||
if self._settings.get_value("passwords")[active]:
|
if self._settings.get_value("passwords")[active]:
|
||||||
self.password(self._settings.get_value("passwords")[active])
|
self.password(self._settings.get_value("passwords")[active])
|
||||||
except:
|
except ConnectionRefusedError:
|
||||||
self.emitter.emit("connection_error")
|
self.emitter.emit("connection_error")
|
||||||
return False
|
return False
|
||||||
# connect successful
|
# connect successful
|
||||||
@@ -643,7 +643,7 @@ class Client(MPDClient):
|
|||||||
current_song_file=self.playlistinfo()[0]["file"]
|
current_song_file=self.playlistinfo()[0]["file"]
|
||||||
try:
|
try:
|
||||||
self.delete((1,)) # delete all songs, but the first. bad song index possible
|
self.delete((1,)) # delete all songs, but the first. bad song index possible
|
||||||
except:
|
except MPDBase.CommandError:
|
||||||
pass
|
pass
|
||||||
for f in files:
|
for f in files:
|
||||||
if f == current_song_file:
|
if f == current_song_file:
|
||||||
@@ -704,7 +704,7 @@ class Client(MPDClient):
|
|||||||
current_song_file=self.currentsong()["file"]
|
current_song_file=self.currentsong()["file"]
|
||||||
try:
|
try:
|
||||||
self.delete((1,)) # delete all songs, but the first. bad song index possible
|
self.delete((1,)) # delete all songs, but the first. bad song index possible
|
||||||
except:
|
except MPDBase.CommandError:
|
||||||
pass
|
pass
|
||||||
append()
|
append()
|
||||||
duplicates=self.playlistfind("file", current_song_file)
|
duplicates=self.playlistfind("file", current_song_file)
|
||||||
@@ -1787,7 +1787,7 @@ class AlbumPopover(Gtk.Popover):
|
|||||||
# only show artists =/= albumartist
|
# only show artists =/= albumartist
|
||||||
try:
|
try:
|
||||||
song["artist"].remove(album_artist)
|
song["artist"].remove(album_artist)
|
||||||
except:
|
except ValueError:
|
||||||
pass
|
pass
|
||||||
artist=str(song["artist"])
|
artist=str(song["artist"])
|
||||||
if artist == album_artist or not artist:
|
if artist == album_artist or not artist:
|
||||||
@@ -1991,7 +1991,7 @@ class SearchWindow(Gtk.Box):
|
|||||||
return
|
return
|
||||||
try:
|
try:
|
||||||
int_track=int(song["track"][0])
|
int_track=int(song["track"][0])
|
||||||
except:
|
except ValueError:
|
||||||
int_track=0
|
int_track=0
|
||||||
self._store.insert_with_valuesv(-1, range(7), [
|
self._store.insert_with_valuesv(-1, range(7), [
|
||||||
str(song["track"]), str(song["title"]),
|
str(song["track"]), str(song["title"]),
|
||||||
|
Reference in New Issue
Block a user