Browse Source

Add support for 3rd party extensions to runserver.py

Signed-off-by: Pierre-Yves Chibon <pingou@pingoured.fr>
Pierre-Yves Chibon 5 years ago
parent
commit
0f6d83d937
1 changed files with 10 additions and 0 deletions
  1. 10 0
      runserver.py

+ 10 - 0
runserver.py

@@ -16,6 +16,9 @@ parser = argparse.ArgumentParser(
 parser.add_argument(
     '--config', '-c', dest='config',
     help='Configuration file to use for pagure.')
+parser.add_argument(
+    '--plugins',  dest='plugins',
+    help='Configuration file for pagure plugin.')
 parser.add_argument(
     '--debug', dest='debug', action='store_true',
     default=False,
@@ -48,6 +51,13 @@ if args.config:
         config = os.path.join(here, config)
     os.environ['PAGURE_CONFIG'] = config
 
+if args.plugins:
+    config = args.plugins
+    if not config.startswith('/'):
+        here = os.path.join(os.path.dirname(os.path.abspath(__file__)))
+        config = os.path.join(here, config)
+    os.environ['PAGURE_PLUGIN'] = config
+
 if args.perfverbose:
     os.environ['PAGURE_PERFREPO'] = 'true'
     os.environ['PAGURE_PERFREPO_VERBOSE'] = 'true'