def _log_path(cls, fname): config = Config.getInstance() configDir = config.getLogDir() for fpath in (os.path.join(configDir, fname), os.path.join(os.getcwd(), ".indico.log")): if os.access(os.path.dirname(fpath), os.W_OK): return fpath.replace("\\", "\\\\") else: raise IOError("Log file can't be written")
def _log_path(cls, fname): config = Config.getInstance() configDir = config.getLogDir() for fpath in (os.path.join(configDir, fname), os.path.join(os.getcwd(), '.indico.log')): if os.access(os.path.dirname(fpath), os.W_OK): return fpath.replace('\\', '\\\\') else: raise IOError("Log file can't be written")
def _log_path(cls, fname): config = Config.getInstance() configDir = config.getLogDir() fpath = os.path.join(configDir, fname) if not os.access(os.path.dirname(fpath), os.W_OK): # if the file in the config is not accessible, use a "local" one fpath = os.path.join(os.getcwd(), '.indico.log') return fpath.replace('\\', '\\\\')