[geany/www.geany.org] b84b56: Show Geany-Plugins releases also on the download page

Enrico Tröger git-noreply at xxxxx
Sun Sep 27 21:01:37 UTC 2020


Branch:      refs/heads/master
Author:      Enrico Tröger <enrico.troeger at uvena.de>
Committer:   Enrico Tröger <enrico.troeger at uvena.de>
Date:        Sun, 27 Sep 2020 21:01:37 UTC
Commit:      b84b56185c31e489bee4ef0b40ee8a889964b009
             https://github.com/geany/www.geany.org/commit/b84b56185c31e489bee4ef0b40ee8a889964b009

Log Message:
-----------
Show Geany-Plugins releases also on the download page

The available release files are read from the filesystem and so don't
need to be updated manually.


Modified Paths:
--------------
    README.dev.md
    docker/local_settings.docker.py
    geany/settings.py
    latest_version/context_processors.py
    latest_version/releases.py
    page_content/download/releases.md

Modified: README.dev.md
1 lines changed, 1 insertions(+), 0 deletions(-)
===================================================================
@@ -112,6 +112,7 @@ the settings to your needs:
     LOGGING['handlers']['file']['filename'] = '/tmp/geany_django.log'
 
     LATEST_VERSION_RELEASES_DIRECTORY = '/path/to/geany/releases/directory/or/just/empty'
+    LATEST_VERSION_PLUGINS_RELEASES_DIRECTORY = '/path/to/plugins/releases/directory/or/just/empty'
     STATIC_DOCS_GEANY_SOURCE_TARBALL = '/path/to/geany/source/tarball/or/just/empty'
     IRC_USER_LIST_FILE = '/path/to/irc/data/or/just/empty'
 


Modified: docker/local_settings.docker.py
3 lines changed, 2 insertions(+), 1 deletions(-)
===================================================================
@@ -55,7 +55,8 @@
 STATIC_DOCS_GEANY_DESTINATION_URL = os.path.join(MEDIA_URL, 'i18n')
 STATIC_DOCS_GEANY_I18N_STATISTICS_FILENAME = 'i18n_statistics.json'
 
-LATEST_VERSION_RELEASES_DIRECTORY = ''
+LATEST_VERSION_RELEASES_DIRECTORY = '/nonexistant/geany'
+LATEST_VERSION_PLUGINS_RELEASES_DIRECTORY = '/nonexistant/plugins'
 
 LOGGING = {
     'version': 1,


Modified: geany/settings.py
1 lines changed, 1 insertions(+), 0 deletions(-)
===================================================================
@@ -458,6 +458,7 @@
 IRC_USER_LIST_FILE = '/srv/tmp/irc_userlist'
 
 LATEST_VERSION_RELEASES_DIRECTORY = '/srv/www/download.geany.org'
+LATEST_VERSION_PLUGINS_RELEASES_DIRECTORY = '/srv/www/plugins.geany.org/geany-plugins/'
 
 MEZZANINE_SYNC_PAGES_DESTINATION_PATH = os.path.join(PROJECT_ROOT, 'page_content')
 


Modified: latest_version/context_processors.py
9 lines changed, 8 insertions(+), 1 deletions(-)
===================================================================
@@ -24,11 +24,18 @@
 def latest_version(request):
     geany_latest_version = LatestVersion.objects.get(id=1)
 
+    # Geany
     release_versions_provider = ReleaseVersionsProvider(
         settings.LATEST_VERSION_RELEASES_DIRECTORY,
         fallback_version=geany_latest_version.version)
     release_versions = release_versions_provider.provide()
+    # Geany-Plugins
+    geany_plugins_release_versions_provider = ReleaseVersionsProvider(
+        settings.LATEST_VERSION_PLUGINS_RELEASES_DIRECTORY,
+        fallback_version=geany_latest_version.version)
+    plugins_release_versions = geany_plugins_release_versions_provider.provide()
 
     return dict(
         geany_latest_version=geany_latest_version,
-        release_versions=release_versions)
+        release_versions=release_versions,
+        plugins_release_versions=plugins_release_versions)


Modified: latest_version/releases.py
72 lines changed, 46 insertions(+), 26 deletions(-)
===================================================================
@@ -16,6 +16,7 @@
 import logging
 import re
 
+from django.conf import settings
 from packaging.version import parse as parse_version
 
 
