misc uninteresting stuff (killing time at airport commit)
authorCampbell Barton <ideasman42@gmail.com>
Mon, 3 May 2010 16:00:42 +0000 (16:00 +0000)
committerCampbell Barton <ideasman42@gmail.com>
Mon, 3 May 2010 16:00:42 +0000 (16:00 +0000)
- pep8 updates
- RNA_TwoDFilterActuator --> RNA_Filter2DActuator
- minor changes to conolse namespace init.

13 files changed:
release/scripts/op/console_python.py
release/scripts/op/image.py
release/scripts/op/vertexpaint_dirt.py
release/scripts/ui/properties_data_mesh.py
release/scripts/ui/properties_particle.py
release/scripts/ui/properties_physics_common.py
release/scripts/ui/properties_render.py
release/scripts/ui/properties_texture.py
release/scripts/ui/space_image.py
release/scripts/ui/space_outliner.py
release/scripts/ui/space_sequencer.py
release/scripts/ui/space_userpref_keymap.py
source/blender/makesrna/intern/rna_actuator.c

index 99654505c172207025cca2bd0fa78165642c561a..87abe0b6f4762e609866561969c7b94a8f46c497 100644 (file)
@@ -40,9 +40,9 @@ def get_console(console_id):
     '''
     from code import InteractiveConsole
 
-    try:
-        consoles = get_console.consoles
-    except:
+    consoles = getattr(get_console, "consoles", None)
+
+    if consoles is None:
         consoles = get_console.consoles = {}
 
     # clear all dead consoles, use text names as IDs
@@ -53,16 +53,17 @@ def get_console(console_id):
             del consoles[id]
     '''
 
-    try:
-        console, stdout, stderr = consoles[console_id]
-        
+    console_data = consoles.get(console_id)
+
+    if console_data:
+        console, stdout, stderr = console_data
+
         # XXX, bug in python 3.1.2 ?
         # seems there is no way to clear StringIO objects for writing, have to make new ones each time.
         import io
         stdout = io.StringIO()
         stderr = io.StringIO()
-        
-    except:
+    else:
         namespace = {'__builtins__': __builtins__, 'bpy': bpy}
         console = InteractiveConsole(namespace)
 
index 45ccda1396b5a2938b60e825a412c87aaef118d2..9907362502e29cca03058e8b3082c6658fa9ab82 100644 (file)
@@ -28,7 +28,7 @@ class EditExternally(bpy.types.Operator):
     bl_label = "Image Edit Externally"
     bl_options = {'REGISTER'}
 
-    path = StringProperty(name="File Path", description="Path to an image file", maxlen= 1024, default= "")
+    path = StringProperty(name="File Path", description="Path to an image file", maxlen=1024, default="")
 
     def _editor_guess(self, context):
         import platform
index c7b7ee71964d66dc8126ac963288a8406d247287..c1521866a56a52597a84bf017ea9a6c063a239be 100644 (file)
@@ -69,10 +69,10 @@ def applyVertexDirt(me, blur_iterations, blur_strength, clamp_dirt, clamp_clean,
 
         # normalize the vector by dividing by the number of connected verts
         tot_con = len(con[i])
-        
+
         if tot_con == 0:
             continue
-        
+
         vec /= tot_con
 
         # angle is the acos of the dot product between vert and connected verts normals
index a33b4f2236814c193ae5b4801b9800f153b876ab..780a743f15a4ab3bd13f17bd4dff5e14909c6f19 100644 (file)
@@ -303,7 +303,7 @@ class DATA_PT_texface(DataButtonsPanel):
         ob = context.active_object
         rd = context.scene.render
 
-        return (context.mode =='EDIT_MESH') and (rd.engine == 'BLENDER_GAME') and ob and ob.type == 'MESH'
+        return (context.mode == 'EDIT_MESH') and (rd.engine == 'BLENDER_GAME') and ob and ob.type == 'MESH'
 
     def draw(self, context):
         layout = self.layout
index 84b756e62570ca39096e926ce59f4e9bf78defdf..6ec396bf7a1616aaa68d35f7db0fe189aa622db9 100644 (file)
@@ -389,7 +389,7 @@ class PARTICLE_PT_physics(ParticleButtonsPanel):
             row.prop(part, "physics_type", expand=True)
         else:
             row.prop(part, "physics_type", text="")
-            
+
         if part.physics_type != 'NO':
             row = layout.row()
             col = row.column(align=True)
index 080d576ab9a307de17b361c2b1fb43fde76d646a..20073c689892c575b5e6411b9043b262abe97ab9 100644 (file)
@@ -49,12 +49,11 @@ def point_cache_ui(self, context, cache, enabled, particles, smoke):
         layout.label(text=cache.info)
     else:
         layout.prop(cache, "name", text="File Name")
-        
+
         split = layout.split()
         col = split.column(align=True)
-        
+
         if not particles:
-            
             col.enabled = enabled
             col.prop(cache, "frame_start")
             col.prop(cache, "frame_end")
@@ -74,19 +73,18 @@ def point_cache_ui(self, context, cache, enabled, particles, smoke):
             sub.prop(cache, "disk_cache")
             col.label(text=cache.info)
 
-        
 
         layout.separator()
-        
+
         split = layout.split()
-        
+
         col = split.column()
-        
+
         if cache.baked == True:
             col.operator("ptcache.free_bake", text="Free Bake")
         else:
             col.operator("ptcache.bake", text="Bake").bake = True
-        
+
         sub = col.row()
         sub.enabled = (cache.frames_skipped or cache.outdated) and enabled
         sub.operator("ptcache.bake", text="Calculate To Frame").bake = False
@@ -94,8 +92,8 @@ def point_cache_ui(self, context, cache, enabled, particles, smoke):
         sub = col.column()
         sub.enabled = enabled
         sub.operator("ptcache.bake_from_cache", text="Current Cache to Bake")
-        
-        
+
+
         if wide_ui:
             col = split.column()
         col.operator("ptcache.bake_all", text="Bake All Dynamics").bake = True
index b6137e271b999f5b1ff7ebfc65cba3074402ed94..f95228567f1c64f738ea23ea46bae0612fbd682f 100644 (file)
@@ -106,7 +106,6 @@ class RENDER_PT_layers(RenderButtonsPanel):
         col.label(text="Mask Layers:")
         col.prop(rl, "zmask_layers", text="")
 
-        
 
         layout.separator()
         layout.label(text="Include:")
index d537b5c29c212e7447a392b6cb07d79f1ec7bb1d..07a097cfd3a404b1672ae4e9b373118ac64f58b7 100644 (file)
@@ -47,6 +47,7 @@ class TEXTURE_MT_envmap_specials(bpy.types.Menu):
 
 from properties_material import active_node_mat
 
+
 def context_tex_datablock(context):
     idblock = context.material
     if idblock:
@@ -71,7 +72,8 @@ class TextureButtonsPanel(bpy.types.Panel):
 
     def poll(self, context):
         tex = context.texture
-        if not tex or tex == None: return False
+        if not tex:
+            return False
         engine = context.scene.render.engine
         return (tex.type != 'NONE' or tex.use_nodes) and (engine in self.COMPAT_ENGINES)
 
@@ -102,7 +104,7 @@ class TEXTURE_PT_context_texture(TextureButtonsPanel):
         engine = context.scene.render.engine
         if not hasattr(context, "texture_slot"):
             return False
-        return ((context.material or context.world or context.lamp or context.brush or context.texture) 
+        return ((context.material or context.world or context.lamp or context.brush or context.texture)
             and (engine in self.COMPAT_ENGINES))
 
     def draw(self, context):
@@ -212,7 +214,7 @@ class TextureSlotPanel(TextureButtonsPanel):
     def poll(self, context):
         if not hasattr(context, "texture_slot"):
             return False
-        
+
         engine = context.scene.render.engine
         return TextureButtonsPanel.poll(self, context) and (engine in self.COMPAT_ENGINES)
 
@@ -228,7 +230,7 @@ class TEXTURE_PT_mapping(TextureSlotPanel):
 
         if not getattr(context, "texture_slot", None):
             return False
-        
+
         engine = context.scene.render.engine
         return (engine in self.COMPAT_ENGINES)
 
@@ -277,7 +279,7 @@ class TEXTURE_PT_mapping(TextureSlotPanel):
                 row = layout.row()
                 row.active = tex.map_mode in ('FIXED', 'TILED')
                 row.prop(tex, "angle")
-    
+
                 row = layout.row()
                 row.active = tex.map_mode in ('TILED', '3D')
                 row.column().prop(tex, "size")
index 7f595207f53f6c854fd423eb037023cf9707e975..dd07f7b66f8563e507cb0223fda2df3299d3796f 100644 (file)
@@ -471,7 +471,7 @@ class IMAGE_PT_scope_sample(bpy.types.Panel):
 
     def poll(self, context):
         sima = context.space_data
-        return sima 
+        return sima
 
     def draw(self, context):
         layout = self.layout
index a0f8f41f58a4ba63b412dc5a4a264ec4acc1164b..ec3c430feaa655d803c8f9065cfe106f94d1c463 100644 (file)
@@ -85,6 +85,7 @@ class OUTLINER_MT_view(bpy.types.Menu):
         layout.operator("screen.area_dupli")
         layout.operator("screen.screen_full_area")
 
+
 class OUTLINER_MT_search(bpy.types.Menu):
     bl_label = "Search"
 
@@ -98,6 +99,7 @@ class OUTLINER_MT_search(bpy.types.Menu):
         col.prop(space, "match_case_sensitive")
         col.prop(space, "match_complete")
 
+
 class OUTLINER_MT_edit_datablocks(bpy.types.Menu):
     bl_label = "Edit"
 
@@ -118,7 +120,7 @@ class OUTLINER_MT_edit_datablocks(bpy.types.Menu):
 classes = [
     OUTLINER_HT_header,
     OUTLINER_MT_view,
-       OUTLINER_MT_search,
+    OUTLINER_MT_search,
     OUTLINER_MT_edit_datablocks]
 
 
index d928f40250e709e8c9c1baec41180f38d3e9a107..fad8307c401b9bd906bbf130774b7dc8e6f0f684 100644 (file)
@@ -446,7 +446,7 @@ class SEQUENCER_PT_effect(SequencerButtonsPanel):
 
         elif strip.type == 'TRANSFORM':
             self.draw_panel_transform(strip)
-            
+
         elif strip.type == "MULTICAM":
             layout.prop(strip, "multicam_source")
 
@@ -518,7 +518,7 @@ class SEQUENCER_PT_input(SequencerButtonsPanel):
                               'CROSS', 'GAMMA_CROSS', 'MULTIPLY', 'OVER_DROP',
                               'PLUGIN',
                               'WIPE', 'GLOW', 'TRANSFORM', 'COLOR',
-                              'MULTICAM','SPEED')
+                              'MULTICAM', 'SPEED')
 
     def draw_filename(self, context):
         pass
