Revision 593
org.gvsig.scripting/trunk/org.gvsig.scripting/org.gvsig.scripting.app/org.gvsig.scripting.app.mainplugin/src/main/resources-plugin/scripting/lib/console/console.py | ||
---|---|---|
18 | 18 |
import traceback |
19 | 19 |
from code import InteractiveInterpreter |
20 | 20 |
from org.python.util import InteractiveConsole |
21 |
#InteractiveConsole=sys.gvSIG.classForName("org.python.util.InteractiveConsole") |
|
22 | 21 |
|
23 | 22 |
__author__ = "Don Coleman <dcoleman@chariotsolutions.com>" |
24 | 23 |
__cvsid__ = "$Id: console.py 5910 2006-06-20 10:03:31Z jmvivo $" |
... | ... | |
374 | 373 |
def __init__(self): |
375 | 374 |
self.title = "Jython" |
376 | 375 |
self.size = (600, 400) |
377 |
try: |
|
378 |
#No queremos que se salga cuando cerremos la ventana |
|
379 |
##self.setDefaultCloseOperation(WindowConstants.EXIT_ON_CLOSE) |
|
380 |
self.setDefaultCloseOperation(WindowConstants.DISPOSE_ON_CLOSE) |
|
381 |
except: |
|
382 |
# assume jdk < 1.4 |
|
383 |
self.addWindowListener(KillListener()) |
|
384 |
self.setDefaultCloseOperation(WindowConstants.DISPOSE_ON_CLOSE) |
|
376 |
self.setDefaultCloseOperation(WindowConstants.DISPOSE_ON_CLOSE) |
|
385 | 377 |
|
386 |
class KillListener(WindowAdapter): |
|
387 |
""" |
|
388 |
Handle EXIT_ON_CLOSE for jdk < 1.4 |
|
389 |
Thanks to James Richards for this method |
|
390 |
""" |
|
391 |
def windowClosed(self, evt): |
|
392 |
import java.lang.System as System |
|
393 |
System.exit(0) |
|
394 | 378 |
|
395 | 379 |
def main(): |
396 | 380 |
frame = JythonFrame() |
org.gvsig.scripting/trunk/org.gvsig.scripting/org.gvsig.scripting.app/org.gvsig.scripting.app.mainplugin/src/main/resources-plugin/scripting/scripts/libs/__init__.inf | ||
---|---|---|
1 |
[Unit] |
|
2 |
type = Script |
|
3 |
name = __init__ |
|
4 |
description = |
|
5 |
createdBy = |
|
6 |
version = |
|
7 |
|
|
8 |
[Script] |
|
9 |
main = main |
|
10 |
Lang = python |
|
11 |
|
org.gvsig.scripting/trunk/org.gvsig.scripting/org.gvsig.scripting.app/org.gvsig.scripting.app.mainplugin/src/main/resources-plugin/scripting/scripts/libs/toolbox.py | ||
---|---|---|
8 | 8 |
# clase base para crear procesos desde scripting con python. |
9 | 9 |
# |
10 | 10 |
# |
11 |
from uselib import use_plugin |
|
11 | 12 |
|
12 |
|
|
13 | 13 |
use_plugin("org.gvsig.geoprocess.app.mainplugin") |
14 | 14 |
|
15 | 15 |
from org.gvsig.geoprocess.lib.sextante import AbstractSextanteGeoProcess |
org.gvsig.scripting/trunk/org.gvsig.scripting/org.gvsig.scripting.app/org.gvsig.scripting.app.mainplugin/src/main/resources-plugin/scripting/scripts/examples/layout/personalizar_mapa1.py | ||
---|---|---|
1 | 1 |
|
2 |
from uselib import use_plugin |
|
3 |
|
|
2 | 4 |
use_plugin("org.gvsig.app.document.layout2.app.mainplugin") |
3 | 5 |
|
4 | 6 |
from gvsig import * |
org.gvsig.scripting/trunk/org.gvsig.scripting/org.gvsig.scripting.app/org.gvsig.scripting.app.mainplugin/src/main/resources-plugin/scripting/scripts/examples/layout/personalizar_mapa2.py | ||
---|---|---|
1 | 1 |
|
2 |
from uselib import use_plugin |
|
2 | 3 |
|
3 | 4 |
use_plugin("org.gvsig.app.document.layout2.app.mainplugin") |
4 | 5 |
|
org.gvsig.scripting/trunk/org.gvsig.scripting/org.gvsig.scripting.app/org.gvsig.scripting.app.mainplugin/src/main/resources-plugin/scripting/scripts/examples/layout/personalizar_mapa3.py | ||
---|---|---|
1 | 1 |
|
2 |
from uselib import use_plugin |
|
3 |
|
|
2 | 4 |
use_plugin("org.gvsig.app.document.layout2.app.mainplugin") |
3 | 5 |
|
4 | 6 |
from gvsig import * |
org.gvsig.scripting/trunk/org.gvsig.scripting/org.gvsig.scripting.app/org.gvsig.scripting.app.mainplugin/src/main/resources-plugin/scripting/scripts/tools/photo2shape/photo2shape.py | ||
---|---|---|
19 | 19 |
from org.gvsig.fmap.dal import DALLocator |
20 | 20 |
from org.gvsig.fmap.dal import DataTypes |
21 | 21 |
|
22 |
from org.gvsig.fmap.mapcontext import MapContextLocator |
|
22 | 23 |
|
23 | 24 |
from imagegpsmetadata import ImageGPSMetadata |
24 | 25 |
from libs.relpath import relpath |
... | ... | |
125 | 126 |
store.insert(feature) |
126 | 127 |
|
127 | 128 |
store.finishEditing() |
128 |
if self.__addLayerToView: |
|
129 |
if self.__addLayerToView and currentView()!=None:
|
|
129 | 130 |
layer = MapContextLocator.getMapContextManager().createLayer( |
130 | 131 |
self.__outputFile.getName(), |
131 | 132 |
store |
... | ... | |
161 | 162 |
self.hide() |
162 | 163 |
|
163 | 164 |
def btnMakeShape_click(self, *args): |
165 |
if currentView() == None and self.chkInsertLayer.isSelected() : |
|
166 |
msgbox("Need a view to add layer to it.") |
|
167 |
return |
|
168 |
|
|
164 | 169 |
if self.chkRemoveShape.isSelected(): |
165 | 170 |
try: |
166 | 171 |
f = os.path.splitext(self.txtOutputFile.getText())[0] |
org.gvsig.scripting/trunk/org.gvsig.scripting/org.gvsig.scripting.app/org.gvsig.scripting.app.mainplugin/src/main/resources-plugin/scripting/scripts/tools/photo2shape/imagegpsmetadata.py | ||
---|---|---|
7 | 7 |
# |
8 | 8 |
import os |
9 | 9 |
|
10 |
from uselib import use_jar |
|
11 |
|
|
10 | 12 |
use_jar(os.path.join(os.path.dirname(__file__),"libs","metadata-extractor-2.8.1.jar") |
11 | 13 |
use_jar(os.path.join(os.path.dirname(__file__),"libs","xmpcore-5.1.2.jar") |
12 | 14 |
|
org.gvsig.scripting/trunk/org.gvsig.scripting/org.gvsig.scripting.app/org.gvsig.scripting.app.mainplugin/src/main/resources-plugin/scripting/scripts/tools/makedocs/makedocs.xml | ||
---|---|---|
24 | 24 |
</at> |
25 | 25 |
<at name="componentclass">com.jeta.forms.gui.form.FormComponent</at> |
26 | 26 |
</super> |
27 |
<at name="id">/home/jjdelcerro/gvSIG/plugins/org.gvsig.scripting.app.extension/scripts/makedocs/makedocs.xml</at> |
|
28 |
<at name="path">gvSIG/plugins/org.gvsig.scripting.app.extension/scripts/makedocs/makedocs.xml</at> |
|
29 |
<at name="rowspecs">CENTER:DEFAULT:NONE,CENTER:DEFAULT:NONE,CENTER:DEFAULT:NONE,CENTER:DEFAULT:NONE,CENTER:DEFAULT:NONE,CENTER:DEFAULT:NONE,CENTER:DEFAULT:NONE,CENTER:DEFAULT:NONE,CENTER:DEFAULT:NONE,CENTER:DEFAULT:NONE,CENTER:DEFAULT:NONE,CENTER:DEFAULT:NONE,CENTER:DEFAULT:NONE,CENTER:DEFAULT:NONE,CENTER:DEFAULT:NONE</at> |
|
27 |
<at name="id">/home/jjdelcerro/datos/devel/org.gvsig.desktop/target/product/gvSIG/extensiones/org.gvsig.scripting.app.mainplugin/scripting/scripts/tools/makedocs/makedocs.xml</at> |
|
28 |
<at name="rowspecs">CENTER:DEFAULT:NONE,CENTER:DEFAULT:NONE,CENTER:DEFAULT:NONE,CENTER:DEFAULT:NONE,CENTER:DEFAULT:NONE,CENTER:DEFAULT:NONE,CENTER:DEFAULT:NONE,CENTER:DEFAULT:NONE,CENTER:DEFAULT:NONE,CENTER:DEFAULT:NONE,CENTER:DEFAULT:NONE,CENTER:DEFAULT:NONE,CENTER:DEFAULT:NONE,CENTER:DEFAULT:NONE,CENTER:DEFAULT:NONE,CENTER:DEFAULT:NONE,CENTER:DEFAULT:NONE</at> |
|
30 | 29 |
<at name="colspecs">FILL:DEFAULT:NONE,FILL:DEFAULT:NONE,FILL:DEFAULT:NONE,FILL:DEFAULT:GROW(1.0),FILL:DEFAULT:NONE,FILL:DEFAULT:NONE</at> |
31 | 30 |
<at name="components"> |
32 | 31 |
<object classname="java.util.LinkedList"> |
... | ... | |
57 | 56 |
<at name="text">Workspace</at> |
58 | 57 |
<at name="height">14</at> |
59 | 58 |
<at name="name"/> |
60 |
<at name="width">101</at>
|
|
59 |
<at name="width">154</at>
|
|
61 | 60 |
<at name="fill"> |
62 | 61 |
<object classname="com.jeta.forms.store.properties.effects.PaintProperty"> |
63 | 62 |
<at name="name">fill</at> |
... | ... | |
117 | 116 |
<at name="text">Output folder</at> |
118 | 117 |
<at name="height">14</at> |
119 | 118 |
<at name="name"/> |
120 |
<at name="width">101</at>
|
|
119 |
<at name="width">154</at>
|
|
121 | 120 |
<at name="fill"> |
122 | 121 |
<object classname="com.jeta.forms.store.properties.effects.PaintProperty"> |
123 | 122 |
<at name="name">fill</at> |
... | ... | |
175 | 174 |
<at name="properties"> |
176 | 175 |
<object classname="com.jeta.forms.store.support.PropertyMap"> |
177 | 176 |
<at name="height">20</at> |
178 |
<at name="width">742</at>
|
|
177 |
<at name="width">695</at>
|
|
179 | 178 |
<at name="name">txtWorkspace</at> |
180 | 179 |
<at name="border"> |
181 | 180 |
<object classname="com.jeta.forms.store.properties.CompoundBorderProperty"> |
... | ... | |
229 | 228 |
<at name="properties"> |
230 | 229 |
<object classname="com.jeta.forms.store.support.PropertyMap"> |
231 | 230 |
<at name="height">20</at> |
232 |
<at name="width">742</at>
|
|
231 |
<at name="width">695</at>
|
|
233 | 232 |
<at name="name">txtOutputFolder</at> |
234 | 233 |
<at name="border"> |
235 | 234 |
<object classname="com.jeta.forms.store.properties.CompoundBorderProperty"> |
... | ... | |
377 | 376 |
<at name="cellconstraints"> |
378 | 377 |
<object classname="com.jeta.forms.store.memento.CellConstraintsMemento"> |
379 | 378 |
<at name="column">2</at> |
380 |
<at name="row">14</at>
|
|
379 |
<at name="row">16</at>
|
|
381 | 380 |
<at name="colspan">4</at> |
382 | 381 |
<at name="rowspan">1</at> |
383 | 382 |
<at name="halign">right</at> |
... | ... | |
387 | 386 |
</at> |
388 | 387 |
<at name="componentclass">com.jeta.forms.gui.form.FormComponent</at> |
389 | 388 |
</super> |
390 |
<at name="id">embedded.1384437</at>
|
|
389 |
<at name="id">embedded.610170248</at>
|
|
391 | 390 |
<at name="rowspecs">CENTER:DEFAULT:NONE</at> |
392 | 391 |
<at name="colspecs">FILL:DEFAULT:NONE,FILL:DEFAULT:NONE,FILL:DEFAULT:NONE</at> |
393 | 392 |
<at name="components"> |
... | ... | |
612 | 611 |
<object classname="com.jeta.forms.store.support.PropertyMap"> |
613 | 612 |
<at name="selected">true</at> |
614 | 613 |
<at name="height">15</at> |
615 |
<at name="width">742</at>
|
|
614 |
<at name="width">695</at>
|
|
616 | 615 |
<at name="name">chkGenerarJavadocs</at> |
617 | 616 |
<at name="border"> |
618 | 617 |
<object classname="com.jeta.forms.store.properties.CompoundBorderProperty"> |
... | ... | |
668 | 667 |
<at name="text">Generar javadocs</at> |
669 | 668 |
<at name="height">14</at> |
670 | 669 |
<at name="name"/> |
671 |
<at name="width">101</at>
|
|
670 |
<at name="width">154</at>
|
|
672 | 671 |
<at name="fill"> |
673 | 672 |
<object classname="com.jeta.forms.store.properties.effects.PaintProperty"> |
674 | 673 |
<at name="name">fill</at> |
... | ... | |
727 | 726 |
<object classname="com.jeta.forms.store.support.PropertyMap"> |
728 | 727 |
<at name="selected">true</at> |
729 | 728 |
<at name="height">15</at> |
730 |
<at name="width">742</at>
|
|
729 |
<at name="width">695</at>
|
|
731 | 730 |
<at name="name">chkProcesarCSS</at> |
732 | 731 |
<at name="border"> |
733 | 732 |
<object classname="com.jeta.forms.store.properties.CompoundBorderProperty"> |
... | ... | |
783 | 782 |
<at name="text">Procesar CSSs</at> |
784 | 783 |
<at name="height">14</at> |
785 | 784 |
<at name="name"/> |
786 |
<at name="width">101</at>
|
|
785 |
<at name="width">154</at>
|
|
787 | 786 |
<at name="fill"> |
788 | 787 |
<object classname="com.jeta.forms.store.properties.effects.PaintProperty"> |
789 | 788 |
<at name="name">fill</at> |
... | ... | |
823 | 822 |
<at name="cellconstraints"> |
824 | 823 |
<object classname="com.jeta.forms.store.memento.CellConstraintsMemento"> |
825 | 824 |
<at name="column">2</at> |
826 |
<at name="row">10</at>
|
|
825 |
<at name="row">12</at>
|
|
827 | 826 |
<at name="colspan">4</at> |
828 | 827 |
<at name="rowspan">1</at> |
829 | 828 |
<at name="halign">default</at> |
... | ... | |
841 | 840 |
<at name="properties"> |
842 | 841 |
<object classname="com.jeta.forms.store.support.PropertyMap"> |
843 | 842 |
<at name="height">14</at> |
844 |
<at name="width">911</at>
|
|
843 |
<at name="width">917</at>
|
|
845 | 844 |
<at name="name">pgbProgreso</at> |
846 | 845 |
<at name="border"> |
847 | 846 |
<object classname="com.jeta.forms.store.properties.CompoundBorderProperty"> |
... | ... | |
877 | 876 |
<at name="cellconstraints"> |
878 | 877 |
<object classname="com.jeta.forms.store.memento.CellConstraintsMemento"> |
879 | 878 |
<at name="column">2</at> |
880 |
<at name="row">11</at>
|
|
879 |
<at name="row">13</at>
|
|
881 | 880 |
<at name="colspan">4</at> |
882 | 881 |
<at name="rowspan">1</at> |
883 | 882 |
<at name="halign">default</at> |
... | ... | |
895 | 894 |
<at name="properties"> |
896 | 895 |
<object classname="com.jeta.forms.store.support.PropertyMap"> |
897 | 896 |
<at name="height">12</at> |
898 |
<at name="width">911</at>
|
|
897 |
<at name="width">917</at>
|
|
899 | 898 |
<at name="name">lblStatus</at> |
900 | 899 |
<at name="fill"> |
901 | 900 |
<object classname="com.jeta.forms.store.properties.effects.PaintProperty"> |
... | ... | |
936 | 935 |
<at name="cellconstraints"> |
937 | 936 |
<object classname="com.jeta.forms.store.memento.CellConstraintsMemento"> |
938 | 937 |
<at name="column">2</at> |
939 |
<at name="row">12</at>
|
|
938 |
<at name="row">14</at>
|
|
940 | 939 |
<at name="colspan">4</at> |
941 | 940 |
<at name="rowspan">1</at> |
942 | 941 |
<at name="halign">default</at> |
... | ... | |
954 | 953 |
<at name="properties"> |
955 | 954 |
<object classname="com.jeta.forms.store.support.PropertyMap"> |
956 | 955 |
<at name="height">12</at> |
957 |
<at name="width">911</at>
|
|
956 |
<at name="width">917</at>
|
|
958 | 957 |
<at name="name">lblStatus2</at> |
959 | 958 |
<at name="fill"> |
960 | 959 |
<object classname="com.jeta.forms.store.properties.effects.PaintProperty"> |
... | ... | |
988 | 987 |
</object> |
989 | 988 |
</at> |
990 | 989 |
</item> |
990 |
<item > |
|
991 |
<at name="value"> |
|
992 |
<object classname="com.jeta.forms.store.memento.BeanMemento"> |
|
993 |
<super classname="com.jeta.forms.store.memento.ComponentMemento"> |
|
994 |
<at name="cellconstraints"> |
|
995 |
<object classname="com.jeta.forms.store.memento.CellConstraintsMemento"> |
|
996 |
<at name="column">2</at> |
|
997 |
<at name="row">10</at> |
|
998 |
<at name="colspan">1</at> |
|
999 |
<at name="rowspan">1</at> |
|
1000 |
<at name="halign">default</at> |
|
1001 |
<at name="valign">default</at> |
|
1002 |
<at name="insets" object="insets">0,0,0,0</at> |
|
1003 |
</object> |
|
1004 |
</at> |
|
1005 |
<at name="componentclass">com.jeta.forms.gui.form.StandardComponent</at> |
|
1006 |
</super> |
|
1007 |
<at name="jetabeanclass">com.jeta.forms.gui.beans.JETABean</at> |
|
1008 |
<at name="beanclass">com.jeta.forms.components.label.JETALabel</at> |
|
1009 |
<at name="beanproperties"> |
|
1010 |
<object classname="com.jeta.forms.store.memento.PropertiesMemento"> |
|
1011 |
<at name="classname">com.jeta.forms.components.label.JETALabel</at> |
|
1012 |
<at name="properties"> |
|
1013 |
<object classname="com.jeta.forms.store.support.PropertyMap"> |
|
1014 |
<at name="text">Continuar proceso anterior</at> |
|
1015 |
<at name="height">14</at> |
|
1016 |
<at name="name"/> |
|
1017 |
<at name="width">154</at> |
|
1018 |
<at name="fill"> |
|
1019 |
<object classname="com.jeta.forms.store.properties.effects.PaintProperty"> |
|
1020 |
<at name="name">fill</at> |
|
1021 |
</object> |
|
1022 |
</at> |
|
1023 |
<at name="border"> |
|
1024 |
<object classname="com.jeta.forms.store.properties.CompoundBorderProperty"> |
|
1025 |
<super classname="com.jeta.forms.store.properties.BorderProperty"> |
|
1026 |
<at name="name">border</at> |
|
1027 |
</super> |
|
1028 |
<at name="borders"> |
|
1029 |
<object classname="java.util.LinkedList"> |
|
1030 |
<item > |
|
1031 |
<at name="value"> |
|
1032 |
<object classname="com.jeta.forms.store.properties.DefaultBorderProperty"> |
|
1033 |
<super classname="com.jeta.forms.store.properties.BorderProperty"> |
|
1034 |
<at name="name">border</at> |
|
1035 |
</super> |
|
1036 |
</object> |
|
1037 |
</at> |
|
1038 |
</item> |
|
1039 |
</object> |
|
1040 |
</at> |
|
1041 |
</object> |
|
1042 |
</at> |
|
1043 |
</object> |
|
1044 |
</at> |
|
1045 |
</object> |
|
1046 |
</at> |
|
1047 |
</object> |
|
1048 |
</at> |
|
1049 |
</item> |
|
1050 |
<item > |
|
1051 |
<at name="value"> |
|
1052 |
<object classname="com.jeta.forms.store.memento.BeanMemento"> |
|
1053 |
<super classname="com.jeta.forms.store.memento.ComponentMemento"> |
|
1054 |
<at name="cellconstraints"> |
|
1055 |
<object classname="com.jeta.forms.store.memento.CellConstraintsMemento"> |
|
1056 |
<at name="column">4</at> |
|
1057 |
<at name="row">10</at> |
|
1058 |
<at name="colspan">1</at> |
|
1059 |
<at name="rowspan">1</at> |
|
1060 |
<at name="halign">default</at> |
|
1061 |
<at name="valign">default</at> |
|
1062 |
<at name="insets" object="insets">0,0,0,0</at> |
|
1063 |
</object> |
|
1064 |
</at> |
|
1065 |
<at name="componentclass">com.jeta.forms.gui.form.StandardComponent</at> |
|
1066 |
</super> |
|
1067 |
<at name="jetabeanclass">com.jeta.forms.gui.beans.JETABean</at> |
|
1068 |
<at name="beanclass">javax.swing.JCheckBox</at> |
|
1069 |
<at name="beanproperties"> |
|
1070 |
<object classname="com.jeta.forms.store.memento.PropertiesMemento"> |
|
1071 |
<at name="classname">javax.swing.JCheckBox</at> |
|
1072 |
<at name="properties"> |
|
1073 |
<object classname="com.jeta.forms.store.support.PropertyMap"> |
|
1074 |
<at name="selected">true</at> |
|
1075 |
<at name="height">15</at> |
|
1076 |
<at name="width">695</at> |
|
1077 |
<at name="name">chkContinuarProcesoAnterior</at> |
|
1078 |
<at name="border"> |
|
1079 |
<object classname="com.jeta.forms.store.properties.CompoundBorderProperty"> |
|
1080 |
<super classname="com.jeta.forms.store.properties.BorderProperty"> |
|
1081 |
<at name="name">border</at> |
|
1082 |
</super> |
|
1083 |
<at name="borders"> |
|
1084 |
<object classname="java.util.LinkedList"> |
|
1085 |
<item > |
|
1086 |
<at name="value"> |
|
1087 |
<object classname="com.jeta.forms.store.properties.DefaultBorderProperty"> |
|
1088 |
<super classname="com.jeta.forms.store.properties.BorderProperty"> |
|
1089 |
<at name="name">border</at> |
|
1090 |
</super> |
|
1091 |
</object> |
|
1092 |
</at> |
|
1093 |
</item> |
|
1094 |
</object> |
|
1095 |
</at> |
|
1096 |
</object> |
|
1097 |
</at> |
|
1098 |
</object> |
|
1099 |
</at> |
|
1100 |
</object> |
|
1101 |
</at> |
|
1102 |
</object> |
|
1103 |
</at> |
|
1104 |
</item> |
|
991 | 1105 |
</object> |
992 | 1106 |
</at> |
993 | 1107 |
<at name="properties"> |
... | ... | |
995 | 1109 |
<at name="classname">com.jeta.forms.gui.form.GridView</at> |
996 | 1110 |
<at name="properties"> |
997 | 1111 |
<object classname="com.jeta.forms.store.support.PropertyMap"> |
998 |
<at name="name"></at>
|
|
1112 |
<at name="name"/>
|
|
999 | 1113 |
<at name="fill"> |
1000 | 1114 |
<object classname="com.jeta.forms.store.properties.effects.PaintProperty"> |
1001 | 1115 |
<at name="name">fill</at> |
... | ... | |
1045 | 1159 |
<at name="cellpainters"> |
1046 | 1160 |
<object classname="com.jeta.forms.store.support.Matrix"> |
1047 | 1161 |
<at name="rows"> |
1048 |
<object classname="[Ljava.lang.Object;" size="15">
|
|
1162 |
<object classname="[Ljava.lang.Object;" size="17">
|
|
1049 | 1163 |
<at name="item" index="0"> |
1050 | 1164 |
<object classname="[Ljava.lang.Object;" size="6"/> |
1051 | 1165 |
</at> |
... | ... | |
1091 | 1205 |
<at name="item" index="14"> |
1092 | 1206 |
<object classname="[Ljava.lang.Object;" size="6"/> |
1093 | 1207 |
</at> |
1208 |
<at name="item" index="15"> |
|
1209 |
<object classname="[Ljava.lang.Object;" size="6"/> |
|
1210 |
</at> |
|
1211 |
<at name="item" index="16"> |
|
1212 |
<object classname="[Ljava.lang.Object;" size="6"/> |
|
1213 |
</at> |
|
1094 | 1214 |
</object> |
1095 | 1215 |
</at> |
1096 | 1216 |
</object> |
org.gvsig.scripting/trunk/org.gvsig.scripting/org.gvsig.scripting.app/org.gvsig.scripting.app.mainplugin/src/main/resources-plugin/scripting/scripts/tools/makedocs/makedocs.py | ||
---|---|---|
1 | 1 |
|
2 |
execfile( script.getResource("../libs/formpanel.py").getAbsolutePath() ) |
|
2 |
from gvsig import * |
|
3 |
from commonsdialog import * |
|
3 | 4 |
|
4 | 5 |
import os |
5 | 6 |
import os.path |
... | ... | |
9 | 10 |
import threading |
10 | 11 |
import logging |
11 | 12 |
|
13 |
from libs.formpanel import FormPanel |
|
14 |
|
|
12 | 15 |
from java.awt import Dimension |
13 | 16 |
|
14 |
from gvsig import * |
|
15 |
from commonsdialog import * |
|
16 |
|
|
17 | 17 |
import pynliner |
18 | 18 |
|
19 | 19 |
|
... | ... | |
105 | 105 |
def findJavaSources(self,workspace,project): |
106 | 106 |
projectFolder = os.path.join(workspace,project) |
107 | 107 |
sources = list() |
108 |
#print projectFolder |
|
108 | 109 |
for root, dirs, files in os.walk(projectFolder): |
109 | 110 |
for file in files: |
110 | 111 |
if file == "pom.xml": |
... | ... | |
136 | 137 |
|
137 | 138 |
return countfiles, len(folders) |
138 | 139 |
|
139 |
def calculateCountOfHTMLs(self,htmlroot): |
|
140 |
def calculateHTMLFileList(self,htmlroot, listfname): |
|
141 |
listfile= open(listfname,"w") |
|
140 | 142 |
countfiles = 0 |
141 | 143 |
for root, dirs, files in os.walk(htmlroot): |
142 | 144 |
for f in files: |
... | ... | |
144 | 146 |
continue |
145 | 147 |
if f.endswith(".html"): |
146 | 148 |
countfiles+=1 |
149 |
listfile.write(os.path.join(root,f)) |
|
150 |
listfile.write("\n") |
|
147 | 151 |
self.message2("[%05d] %s" % (countfiles, os.path.join(root,f))) |
152 |
listfile.close() |
|
148 | 153 |
return countfiles |
149 | 154 |
|
150 | 155 |
def message(self,msg): |
... | ... | |
223 | 228 |
self.pgbProgreso.setValue(loadingcount) |
224 | 229 |
self.message2(line[33:]) |
225 | 230 |
|
226 |
|
|
227 | 231 |
if self.chkProcesarCSS.isSelected(): |
228 | 232 |
self.message("Preparando procesdado de HTMLs (CSS inliner)...") |
229 | 233 |
self.message2("") |
230 | 234 |
path=os.path.join(outputpath,"html","org") |
231 |
self.pgbProgreso.setMaximum(self.calculateCountOfHTMLs(path)) |
|
235 |
|
|
236 |
listfname = script.getResource("htmls.txt").getAbsolutePath() |
|
237 |
lastfname = script.getResource("lasthtml.txt").getAbsolutePath() |
|
238 |
if self.chkContinuarProcesoAnterior.isSelected() and os.path.exists(listfname) and os.path.exists(lastfname): |
|
239 |
ff = open(lastfname,"r") |
|
240 |
skipto = ff.read() |
|
241 |
ff.close() |
|
242 |
if skipto in (None,"","\n"): |
|
243 |
skipto = None |
|
244 |
ff = open(listfname,"r") |
|
245 |
htmlscount = 0 |
|
246 |
for fname in ff: |
|
247 |
htmlscount +=1 |
|
248 |
ff.close() |
|
249 |
else: |
|
250 |
skipto = None |
|
251 |
htmlscount = self.calculateHTMLFileList(path,listfname) |
|
252 |
|
|
253 |
self.pgbProgreso.setMaximum(htmlscount) |
|
232 | 254 |
self.pgbProgreso.setValue(0) |
233 | 255 |
self.pgbProgreso.setIndeterminate(False) |
234 | 256 |
self.message("Procesando HTMLs (CSS inliner)...") |
235 | 257 |
cssinliner = CSSInliner() |
236 | 258 |
htmlscount = 0 |
237 |
for root, dirs, files in os.walk(path): |
|
238 |
for f in files: |
|
239 |
if self.canceled: |
|
240 |
break |
|
241 |
if f.startswith("package-"): |
|
259 |
listfile = open(listfname,"r") |
|
260 |
for fname in listfile: |
|
261 |
htmlscount+=1 |
|
262 |
self.message2(fname) |
|
263 |
self.pgbProgreso.setValue(htmlscount) |
|
264 |
if skipto != None: |
|
265 |
if skipto != fname: |
|
242 | 266 |
continue |
243 |
if f.endswith(".html"): |
|
244 |
htmlscount+=1 |
|
245 |
fname = os.path.join(root,f) |
|
246 |
self.message2(fname) |
|
247 |
cssinliner.process(fname) |
|
248 |
self.pgbProgreso.setValue(htmlscount) |
|
267 |
skipto = None |
|
268 |
if self.canceled: |
|
269 |
ff = open(lastfname,"w") |
|
270 |
ff.write(fname) |
|
271 |
ff.close() |
|
272 |
break |
|
273 |
cssinliner.process(fname) |
|
249 | 274 |
|
250 | 275 |
self.message("Proceso terminado") |
251 | 276 |
self.message2("") |
... | ... | |
293 | 318 |
|
294 | 319 |
|
295 | 320 |
def main(*args): |
296 |
workspace = "/home/jjdelcerro/data/devel"
|
|
297 |
outputfolder = "/home/jjdelcerro/data/temp/javadocs"
|
|
321 |
workspace = "/home/jjdelcerro/datos/devel"
|
|
322 |
outputfolder = "/home/jjdelcerro/datos/temp/javadocs"
|
|
298 | 323 |
projects = ( |
299 | 324 |
("org.gvsig.app.document.layout2.app",None), |
300 | 325 |
("org.gvsig.attributeeditor",None), |
Also available in: Unified diff