def get_attrib_file(path, size):
 attribs = []
 path = os.path.join(path, ATTRIB_FILE)
 try:
  f = open(path, 'r')
 except:
  return [None for unused in xrange(size)]
 for unused in xrange(size):
  line = f.readline().strip('\r\n ')
  if line:
   if (line.lower() == 'none'):
    line = None
   try:
    line = int(line)
   except:
    pass
   attribs.append(line)
  else:
   attribs.append(None)
 f.close()
 return attribs

def get_attrib_file ( path , size ) : attribs = [ ] path = os . path . join ( path , ATTRIB_FILE ) try : f = open ( path , 'r' ) except : return [ None for unused in xrange ( size ) ] for unused in xrange ( size ) : line = f . readline ( ) . strip ( '\r\n ' ) if line : if ( line . lower ( ) == 'none' ) : line = None try : line = int ( line ) except : pass attribs . append ( line ) else : attribs . append ( None ) f . close ( ) return attribs
read jobs attributes from file .