[gimp-web/migrate/py3] pelicanconf*: update to current testing/master behaviour



commit c153cf9ad7a6956c5a1764f89b632f08e2a42caf
Author: Michael Schumacher <schumaml gmx de>
Date:   Tue Apr 21 19:08:38 2020 +0200

    pelicanconf*: update to current testing/master behaviour

 pelicanconf.local.py   | 10 +++++-
 pelicanconf.py         | 12 ++++++-
 pelicanconf.static.py  |  9 ++++-
 pelicanconf.testing.py |  9 ++++-
 pelicanconf_common.py  | 92 ++++++++++++++++++++++++++++----------------------
 5 files changed, 88 insertions(+), 44 deletions(-)
---
diff --git a/pelicanconf.local.py b/pelicanconf.local.py
index 853c6756..8ca18c5d 100644
--- a/pelicanconf.local.py
+++ b/pelicanconf.local.py
@@ -9,4 +9,12 @@ sys.path.append(os.path.abspath(os.path.dirname(__file__)))
 
 # Import everything to the global scope.
 from pelicanconf_common import *
-customize_environment('local')
+#customize_environment('local')
+
+SITEURL = 'https://www.gimp.org'
+SITEMAP_SITEURL = 'https://www.gimp.org'
+
+LOAD_CONTENT_CACHE = True
+CHECK_MODIFIED_METHOD = 'mtime'
+CACHE_CONTENT = True
+RELATIVE_URLS = True
diff --git a/pelicanconf.py b/pelicanconf.py
index 638d31f1..07f425f5 100644
--- a/pelicanconf.py
+++ b/pelicanconf.py
@@ -9,4 +9,14 @@ sys.path.append(os.path.abspath(os.path.dirname(__file__)))
 
 # Import everything to the global scope.
 from pelicanconf_common import *
-customize_environment('production')
+#customize_environment('production')
+
+SITEURL = 'https://www.gimp.org'
+SITEMAP_SITEURL = 'https://www.gimp.org'
+
+FEED_DOMAIN = SITEURL
+FEED_ATOM = 'feeds/atom.xml'
+FEED_RSS = 'feeds/rss.xml'
+
+DELETE_OUTPUT_DIRECTORY = True
+RELATIVE_URLS = False
diff --git a/pelicanconf.static.py b/pelicanconf.static.py
index a2dcd3f1..b250a8b6 100644
--- a/pelicanconf.static.py
+++ b/pelicanconf.static.py
@@ -9,4 +9,11 @@ sys.path.append(os.path.abspath(os.path.dirname(__file__)))
 
 # Import everything to the global scope.
 from pelicanconf_common import *
-customize_environment('static')
+#customize_environment('static')
+
+SITEURL = 'https://static.gimp.org'
+SITEMAP_SITEURL = 'https://static.gimp.org'
+
+FEED_DOMAIN = SITEURL
+FEED_ATOM = 'feeds/atom.xml'
+FEED_RSS = 'feeds/rss.xml'
diff --git a/pelicanconf.testing.py b/pelicanconf.testing.py
index 1c0e584e..cc2fd900 100644
--- a/pelicanconf.testing.py
+++ b/pelicanconf.testing.py
@@ -9,4 +9,11 @@ sys.path.append(os.path.abspath(os.path.dirname(__file__)))
 
 # Import everything to the global scope.
 from pelicanconf_common import *
-customize_environment('testing')
+#customize_environment('testing')
+
+SITEURL = 'https://testing.gimp.org'
+SITEMAP_SITEURL = 'https://testing.gimp.org'
+
+FEED_DOMAIN = SITEURL
+FEED_ATOM = 'feeds/atom.xml'
+FEED_RSS = 'feeds/rss.xml'
diff --git a/pelicanconf_common.py b/pelicanconf_common.py
index 48851ce7..b1613f22 100644
--- a/pelicanconf_common.py
+++ b/pelicanconf_common.py
@@ -34,46 +34,46 @@ FEED_RSS = 'feeds/rss.xml'
 
 DELETE_OUTPUT_DIRECTORY = False
 
