diff --git a/06.py b/06.py index 752f9cb..082136d 100644 --- a/06.py +++ b/06.py @@ -2,15 +2,13 @@ # _*_ coding:utf-8 _* # http://www.pythonchallenge.com/pc/def/channel.html - import signal -from zipfile import ZipFile +from zipfile import ZipFile from handlers.python import exit_signal_handler - def get_next_file(i, zf, file_name, result): - isLast = True + is_last = True try: file_words = zf.read(file_name).split() @@ -21,11 +19,11 @@ def get_next_file(i, zf, file_name, result): for word in file_words: if word.isdigit(): - isLast = False + is_last = False next_file = '{0}.txt'.format(word) get_next_file(i+1, zf, next_file, result) - if isLast: + if is_last: print result except Exception as e: diff --git a/handlers/python.py b/handlers/python.py index c4c6e75..2fb702b 100644 --- a/handlers/python.py +++ b/handlers/python.py @@ -1,23 +1,6 @@ -#!/usr/bin/env python +#!/usr/bin/env python2 # _*_ coding:utf-8 _* -""" -@author: Rubén Hortas Astariz -@contact: rubenhortas at gmail.com -@github: http://github.com/rubenhortas -@license: CC BY-NC-SA 3.0 -@file: python -""" - - # noinspection PyUnusedLocal def exit_signal_handler(signal, frame): - """" - exit_signal_handler(signal, frame) - Handles an exit signal. - Arguments: - signal: (int) number of signal. - frame: (string) name of the signal handler. - """ - exit(0) diff --git a/handlers/url.py b/handlers/url.py index 439e1bb..87d0363 100644 --- a/handlers/url.py +++ b/handlers/url.py @@ -1,15 +1,6 @@ #!/usr/bin/env python # _*_ coding:utf-8 _* -""" -@author: Rubén Hortas Astariz -@contact: rubenhortas at gmail.com -@github: http://github.com/rubenhortas -@license: CC BY-NC-SA 3.0 -@file: url -""" - - def print_html(html): print 50 * '-' print html