@@ -25,21 +26,38 @@
 RELEASE_TYPE_MACOS = 'macos_version'
 
 RELEASE_TYPES = {
-    RELEASE_TYPE_SOURCE_GZIP: {
-        'pattern': re.compile(r'^geany-([0-9\.\-]+).tar.gz$'),
-        'fallback_filename': 'geany-{version}.tar.gz'
+    settings.LATEST_VERSION_RELEASES_DIRECTORY: {
+        RELEASE_TYPE_SOURCE_GZIP: {
+            'pattern': re.compile(r'^geany-([0-9\.\-]+).tar.gz$'),
+            'fallback_filename': 'geany-{version}.tar.gz'
+        },
+        RELEASE_TYPE_SOURCE_BZIP2: {
+            'pattern': re.compile(r'^geany-([0-9\.\-]+).tar.bz2$'),
+            'fallback_filename': 'geany-{version}.tar.bz2'
+        },
+        RELEASE_TYPE_WINDOWS: {
+            'pattern': re.compile(r'^geany-([0-9\.\-]+)_setup(-[0-9]+)?.exe$'),
+            'fallback_filename': 'geany-{version}_setup.exe'
+        },
+        RELEASE_TYPE_MACOS: {
+            'pattern': re.compile(r'^geany-([0-9\.\-]+)_osx(-[0-9]+)?.dmg$'),
+            'fallback_filename': 'geany-{version}_osx.dmg'
+        },
     },
-    RELEASE_TYPE_SOURCE_BZIP2: {
-        'pattern': re.compile(r'^geany-([0-9\.\-]+).tar.bz2$'),
-        'fallback_filename': 'geany-{version}.tar.bz2'
-    },
-    RELEASE_TYPE_WINDOWS: {
-        'pattern': re.compile(r'^geany-([0-9\.\-]+)_setup(-[0-9]+)?.exe$'),
-        'fallback_filename': 'geany-{version}_setup.exe'
-    },
-    RELEASE_TYPE_MACOS: {
-        'pattern': re.compile(r'^geany-([0-9\.\-]+)_osx(-[0-9]+)?.dmg$'),
-        'fallback_filename': 'geany-{version}_osx.dmg'
+
+    settings.LATEST_VERSION_PLUGINS_RELEASES_DIRECTORY: {
+        RELEASE_TYPE_SOURCE_GZIP: {
+            'pattern': re.compile(r'^geany-plugins-([0-9\.\-]+).tar.gz$'),
+            'fallback_filename': 'geany-plugins-{version}.tar.gz'
+        },
+        RELEASE_TYPE_SOURCE_BZIP2: {
+            'pattern': re.compile(r'^geany-plugins-([0-9\.\-]+).tar.bz2$'),
+            'fallback_filename': 'geany-plugins-{version}.tar.bz2'
+        },
+        RELEASE_TYPE_WINDOWS: {
+            'pattern': re.compile(r'^geany-plugins-([0-9\.\-]+)_setup(-[0-9]+)?.exe$'),
+            'fallback_filename': 'geany-plugins-{version}_setup.exe'
+        },
     },
 }
 
@@ -81,6 +99,9 @@ def _fetch_releases_from_filesystem(self):
             return
 
         path = Path(self._releases_directory)
+        if not path.exists():
+            return
+
         for entry in path.iterdir():
             relative_entry = entry.relative_to(self._releases_directory)
             filename = relative_entry.as_posix()
@@ -89,21 +110,19 @@ def _fetch_releases_from_filesystem(self):
     # ----------------------------------------------------------------------
     def _group_releases_by_type(self):
         self._release_files_by_version = dict()
-        for release_type in RELEASE_TYPES:
+        release_types = self._get_release_types()
+        for release_type in release_types:
             self._release_files_by_version[release_type] = list()
 
         for filename in self._release_files:
-            if RELEASE_TYPES[RELEASE_TYPE_SOURCE_GZIP]['pattern'].match(filename):
-                self._release_files_by_version[RELEASE_TYPE_SOURCE_GZIP].append(filename)
-
-            elif RELEASE_TYPES[RELEASE_TYPE_SOURCE_BZIP2]['pattern'].match(filename):
-                self._release_files_by_version[RELEASE_TYPE_SOURCE_BZIP2].append(filename)
+            for release_type in release_types:
+                if release_types[release_type]['pattern'].match(filename):
+                    self._release_files_by_version[release_type].append(filename)
+                    break
 
-            elif RELEASE_TYPES[RELEASE_TYPE_WINDOWS]['pattern'].match(filename):
-                self._release_files_by_version[RELEASE_TYPE_WINDOWS].append(filename)
-
-            elif RELEASE_TYPES[RELEASE_TYPE_MACOS]['pattern'].match(filename):
-                self._release_files_by_version[RELEASE_TYPE_MACOS].append(filename)
+    # ----------------------------------------------------------------------
+    def _get_release_types(self):
+        return RELEASE_TYPES.get(self._releases_directory, dict())
 
     # ----------------------------------------------------------------------
     def _factor_release_versions(self):
@@ -117,12 +136,13 @@ def _factor_release_versions(self):
     def _determine_latest_version(self, release_type):
         versions = self._release_files_by_version[release_type]
         sorted_versions = sorted(versions, key=parse_version)
+        release_types = self._get_release_types()
         try:
             latest_version = sorted_versions.pop()
             logger.debug(
                 'Latest version found for "{}": {}'.format(release_type, latest_version))
         except IndexError:
-            fallback_filename = RELEASE_TYPES[release_type]['fallback_filename']
+            fallback_filename = release_types[release_type]['fallback_filename']
             latest_version = fallback_filename.format(version=self._fallback_version)
             logger.debug(
                 'Latest version found for "{}": {} (fallback)'.format(


Modified: page_content/download/releases.md
16 lines changed, 12 insertions(+), 4 deletions(-)
===================================================================
@@ -1,5 +1,4 @@
-Releases
-==========
+## Geany Releases
 
 Distribution      | File          | GPG Signature | GPG Key
 ----------------- | ------------- | ------------- | -------------
@@ -11,10 +10,17 @@ Mac OSX           | [{{ release_versions.macos_version }}](https://download.gean
 [Release notes for Geany {{ geany_latest_version.version }}][3]
 
 
-## Plugins
+## Geany-Plugins Releases
 
 Geany has a few plugins included (Classbuilder, Export, Filebrowser, HTML Characters, Save Actions and Split Window)
-but many more plugins are available in the [Geany-Plugins][5] project.
+but many more plugins are available in the [Geany-Plugins][5] project:
+
+Distribution      | File          | GPG Signature | GPG Key
+----------------- | ------------- | ------------- | -------------
+Source (tar.gz)   | [{{ plugins_release_versions.source_gzip_version }}](https://plugins.geany.org/geany-plugins/{{ plugins_release_versions.source_gzip_version }}) | [{{ plugins_release_versions.source_gzip_version }}.sig](https://plugins.geany.org/geany-plugins/{{ plugins_release_versions.source_gzip_version }}.sig) ([Instructions][4]) | [frlan-pubkey.txt][6]
+Source (tar.bz2)  | [{{ plugins_release_versions.source_bzip2_version }}](https://plugins.geany.org/geany-plugins/{{ plugins_release_versions.source_bzip2_version }}) | [{{ plugins_release_versions.source_bzip2_version }}.sig](https://plugins.geany.org/geany-plugins/{{ plugins_release_versions.source_bzip2_version }}.sig) ([Instructions][4]) | [frlan-pubkey.txt][6]
+Windows           | [{{ plugins_release_versions.windows_version }}](https://plugins.geany.org/geany-plugins/{{ plugins_release_versions.windows_version }}) | [{{ plugins_release_versions.windows_version }}.sig](https://plugins.geany.org/geany-plugins/{{ plugins_release_versions.windows_version }}.sig) ([Instructions][4]) | [frlan-pubkey.txt][6]
+Mac OSX           | (included in `{{ release_versions.macos_version }}` above) | - | -
 
 For more details, see the [plugin page][5].
 
@@ -28,9 +34,11 @@ For older versions, please see https://download.geany.org/.
 - Note: Tarballs before 1.25 used another GPG Key: https://download.geany.org/colombanw-pubkey-pre-1.25.txt
 - Note: Tarballs before 0.21 used another GPG Key: https://download.geany.org/ntrel-pubkey.txt
 - Note: Tarballs before 0.20 used another GPG Key: https://download.geany.org/eht16-pubkey_old.txt
+- Note: Geany-Plugins downloads use the following GPG Key: https://download.geany.org/frlan-pubkey.txt
 
 [1]: https://download.geany.org/colombanw-pubkey.txt
 [2]: https://download.geany.org/eht16-pubkey.txt
 [3]: /documentation/releasenotes/
 [4]: /support/verify-gpg-signature/
 [5]: /support/plugins/
+[6]: https://download.geany.org/frlan-pubkey.txt



--------------
This E-Mail was brought to you by github_commit_mail.py (Source: https://github.com/geany/infrastructure).


More information about the Commits mailing list