Code cleanup: style

This commit is contained in:
2014-02-13 08:51:33 +11:00
parent 8547d17739
commit aea00c7a81
21 changed files with 105 additions and 80 deletions

View File

@@ -22,7 +22,7 @@
This module has utility functions for renaming
rna values in fcurves and drivers.
Currently unused, but might become useful later again.
Currently unused, but might become useful later again.
"""
IS_TESTING = False

View File

@@ -1285,7 +1285,6 @@ class I18n:
return path, env[tuple_id]
return None, None # No data...
def parse(self, kind, src, langs=set()):
self.parsers[kind](self, src, langs)
@@ -1372,6 +1371,7 @@ class I18n:
({} currently).
""".format(self.settings.PARSER_TEMPLATE_ID)
default_context = self.settings.DEFAULT_CONTEXT
def _gen_py(self, langs, tab=" "):
_lencomm = len(self.settings.PO_COMMENT_PREFIX)
_lengen = len(self.settings.PO_COMMENT_PREFIX_GENERATED)
@@ -1451,7 +1451,7 @@ class I18n:
ret.append(tab + lngsp + ' "' + comments[-1] + '"))),')
else:
ret[-1] = ret[-1] + " (" + (('"' + comments[0] + '",') if comments else "") + "))),"
ret.append(tab + "),")
ret += [
")",

View File

@@ -118,7 +118,7 @@ def protect_format_seq(msg):
dlt = 2
while (idx + dlt) < ln and msg[idx + dlt] in digits:
dlt += 1
if (idx + dlt) < ln and msg[idx + dlt] is '|':
if (idx + dlt) < ln and msg[idx + dlt] is '|':
dlt += 1
# %.4f
elif idx < (ln - 3) and msg[idx] == '%' and msg[idx + 1] in digits:

View File

@@ -409,7 +409,9 @@ def path_reference(filepath,
if mode == 'ABSOLUTE':
return filepath_abs
elif mode == 'RELATIVE':
try: # can't always find the relative path (between drive letters on windows)
# can't always find the relative path
# (between drive letters on windows)
try:
return os.path.relpath(filepath_abs, base_dst)
except ValueError:
return filepath_abs

View File

@@ -232,7 +232,8 @@ def object_add_grid_scale_apply_operator(operator, context):
if not properties.is_property_set(prop_id):
prop_def = properties_def[prop_id]
if prop_def.unit == 'LENGTH' and prop_def.subtype == 'DISTANCE':
setattr(operator, prop_id, getattr(operator, prop_id) * grid_scale)
setattr(operator, prop_id,
getattr(operator, prop_id) * grid_scale)
def object_image_guess(obj, bm=None):

View File

@@ -133,7 +133,7 @@ def write_sysinfo(op):
oiio = bpy.app.oiio
output.write("OpenImageIO: ")
if ocio.supported :
if ocio.supported:
output.write("%s\n" % (oiio.version_string))
else:
output.write("Blender was built without OpenImageIO support\n")