Skip to content

Commit 04bd31a

Browse files
authored
Merge pull request #69 from ETS-Next-Gen/master
Minor change PR.
2 parents 9a69658 + 8e3efbc commit 04bd31a

File tree

2 files changed

+10
-5
lines changed

2 files changed

+10
-5
lines changed

.github/workflows/pycodestyle.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -20,4 +20,4 @@ jobs:
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')

learning_observer/learning_observer/offline.py

Lines changed: 9 additions & 4 deletions
Original file line numberDiff line numberDiff 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:

0 commit comments

Comments
 (0)