Now the 'replace-marker' is removed when the fix ignored.

Gra [2009-06-04 18:27]
Now the 'replace-marker' is removed when the fix ignored.
Filename
pl.py
diff --git a/pl.py b/pl.py
index 3bb4a0e..2c5e7db 100755
--- a/pl.py
+++ b/pl.py
@@ -274,23 +274,23 @@ def playlist_is_ok(playlist, options):
                                 message = 'Which one to use? [%s or nothing to ignore] '
                                 seq = ','.join([str(num + 1) for num in range(nbr_suggs)])
                                 replace = raw_input(message % seq)
+                            number = -1
                             if replace.strip():
                                 try:
                                     number = int(replace) - 1
-                                except:
-                                    number = -1
-                                else:
-                                    if 0 <= number < nbr_suggs:
-                                        new_playlist = replace_in_pl(
-                                                  pl=new_playlist,
-                                                  entry=missing_item[len(options.target):],
-                                                  new=suggs[number][len(options.target):])
-                                    else:
-                                        # removes the marker
-                                        new_playlist = replace_in_pl(
-                                                  pl=new_playlist,
-                                                  entry=missing_item[len(options.target):],
-                                                  new=missing_item[len(options.target):])
+                                except ValueError:
+                                    pass
+                            if 0 <= number < nbr_suggs:
+                                new_playlist = replace_in_pl(
+                                          pl=new_playlist,
+                                          entry=missing_item[len(options.target):],
+                                          new=suggs[number][len(options.target):])
+                            else:
+                                # removes the marker
+                                new_playlist = replace_in_pl(
+                                          pl=new_playlist,
+                                          entry=missing_item[len(options.target):],
+                                          new=missing_item[len(options.target):])
                 else:
                     # new line if no suggestions needed
                     print
ViewGit