File tree Expand file tree Collapse file tree 2 files changed +10
-5
lines changed
learning_observer/learning_observer Expand file tree Collapse file tree 2 files changed +10
-5
lines changed Original file line number Diff line number Diff line change 2020 pip install pycodestyle
2121 - name : Analysing the code with pycodestyle
2222 run : |
23- pycodestyle --ignore=E501,W503,E731 $(git ls-files 'learning_observer/*.py' 'modules/*.py')
23+ pycodestyle --ignore=E501,W503 $(git ls-files 'learning_observer/*.py' 'modules/*.py')
Original file line number Diff line number Diff line change @@ -101,16 +101,21 @@ async def process_file(
101101
102102 # Opener returns an iterator of events. It handles diverse sources:
103103 # lists, log files, and compressed log files
104- opener = lambda : events_list
104+ def opener ():
105+ return events_list
105106
106107 if file_path is not None :
107108 if file_path .endswith ('.log' ):
108- file_opener = lambda : open (file_path )
109+ def file_opener ():
110+ return open (file_path )
109111 elif file_path .endswith ('.log.gz' ):
110- file_opener = lambda : gzip .open (file_path )
112+ def file_opener ():
113+ return gzip .open (file_path )
111114 else :
112115 raise ValueError ("Unknown file type: " + file_path )
113- opener = lambda : (json .loads (line ) for line in file_opener ().readlines ())
116+
117+ def opener ():
118+ return (json .loads (line ) for line in file_opener ().readlines ())
114119
115120 if source is None :
116121 for event in opener :
You can’t perform that action at this time.
0 commit comments