Browse Source

Produce better output with no capabilities

Instead of making a little empty dialog, now we make a dialog that says
a helpful message.
Clara Hobbs 7 years ago
parent
commit
55b5a5067e
1 changed files with 6 additions and 2 deletions
  1. 6
    2
      pd-buddy-gtk.py

+ 6
- 2
pd-buddy-gtk.py View File

338
             caps = pdbs.get_source_cap()
338
             caps = pdbs.get_source_cap()
339
             s = ""
339
             s = ""
340
             for i, cap in enumerate(caps):
340
             for i, cap in enumerate(caps):
341
-                s += "PDO {}: {}\n".format(i+1, cap)
341
+                s += "PDO {}: {}".format(i+1, cap)
342
+                if i < len(caps) - 1:
343
+                    s += "\n"
344
+            if not s:
345
+                s = "No Source_Capabilities"
342
             flags = Gtk.DialogFlags.DESTROY_WITH_PARENT;
346
             flags = Gtk.DialogFlags.DESTROY_WITH_PARENT;
343
             window = self.builder.get_object("pdb-window")
347
             window = self.builder.get_object("pdb-window")
344
             dialog = Gtk.MessageDialog(window,
348
             dialog = Gtk.MessageDialog(window,
346
                              Gtk.MessageType.INFO,
350
                              Gtk.MessageType.INFO,
347
                              Gtk.ButtonsType.CLOSE,
351
                              Gtk.ButtonsType.CLOSE,
348
                              None)
352
                              None)
349
-            dialog.set_markup("<span font_family='monospace'>{}</span>".format(s[:-1]))
353
+            dialog.set_markup("<span font_family='monospace'>{}</span>".format(s))
350
             dialog.run()
354
             dialog.run()
351
             dialog.destroy()
355
             dialog.destroy()
352
 
356
 

Loading…
Cancel
Save