Rev 1204 | Go to most recent revision | Details | Last modification | View Log | RSS feed
Rev | Author | Line No. | Line |
---|---|---|---|
20 | reyssat | 1 | # Make index of subclasses for the gateway. |
2 | # No calling parameter. |
||
3 | !nocache |
||
4 | !if $wims_superclass=$empty |
||
5 | !exit |
||
6 | !endif |
||
7 | |||
8 | D_=wimshome/log/classes/$wims_superclass |
||
9 | E_=$wims_home/log/classes/$wims_superclass |
||
10 | |||
11 | levels=!sh cd $E_; find . -maxdepth 1 -mindepth 1 -type d -name '[0-9]*' | sed 's!^\./!!' |
||
12 | classes=!sh cd $E_; find . -maxdepth 2 -mindepth 2 -type d -name '1[0-9][0-9]' | sed 's!^\./!!' |
||
13 | progs=!sh cd $E_; find . -maxdepth 2 -mindepth 2 -type d -name '2[0-9][0-9]' | sed 's!^\./!!' |
||
14 | courses=!sh cd $E_; find . -maxdepth 3 -mindepth 3 -type d -name '2[0-9][0-9]*' | sed 's!^\./!!' |
||
15 | icourses=!sh cd $E_; find . -maxdepth 3 -mindepth 3 -type d -name '3[0-9][0-9]' | sed 's!^\./!!' |
||
16 | !for n_ in levels,classes,progs,courses,icourses |
||
17 | $n_=!words2items $($n_) |
||
18 | !next n_ |
||
19 | |||
20 | cp_=!append item $classes to $progs |
||
21 | cp_=!translate internal / to _ in $cp_ |
||
22 | idata= |
||
23 | !for c in $cp_ |
||
24 | rdata_$cp_= |
||
25 | idata_$cp_= |
||
26 | !next c |
||
27 | |||
28 | !for c in $levels |
||
29 | cdata_$c= |
||
30 | pdata_$c= |
||
31 | idata_$c= |
||
32 | !next c |
||
33 | |||
34 | !for c in $courses |
||
35 | c_=!translate internal / to , in $c |
||
36 | cc=!char 1 to 3 of $(c_[3]) |
||
37 | l_=$(c_[1]) |
||
38 | C_=$(c_[1])_$(c_[2]) |
||
39 | p_=$(c_[1])_$cc |
||
40 | t_=!defof class_Supervisor\ |
||
41 | class_supervisor\ |
||
42 | class_description in $D_/$c/.def |
||
43 | !distribute lines $t_ into s_,n_,t_ |
||
44 | L_=$c,$s_,$t_,$n_ |
||
45 | rdata_$l_=!append line $L_ to $(rdata_$l_) |
||
46 | rdata_$C_=!append line $L_ to $(rdata_$C_) |
||
47 | rdata_$p_=!append line $L_ to $(rdata_$p_) |
||
48 | !next c |
||
49 | |||
50 | !for c in $icourses |
||
51 | c_=!translate internal / to , in $c |
||
52 | l_=$(c_[1]) |
||
53 | p_=$(c_[1])_$(c_[2]) |
||
54 | t_=!defof class_Supervisor\ |
||
55 | class_supervisor\ |
||
56 | class_description in $D_/$c/.def |
||
57 | !distribute lines $t_ into s_,n_,t_ |
||
58 | L_=$c,$s_,$t_,$n_ |
||
59 | idata_$l_=!append line $L_ to $(idata_$l_) |
||
60 | idata_$p_=!append line $L_ to $(idata_$p_) |
||
61 | vistest=!defof class_visibility in $D_/$c/.def |
||
62 | !ifval $vistest=2 |
||
63 | idata=!append line $L_ to $idata |
||
64 | !endif |
||
65 | !next c |
||
66 | |||
67 | cdata= |
||
68 | !for c in $classes |
||
69 | c_=!translate internal / to , in $c |
||
70 | c_=!item 1 of $c_ |
||
71 | t_=!defof class_Supervisor\ |
||
72 | class_supervisor\ |
||
73 | class_description in $D_/$c/.def |
||
74 | !distribute lines $t_ into s_,n_,t_ |
||
75 | cdata=!append line $c,$s_,$t_,$n_ to $cdata |
||
76 | cdata_$c_=!append line $c,$s_,$t_,$n_ to $(cdata_$c_) |
||
77 | c_=!translate internal / to _ in $c |
||
78 | !writefile $D_/$c/courses $(rdata_$c_) |
||
79 | !next c |
||
80 | |||
81 | pdata= |
||
82 | !for c in $progs |
||
83 | c_=!translate internal / to , in $c |
||
84 | c_=!item 1 of $c_ |
||
85 | t_=!defof class_Supervisor\ |
||
86 | class_supervisor\ |
||
87 | class_description in $D_/$c/.def |
||
88 | !distribute lines $t_ into s_,n_,t_ |
||
89 | pdata=!append line $c,$s_,$t_,$n_ to $pdata |
||
90 | pdata_$c_=!append line $c,$s_,$t_,$n_ to $(pdata_$c_) |
||
91 | c_=!translate internal / to _ in $c |
||
92 | !writefile $D_/$c/courses $(rdata_$c_) |
||
93 | !writefile $D_/$c/icourses $(idata_$c_) |
||
94 | !next c |
||
95 | |||
96 | ldata= |
||
97 | !for c in $levels |
||
98 | t_=!defof class_Supervisor\ |
||
99 | class_supervisor\ |
||
100 | class_description in $D_/$c/.def |
||
101 | !distribute lines $t_ into s_,n_,t_ |
||
102 | ldata=!append line $c,$s_,$t_,$n_ to $ldata |
||
103 | !writefile $D_/$c/classes $(cdata_$c) |
||
104 | !writefile $D_/$c/programs $(pdata_$c) |
||
105 | !writefile $D_/$c/courses $(rdata_$c) |
||
106 | !writefile $D_/$c/icourses $(idata_$c) |
||
107 | !next c |
||
108 | |||
109 | !writefile $D_/levels $ldata |
||
110 | !writefile $D_/classes $cdata |
||
111 | !writefile $D_/programs $pdata |
||
112 | !writefile $D_/icourses $idata |
||
113 |