@@ -611,6 +611,7 @@ class SEQUENCER_PT_input_image(SEQUENCER_PT_input):
             col = split.column()
             col.prop(elem, "filename", text="") # strip.elements[0] could be a fallback
 
+
 class SEQUENCER_PT_input_secondary(SEQUENCER_PT_input):
     bl_label = "Strip Input"
 
@@ -627,6 +628,7 @@ class SEQUENCER_PT_input_secondary(SEQUENCER_PT_input):
     def draw_filename(self, context):
         pass
 
+
 class SEQUENCER_PT_sound(SequencerButtonsPanel):
     bl_label = "Sound"
 
index 4f440729e9d0a424e8392718a2046b510e350590..961b138ab7e176ef3663fba4b8988af457ac885e 100644 (file)
@@ -92,7 +92,7 @@ KM_HIERARCHY = [
         ]),
 
     ('Property Editor', 'PROPERTIES', 'WINDOW', []), # align context menu
-    
+
     ('Script', 'SCRIPTS_WINDOW', 'WINDOW', []),
     ('Text', 'TEXT_EDITOR', 'WINDOW', []),
     ('Console', 'CONSOLE', 'WINDOW', []),
@@ -107,19 +107,22 @@ KM_HIERARCHY = [
     ('View3D Zoom Modal', 'EMPTY', 'WINDOW', []),
     ]
 
+
 def _km_exists_in(km, export_keymaps):
     for km2, kc in export_keymaps:
         if km2.name == km.name:
             return True
     return False
 
-# kc1 takes priority over kc2
+
 def _merge_keymaps(kc1, kc2):
+    """ note: kc1 takes priority over kc2
+    """
     merged_keymaps = [(km, kc1) for km in kc1.keymaps]
     if kc1 != kc2:
         merged_keymaps.extend([(km, kc2) for km in kc2.keymaps if not _km_exists_in(km, merged_keymaps)])
-            
-    return merged_keymaps  
+
+    return merged_keymaps
 
 
 class InputKeyMapPanel(bpy.types.Panel):
index 23698e8140f4535c014e7fe6d01957c5fde53f25..88bd88ec746b2a751ec7ecc80ca5e338b39e297c 100644 (file)
@@ -65,7 +65,7 @@ static StructRNA* rna_Actuator_refine(struct PointerRNA *ptr)
                case ACT_VISIBILITY:
                        return &RNA_VisibilityActuator;
                case ACT_2DFILTER:
-                       return &RNA_TwoDFilterActuator;
+                       return &RNA_Filter2DActuator;
                case ACT_PARENT:
                        return &RNA_ParentActuator;
                case ACT_SHAPEACTION:
@@ -969,7 +969,7 @@ static void rna_def_twodfilter_actuator(BlenderRNA *brna)
 //             {ACT_2DFILTER_NUMBER_OF_FILTERS, "", 0, "Do not use it. Sentinel", ""},
                {0, NULL, 0, NULL, NULL}};
 
-       srna= RNA_def_struct(brna, "TwoDFilterActuator", "Actuator");
+       srna= RNA_def_struct(brna, "Filter2DActuator", "Actuator");
        RNA_def_struct_ui_text(srna, "2D Filter Actuator", "Actuator to ..");
        RNA_def_struct_sdna_from(srna, "bTwoDFilterActuator", "data");