code: def process_casefile(cls, workdir):
          '''generate code from case.json'''
          record = cls(None, workdir)
          obj = {}
          with open(os.path.join(workdir, 'frames', 'frames.json')) as f:
              obj = json.load(f)
          record.device_info = obj['device']
          record.frames = obj['frames']
  
          casedir = os.path.join(workdir, 'case')
          with open(os.path.join(casedir, 'case.json')) as f:
              record.case_draft = json.load(f)
  
          # remove old files
          for f in os.listdir(casedir):
              if f != 'case.json':
                  os.remove(os.path.join(casedir, f))
  
          record.generate_script(f process_casefile(cls, workdir):
          '''generate code from case.json'''
          record = cls(None, workdir)
          obj = {}
          with open(os.path.join(workdir, 'frames', 'frames.json')) as f:
              obj = json.load(f)
          record.device_info = obj['device']
          record.frames = obj['frames']
  
          casedir = os.path.join(workdir, 'case')
          with open(os.path.join(casedir, 'case.json')) as f:
              record.case_draft = json.load(f)
  
          # remove old files
          for f in os.listdir(casedir):
              if f != 'case.json':
                  os.remove(os.path.join(casedir, f))
  
          record.generate_script()
docs: generate code from case.json