Welcome to mirror list, hosted at ThFree Co, Russian Federation.

git.blender.org/blender.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorCampbell Barton <ideasman42@gmail.com>2010-08-09 11:05:37 +0400
committerCampbell Barton <ideasman42@gmail.com>2010-08-09 11:05:37 +0400
commit66cbb0d97327e50fcc794e8e98d68ec393709f8c (patch)
tree61954acd984e28f11bf88dc2023bb94f50c71881 /source/blender/makesrna/rna_cleanup
parent8d517cff3395102367a75a854e3568a1786542c6 (diff)
restrict prefix checking to booleans for now
Diffstat (limited to 'source/blender/makesrna/rna_cleanup')
-rwxr-xr-xsource/blender/makesrna/rna_cleanup/rna_cleaner.py27
1 files changed, 15 insertions, 12 deletions
diff --git a/source/blender/makesrna/rna_cleanup/rna_cleaner.py b/source/blender/makesrna/rna_cleanup/rna_cleaner.py
index a2909923388..f623b1c673d 100755
--- a/source/blender/makesrna/rna_cleanup/rna_cleaner.py
+++ b/source/blender/makesrna/rna_cleanup/rna_cleaner.py
@@ -76,18 +76,21 @@ def check_commandline():
return (inputfile, sort_priority)
-def check_prefix(prop):
+def check_prefix(prop, btype):
# reminder: props=[comment, changed, bclass, bfrom, bto, kwcheck, btype, description]
- if '_' in prop:
- prefix = prop.split('_')[0]
- if prefix not in kw_prefixes:
- return 'BAD-PREFIX: ' + prefix
+ if btype == "boolean":
+ if '_' in prop:
+ prefix = prop.split('_')[0]
+ if prefix not in kw_prefixes:
+ return 'BAD-PREFIX: ' + prefix
+ else:
+ return prefix + '_'
+ elif prop in kw:
+ return 'SPECIAL-KEYWORD: ' + prop
else:
- return prefix + '_'
- elif prop in kw:
- return 'SPECIAL-KEYWORD: ' + prop
+ return 'BAD-KEYWORD: ' + prop
else:
- return 'BAD-KEYWORD: ' + prop
+ return ""
def check_if_changed(a,b):
@@ -144,7 +147,7 @@ def get_props_from_txt(input_filename):
[btype, description] = [tail,'NO DESCRIPTION']
# keyword-check
- kwcheck = check_prefix(bto)
+ kwcheck = check_prefix(bto, btype)
# changed
changed = check_if_changed(bfrom, bto)
@@ -168,7 +171,7 @@ def get_props_from_py(input_filename):
props_length_max = [0 for i in rna_api[0]] # this way if the vector will take more elements we are safe
for index,props in enumerate(rna_api):
comment, changed, bclass, bfrom, bto, kwcheck, btype, description = props
- kwcheck = check_prefix(bto) # keyword-check
+ kwcheck = check_prefix(bto, btype) # keyword-check
changed = check_if_changed(bfrom, bto) # changed?
description = repr(description)
rna_api[index] = [comment, changed, bclass, bfrom, bto, kwcheck, btype, description]
@@ -275,7 +278,7 @@ def main():
sort_choices = ['note','changed','class','from','to','kw', 'class.from']
default_sort_choice = sort_choices[-1]
kw_prefixes = [ 'active','apply','bl','exclude','has','invert','is','lock', \
- 'pressed','show','show_only','use','use_only','layers','states']
+ 'pressed','show','show_only','use','use_only','layers','states', 'select']
kw = ['active','hide','invert','select','layers','mute','states','use','lock']
input_filename, sort_priority = check_commandline()