Skip to content

Commit

Permalink
[FIX] update __init__ function
Browse files Browse the repository at this point in the history
  • Loading branch information
Endika committed Sep 2, 2017
1 parent 0b4d574 commit 31654f5
Showing 1 changed file with 13 additions and 7 deletions.
20 changes: 13 additions & 7 deletions dlen/dlen.py
Original file line number Diff line number Diff line change
Expand Up @@ -146,13 +146,12 @@ def process_line(self, line):
self.check_function(current_tab)
self.check_class(current_tab)

def __init__(self, files_content=None):
"""Init."""
if files_content:
for file_txt in files_content:
for line in file_txt.split('\n'):
self.process_line(line)
return
def _run_import_mode(self, files_content):
for file_txt in files_content:
for line in file_txt.split('\n'):
self.process_line(line)

def _run_cli_mode(self, files_content):
self.show_console = True
data = self.create_parser()
for file in self.iter_source_code(data['files']):
Expand All @@ -161,6 +160,13 @@ def __init__(self, files_content=None):
for line_number, line in enumerate(f, 1):
self.process_line(line)

def __init__(self, files_content=None):
"""Init."""
if files_content:
self._run_import_mode(files_content)
else:
self._run_cli_mode(files_content)


def main():
"""Run in command line."""
Expand Down

0 comments on commit 31654f5

Please sign in to comment.