[meld] Fix maint script for required conf.py.in hack
- From: Kai Willadsen <kaiw src gnome org>
- To: commits-list gnome org
- Cc:
- Subject: [meld] Fix maint script for required conf.py.in hack
- Date: Sun, 19 Apr 2020 01:11:04 +0000 (UTC)
commit 8ed79c020fba683824a986c09ce4d90c3fde7177
Author: Kai Willadsen <kai willadsen gmail com>
Date: Sun Apr 19 10:54:16 2020 +1000
Fix maint script for required conf.py.in hack
maint | 18 +++++++++++++++++-
1 file changed, 17 insertions(+), 1 deletion(-)
---
diff --git a/maint b/maint
old mode 100755
new mode 100644
index 3e56245a..772c1dc7
--- a/maint
+++ b/maint
@@ -2,9 +2,12 @@
import collections
import datetime
+import importlib.machinery
+import importlib.util
import os
import re
import subprocess
+import sys
import urllib.parse
import click
@@ -12,7 +15,20 @@ import keyring
import requests
from jinja2 import Environment
-import meld.conf
+# Import system hackery to import conf.py.in without copying it to
+# have a .py suffix. This is entirely so that we can run from a git
+# checkout without any user intervention.
+
+loader = importlib.machinery.SourceFileLoader('meld.conf', 'meld/conf.py.in')
+spec = importlib.util.spec_from_loader(loader.name, loader)
+mod = importlib.util.module_from_spec(spec)
+loader.exec_module(mod)
+
+import meld # noqa: E402 isort:skip
+meld.conf = mod
+sys.modules['meld.conf'] = mod
+import meld.conf # noqa: E402 isort:skip
+
PO_DIR = "po"
HELP_DIR = "help"
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]