Branch: refs/heads/master Author: Dominic Hopf dmaphy@googlemail.com Committer: GitHub noreply@github.com Date: Sun, 11 Oct 2020 12:16:28 UTC Commit: 2eca01cda3dc484d9dfa9552f16845ce322b1a30 https://github.com/geany/www.geany.org/commit/2eca01cda3dc484d9dfa9552f16845...
Log Message: ----------- Merge pull request #25 from eht16/plugins_on_download_page
Plugins on download page
Modified Paths: -------------- README.dev.md docker/local_settings.docker.py geany/settings.py latest_version/context_processors.py latest_version/fixtures/first_plugins_version.json latest_version/migrations/0002_latestversion_name.py latest_version/models.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 18 lines changed, 16 insertions(+), 2 deletions(-) =================================================================== @@ -22,13 +22,27 @@ # ---------------------------------------------------------------------- @cache_function(CACHE_TIMEOUT_1HOUR, ignore_arguments=True) def latest_version(request): - geany_latest_version = LatestVersion.objects.get(id=1) + latest_versions = LatestVersion.objects.all() + latest_versions_by_name = { + latest_version.name: latest_version + for latest_version + in latest_versions} + geany_latest_version = latest_versions_by_name.get('Geany') + geany_plugins_latest_version = latest_versions_by_name.get('Geany-Plugins')
+ # 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_plugins_latest_version.version) + plugins_release_versions = geany_plugins_release_versions_provider.provide()
return dict( geany_latest_version=geany_latest_version, - release_versions=release_versions) + geany_plugins_latest_version=geany_plugins_latest_version, + release_versions=release_versions, + plugins_release_versions=plugins_release_versions)
Modified: latest_version/fixtures/first_plugins_version.json 12 lines changed, 12 insertions(+), 0 deletions(-) =================================================================== @@ -0,0 +1,12 @@ +[ + { + "model": "latest_version.latestversion", + "pk": 2, + "fields": { + "name": "Geany-Plugins", + "version": "1.36.0", + "github_link": "/commits/1.36.0", + "release_date": "2020-09-28T14:12:00Z" + } + } +]
Modified: latest_version/migrations/0002_latestversion_name.py 19 lines changed, 19 insertions(+), 0 deletions(-) =================================================================== @@ -0,0 +1,19 @@ +# Generated by Django 2.2.16 on 2020-09-27 21:36 + +from django.db import migrations, models + + +class Migration(migrations.Migration): + + dependencies = [ + ('latest_version', '0001_initial'), + ] + + operations = [ + migrations.AddField( + model_name='latestversion', + name='name', + field=models.CharField(default='Geany', max_length=50, unique=True), + preserve_default=False, + ), + ]
Modified: latest_version/models.py 9 lines changed, 2 insertions(+), 7 deletions(-) =================================================================== @@ -17,6 +17,7 @@
class LatestVersion(models.Model):
+ name = models.CharField(max_length=50, unique=True) version = models.CharField(max_length=50, verbose_name='Latest Geany version') release_date = models.DateTimeField() github_link = models.CharField( @@ -28,16 +29,10 @@ class Meta: verbose_name = 'Latest Version' verbose_name_plural = 'Latest Version'
- # ---------------------------------------------------------------------- - def save(self, *args, **kwargs): # pylint: disable=signature-differs - """Save but replace the existing row instead of adding a new one""" - self.id = 1 # pylint: disable=invalid-name,attribute-defined-outside-init - super().save(*args, **kwargs) - # ---------------------------------------------------------------------- def delete(self, using=None, keep_parents=False): """Never delete anything"""
# ---------------------------------------------------------------------- def __str__(self): - return 'Geany {}'.format(self.version) + return '{} {}'.format(self.name, self.version)
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 19 lines changed, 15 insertions(+), 4 deletions(-) =================================================================== @@ -1,5 +1,4 @@ -Releases -========== +## Geany Releases
Distribution | File | GPG Signature | GPG Key ----------------- | ------------- | ------------- | ------------- @@ -11,10 +10,19 @@ 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/%7B%7B plugins_release_versions.source_gzip_version }}) | [{{ plugins_release_versions.source_gzip_version }}.sig](https://plugins.geany.org/geany-plugins/%7B%7B 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/%7B%7B plugins_release_versions.source_bzip2_version }}) | [{{ plugins_release_versions.source_bzip2_version }}.sig](https://plugins.geany.org/geany-plugins/%7B%7B 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/%7B%7B plugins_release_versions.windows_version }}) | [{{ plugins_release_versions.windows_version }}.sig](https://plugins.geany.org/geany-plugins/%7B%7B plugins_release_versions.windows_version }}.sig) ([Instructions][4]) | [frlan-pubkey.txt][6] +Mac OSX | (included in `{{ release_versions.macos_version }}` above) | - | - + +[Release notes for Geany-Plugins {{ geany_plugins_latest_version.version }}][7]
For more details, see the [plugin page][5].
@@ -28,9 +36,12 @@ 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 +[7]: https://raw.githubusercontent.com/geany/geany-plugins/%7B%7B geany_plugins_latest_version.version }}/NEWS
-------------- This E-Mail was brought to you by github_commit_mail.py (Source: https://github.com/geany/infrastructure).