mirror of
https://github.com/freedombox/FreedomBox.git
synced 2026-01-21 07:55:00 +00:00
Create an enum for different package types
Signed-off-by: Joseph Nuthalapati <njoseph@thoughtworks.com> Reviewed-by: James Valleroy <jvalleroy@mailbox.org>
This commit is contained in:
parent
0b1b8157e4
commit
590ba78f89
@ -17,6 +17,8 @@
|
||||
|
||||
from django.utils.translation import ugettext_lazy as _
|
||||
|
||||
from plinth.templatetags.plinth_extras import Package
|
||||
|
||||
clients = [{
|
||||
'name':
|
||||
_('Deluge'),
|
||||
@ -24,10 +26,10 @@ clients = [{
|
||||
_('Bittorrent client written in Python/PyGTK '),
|
||||
'platforms': [{
|
||||
'type': 'web',
|
||||
'relative_path': '/deluge'
|
||||
'url': '/deluge'
|
||||
}, {
|
||||
'type': 'package',
|
||||
'format': 'deb',
|
||||
'format': Package.DEB.value,
|
||||
'name': 'deluge',
|
||||
}]
|
||||
}]
|
||||
|
||||
@ -18,7 +18,8 @@
|
||||
from django.utils.translation import ugettext_lazy as _
|
||||
|
||||
from plinth.modules.jsxc import manifest as jsxc_manifest
|
||||
from plinth.templatetags.plinth_extras import Desktop_OS, Mobile_OS, Store
|
||||
from plinth.templatetags.plinth_extras import (Desktop_OS, Mobile_OS, Package,
|
||||
Store)
|
||||
from plinth.utils import play_store_url
|
||||
|
||||
yaxim_package_id = 'org.yaxim.androidclient'
|
||||
@ -86,7 +87,7 @@ _clients = [{
|
||||
_('Gajim'),
|
||||
'platforms': [{
|
||||
'type': 'package',
|
||||
'format': 'deb',
|
||||
'format': Package.DEB.value,
|
||||
'name': 'gajim'
|
||||
}, {
|
||||
'type': 'download',
|
||||
|
||||
@ -18,7 +18,7 @@
|
||||
from django.utils.translation import ugettext_lazy as _
|
||||
|
||||
from plinth import cfg
|
||||
from plinth.templatetags.plinth_extras import Desktop_OS
|
||||
from plinth.templatetags.plinth_extras import Desktop_OS, Package
|
||||
from plinth.utils import format_lazy
|
||||
|
||||
clients = [{
|
||||
@ -34,10 +34,10 @@ clients = [{
|
||||
'platforms': [{
|
||||
'type': 'download',
|
||||
'os': Desktop_OS.WINDOWS.value,
|
||||
'url': 'http://releases.0x539.de/gobby/gobby-stable.exe'
|
||||
'url': 'https://github.com/gobby/gobby/wiki/Download'
|
||||
}, {
|
||||
'type': 'package',
|
||||
'format': 'deb',
|
||||
'format': Package.DEB.value,
|
||||
'name': 'gobby'
|
||||
}]
|
||||
}]
|
||||
|
||||
@ -17,12 +17,14 @@
|
||||
|
||||
from django.utils.translation import ugettext_lazy as _
|
||||
|
||||
from plinth.templatetags.plinth_extras import Package
|
||||
|
||||
clients = [{
|
||||
'name':
|
||||
_('JSXC'),
|
||||
'platforms': [{
|
||||
'type': 'package',
|
||||
'format': 'deb',
|
||||
'format': Package.DEB.value,
|
||||
'name': 'libjs-jsxc'
|
||||
}, {
|
||||
'type': 'web',
|
||||
|
||||
@ -17,7 +17,8 @@
|
||||
|
||||
from django.utils.translation import ugettext_lazy as _
|
||||
|
||||
from plinth.templatetags.plinth_extras import Desktop_OS, Mobile_OS, Store
|
||||
from plinth.templatetags.plinth_extras import (Desktop_OS, Mobile_OS, Package,
|
||||
Store)
|
||||
|
||||
clients = [{
|
||||
'name':
|
||||
@ -40,7 +41,7 @@ clients = [{
|
||||
'url': 'https://f-droid.org/packages/net.minetest.minetest/ '
|
||||
}, {
|
||||
'type': 'package',
|
||||
'format': 'deb',
|
||||
'format': Package.DEB.value,
|
||||
'name': 'minetest'
|
||||
}]
|
||||
}]
|
||||
|
||||
@ -17,7 +17,8 @@
|
||||
|
||||
from django.utils.translation import ugettext_lazy as _
|
||||
|
||||
from plinth.templatetags.plinth_extras import Desktop_OS, Mobile_OS, Store
|
||||
from plinth.templatetags.plinth_extras import (Desktop_OS, Mobile_OS, Package,
|
||||
Store)
|
||||
from plinth.utils import f_droid_url, play_store_url
|
||||
|
||||
plumble_package_id = 'com.morlunk.mumbleclient.free'
|
||||
@ -35,7 +36,7 @@ clients = [{
|
||||
'url': 'https://wiki.mumble.info/wiki/Main_Page'
|
||||
}, {
|
||||
'type': 'package',
|
||||
'format': 'deb',
|
||||
'format': Package.DEB.value,
|
||||
'name': 'mumble'
|
||||
}, {
|
||||
'type': 'store',
|
||||
|
||||
@ -17,7 +17,8 @@
|
||||
|
||||
from django.utils.translation import ugettext_lazy as _
|
||||
|
||||
from plinth.templatetags.plinth_extras import Desktop_OS, Mobile_OS, Store
|
||||
from plinth.templatetags.plinth_extras import (Desktop_OS, Mobile_OS, Package,
|
||||
Store)
|
||||
from plinth.utils import play_store_url
|
||||
|
||||
quasseldroid_package_id = 'com.iskrembilen.quasseldroid',
|
||||
@ -32,7 +33,7 @@ clients = [{
|
||||
'url': quassel_download_url,
|
||||
}, {
|
||||
'type': 'package',
|
||||
'format': 'deb',
|
||||
'format': Package.DEB.value,
|
||||
'name': 'quassel-client',
|
||||
}]
|
||||
}, {
|
||||
|
||||
@ -17,7 +17,7 @@
|
||||
|
||||
from django.utils.translation import ugettext_lazy as _
|
||||
|
||||
from plinth.templatetags.plinth_extras import Mobile_OS, Store
|
||||
from plinth.templatetags.plinth_extras import Mobile_OS, Package, Store
|
||||
from plinth.utils import play_store_url
|
||||
|
||||
davdroid_package_id = 'at.bitfire.davdroid'
|
||||
@ -41,7 +41,7 @@ clients = [{
|
||||
_('GNOME Calendar'),
|
||||
'platforms': [{
|
||||
'type': 'package',
|
||||
'format': 'deb',
|
||||
'format': Package.DEB.value,
|
||||
'name': 'gnome-calendar'
|
||||
}]
|
||||
}, {
|
||||
@ -59,7 +59,7 @@ clients = [{
|
||||
'calendars and address books.'),
|
||||
'platforms': [{
|
||||
'type': 'package',
|
||||
'format': 'deb',
|
||||
'format': Package.DEB.value,
|
||||
'name': 'evolution'
|
||||
}]
|
||||
}]
|
||||
|
||||
@ -17,7 +17,8 @@
|
||||
|
||||
from django.utils.translation import ugettext_lazy as _
|
||||
|
||||
from plinth.templatetags.plinth_extras import Desktop_OS, Mobile_OS, Store
|
||||
from plinth.templatetags.plinth_extras import (Desktop_OS, Mobile_OS, Package,
|
||||
Store)
|
||||
from plinth.utils import play_store_url
|
||||
|
||||
jitsi_package_id = 'org.jitsi.meet'
|
||||
@ -53,7 +54,7 @@ clients = [{
|
||||
'url': jitsi_download_url
|
||||
}, {
|
||||
'type': 'package',
|
||||
'format': 'deb',
|
||||
'format': Package.DEB.value,
|
||||
'name': 'jitsi'
|
||||
}, {
|
||||
'type': 'download',
|
||||
|
||||
@ -17,7 +17,8 @@
|
||||
|
||||
from django.utils.translation import ugettext_lazy as _
|
||||
|
||||
from plinth.templatetags.plinth_extras import Desktop_OS, Mobile_OS, Store
|
||||
from plinth.templatetags.plinth_extras import (Desktop_OS, Mobile_OS, Package,
|
||||
Store)
|
||||
from plinth.utils import f_droid_url, play_store_url
|
||||
|
||||
syncthing_package_id = 'com.nutomic.syncthingandroid'
|
||||
@ -28,11 +29,11 @@ clients = [{
|
||||
_('Syncthing'),
|
||||
'platforms': [{
|
||||
'type': 'package',
|
||||
'format': 'deb',
|
||||
'format': Package.DEB.value,
|
||||
'name': 'syncthing',
|
||||
}, {
|
||||
'type': 'package',
|
||||
'format': 'homebrew',
|
||||
'format': Package.HOMEBREW.value,
|
||||
'name': 'syncthing',
|
||||
}, {
|
||||
'type': 'download',
|
||||
|
||||
@ -170,7 +170,7 @@
|
||||
{% if platform.type == 'package' and platform.format == 'deb' %}
|
||||
<li> <strong> Debian: </strong> {{ platform.name }} </li>
|
||||
{% endif %}
|
||||
{% if platform.type == 'package' and platform.format == 'homebrew' %}
|
||||
{% if platform.type == 'package' and platform.format == 'brew' %}
|
||||
<li> <strong> HomeBrew: </strong> {{ platform.name }} </li>
|
||||
{% endif %}
|
||||
{% endfor %}
|
||||
|
||||
@ -40,6 +40,12 @@ class Store(Enum):
|
||||
GOOGLE_PLAY = 'google-play'
|
||||
|
||||
|
||||
class Package(Enum):
|
||||
DEB = 'deb'
|
||||
HOMEBREW = 'brew'
|
||||
RPM = 'rpm'
|
||||
|
||||
|
||||
def enum_values(enum):
|
||||
return [x.value for x in list(enum)]
|
||||
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user