mirror of
https://github.com/dkmstr/openuds.git
synced 2025-01-08 21:18:00 +03:00
Replaced "translatable" by "_", so messages localization is easier... (my blame this was this way ;-))
This commit is contained in:
parent
3decdf3d9e
commit
ff955738b1
@ -31,7 +31,7 @@
|
|||||||
.. moduleauthor:: Adolfo Gómez, dkmaster at dkmon dot com
|
.. moduleauthor:: Adolfo Gómez, dkmaster at dkmon dot com
|
||||||
'''
|
'''
|
||||||
|
|
||||||
from django.utils.translation import ugettext_noop as translatable, ugettext as _
|
from django.utils.translation import ugettext_noop as _, ugettext
|
||||||
from uds.core.services import Service
|
from uds.core.services import Service
|
||||||
from OVirtPublication import OVirtPublication
|
from OVirtPublication import OVirtPublication
|
||||||
from OVirtLinkedDeployment import OVirtLinkedDeployment
|
from OVirtLinkedDeployment import OVirtLinkedDeployment
|
||||||
@ -52,15 +52,15 @@ class OVirtLinkedService(Service):
|
|||||||
'''
|
'''
|
||||||
#: Name to show the administrator. This string will be translated BEFORE
|
#: Name to show the administrator. This string will be translated BEFORE
|
||||||
#: sending it to administration interface, so don't forget to
|
#: sending it to administration interface, so don't forget to
|
||||||
#: mark it as translatable (using ugettext_noop)
|
#: mark it as _ (using ugettext_noop)
|
||||||
typeName = translatable('oVirt Linked Clone')
|
typeName = _('oVirt Linked Clone')
|
||||||
#: Type used internally to identify this provider
|
#: Type used internally to identify this provider
|
||||||
typeType = 'oVirtLinkedService'
|
typeType = 'oVirtLinkedService'
|
||||||
#: Description shown at administration interface for this provider
|
#: Description shown at administration interface for this provider
|
||||||
typeDescription = translatable('oVirt Services based on templates and COW')
|
typeDescription = _('oVirt Services based on templates and COW')
|
||||||
#: Icon file used as icon for this provider. This string will be translated
|
#: Icon file used as icon for this provider. This string will be translated
|
||||||
#: BEFORE sending it to administration interface, so don't forget to
|
#: BEFORE sending it to administration interface, so don't forget to
|
||||||
#: mark it as translatable (using ugettext_noop)
|
#: mark it as _ (using ugettext_noop)
|
||||||
iconFile = 'service.png'
|
iconFile = 'service.png'
|
||||||
|
|
||||||
# Functional related data
|
# Functional related data
|
||||||
@ -74,13 +74,13 @@ class OVirtLinkedService(Service):
|
|||||||
usesCache = True
|
usesCache = True
|
||||||
#: Tooltip shown to user when this item is pointed at admin interface, none
|
#: Tooltip shown to user when this item is pointed at admin interface, none
|
||||||
#: because we don't use it
|
#: because we don't use it
|
||||||
cacheTooltip = translatable('Number of desired machines to keep running waiting for a user')
|
cacheTooltip = _('Number of desired machines to keep running waiting for a user')
|
||||||
#: If we need to generate a "Level 2" cache for this service (i.e., L1
|
#: If we need to generate a "Level 2" cache for this service (i.e., L1
|
||||||
#: could be running machines and L2 suspended machines)
|
#: could be running machines and L2 suspended machines)
|
||||||
usesCache_L2 = True
|
usesCache_L2 = True
|
||||||
#: Tooltip shown to user when this item is pointed at admin interface, None
|
#: Tooltip shown to user when this item is pointed at admin interface, None
|
||||||
#: also because we don't use it
|
#: also because we don't use it
|
||||||
cacheTooltip_L2 = translatable('Number of desired machines to keep suspended waiting for use')
|
cacheTooltip_L2 = _('Number of desired machines to keep suspended waiting for use')
|
||||||
|
|
||||||
#: If the service needs a s.o. manager (managers are related to agents
|
#: If the service needs a s.o. manager (managers are related to agents
|
||||||
#: provided by services itselfs, i.e. virtual machines with actors)
|
#: provided by services itselfs, i.e. virtual machines with actors)
|
||||||
@ -96,24 +96,31 @@ class OVirtLinkedService(Service):
|
|||||||
deployedType = OVirtLinkedDeployment
|
deployedType = OVirtLinkedDeployment
|
||||||
|
|
||||||
# Now the form part
|
# Now the form part
|
||||||
machine = gui.ChoiceField(label=translatable("Base Machine"), order = 1, tooltip = _('Service base machine'), required = True)
|
machine = gui.ChoiceField(label=_("Base Machine"), order = 1, tooltip = _('Service base machine'), required = True)
|
||||||
cluster = gui.ChoiceField(label=translatable("Cluster"), order = 2,
|
cluster = gui.ChoiceField(label=_("Cluster"), order = 2,
|
||||||
fills = {
|
fills = {
|
||||||
'callbackName' : 'ovFillResourcesFromCluster',
|
'callbackName' : 'ovFillResourcesFromCluster',
|
||||||
'function' : oVirtHelpers.getResources,
|
'function' : oVirtHelpers.getResources,
|
||||||
'parameters' : ['cluster', 'ov', 'ev']
|
'parameters' : ['cluster', 'ov', 'ev']
|
||||||
},
|
},
|
||||||
tooltip = translatable("Cluster to contain services"), required = True
|
tooltip = _("Cluster to contain services"), required = True
|
||||||
)
|
)
|
||||||
|
|
||||||
datastore = gui.ChoiceField(label = translatable("Datastore Domain"), rdonly = False, order = 3,
|
datastore = gui.ChoiceField(label = _("Datastore Domain"), rdonly = False, order = 3,
|
||||||
tooltip = translatable('Datastore domain where to publish and put incrementals'), required = True)
|
tooltip = _('Datastore domain where to publish and put incrementals'), required = True)
|
||||||
baseName = gui.TextField(label = translatable('Machine Names'), rdonly = False, order = 4, tooltip = ('Base name for clones from this machine'), required = True)
|
|
||||||
lenName = gui.NumericField(length = 1, label = translatable('Name Length'), defvalue = 5, order = 5,
|
|
||||||
tooltip = translatable('Length of numeric part for the names of this machines (betwen 3 and 6'), required = True)
|
|
||||||
|
|
||||||
display = gui.ChoiceField(label = translatable('Display'), rdonly = False, order = 6,
|
memory = gui.NumericField(label = _("Memory (Mb)"), length = 4, defvalue = 512, rdonly = False, order = 4,
|
||||||
tooltip = translatable('Display type (only for administration pourposses)'),
|
tooltip = _('Memory assigned to machines'), required = True)
|
||||||
|
|
||||||
|
memoryGuaranteed = gui.NumericField(label = _("Memory Guaranteed (Mb)"), length = 4, defvalue = 256, rdonly = False, order = 5,
|
||||||
|
tooltip = _('Physical memory guaranteed to machines'), required = True)
|
||||||
|
|
||||||
|
baseName = gui.TextField(label = _('Machine Names'), rdonly = False, order = 6, tooltip = ('Base name for clones from this machine'), required = True)
|
||||||
|
lenName = gui.NumericField(length = 1, label = _('Name Length'), defvalue = 5, order = 7,
|
||||||
|
tooltip = _('Length of numeric part for the names of this machines (betwen 3 and 6'), required = True)
|
||||||
|
|
||||||
|
display = gui.ChoiceField(label = _('Display'), rdonly = False, order = 8,
|
||||||
|
tooltip = _('Display type (only for administration pourposses)'),
|
||||||
values = [ gui.choiceItem('spice', 'Spice'),
|
values = [ gui.choiceItem('spice', 'Spice'),
|
||||||
gui.choiceItem('vnc', 'Vnc')
|
gui.choiceItem('vnc', 'Vnc')
|
||||||
],
|
],
|
||||||
|
@ -33,7 +33,7 @@ Created on Jun 22, 2012
|
|||||||
.. moduleauthor:: Adolfo Gómez, dkmaster at dkmon dot com
|
.. moduleauthor:: Adolfo Gómez, dkmaster at dkmon dot com
|
||||||
'''
|
'''
|
||||||
|
|
||||||
from django.utils.translation import ugettext_noop as translatable, ugettext as _
|
from django.utils.translation import ugettext_noop as _, ugettext
|
||||||
from uds.core.util.State import State
|
from uds.core.util.State import State
|
||||||
from uds.core.services import ServiceProvider
|
from uds.core.services import ServiceProvider
|
||||||
from OVirtLinkedService import OVirtLinkedService
|
from OVirtLinkedService import OVirtLinkedService
|
||||||
@ -68,15 +68,15 @@ class Provider(ServiceProvider):
|
|||||||
offers = [OVirtLinkedService]
|
offers = [OVirtLinkedService]
|
||||||
#: Name to show the administrator. This string will be translated BEFORE
|
#: Name to show the administrator. This string will be translated BEFORE
|
||||||
#: sending it to administration interface, so don't forget to
|
#: sending it to administration interface, so don't forget to
|
||||||
#: mark it as translatable (using ugettext_noop)
|
#: mark it as _ (using ugettext_noop)
|
||||||
typeName = translatable('oVirt Platform Provider')
|
typeName = _('oVirt Platform Provider')
|
||||||
#: Type used internally to identify this provider
|
#: Type used internally to identify this provider
|
||||||
typeType = 'oVirtPlatform'
|
typeType = 'oVirtPlatform'
|
||||||
#: Description shown at administration interface for this provider
|
#: Description shown at administration interface for this provider
|
||||||
typeDescription = translatable('oVirt platform service provider')
|
typeDescription = _('oVirt platform service provider')
|
||||||
#: Icon file used as icon for this provider. This string will be translated
|
#: Icon file used as icon for this provider. This string will be translated
|
||||||
#: BEFORE sending it to administration interface, so don't forget to
|
#: BEFORE sending it to administration interface, so don't forget to
|
||||||
#: mark it as translatable (using ugettext_noop)
|
#: mark it as _ (using ugettext_noop)
|
||||||
iconFile = 'provider.png'
|
iconFile = 'provider.png'
|
||||||
|
|
||||||
# now comes the form fields
|
# now comes the form fields
|
||||||
@ -89,7 +89,7 @@ class Provider(ServiceProvider):
|
|||||||
# If we don't indicate an order, the output order of fields will be
|
# If we don't indicate an order, the output order of fields will be
|
||||||
# "random"
|
# "random"
|
||||||
host = gui.TextField(length=64, label = _('Host'), order = 1, tooltip = _('oVirt Server IP or Hostname'), required = True)
|
host = gui.TextField(length=64, label = _('Host'), order = 1, tooltip = _('oVirt Server IP or Hostname'), required = True)
|
||||||
username = gui.TextField(length=32, label = _('Username'), order = 3, tooltip = _('User with valid privileges on oVirt, (use "user@domain" form'), required = True, defvalue='admin@internal')
|
username = gui.TextField(length=32, label = _('Username'), order = 3, tooltip = _('User with valid privileges on oVirt, (use "user@domain" form)'), required = True, defvalue='admin@internal')
|
||||||
password = gui.PasswordField(lenth=32, label = _('Password'), order = 4, tooltip = _('Password of the user of oVirt'), required = True)
|
password = gui.PasswordField(lenth=32, label = _('Password'), order = 4, tooltip = _('Password of the user of oVirt'), required = True)
|
||||||
timeout = gui.NumericField(length=3, label = _('Timeout'), defvalue = '10', order = 5, tooltip = _('Timeout in seconds of connection to VC'), required = True)
|
timeout = gui.NumericField(length=3, label = _('Timeout'), defvalue = '10', order = 5, tooltip = _('Timeout in seconds of connection to VC'), required = True)
|
||||||
macsRange = gui.TextField(length=36, label = _('Macs range'), defvalue = '52:54:00:00:00:00-52:54:00:FF:FF:FF', order = 6, rdonly = True,
|
macsRange = gui.TextField(length=36, label = _('Macs range'), defvalue = '52:54:00:00:00:00-52:54:00:FF:FF:FF', order = 6, rdonly = True,
|
||||||
|
Loading…
Reference in New Issue
Block a user