@synchronized(IO_LOCK)
def get_new_id(prefix, folder, check_list=None):
 for n in xrange(10000):
  try:
   if (not os.path.exists(folder)):
    os.makedirs(folder)
   (fd, path) = tempfile.mkstemp('', ('SABnzbd_%s_' % prefix), folder)
   os.close(fd)
   (head, tail) = os.path.split(path)
   if ((not check_list) or (tail not in check_list)):
    return tail
  except:
   logging.error(T('Failure in tempfile.mkstemp'))
   logging.info('Traceback: ', exc_info=True)
 raise IOError

@ synchronized ( IO_LOCK ) def get_new_id ( prefix , folder , check_list = None ) : for n in xrange ( 10000 ) : try : if ( not os . path . exists ( folder ) ) : os . makedirs ( folder ) ( fd , path ) = tempfile . mkstemp ( '' , ( 'SABnzbd_%s_' % prefix ) , folder ) os . close ( fd ) ( head , tail ) = os . path . split ( path ) if ( ( not check_list ) or ( tail not in check_list ) ) : return tail except : logging . error ( T ( 'Failure in tempfile.mkstemp' ) ) logging . info ( 'Traceback: ' , exc_info = True ) raise IOError
return unique prefixed admin identifier within folder optionally making sure that id is not in the check_list .