-def customize_environment(environment):
-    global SITEURL, SITEMAP_SITEURL
-    global LOAD_CONTENT_CACHE, CHECK_MODIFIED_METHOD, CACHE_CONTENT
-    global FEED_DOMAIN, FEED_ATOM, FEED_RSS
-    global DELETE_OUTPUT_DIRECTORY
-    global RELATIVE_URLS
-
-    valid_environments = [ 'local', 'testing', 'static', 'production' ]
-    if environment not in valid_environments:
-        print("customize_environment() must be called with one of: {}".format(', '.join(valid_environments)))
-        exit(1)
-
-    if environment == 'testing':
-        SITEURL = 'https://testing.gimp.org'
-        SITEMAP_SITEURL = 'https://testing.gimp.org'
-    elif environment == 'static':
-        SITEURL = 'https://static.gimp.org'
-        SITEMAP_SITEURL = 'https://static.gimp.org'
-    else:
-        SITEURL = 'https://www.gimp.org'
-        SITEMAP_SITEURL = 'https://www.gimp.org'
-
-    if environment == 'local':
-        #
-        # Caching build for faster regeneration
-        #
-        LOAD_CONTENT_CACHE = True
-        CHECK_MODIFIED_METHOD = 'mtime'
-        CACHE_CONTENT = True
-    else:
-        # Feed generation is usually not desired when developing
-        FEED_DOMAIN = SITEURL
-        FEED_ATOM = 'feeds/atom.xml'
-        FEED_RSS = 'feeds/rss.xml'
-
-        DELETE_OUTPUT_DIRECTORY = True
-
-    # When developing, you probably want document relative URLs - so set this to True
-    # When publishing, set to False
-    RELATIVE_URLS = True if environment == 'local' else False
+# def customize_environment(environment):
+#     global SITEURL, SITEMAP_SITEURL
+#     global LOAD_CONTENT_CACHE, CHECK_MODIFIED_METHOD, CACHE_CONTENT
+#     global FEED_DOMAIN, FEED_ATOM, FEED_RSS
+#     global DELETE_OUTPUT_DIRECTORY
+#     global RELATIVE_URLS
+
+#     valid_environments = [ 'local', 'testing', 'static', 'production' ]
+#     if environment not in valid_environments:
+#         print("customize_environment() must be called with one of: {}".format(', 
'.join(valid_environments)))
+#         exit(1)
+
+#     if environment == 'testing':
+#         SITEURL = 'https://testing.gimp.org'
+#         SITEMAP_SITEURL = 'https://testing.gimp.org'
+#     elif environment == 'static':
+#         SITEURL = 'https://static.gimp.org'
+#         SITEMAP_SITEURL = 'https://static.gimp.org'
+#     else:
+#         SITEURL = 'https://www.gimp.org'
+#         SITEMAP_SITEURL = 'https://www.gimp.org'
+
+#     if environment == 'local':
+#         #
+#         # Caching build for faster regeneration
+#         #
+#         LOAD_CONTENT_CACHE = True
+#         CHECK_MODIFIED_METHOD = 'mtime'
+#         CACHE_CONTENT = True
+#     else:
+#         # Feed generation is usually not desired when developing
+#         FEED_DOMAIN = SITEURL
+#         FEED_ATOM = 'feeds/atom.xml'
+#         FEED_RSS = 'feeds/rss.xml'
+
+#         DELETE_OUTPUT_DIRECTORY = True
+
+#     # When developing, you probably want document relative URLs - so set this to True
+#     # When publishing, set to False
+#     RELATIVE_URLS = True if environment == 'local' else False
 
 
 #######################################
@@ -246,6 +246,12 @@ if 'STABLE' in GIMP:
                 WINDOWS_HASH = info['windows'][0][WINDOWS_HASH_FUN]
                 if 'min-support' in info['windows'][0]:
                     WINDOWS_MIN_SUPPORT = info['windows'][0]["min-support"]
+                if 'comment' in info['windows'][0]:
+                    WINDOWS_COMMENT = info['windows'][0]["comment"]
+                if 'date' in info['windows'][0]:
+                    WINDOWS_DATE = info['windows'][0]["date"]
+                if 'revision' in info['windows'][0]:
+                    WINDOWS_REVISION = info['windows'][0]["revision"]
         if 'macos' in info:
             try:
                 MACOS_FILE
@@ -262,6 +268,12 @@ if 'STABLE' in GIMP:
                 MACOS_HASH = info['macos'][0][MACOS_HASH_FUN]
                 if 'min-support' in info['macos'][0]:
                     MACOS_MIN_SUPPORT = info['macos'][0]["min-support"]
+                if 'comment' in info['macos'][0]:
+                    MACOS_COMMENT = info['macos'][0]["comment"]
+                if 'date' in info['macos'][0]:
+                    MACOS_DATE = info['macos'][0]["date"]
+                if 'revision' in info['macos'][0]:
+                    MACOS_REVISION = info['macos'][0]["revision"]
 else:
     print('STABLE not defined')
 


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