source: CPL/oasis3-mct/branches/OASIS3-MCT_2.0_branch/util/oasisgui/library/oasis3-mct/scripts/process_grids.py @ 4775

Last change on this file since 4775 was 4775, checked in by aclsce, 5 years ago
  • Imported oasis3-mct from Cerfacs svn server (not suppotred anymore).

The version has been extracted from https://oasis3mct.cerfacs.fr/svn/branches/OASIS3-MCT_2.0_branch/oasis3-mct@1818

  • Property svn:executable set to *
File size: 868 bytes
Line 
1from XDR import *
2
3###########################
4# INITIALIZATION
5
6init()
7
8##
9#
10grid_names_list = []
11grid_dims_list = []
12
13# Create the list of grid names
14# Verify that either all the dimensions are given for all grids
15# either none dimensions are given
16nb_grids = 0
17nb_dims = 0
18for grid_id in getChildrenName("gridsline"):
19    grid_name = getValue(grid_id)
20    grid_names_list.append(grid_name)
21    nb_grids += 1
22    if grid_name == "no label":
23        error("You must give a name to your grid or delete it")
24    if (len(grid_name) != 4):
25        error("Grid name must be 4 characters")
26    if getValue("dimsgrid",grid_id) == "dims_on" :
27        nb_dims += 1
28
29if nb_grids != nb_dims and nb_dims != 0:
30    error("The dimensions of the grids must be given for none or for all the grids")
31
32#print(grid_names_list)
33setValue(grid_names_list, "grid_names_list")
34
35finish()
36
37
Note: See TracBrowser for help on using the repository browser.