Révision 3429
TXM/trunk/org.txm.groovy.core/src/groovy/org/txm/macro/annotation/ImportWordPropertiesFromTableMacro.groovy (revision 3429) | ||
---|---|---|
9 | 9 |
|
10 | 10 |
import groovy.transform.Field |
11 | 11 |
|
12 |
import org.txm.core.preferences.TBXPreferences |
|
12 | 13 |
import org.txm.rcp.swt.widget.parameters.* |
13 | 14 |
|
14 | 15 |
@Field @Option(name="tsvFile", usage="The annotation TSV file", widget="FileOpen", required=true, def="") |
... | ... | |
23 | 24 |
if (!ParametersDialog.open(this)) return; |
24 | 25 |
|
25 | 26 |
println "Importing the $properties properties in the $selection corpus" |
26 |
println "selection="+selection |
|
27 |
println "sel class="+selection.getClass() |
|
28 |
println "sel project="+selection.getParent() |
|
29 |
println "sel name="+selection.getName() |
|
30 | 27 |
|
31 | 28 |
File inputDirectory = new File(selection.getParent().getProjectDirectory(), "txm/"+selection.getName()) |
32 | 29 |
|
... | ... | |
37 | 34 |
, "properties": properties |
38 | 35 |
, "debug":debug]) |
39 | 36 |
|
40 |
org.txm.rcp.commands.workspace.UpdateCorpus.update(selection, false) |
|
37 |
org.txm.rcp.commands.workspace.UpdateCorpus.update(selection, TBXPreferences.getInstance().getBoolean(TBXPreferences.UPDATEEDITIONS)) |
TXM/trunk/org.txm.groovy.core/src/groovy/org/txm/macro/annotation/InjectWordPropTableMacro.groovy (revision 3429) | ||
---|---|---|
79 | 79 |
no++; |
80 | 80 |
} |
81 | 81 |
|
82 |
println "Injecting..." |
|
82 |
println "Injecting properties..."
|
|
83 | 83 |
//for (String textid : injections.keySet()) { |
84 |
for (File currentXMLFile : inputDirectory.listFiles().sort{ it.name }) { |
|
84 |
def files = inputDirectory.listFiles().sort{ it.name } |
|
85 |
ConsoleProgressBar cpb = new ConsoleProgressBar(files.size()) |
|
86 |
for (File currentXMLFile : files) { |
|
87 |
cpb.tick() |
|
85 | 88 |
if (currentXMLFile.isDirectory()) continue; |
86 | 89 |
if (currentXMLFile.isHidden()) continue; |
87 | 90 |
|
... | ... | |
101 | 104 |
currentXMLFile = tmp; |
102 | 105 |
} |
103 | 106 |
def builder = new AnnotationInjectionFilter(currentXMLFile, injections[textid], properties, debug) |
104 |
println "injecting in $currentXMLFile $properties" |
|
107 |
if (debug) println "injecting in $currentXMLFile $properties"
|
|
105 | 108 |
builder.process(new File(outputDirectory, filename)); |
106 | 109 |
|
107 | 110 |
if (tmp != null) tmp.delete(); // tmp != null if inputdir == outputir |
108 | 111 |
|
109 |
println ""+builder.n+" lines injected." |
|
112 |
if (debug) println ""+builder.n+" lines injected."
|
|
110 | 113 |
} else { |
111 | 114 |
if (!outputDirectory.equals(inputDirectory)) { |
112 | 115 |
println "copying file $currentXMLFile" |
... | ... | |
115 | 118 |
} |
116 | 119 |
} |
117 | 120 |
|
118 |
println "New XML-TXM files are saved in ${outputDirectory}." |
|
121 |
cpb.done() |
|
122 |
|
|
123 |
println "New XML-TXM files are saved in ${outputDirectory}." |
TXM/trunk/org.txm.groovy.core/src/groovy/org/txm/macro/annotation/BuildWordPropTableMacro.groovy (revision 3429) | ||
---|---|---|
185 | 185 |
writer.flush() |
186 | 186 |
} |
187 | 187 |
println "Saved in "+tsvFile.getAbsolutePath() |
188 |
writer.close() |
|
188 |
writer.close() |
|
189 |
|
|
190 |
concordance.delete() |
TXM/trunk/org.txm.groovy.core/src/groovy/org/txm/macro/annotation/ExportWordPropertiesToTableMacro.groovy (revision 3429) | ||
---|---|---|
185 | 185 |
writer.flush() |
186 | 186 |
} |
187 | 187 |
println "Saved in "+tsvFile.getAbsolutePath() |
188 |
writer.close() |
|
188 |
writer.close() |
|
189 |
|
|
190 |
concordance.delete() |
TXM/trunk/org.txm.rcp/plugin.xml (revision 3429) | ||
---|---|---|
521 | 521 |
</command> |
522 | 522 |
<separator |
523 | 523 |
name="menu.file.import.separator.end" |
524 |
visible="false">
|
|
524 |
visible="true">
|
|
525 | 525 |
</separator> |
526 | 526 |
<menu |
527 | 527 |
id="menu.file.import.properties" |
Formats disponibles : Unified diff