mirror of
https://git.anonymousland.org/anonymousland/synapse.git
synced 2025-05-02 18:14:49 -04:00
Add a config file for perspective servers
This commit is contained in:
parent
31e262e6b4
commit
b1e68add19
2 changed files with 30 additions and 0 deletions
|
@ -77,6 +77,17 @@ class Config(object):
|
|||
with open(file_path) as file_stream:
|
||||
return file_stream.read()
|
||||
|
||||
@classmethod
|
||||
def read_yaml_file(cls, file_path, config_name):
|
||||
cls.check_file(file_path, config_name)
|
||||
with open(file_path) as file_stream:
|
||||
try:
|
||||
return yaml.load(file_stream)
|
||||
except Exception as e:
|
||||
raise ConfigError(
|
||||
"Error parsing yaml in file %r: " % (file_path,), e
|
||||
)
|
||||
|
||||
@staticmethod
|
||||
def default_path(name):
|
||||
return os.path.abspath(os.path.join(os.path.curdir, name))
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue