String fix and a bunch of PEP8 issues I had collected in the meanwhile.

This commit is contained in:
Guillermo S. Romero
2009-12-04 17:54:48 +00:00
parent 19c0a169b8
commit 648122b1a2
14 changed files with 108 additions and 102 deletions

View File

@@ -20,6 +20,7 @@
import bpy
def rna_idprop_ui_get(item, create=True):
try:
return item['_RNA_UI']
@@ -57,7 +58,7 @@ def rna_idprop_ui_prop_clear(item, prop):
pass
def draw(layout, context, context_member, use_edit = True):
def draw(layout, context, context_member, use_edit=True):
def assign_props(prop, val, key):
prop.path = context_member
@@ -69,7 +70,7 @@ def draw(layout, context, context_member, use_edit = True):
pass
rna_item = eval("context." + context_member)
# poll should really get this...
if not rna_item:
return
@@ -138,6 +139,7 @@ rna_property = StringProperty(name="Property Name",
rna_min = FloatProperty(name="Min", default=0.0, precision=3)
rna_max = FloatProperty(name="Max", default=1.0, precision=3)
class WM_OT_properties_edit(bpy.types.Operator):
'''Internal use (edit a property path)'''
bl_idname = "wm.properties_edit"
@@ -206,15 +208,15 @@ class WM_OT_properties_edit(bpy.types.Operator):
prop_ui = rna_idprop_ui_prop_get(item, self.properties.property, False) # dont create
if prop_ui:
self.properties.min = prop_ui.get("min", -1000000000)
self.properties.max = prop_ui.get("max", 1000000000)
self.properties.description = prop_ui.get("description", "")
self.properties.max = prop_ui.get("max", 1000000000)
self.properties.description = prop_ui.get("description", "")
if 0:
_message= "PyConsole, press Ctrl+D to unlock the BGE"
_message = "PyConsole, press Ctrl+D to unlock the BGE"
import sys
# evaluate commands in current namespace
frame= sys._getframe()
frame = sys._getframe()
namespace = frame.f_globals.copy()
namespace.update(frame.f_locals)
@@ -252,7 +254,7 @@ class WM_OT_properties_add(bpy.types.Operator):
i = 1
while prop_new in names:
prop_new = prop + str(i)
i+=1
i += 1
return prop_new
@@ -261,6 +263,7 @@ class WM_OT_properties_add(bpy.types.Operator):
item[property] = 1.0
return ('FINISHED',)
class WM_OT_properties_remove(bpy.types.Operator):
'''Internal use (edit a property path)'''
bl_idname = "wm.properties_remove"
@@ -273,4 +276,3 @@ class WM_OT_properties_remove(bpy.types.Operator):
item = eval("context.%s" % self.properties.path)
del item[self.properties.property]
return ('FINISHED',)