@synchronized(IO_LOCK)
def save_admin(data, _id, do_pickle=True):
 path = os.path.join(cfg.admin_dir.get_path(), _id)
 logging.info('Saving data for %s in %s', _id, path)
 try:
  _f = open(path, 'wb')
  if do_pickle:
   pickler = cPickle.Pickler(_f, 2)
   pickler.dump(data)
   _f.flush()
   _f.close()
   pickler.clear_memo()
   del pickler
  else:
   _f.write(data)
   _f.flush()
   _f.close()
 except:
  logging.error(T('Saving %s failed'), path)
  logging.info('Traceback: ', exc_info=True)

@ synchronized ( IO_LOCK ) def save_admin ( data , _id , do_pickle = True ) : path = os . path . join ( cfg . admin_dir . get_path ( ) , _id ) logging . info ( 'Saving data for %s in %s' , _id , path ) try : _f = open ( path , 'wb' ) if do_pickle : pickler = cPickle . Pickler ( _f , 2 ) pickler . dump ( data ) _f . flush ( ) _f . close ( ) pickler . clear_memo ( ) del pickler else : _f . write ( data ) _f . flush ( ) _f . close ( ) except : logging . error ( T ( 'Saving %s failed' ) , path ) logging . info ( 'Traceback: ' , exc_info = True )
save data in admin folder in specified format .