Skip to content
GitLab
Projects
Groups
Snippets
/
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
Menu
Open sidebar
Pleroma
relay
Commits
e1498a8d
Commit
e1498a8d
authored
Oct 15, 2021
by
Joel Beckmeyer
Browse files
add parameter for config location
parent
e4de3081
Changes
1
Hide whitespace changes
Inline
Side-by-side
relay/__init__.py
View file @
e1498a8d
...
...
@@ -5,10 +5,17 @@ import asyncio
import
aiohttp
import
aiohttp.web
import
yaml
import
argparse
parser
=
argparse
.
ArgumentParser
(
description
=
"A generic LitePub relay (works with all LitePub consumers and Mastodon)."
,
prog
=
"python -m relay"
)
parser
.
add_argument
(
"-c"
,
"--config"
,
type
=
str
,
default
=
"relay.yaml"
,
metavar
=
"<path>"
,
help
=
"the path to your config file"
)
args
=
parser
.
parse_args
()
def
load_config
():
with
open
(
'relay.yaml'
)
as
f
:
with
open
(
args
.
config
)
as
f
:
options
=
{}
## Prevent a warning message for pyyaml 5.1+
...
...
Write
Preview
Supports
Markdown
0%
Try again
or
attach a new file
.
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment