Go to most recent revision | Details | Last modification | View Log | RSS feed
Rev | Author | Line No. | Line |
---|---|---|---|
23 | reyssat | 1 | wims_prefix=class user tmp |
2 | !if robot isin $session |
||
3 | !exit |
||
4 | !endif |
||
49 | bpr | 5 | !sh cd $wims_home/$wims_sesdir ; mkdir -p latex2wims |
6 | !sh mkdir -p $wims_home/$wims_sesdir/getfile/ ; cp modules/$module/latex2wimsdoc.pdf $wims_home/$wims_sesdir/getfile/ |
||
7 | |||
8 | |||
23 | reyssat | 9 | !if $wims_developer!=$empty |
10 | !goto debut |
||
11 | !endif |
||
12 | !read auth |
||
13 | !if $wims_developer=$empty |
||
14 | !exit |
||
15 | !endif |
||
16 | |||
17 | :debut |
||
18 | !default execut=0 |
||
19 | !if / isin $wims_deposit or .. isin $wims_deposit |
||
20 | !exit |
||
21 | !endif |
||
920 | bpr | 22 | style=!record 0 of style.css |
23 | reyssat | 23 | wims =!record 0 of wims.sty |
24 | fichier_test=!record 0 of fichier_test.tex |
||
25 | !filewrite getfile/style.css $style |
||
26 | !filewrite getfile/wims.sty $wims |
||
27 | !filewrite getfile/fichier_test.tex $fichier_test |
||
28 | |||
29 | |||
30 | !if $wims_deposit!=noname.file and $wims_deposit!=$empty |
||
31 | !sh cd $wims_home/$wims_sesdir\ |
||
32 | mkdir -p latex2wims\ |
||
33 | mkdir -p getfile\ |
||
34 | mv user-deposit latex2wims/$wims_deposit |
||
35 | !endif |
||
36 | |||
37 | !ifval $exemple=1 |
||
38 | style=!record 0 of style.css |
||
39 | wims =!record 0 of wims.sty |
||
40 | fichier_test=!record 0 of fichier_test.tex |
||
41 | !filewrite wimshome/$wims_sesdir/latex2wims/style.css $style |
||
42 | !filewrite wimshome/$wims_sesdir/latex2wims/wims.sty $wims |
||
43 | !filewrite wimshome/$wims_sesdir/latex2wims/fichier_test.tex $fichier_test |
||
44 | !!!reset exemple |
||
45 | !endif |
||
46 | |||
47 | # Enregistrer |
||
48 | wims_module_log=$httpd_REMOTE_ADDR depose $wims_deposit |
||
49 | |||
50 | # Quels sont les fichiers existants ? |
||
51 | test=!sh cd $wims_home; find $wims_sesdir/latex2wims -type f |
||
52 | fichiers=!replace internal / by , in $test |
||
53 | fichiers=!column -1 of $fichiers |
||
54 | |||
55 | Fichiers=!replace internal , by $ $ in $fichiers |
||
56 | cnt_fichier=!itemcnt $fichiers |
||
57 | !if $cnt_fichier >0 |
||
58 | date=!sh cd $wims_home/$wims_sesdir/latex2wims; ls -al $Fichiers | awk '{ print $$6 " " $$7 " " $$8 }' |
||
59 | date=!trim $date |
||
60 | date= !lines2items $date |
||
61 | !endif |
||
62 | |||
63 | !if $cnt_fichier=1 |
||
64 | principal=1 |
||
65 | !endif |
||
66 | |||
67 | |||
68 | !if $execut=2 and $cnt_fichier=0 |
||
69 | error=$error fichier |
||
70 | execut=1 |
||
71 | !endif |
||
72 | |||
73 | !if $execut=2 and $principal=$empty |
||
74 | error = $error principal |
||
75 | execut=1 |
||
76 | !endif |
||
77 | !if $execut=2 and ($document=$empty or $document=$choix) |
||
78 | error = $error document |
||
79 | execut=1 |
||
80 | !endif |
||
81 | |||
82 | !if $error!=$empty |
||
83 | !exit |
||
84 | !endif |
||
85 | Document dans le compte Modtool |
||
86 | |||
87 | !if $wims_developer!=$empty |
||
88 | list_mod=!sh ls $wims_home/public_html/modules/devel/$wims_developer |
||
89 | list_mod=!words2items $list_mod |
||
90 | list_module= |
||
91 | !for a in $list_mod |
||
92 | category = !module category devel/$wims_developer/$a |
||
93 | !if document isin $category |
||
94 | list_module=!append item $a to $list_module |
||
95 | !endif |
||
96 | !next |
||
97 | !if $list_module=$empty |
||
98 | error = $error documentempty |
||
99 | !endif |
||
100 | !endif |
||
101 | !if $principal!=$empty and ($execut=2 or $execut=3) and $document!=$empty and $document!=$choix |
||
102 | execut=3 |
||
103 | !if $confirm=0 |
||
104 | auth_name1=!word 2 of $auth_name |
||
105 | fichier_p=!item $principal of $fichiers |
||
106 | !!!mexec dos2unix $fichier_p |
||
49 | bpr | 107 | docdir=$wims_home/public_html/modules/devel/$wims_developer/$document |
23 | reyssat | 108 | !sh rm -r $docdir/doc/1/* ; mkdir -p $docdir/doc/1/src |
109 | dir=$wims_home/$wims_sesdir/latex2wims/ |
||
110 | !mexec latex2wims.pl --dir=$dir --docdir=$docdir --author=$auth_name1 --email=$auth_email --worksheet=$wksheet --verbose=1 $fichier_p |
||
111 | |||
112 | |||
113 | images=!sh cd $wims_home\ |
||
114 | ls $wims_sesdir/latex2wims/* |
||
115 | images=!replace internal / by , in $images |
||
116 | images=!column -1 of $images |
||
117 | cnt_images=!itemcnt $images |
||
118 | !for i = 1 to $cnt_images |
||
119 | !if .css isin $(images[$i]) or .sty isin $(images[$i]) or .tex isin $(images[$i]) |
||
120 | images=!replace item number $i by in $images |
||
121 | !endif |
||
122 | !next |
||
123 | |||
124 | images=!items2words $images |
||
125 | images=!trim $images |
||
126 | images=!singlespace $images |
||
127 | !sh mkdir -p $docdir/doc/1/files\ |
||
128 | for a in $images ; do cp $wims_home/$wims_sesdir/latex2wims/$$a $docdir/doc/1/files/$$a ; done\ |
||
129 | cd $docdir \ |
||
130 | src2def 2>/dev/null |
||
131 | !else |
||
132 | !if $confirm=1 |
||
133 | execut=1 |
||
134 | !reset confirm |
||
135 | !else |
||
136 | execut=3 |
||
137 | !endif |
||
138 | !endif |
||
139 | !endif |
||
140 |