|
|
|
@ -21,7 +21,7 @@ from soaplib.serializers.clazz import Array, ClassSerializer
|
|
|
|
|
from soaplib.service import rpc, DefinitionBase
|
|
|
|
|
|
|
|
|
|
from calculate.api.server.api_types import ReturnedMessage
|
|
|
|
|
from calculate.api.server.api_types import ChoiceValue, Table, Option, Field, \
|
|
|
|
|
from calculate.api.server.api_types import ChoiceValue, Table, Field, \
|
|
|
|
|
GroupField, ViewInfo
|
|
|
|
|
|
|
|
|
|
from calculate.api.server.baseClass import Basic
|
|
|
|
@ -231,9 +231,12 @@ class ApiWsdl:
|
|
|
|
|
return [returnmess]
|
|
|
|
|
|
|
|
|
|
@rpc(Integer, Integer, Boolean, _returns = ViewInfo)
|
|
|
|
|
def test_view (self, sid, step, expert = None):
|
|
|
|
|
def test_view (self, sid, step, expert):
|
|
|
|
|
print '%%%%%% test_view, step', step
|
|
|
|
|
if step == 0 or not step:
|
|
|
|
|
print "expert = ", expert
|
|
|
|
|
if step == 7:
|
|
|
|
|
step = None
|
|
|
|
|
if step == 0 or step == -1:
|
|
|
|
|
view = ViewInfo(groups=[])
|
|
|
|
|
|
|
|
|
|
group = GroupField(name=_("TEST_METHOD"),nextlabel="To step 2",last=False)
|
|
|
|
@ -244,9 +247,6 @@ class ApiWsdl:
|
|
|
|
|
label = _("YOUR NAME: "),
|
|
|
|
|
type = "str",
|
|
|
|
|
value = '',
|
|
|
|
|
opt = Option(shortopt="-n",
|
|
|
|
|
longopt="--name",
|
|
|
|
|
metavalue="NAME"),
|
|
|
|
|
help = \
|
|
|
|
|
_("Please, enter your name"),
|
|
|
|
|
element = "input"))
|
|
|
|
@ -256,8 +256,6 @@ class ApiWsdl:
|
|
|
|
|
#type = "int",
|
|
|
|
|
type = "int",
|
|
|
|
|
value = '55',
|
|
|
|
|
opt = Option(longopt="--times",
|
|
|
|
|
metavalue="TIMES"),
|
|
|
|
|
help = \
|
|
|
|
|
_("Enter times"),
|
|
|
|
|
#uncompatible = 'Tool tip text',
|
|
|
|
@ -267,8 +265,6 @@ class ApiWsdl:
|
|
|
|
|
label = _("select ISO"),
|
|
|
|
|
value = '/var/calculate',
|
|
|
|
|
type = 'files',
|
|
|
|
|
opt = Option(longopt="--times",
|
|
|
|
|
metavalue="TIMES"),
|
|
|
|
|
help = \
|
|
|
|
|
_("Enter times"),
|
|
|
|
|
element = "openfile"))
|
|
|
|
@ -279,16 +275,12 @@ class ApiWsdl:
|
|
|
|
|
comments = ['first', 'second'],
|
|
|
|
|
value = '/home/guest/1',
|
|
|
|
|
type = 'files',
|
|
|
|
|
opt = Option(longopt="--times",
|
|
|
|
|
metavalue="TIMES"),
|
|
|
|
|
help = \
|
|
|
|
|
_("Enter times"),
|
|
|
|
|
element = "file"))
|
|
|
|
|
group.fields.append(Field(
|
|
|
|
|
name = "Partition_table",
|
|
|
|
|
label = _("Mount Points: "),
|
|
|
|
|
opt = Option(longopt="--times",
|
|
|
|
|
metavalue="TIMES"),
|
|
|
|
|
element = "table",
|
|
|
|
|
type = 'writable',
|
|
|
|
|
# Table
|
|
|
|
@ -319,13 +311,17 @@ class ApiWsdl:
|
|
|
|
|
name = "Steps",
|
|
|
|
|
element = "table",
|
|
|
|
|
type = 'steps',
|
|
|
|
|
label = 'Brief preview',
|
|
|
|
|
help = '<b><i>help</b></i>',
|
|
|
|
|
value = 'install',
|
|
|
|
|
# Table
|
|
|
|
|
listvalue = ['go-previous',' ','system-log-out'],
|
|
|
|
|
tablevalue = Table(
|
|
|
|
|
head = ['Табличка','Второй шаг','Завершение'],
|
|
|
|
|
fields = ['calculate','cl-install-gui','calculate'],
|
|
|
|
|
body = [['times','name','isopath','Partition_table','',\
|
|
|
|
|
'boolvariable2','boolvariable', 'combovariable', \
|
|
|
|
|
'combovariable2'],\
|
|
|
|
|
'boolvariable2','boolvariable', 'combovariable', \
|
|
|
|
|
'combovariable2'],\
|
|
|
|
|
['radiovariable2','radiovariable','comboEdit1', \
|
|
|
|
|
'comboEdit2', 'multichoice_add', 'multichoice'], \
|
|
|
|
|
['comboLang']]
|
|
|
|
@ -335,8 +331,6 @@ class ApiWsdl:
|
|
|
|
|
name = "expert_open",
|
|
|
|
|
label = _("Press for advanced settings..."),
|
|
|
|
|
type = "label",
|
|
|
|
|
opt = Option(longopt="--bot",
|
|
|
|
|
metavalue="BOT"),
|
|
|
|
|
help = \
|
|
|
|
|
"you not human? This is a anti-bot test",
|
|
|
|
|
value = 'open',
|
|
|
|
@ -345,6 +339,7 @@ class ApiWsdl:
|
|
|
|
|
name = "boolvariable",
|
|
|
|
|
label = "you BOT?",
|
|
|
|
|
type = "bool",
|
|
|
|
|
value = 'on',
|
|
|
|
|
default = True,
|
|
|
|
|
help = \
|
|
|
|
|
"you not human? This is a anti-bot test",
|
|
|
|
@ -384,8 +379,6 @@ class ApiWsdl:
|
|
|
|
|
name = "expert_close",
|
|
|
|
|
label = _("Press for advanced settings..."),
|
|
|
|
|
type = "label",
|
|
|
|
|
opt = Option(longopt="--bot",
|
|
|
|
|
metavalue="BOT"),
|
|
|
|
|
help = \
|
|
|
|
|
"you not human? This is a anti-bot test",
|
|
|
|
|
value = 'close',
|
|
|
|
@ -393,8 +386,6 @@ class ApiWsdl:
|
|
|
|
|
#group.fields.append(Field(
|
|
|
|
|
#name = "Partition_table2",
|
|
|
|
|
#label = _("Mount Points: "),
|
|
|
|
|
#opt = Option(longopt="--times",
|
|
|
|
|
#metavalue="TIMES"),
|
|
|
|
|
#element = "table",
|
|
|
|
|
##type = 'writable',
|
|
|
|
|
## Table
|
|
|
|
@ -425,39 +416,36 @@ class ApiWsdl:
|
|
|
|
|
#name = "button_view1",
|
|
|
|
|
#label = _("Next Step"),
|
|
|
|
|
#value = 'test_view',
|
|
|
|
|
#opt = Option(longopt="--bot",
|
|
|
|
|
#metavalue="BOT"),
|
|
|
|
|
#element = "button"))
|
|
|
|
|
|
|
|
|
|
elif step == 1:
|
|
|
|
|
view = ViewInfo(groups=[])
|
|
|
|
|
if step == 1 or step == -1:
|
|
|
|
|
if not 'view' in locals():
|
|
|
|
|
view = ViewInfo(groups=[])
|
|
|
|
|
else:
|
|
|
|
|
view.groups.append(group)
|
|
|
|
|
|
|
|
|
|
group = GroupField(name=_("TEST_METHOD"),nextlabel=_("Next"))
|
|
|
|
|
group = GroupField(name=_("Other Settings"),nextlabel=_("Next"))
|
|
|
|
|
group.fields = []
|
|
|
|
|
|
|
|
|
|
#group.fields.append(Field(
|
|
|
|
|
#name = "radiovariable",
|
|
|
|
|
#label = "check city: ",
|
|
|
|
|
#choice = ['Moscow','Piter','New York','London'],
|
|
|
|
|
#type = "str",
|
|
|
|
|
##value = 'London',
|
|
|
|
|
#opt = Option(longopt="--bot",
|
|
|
|
|
#metavalue="BOT"),
|
|
|
|
|
#help = \
|
|
|
|
|
#"you not human? This is a anti-bot test",
|
|
|
|
|
#element = "radio"))
|
|
|
|
|
#group.fields.append(Field(
|
|
|
|
|
#name = "radiovariable2",
|
|
|
|
|
#label = "check village: ",
|
|
|
|
|
#choice = ['aaaaaa','bbbb','ccccc','dddddd'],
|
|
|
|
|
#comments = ['a','b','c','d'],
|
|
|
|
|
#type = "str",
|
|
|
|
|
#value = 'bbbb',
|
|
|
|
|
#opt = Option(longopt="--bot",
|
|
|
|
|
#metavalue="BOT"),
|
|
|
|
|
#help = \
|
|
|
|
|
#"you not human? This is a anti-bot test",
|
|
|
|
|
#element = "radio"))
|
|
|
|
|
group.fields.append(Field(
|
|
|
|
|
name = "radiovariable",
|
|
|
|
|
label = "check city: ",
|
|
|
|
|
choice = ['Moscow','Piter','New York','London'],
|
|
|
|
|
type = "str",
|
|
|
|
|
#value = 'London',
|
|
|
|
|
help = \
|
|
|
|
|
"you not human? This is a anti-bot test",
|
|
|
|
|
element = "radio"))
|
|
|
|
|
group.fields.append(Field(
|
|
|
|
|
name = "radiovariable2",
|
|
|
|
|
label = "check village: ",
|
|
|
|
|
choice = ['aaaaaa','bbbb','ccccc','dddddd'],
|
|
|
|
|
comments = ['a','b','c','d'],
|
|
|
|
|
type = "str",
|
|
|
|
|
value = 'bbbb',
|
|
|
|
|
help = \
|
|
|
|
|
"you not human? This is a anti-bot test",
|
|
|
|
|
element = "radio"))
|
|
|
|
|
group.fields.append(Field(
|
|
|
|
|
name = "comboEdit1",
|
|
|
|
|
label = "check city number: ",
|
|
|
|
@ -465,8 +453,6 @@ class ApiWsdl:
|
|
|
|
|
comments = ['Moscow','Piter','New York','London'],
|
|
|
|
|
type = "str",
|
|
|
|
|
value = 'N',
|
|
|
|
|
opt = Option(longopt="--bot",
|
|
|
|
|
metavalue="BOT"),
|
|
|
|
|
help = \
|
|
|
|
|
"you not human? This is a anti-bot test",
|
|
|
|
|
element = "combo"))
|
|
|
|
@ -476,8 +462,6 @@ class ApiWsdl:
|
|
|
|
|
choice = ['1000','10000','500000','2000000'],
|
|
|
|
|
type = "str",
|
|
|
|
|
value = '10000',
|
|
|
|
|
opt = Option(longopt="--bot",
|
|
|
|
|
metavalue="BOT"),
|
|
|
|
|
help = \
|
|
|
|
|
_("you not human? This is a anti-bot test"),
|
|
|
|
|
element = "combo"))
|
|
|
|
@ -488,82 +472,76 @@ class ApiWsdl:
|
|
|
|
|
comments = ['America','Bosniya','Chine','Denmark'],
|
|
|
|
|
type = "str",
|
|
|
|
|
listvalue = ['bb','cc'],
|
|
|
|
|
opt = Option(longopt="--bot",
|
|
|
|
|
metavalue="BOT"),
|
|
|
|
|
help = \
|
|
|
|
|
_("you not human? This is a anti-bot test"),
|
|
|
|
|
element = "multichoice_add"))
|
|
|
|
|
group.fields.append(Field(
|
|
|
|
|
name = "multichoice",
|
|
|
|
|
label = _("check population: "),
|
|
|
|
|
choice = ['1000','10000','500000','2000000','qwe','ert'],
|
|
|
|
|
type = "str",
|
|
|
|
|
listvalue = ['1000','ert'],
|
|
|
|
|
comments = ['Thousand',\
|
|
|
|
|
'Ten thousand smoothly and is less than a penny'],
|
|
|
|
|
default = False,
|
|
|
|
|
help = \
|
|
|
|
|
_("you not human? This is a anti-bot test"),
|
|
|
|
|
element = "selecttable_add"))
|
|
|
|
|
group.fields.append(Field(
|
|
|
|
|
name = "Partition_table",
|
|
|
|
|
label = _("Mount Points: "),
|
|
|
|
|
element = "table",
|
|
|
|
|
type = 'writable',
|
|
|
|
|
# Table
|
|
|
|
|
tablevalue = Table(
|
|
|
|
|
head = ['Partition','Mount Point','Filesystem', \
|
|
|
|
|
'Perform format','Label','Size'],
|
|
|
|
|
body = [['/dev/sda1','swap','swap','off',None,'4G'],\
|
|
|
|
|
['/dev/sda2','/','reiserfs','on','CLD','10G'],\
|
|
|
|
|
['/dev/sda3','/var/calculate','ext4','off',None,'30G']],
|
|
|
|
|
values = [ChoiceValue(
|
|
|
|
|
typefield = 'combo',
|
|
|
|
|
values = ['/dev/sda1','/dev/sda2','/dev/sda3'],
|
|
|
|
|
onChanged = ['nothing',None,'get_body','get_body',\
|
|
|
|
|
'get_body','get_body']),
|
|
|
|
|
|
|
|
|
|
ChoiceValue(
|
|
|
|
|
typefield = 'comboEdit',
|
|
|
|
|
values = ['/','swap','/var/calculate']),
|
|
|
|
|
|
|
|
|
|
ChoiceValue(
|
|
|
|
|
typefield = 'multichoice_add',
|
|
|
|
|
values = ['swap','reiserfs','ext4']),
|
|
|
|
|
|
|
|
|
|
ChoiceValue(
|
|
|
|
|
typefield = 'check',
|
|
|
|
|
values = ['on','off'])]
|
|
|
|
|
)))
|
|
|
|
|
if expert:
|
|
|
|
|
group.fields.append(Field(
|
|
|
|
|
name = "expert_open",
|
|
|
|
|
label = _("Press for advanced settings..."),
|
|
|
|
|
type = "label",
|
|
|
|
|
opt = Option(longopt="--bot",
|
|
|
|
|
metavalue="BOT"),
|
|
|
|
|
help = \
|
|
|
|
|
"you not human? This is a anti-bot test",
|
|
|
|
|
value = 'open',
|
|
|
|
|
element = "expert"))
|
|
|
|
|
group.fields.append(Field(
|
|
|
|
|
name = "multichoice",
|
|
|
|
|
label = _("check population: "),
|
|
|
|
|
choice = ['1000','10000','500000','2000000','qwe','ert'],
|
|
|
|
|
type = "str",
|
|
|
|
|
listvalue = ['qwe','ert'],
|
|
|
|
|
opt = Option(longopt="--bot",
|
|
|
|
|
metavalue="BOT"),
|
|
|
|
|
comments = ['Thousand',\
|
|
|
|
|
'Ten thousand smoothly and is less than a penny'],
|
|
|
|
|
default = False,
|
|
|
|
|
help = \
|
|
|
|
|
_("you not human? This is a anti-bot test"),
|
|
|
|
|
element = "selecttable_add"))
|
|
|
|
|
group.fields.append(Field(
|
|
|
|
|
name = "Partition_table",
|
|
|
|
|
label = _("Mount Points: "),
|
|
|
|
|
opt = Option(longopt="--times",
|
|
|
|
|
metavalue="TIMES"),
|
|
|
|
|
element = "table",
|
|
|
|
|
type = 'writable',
|
|
|
|
|
# Table
|
|
|
|
|
tablevalue = Table(
|
|
|
|
|
head = ['Partition','Mount Point','Filesystem', \
|
|
|
|
|
'Perform format','Label','Size'],
|
|
|
|
|
body = [['/dev/sda1','swap','swap','off',None,'4G'],\
|
|
|
|
|
['/dev/sda2','/','reiserfs','on','CLD','10G'],\
|
|
|
|
|
['/dev/sda3','/var/calculate','ext4','off',None,'30G']],
|
|
|
|
|
values = [ChoiceValue(
|
|
|
|
|
typefield = 'combo',
|
|
|
|
|
values = ['/dev/sda1','/dev/sda2','/dev/sda3'],
|
|
|
|
|
onChanged = ['nothing',None,'get_body','get_body','get_body','get_body']),
|
|
|
|
|
|
|
|
|
|
ChoiceValue(
|
|
|
|
|
typefield = 'comboEdit',
|
|
|
|
|
values = ['/','swap','/var/calculate']),
|
|
|
|
|
|
|
|
|
|
ChoiceValue(
|
|
|
|
|
typefield = 'multichoice_add',
|
|
|
|
|
values = ['swap','reiserfs','ext4']),
|
|
|
|
|
|
|
|
|
|
ChoiceValue(
|
|
|
|
|
typefield = 'check',
|
|
|
|
|
values = ['on','off'])]
|
|
|
|
|
)))
|
|
|
|
|
else:
|
|
|
|
|
group.fields.append(Field(
|
|
|
|
|
name = "expert_close",
|
|
|
|
|
label = _("Press for advanced settings..."),
|
|
|
|
|
type = "label",
|
|
|
|
|
opt = Option(longopt="--bot",
|
|
|
|
|
metavalue="BOT"),
|
|
|
|
|
help = \
|
|
|
|
|
"you not human? This is a anti-bot test",
|
|
|
|
|
value = 'close',
|
|
|
|
|
element = "expert"))
|
|
|
|
|
elif step == 2:
|
|
|
|
|
view = ViewInfo(groups=[])
|
|
|
|
|
if step == 2 or step == -1:
|
|
|
|
|
if not 'view' in locals():
|
|
|
|
|
view = ViewInfo(groups=[])
|
|
|
|
|
else:
|
|
|
|
|
view.groups.append(group)
|
|
|
|
|
|
|
|
|
|
group = GroupField(name=_("Gratulations!"),nextlabel=_("Done"),last=True)
|
|
|
|
|
group = GroupField(name=_("Gratulations!"),last=True)
|
|
|
|
|
group.fields = []
|
|
|
|
|
|
|
|
|
|
group.fields.append(Field(
|
|
|
|
@ -584,9 +562,7 @@ class ApiWsdl:
|
|
|
|
|
label = "check language: ",
|
|
|
|
|
choice = ['Russian','English'],
|
|
|
|
|
type = "str",
|
|
|
|
|
#value = 'London',
|
|
|
|
|
opt = Option(longopt="--bot",
|
|
|
|
|
metavalue="BOT"),
|
|
|
|
|
value = 'Russian',
|
|
|
|
|
help = \
|
|
|
|
|
"you not human? This is a anti-bot test",
|
|
|
|
|
element = "combo"))
|
|
|
|
@ -601,5 +577,5 @@ class ApiWsdl:
|
|
|
|
|
#@Dec.gui('Api', 'APITEST', \
|
|
|
|
|
#'/usr/share/wallpapers/Horos/contents/screenshot.png,system-log-out')
|
|
|
|
|
#def apitest ( self, l, t):
|
|
|
|
|
#print '==>', l
|
|
|
|
|
#print '++>', t
|
|
|
|
|
#print '==>', l
|
|
|
|
|
#print '++>', t
|