Skip to content

Commit

Permalink
Fix exporting tool, when a check on version starts just after a previ…
Browse files Browse the repository at this point in the history
…ous one ends
  • Loading branch information
julienduroure committed Dec 5, 2018
1 parent b3955fe commit 7e895ee
Showing 1 changed file with 12 additions and 4 deletions.
16 changes: 12 additions & 4 deletions tools/convert_to_strict_2.80.py
Expand Up @@ -76,10 +76,18 @@
# Do not write 'else:' line
else:
# else is now finished
erase_mode = False
mode = "IF"
last_line = line
f_output.write(line + "\n")

# but we have first to check if we start a new IF
if "bpy.app.version" in line:
# get indentation of the line
nb_spaces = len(line) - len(line.lstrip(' '))
erase_mode = True
else_mode = "IF"
else:
erase_mode = False
mode = "IF"
last_line = line
f_output.write(line + "\n")

elif current_nb_spaces < nb_spaces:
if len(line) != 0:
Expand Down

0 comments on commit 7e895ee

Please sign in to comment.