@synchronized(IO_LOCK)
def load_admin(_id, remove=False, do_pickle=True, silent=False):
 path = os.path.join(cfg.admin_dir.get_path(), _id)
 logging.info('Loading data for %s from %s', _id, path)
 if (not os.path.exists(path)):
  logging.info('%s missing', path)
  return None
 try:
  f = open(path, 'rb')
  if do_pickle:
   data = cPickle.load(f)
  else:
   data = f.read()
  f.close()
  if remove:
   os.remove(path)
 except:
  if (not silent):
   excepterror = str(sys.exc_info()[0])
   logging.error(T('Loading %s failed with error %s'), path, excepterror)
   logging.info('Traceback: ', exc_info=True)
  return None
 return data

@ synchronized ( IO_LOCK ) def load_admin ( _id , remove = False , do_pickle = True , silent = False ) : path = os . path . join ( cfg . admin_dir . get_path ( ) , _id ) logging . info ( 'Loading data for %s from %s' , _id , path ) if ( not os . path . exists ( path ) ) : logging . info ( '%s missing' , path ) return None try : f = open ( path , 'rb' ) if do_pickle : data = cPickle . load ( f ) else : data = f . read ( ) f . close ( ) if remove : os . remove ( path ) except : if ( not silent ) : excepterror = str ( sys . exc_info ( ) [ 0 ] ) logging . error ( T ( 'Loading %s failed with error %s' ) , path , excepterror ) logging . info ( 'Traceback: ' , exc_info = True ) return None return data
read data in admin folder in specified format .