Statistics
| Revision:

root / tmp / org.txm.groovy.core / src / groovy / org / txm / macro / transcription / TextTranscription2TRSMacro.groovy @ 499

History | View | Annotate | Download (1.7 kB)

1
// Copyright © 2010-2013 ENS de Lyon.
2
// Copyright © 2007-2010 ENS de Lyon, CNRS, INRP, University of
3
// Lyon 2, University of Franche-Comté, University of Nice
4
// Sophia Antipolis, University of Paris 3.
5
//
6
// The TXM platform is free software: you can redistribute it
7
// and/or modify it under the terms of the GNU General Public
8
// License as published by the Free Software Foundation,
9
// either version 2 of the License, or (at your option) any
10
// later version.
11
//
12
// The TXM platform is distributed in the hope that it will be
13
// useful, but WITHOUT ANY WARRANTY; without even the implied
14
// warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR
15
// PURPOSE. See the GNU General Public License for more
16
// details.
17
//
18
// You should have received a copy of the GNU General
19
// Public License along with the TXM platform. If not, see
20
// http://www.gnu.org/licenses.
21

    
22
package org.txm.macro.transcription
23

    
24
import org.kohsuke.args4j.*
25

    
26
import groovy.transform.Field
27

    
28
import org.txm.rcp.swt.widget.parameters.*
29

    
30

    
31
@Field @Option(name="odtDir", usage="Dossier qui contient les fichiers ODT", widget="Folder", required=true, def="")
32
File odtDir;
33

    
34
@Field @Option(name="debug", usage="Don't clean files, 'y' to enable debug", widget="String", required=false, def="n")
35
def debug = "n";
36

    
37
if (!ParametersDialog.open(this)) return;
38

    
39
File outDir = new File(odtDir, "out") // write result in "out" folder
40

    
41
outDir.deleteDir()
42
outDir.mkdir()
43

    
44
println "out: $outDir"
45
println "odtDir: $odtDir"
46

    
47
println "DEBUG: "+("y" == debug || "yes" == debug)
48

    
49
if (!odtDir.exists()) {
50
        println "$odtDir does not exists. Aborting"
51
}
52
def monitor = null
53
TextTranscription2TRS trs = new TextTranscription2TRS(outDir, "y" == debug, monitor)
54
trs.process(odtDir)