def _copy_lines_to_journal(in_, fields={}, n=None, skip=0, terminal_line=''):
 if isinstance(in_, str):
  fin = open(in_, 'r')
 else:
  fin = in_
 fields.update(TEST_JOURNAL_FIELDS)
 for i in xrange(skip):
  fin.readline()
 i = 0
 while ((n is None) or (i < n)):
  l = fin.readline()
  if ((terminal_line is not None) and (l == terminal_line)):
   break
  journal.send(MESSAGE=l.strip(), **fields)
  i += 1
 if isinstance(in_, str):
  fin.close()

def _copy_lines_to_journal ( in_ , fields = { } , n = None , skip = 0 , terminal_line = '' ) : if isinstance ( in_ , str ) : fin = open ( in_ , 'r' ) else : fin = in_ fields . update ( TEST_JOURNAL_FIELDS ) for i in xrange ( skip ) : fin . readline ( ) i = 0 while ( ( n is None ) or ( i < n ) ) : l = fin . readline ( ) if ( ( terminal_line is not None ) and ( l == terminal_line ) ) : break journal . send ( MESSAGE = l . strip ( ) , ** fields ) i += 1 if isinstance ( in_ , str ) : fin . close ( )
copy lines from one file to systemd journal returns none .