app/metadata/utils.py
def convert_file_to_stream(infile):
  '''
  A function for converting trext file to string

  :param infile: An input file
  '''
  try:
    data = ''
    with open(infile,'r') as file_i:
      with io.StringIO() as file_o:
        for line in file_i:
          file_o.write(line)

        data = file_o.getvalue()
    return data
  except Exception as e:
    raise ValueError('Failedto convert file to stream, error: {0}'.format(e))

  A function for converting trext file to string

  :param infile: An input file
  
A function for converting trext file to string
A function for converting trext file to string
def convert_file_to_stream(infile):
  try:
    data = ''
    with open(infile,'r') as file_i:
      with io.StringIO() as file_o:
        for line in file_i:
          file_o.write(line)
        data = file_o.getvalue()
    return data
  except Exception as e:
    raise ValueError('Failedto convert file to stream, error: {0}'.format(e))
def convert_file_to_stream ( infile ) : try : data = '' with open ( infile , 'r' ) as file_i : with io . StringIO ( ) as file_o : for line in file_i : file_o . write ( line ) data = file_o . getvalue ( ) return data except Exception as e : raise ValueError ( 'Failedto convert file to stream, error: {0}' . format ( e ) )
A function for converting trext file to string
A function for converting trext file to string
'''
  A function for converting trext file to string

  :param infile: An input file
  '''
infile
An input file
An input file