[gimp-web/migrate/py3] Add current directory to Python import search path



commit b55e1267b26dfd244a49477802f2355cc9323717
Author: Michael Schumacher <schumaml gmx de>
Date:   Sat Apr 18 22:06:34 2020 +0200

    Add current directory to Python import search path
    
    Fixes 'from pelicanconf_common import *' and makes make html and make testing work again

 pelicanconf.local.py   | 6 ++++++
 pelicanconf.py         | 6 ++++++
 pelicanconf.testing.py | 6 ++++++
 3 files changed, 18 insertions(+)
---
diff --git a/pelicanconf.local.py b/pelicanconf.local.py
index 47616ed0..853c6756 100644
--- a/pelicanconf.local.py
+++ b/pelicanconf.local.py
@@ -1,6 +1,12 @@
 #!/usr/bin/env python
 # -*- coding: utf-8 -*- #
 
+# make sure the current path is searched for imports
+import sys
+import os
+
+sys.path.append(os.path.abspath(os.path.dirname(__file__)))
+
 # Import everything to the global scope.
 from pelicanconf_common import *
 customize_environment('local')
diff --git a/pelicanconf.py b/pelicanconf.py
index a38fa5f3..638d31f1 100644
--- a/pelicanconf.py
+++ b/pelicanconf.py
@@ -1,6 +1,12 @@
 #!/usr/bin/env python
 # -*- coding: utf-8 -*- #
 
+# make sure the current path is searched for imports
+import sys
+import os
+
+sys.path.append(os.path.abspath(os.path.dirname(__file__)))
+
 # Import everything to the global scope.
 from pelicanconf_common import *
 customize_environment('production')
diff --git a/pelicanconf.testing.py b/pelicanconf.testing.py
index 3e5b51b0..1c0e584e 100644
--- a/pelicanconf.testing.py
+++ b/pelicanconf.testing.py
@@ -1,6 +1,12 @@
 #!/usr/bin/env python
 # -*- coding: utf-8 -*- #
 
+# make sure the current path is searched for imports
+import sys
+import os
+
+sys.path.append(os.path.abspath(os.path.dirname(__file__)))
+
 # Import everything to the global scope.
 from pelicanconf_common import *
 customize_environment('testing')


[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]