def read_lockfile(lockfilename):
 lockfiledict = {}
 with get_readable_fileobj(lockfilename) as f:
  for line in f:
   if (not line.startswith(u'#')):
    (kw, val) = line.split(u'=')
    lockfiledict[kw.strip()] = val.strip()
 return lockfiledict

def read_lockfile ( lockfilename ) : lockfiledict = { } with get_readable_fileobj ( lockfilename ) as f : for line in f : if ( not line . startswith ( u'#' ) ) : ( kw , val ) = line . split ( u'=' ) lockfiledict [ kw . strip ( ) ] = val . strip ( ) return lockfiledict
read in the lockfile given by lockfilename into a dictionary .