revert removal of ternary operators from r54414
authorCampbell Barton <ideasman42@gmail.com>
Sun, 10 Feb 2013 08:26:48 +0000 (08:26 +0000)
committerCampbell Barton <ideasman42@gmail.com>
Sun, 10 Feb 2013 08:26:48 +0000 (08:26 +0000)
release/scripts/startup/bl_ui/space_clip.py
release/scripts/startup/bl_ui/space_text.py

index 303f47b..84f26ac 100644 (file)
@@ -313,11 +313,9 @@ class CLIP_PT_tools_solve(CLIP_PT_tracking_panel, Panel):
 
         col = layout.column(align=True)
 
-        # Note: avoid complex code in "text" values, they can't be handled right by i18n messages extractor script!
-        if tracking_object.is_camera:
-            col.operator("clip.solve_camera", text="Camera Motion")
-        else:
-            col.operator("clip.solve_camera", text="Object Motion")
+        col.operator("clip.solve_camera",
+                     text="Camera Motion" if tracking_object.is_camera
+                     else "Object Motion")
         col.operator("clip.clear_solution")
 
         col = layout.column()
@@ -911,7 +909,9 @@ class CLIP_MT_view(Menu):
 
             text = bpy.app.translations.pgettext("Zoom %d:%d")
             for a, b in ratios:
-                layout.operator("clip.view_zoom_ratio", text=text % (a, b), translate=False).ratio = a / b
+                layout.operator("clip.view_zoom_ratio",
+                                text=text % (a, b),
+                                translate=False).ratio = a / b
         else:
             if sc.view == 'GRAPH':
                 layout.operator_context = 'INVOKE_REGION_PREVIEW'
index d976475..b32172e 100644 (file)
@@ -73,13 +73,15 @@ class TEXT_HT_header(Header):
             if text.filepath:
                 pgettext = bpy.app.translations.pgettext
                 if text.is_dirty:
-                    row.label(text=pgettext("File: *%r (unsaved)") % text.filepath, translate=False)
+                    row.label(text=pgettext("File: *%r (unsaved)") %
+                              text.filepath, translate=False)
                 else:
-                    row.label(text=pgettext("File: %r") % text.filepath, translate=False)
-            elif text.library:
-                row.label(text="Text: External")
+                    row.label(text=pgettext("File: %r") %
+                              text.filepath, translate=False)
             else:
-                row.label(text="Text: Internal")
+                row.label(text="Text: External"
+                          if text.library
+                          else "Text: Internal")
 
 
 class TEXT_PT_properties(Panel):