1#!/usr/bin/env python 2#coding=utf-8 3import onelab 4 5modelName = 'coin' 6 7OL = onelab.client() 8print('\nStarting METAMODEL - Action = %s' %(OL.getString('python/Action'))) 9 10print __file__ 11 12A = OL.defineNumber('A', value=10) 13B = OL.defineNumber('Group/B', value=0, min = -10, max = 10, step = 1) 14C = OL.defineNumber('Group/C', value=2, choices = [0, 1, 2, 3], attributes={'Highlight':'Pink'}) 15D = OL.defineNumber('Group/D', value=3, labels = {0:'zero', 1:'un', 2:'deux', 3:'trois'}, attributes={'Highlight':'Blue'}) 16 17OL.reloadGeometry(modelName + '.geo') 18OL.preProcess(modelName + '.txt.ol') 19 20if OL.action == 'compute' : 21 OL.mesh(modelName + '.msh') 22 23#OL.run('gmsh', 'gmsh ' + modelName + '.geo -2') 24#OL.mergeFile(modelName + '.msh') 25 26OL.run('subclient', './sub.py','') 27 28OL.show('A') 29OL.addNumberChoice('A',1.234) 30OL.addNumberChoice('A',2.345) 31OL.addNumberChoice('A',3.456) 32OL.show('A') 33OL.setNumber('A', choices=[]) 34OL.show('A') 35 36#utf-8 are allowed everywhere 37#(should be prefixed by 'u' in python 2, not required in python 3) 38#Omega = OL.getString(u'Ω', u'∫(∂φ/∂α)³dx', help=u'ask someone@universe.org', 39#choices = ['oui', 'non', u'peut-être']) 40 41 42 43 44