[gimp-web/migrate/py3] Update pelicanconf.py to match pelicanconf.local.py as needed



commit 1a248ba7b522aa003a1be45743075e4c33632f01
Author: Pat David <patdavid gmail com>
Date:   Fri Jul 12 22:34:32 2019 -0500

    Update pelicanconf.py to match pelicanconf.local.py as needed
    
    This syncs up the changes I made in pelicanconf.local.py to work
    with py3 and new pelican.
    
    This seems to build ok.

 pelicanconf.py | 104 +++++++++++++++++++++++++++++++--------------------------
 1 file changed, 56 insertions(+), 48 deletions(-)
---
diff --git a/pelicanconf.py b/pelicanconf.py
index 3cbee7d5..e8119491 100644
--- a/pelicanconf.py
+++ b/pelicanconf.py
@@ -4,8 +4,8 @@ from __future__ import unicode_literals
 
 #Plugins
 PLUGIN_PATHS = ["plugins"]
-#PLUGINS = ["page_hierarchy_gimp"]
-PLUGINS = ["mimic_hierarchy", "i18n_subsites", "sitemap", "gimp_mirrors", "tipue_search", "random_header"]
+#PLUGINS = ["mimic_hierarchy", "i18n_subsites", "sitemap", "gimp_mirrors", "tipue_search", "random_header"]
+PLUGINS = ["mimic_hierarchy", "sitemap", "gimp_mirrors", "tipue_search", "random_header"]
 
 # sitemap plugin settings
 SITEMAP = {
@@ -89,8 +89,8 @@ ARTICLE_PATHS = ['news']
 THEME = "./themes/newgimp"
 
 PAGE_URL = "{slug}/"
-#PAGE_SAVE_AS = "{slug}/index.html"
-PAGE_SAVE_AS = "{slug}/{filename}"
+PAGE_SAVE_AS = "{slug}/index.html"
+#PAGE_SAVE_AS = "{slug}/{filename}"
 
 ARTICLE_URL = "news/{date:%Y}/{date:%m}/{date:%d}/{slug}/"
 ARTICLE_SAVE_AS = "news/{date:%Y}/{date:%m}/{date:%d}/{slug}/index.html"
@@ -110,7 +110,14 @@ TYPOGRIFY_IGNORE_TAGS = ['title']
 
 DELETE_OUTPUT_DIRECTORY = True
 
-MD_EXTENSIONS = ['fenced_code', 'codehilite(css_class=codehilite)', 'extra', 'headerid', 
'toc(permalink=True)']
+#MD_EXTENSIONS = ['fenced_code', 'codehilite(css_class=codehilite)', 'extra', 'headerid', 
'toc(permalink=True)']
+MARKDOWN = {
+    'extension_configs': {
+        'markdown.extensions.codehilite': {'css_class': 'highlight'}
+    },
+    'output_format': 'html5',
+    'extensions': ['fenced_code', 'codehilite', 'extra', 'toc'],
+}
 
 # Pagination testing stuff
 
@@ -133,64 +140,65 @@ RELATIVE_URLS = False
 import json
 from collections import OrderedDict
 with open('GIMP_VERSIONS') as data:
-    GIMP = json.load(data, object_pairs_hook=OrderedDict)
+    GIMP = json.load(data)
 
 if 'STABLE' in GIMP:
     # Set the current stable GIMP version from
     # the GIMP_VERSIONS json file.  The most
     # current version _should_ be the first key
     # hence, .keys()[0]
-    GIMP_VERSION = GIMP['STABLE'].keys()[0]
+    GIMP_VERSION = list(GIMP['STABLE'].keys())[0]
     GIMP_MAJOR_MINOR_VERSION = GIMP_VERSION[:GIMP_VERSION.index('.', GIMP_VERSION.index('.') + 1)]
-    for version, info in GIMP['STABLE'].iteritems() :
+    for version, info in GIMP['STABLE'].items() :
         if 'date' in info:
             try:
                 RELEASE_DATE
             except NameError:
                 RELEASE_DATE = info['date']
-        if 'windows' in info:
+        if 'windows' in info: 
             try:
                 WINDOWS_FILE
             except NameError:
                 WINDOWS_VER = version
                 WINDOWS_MAJOR_MINOR_VER = version[:version.index('.', version.index('.') + 1)]
-                WINDOWS_FILE = info['windows'].keys()[0]
-                if 'sha256' in info['windows'].values()[0]:
+                WINDOWS_FILE = list(info['windows'].keys())[0]
+                if 'sha256' in list(info['windows'].values())[0]:
                     WINDOWS_HASH_FUN = 'sha256'
