def create_real_path(name, loc, path, umask=False, writable=True):
 if path:
  my_dir = real_path(loc, path)
  if (not os.path.exists(my_dir)):
   logging.info('%s directory: %s does not exist, try to create it', name, my_dir)
   if (not create_all_dirs(my_dir, umask)):
    logging.error(T('Cannot create directory %s'), clip_path(my_dir))
    return (False, my_dir)
  checks = ((os.W_OK + os.R_OK) if writable else os.R_OK)
  if os.access(my_dir, checks):
   return (True, my_dir)
  else:
   logging.error(T('%s directory: %s error accessing'), name, clip_path(my_dir))
   return (False, my_dir)
 else:
  return (False, '')

def create_real_path ( name , loc , path , umask = False , writable = True ) : if path : my_dir = real_path ( loc , path ) if ( not os . path . exists ( my_dir ) ) : logging . info ( '%s directory: %s does not exist, try to create it' , name , my_dir ) if ( not create_all_dirs ( my_dir , umask ) ) : logging . error ( T ( 'Cannot create directory %s' ) , clip_path ( my_dir ) ) return ( False , my_dir ) checks = ( ( os . W_OK + os . R_OK ) if writable else os . R_OK ) if os . access ( my_dir , checks ) : return ( True , my_dir ) else : logging . error ( T ( '%s directory: %s error accessing' ) , name , clip_path ( my_dir ) ) return ( False , my_dir ) else : return ( False , '' )
when path is relative .