Legacy parser
2 unresolved threads
2 unresolved threads
Merge request reports
Activity
Filter activity
126 126 values.extend([float(v.lower()) for v in fields[4:]]) 127 127 return values 128 128 129 def is_valid_line(self, line): changed this line in version 3 of the diff
- mendotabuoy/level_00/legacybase.py 0 → 100644
53 values = [convert_time(fields[3], fields[4], fields[5])] 54 values.extend([float(v) for v in fields[6:33]]) 55 values.extend([float(v) for v in fields[34:40]]) 56 try: 57 values.append(float(fields[46])) 58 except IndexError: 59 pass 60 return values 61 62 def is_valid_line(self, line): 63 return re.search(r'^1,1,1', line) 64 65 66 class Level0LegacyNarratorBase(Level0NarratorBase): 67 68 def read(self, **request): Is the only difference between
Level0LegacyNarratorBase.read
and the other NarratorBase that it uses the other data file class? Could you add a class attribute to the original base class, something like:class Level0NarratorBase(object): data_file_class = Level0DataFile ...
Then you could go a step further and remove this file all together and just have the
legacy.py
file.Yes, for the
read
method the only difference is the data file class, but there are other methods that still need to be overridden. I guess I'm confused on what you mean by removing the file entirely? Do you mean adding the code from there into the original base class, and then calling the right code depending on the data file class?changed this line in version 2 of the diff
mentioned in commit be841961
Please register or sign in to reply