-                elif 'sha512' in info['windows'].values()[0]:
+                elif 'sha512' in list(info['windows'].values())[0]:
                     WINDOWS_HASH_FUN = 'sha512'
-                elif 'md5' in info['windows'].values()[0]:
+                elif 'md5' in list(info['windows'].values())[0]:
                     WINDOWS_HASH_FUN = 'md5'
-                WINDOWS_HASH = info['windows'].values()[0][WINDOWS_HASH_FUN]
-                if 'min-support' in info['windows'].values()[0]:
-                    WINDOWS_MIN_SUPPORT = info['windows'].values()[0]["min-support"]
+                WINDOWS_HASH = list(info['windows'].values())[0][WINDOWS_HASH_FUN]
+                if 'min-support' in list(info['windows'].values())[0]:
+                    WINDOWS_MIN_SUPPORT = list(info['windows'].values())[0]["min-support"]
         if 'macos' in info:
             try:
                 MACOS_FILE
             except NameError:
                 MACOS_VER = version
                 MACOS_MAJOR_MINOR_VER = version[:version.index('.', version.index('.') + 1)]
-                MACOS_FILE = info['macos'].keys()[0]
-                if 'sha256' in info['macos'].values()[0]:
+                MACOS_FILE = list(info['macos'].keys())[0]
+                if 'sha256' in list(info['macos'].values())[0]:
                     MACOS_HASH_FUN = 'sha256'
-                elif 'sha512' in info['macos'].values()[0]:
+                elif 'sha512' in list(info['macos'].values())[0]:
                     MACOS_HASH_FUN = 'sha512'
-                elif 'md5' in info['macos'].values()[0]:
+                elif 'md5' in list(info['macos'].values())[0]:
                     MACOS_HASH_FUN = 'md5'
-                MACOS_HASH = info['macos'].values()[0][MACOS_HASH_FUN]
-                if 'min-support' in info['macos'].values()[0]:
-                    MACOS_MIN_SUPPORT = info['macos'].values()[0]["min-support"]
+                MACOS_HASH = list(info['macos'].values())[0][MACOS_HASH_FUN]
+                if 'min-support' in list(info['macos'].values())[0]:
+                    MACOS_MIN_SUPPORT = list(info['macos'].values())[0]["min-support"]
 else:
-    print 'STABLE not defined'
+    print('STABLE not defined')
+
 
 if 'OLDSTABLE' in GIMP:
     # Set the current stable GIMP version from
     # the GIMP_VERSIONS json file.  The most
     # current version _should_ be the first key
     # hence, .keys()[0]
-    GIMP_VERSION_OLDSTABLE = GIMP['OLDSTABLE'].keys()[0]
+    GIMP_VERSION_OLDSTABLE = list(GIMP['OLDSTABLE'].keys())[0]
     GIMP_MAJOR_MINOR_VERSION_OLDSTABLE= GIMP_VERSION_OLDSTABLE[:GIMP_VERSION_OLDSTABLE.index('.', 
GIMP_VERSION_OLDSTABLE.index('.') + 1)]
-    for version, info in GIMP['OLDSTABLE'].iteritems() :
+    for version, info in GIMP['OLDSTABLE'].items() :
         if 'date' in info:
             try:
                 RELEASE_DATE_OLDSTABLE
@@ -202,23 +210,23 @@ if 'OLDSTABLE' in GIMP:
             except NameError:
                 WINDOWS_VER_OLDSTABLE = version
                 WINDOWS_MAJOR_MINOR_VER_OLDSTABLE = version[:version.index('.', version.index('.') + 1)]
-                WINDOWS_FILE_OLDSTABLE = info['windows'].keys()[0]
-                WINDOWS_HASH_OLDSTABLE = info['windows'].values()[0]
+                WINDOWS_FILE_OLDSTABLE = list(info['windows'].keys())[0]
+                WINDOWS_HASH_OLDSTABLE = list(info['windows'].values())[0]
         if 'macos' in info:
             try:
                 MACOS_FILE_OLDSTABLE
             except NameError:
                 MACOS_VER_OLDSTABLE = version
                 MACOS_MAJOR_MINOR_VER_OLDSTABLE= version[:version.index('.', version.index('.') + 1)]
-                MACOS_FILE_OLDSTABLE = info['macos'].keys()[0]
-                MACOS_HASH_OLDSTABLE = info['macos'].values()[0]
+                MACOS_FILE_OLDSTABLE = list(info['macos'].keys())[0]
+                MACOS_HASH_OLDSTABLE = list(info['macos'].values())[0]
 else:
-    print 'OLDSTABLE not defined'
+    print('OLDSTABLE not defined')
 
 if 'DEVELOPMENT' in GIMP:
     # development version
-    GIMP_VERSION_DEVELOPMENT = GIMP['DEVELOPMENT'].keys()[0]
-    for version, info in GIMP['DEVELOPMENT'].iteritems() :
+    GIMP_VERSION_DEVELOPMENT = list(GIMP['DEVELOPMENT'].keys())[0]
+    for version, info in GIMP['DEVELOPMENT'].items() :
         if 'date' in info:
             try:
                 RELEASE_DATE_DEVELOPMENT
@@ -229,27 +237,27 @@ if 'DEVELOPMENT' in GIMP:
                 WINDOWS_FILE_DEVELOPMENT
             except NameError:
                 WINDOWS_VER_DEVELOPMENT = version
-                WINDOWS_FILE_DEVELOPMENT = info['windows'].keys()[0]
-                if 'sha256' in info['windows'].values()[0]:
+                WINDOWS_FILE_DEVELOPMENT = list(info['windows'].keys())[0]
+                if 'sha256' in list(info['windows'].values())[0]:
                     WINDOWS_HASH_FUN_DEVELOPMENT = 'sha256'
-                elif 'sha512' in info['windows'].values()[0]:
+                elif 'sha512' in list(info['windows'].values())[0]:
                     WINDOWS_HASH_FUN_DEVELOPMENT = 'sha512'
-                elif 'md5' in info['windows'].values()[0]:
+                elif 'md5' in list(info['windows'].values())[0]:
                     WINDOWS_HASH_FUN_DEVELOPMENT = 'md5'
-                WINDOWS_HASH_DEVELOPMENT = info['windows'].values()[0][WINDOWS_HASH_FUN_DEVELOPMENT]
+                WINDOWS_HASH_DEVELOPMENT = list(info['windows'].values())[0][WINDOWS_HASH_FUN_DEVELOPMENT]
         if 'macos' in info:
             try:
                 MACOS_FILE_DEVELOPMENT
             except NameError:
                 MACOS_VER_DEVELOPMENT = version
-                MACOS_FILE_DEVELOPMENT = info['macos'].keys()[0]
-                if 'sha256' in info['macos'].values()[0]:
+                MACOS_FILE_DEVELOPMENT = list(info['macos'].keys())[0]
+                if 'sha256' in list(info['macos'].values())[0]:
                     MACOS_HASH_FUN_DEVELOPMENT = 'sha256'
-                elif 'sha512' in info['macos'].values()[0]:
+                elif 'sha512' in list(info['macos'].values())[0]:
                     MACOS_HASH_FUN_DEVELOPMENT = 'sha512'
-                elif 'md5' in info['macos'].values()[0]:
+                elif 'md5' in list(info['macos'].values())[0]:
                     MACOS_HASH_FUN_DEVELOPMENT = 'md5'
-                MACOS_HASH_DEVELOPMENT = info['macos'].values()[0][MACOS_HASH_FUN_DEVELOPMENT]
+                MACOS_HASH_DEVELOPMENT = list(info['macos'].values())[0][MACOS_HASH_FUN_DEVELOPMENT]
         if 'flatpak' in info:
             try:
                 FLATPAK_FILE_DEVELOPMENT
@@ -257,19 +265,19 @@ if 'DEVELOPMENT' in GIMP:
                 FLATPAK_VER_DEVELOPMENT = version
                 FLATPAK_FILE_DEVELOPMENT = {}
                 FLATPAK_HASH_DEVELOPMENT = {}
-                for arch, package in info['flatpak'].iteritems() :
-                    FLATPAK_FILE_DEVELOPMENT[arch] = package.keys()[0]
+                for arch, package in info['flatpak'].items() :
+                    FLATPAK_FILE_DEVELOPMENT[arch] = list(package.keys())[0]
                     FLATPAK_HASH_DEVELOPMENT[arch] = package.values()[0]
 else:
-    print 'DEVELOPMENT not defined'
+    print('DEVELOPMENT not defined')
 
 #
 # Random Header Background Image
-#
+# 
 # This is to get the possible header images
 # and choose one randomly to display.
 #
-# Templates will use HEADER_IMG data to parse image information.
+# Templates will use HEADER_IMG data to parse image information.  
 # Refer to the random_header plugin for actually putting the image
 # in the correct stylesheet.
 #


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