Skip to content
Snippets Groups Projects

Legacy parser

Merged Katherine Kolman requested to merge legacy-parser into master
2 unresolved threads

Merge request reports

Loading
Loading

Activity

Filter activity
  • Approvals
  • Assignees & reviewers
  • Comments (from bots)
  • Comments (from users)
  • Commits & branches
  • Edits
  • Labels
  • Lock status
  • Mentions
  • Merge request status
  • Tracking
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):
  • 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

    • Please register or sign in to reply
  • added 1 commit

    • 3406dc18 - Merged legacybase and legacy

    Compare with previous version

  • added 1 commit

    Compare with previous version

  • added 1 commit

    Compare with previous version

  • added 1 commit

    Compare with previous version

  • merged

  • David Hoese mentioned in commit be841961

    mentioned in commit be841961

  • Please register or sign in to reply
    Loading