353 # delete empty lines at end |
353 # delete empty lines at end |
354 while not sourceImpl[-1].strip(): |
354 while not sourceImpl[-1].strip(): |
355 del sourceImpl[-1] |
355 del sourceImpl[-1] |
356 else: |
356 else: |
357 appendAtIndex = cls.endlineno - 1 |
357 appendAtIndex = cls.endlineno - 1 |
|
358 while not sourceImpl[appendAtIndex].strip(): |
|
359 appendAtIndex -= 1 |
|
360 appendAtIndex += 1 |
358 |
361 |
359 # determine indent string |
362 # determine indent string |
360 for line in sourceImpl[cls.lineno:cls.endlineno + 1]: |
363 for line in sourceImpl[cls.lineno:cls.endlineno + 1]: |
361 if line.lstrip().startswith("def __init__"): |
364 if line.lstrip().startswith("def __init__"): |
362 indentStr = line.replace(line.lstrip(), "") |
365 indentStr = line.replace(line.lstrip(), "") |