Line | |
---|
1 | from XDR import * |
---|
2 | |
---|
3 | ########################### |
---|
4 | # INITIALIZATION |
---|
5 | |
---|
6 | init() |
---|
7 | |
---|
8 | ## |
---|
9 | # |
---|
10 | grid_names_list = [] |
---|
11 | grid_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 |
---|
16 | nb_grids = 0 |
---|
17 | nb_dims = 0 |
---|
18 | for 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 | |
---|
29 | if 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) |
---|
33 | setValue(grid_names_list, "grid_names_list") |
---|
34 | |
---|
35 | finish() |
---|
36 | |
---|
37 | |
---|
Note: See
TracBrowser
for help on using the repository browser.