Revision 944

View differences:

org.gvsig.scripting/tags/org.gvsig.scripting-2.3.53/org.gvsig.scripting.app/org.gvsig.scripting.app.mainplugin/pom.xml
1
<?xml version="1.0" encoding="ISO-8859-1"?>
2

  
3
<project xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd">
4
    <modelVersion>4.0.0</modelVersion>
5
    <artifactId>org.gvsig.scripting.app.mainplugin</artifactId>
6
    <packaging>jar</packaging>
7
    <name>${project.artifactId}</name>
8
    <description><![CDATA[
9
This plugin provides support for scripting to gvSIG.
10
Among other things it contains:
11

  
12
- The gvSIG scripting engine
13
- The gvSIG script editor
14
- Script engines for:
15
   - Jython
16
   - Groovy
17
   - javascript
18
   - Renjin
19

  
20
- The script install module for the add-on manager.
21
- Utilities to generate packages of complements with our scripts.
22
- Python libraries as:
23
   - Six - Utilities for writing code that runs on Python 2 and 3
24
   - PyLint - Python source code analyzer
25
   - Pygments - syntax highlighting package
26
   - CSSUtils - CSS Cascading Style Sheets library
27
   - Docutils - Python Documentation Utilities
28
   - geopy - client for several popular geocoding web services
29
   - PyInliner - CSS-to-inline-styles conversion tool for HTML
30
   - Statistics - functions for calculating statistics of data
31
   - Cartodb - simple CartoDB client to perform requests against the CartoDB API
32

  
33
- Java libraries to use from scripting like:
34
   - Abeille forms deseigner
35
   - jOpenDocument
36
   - JNumeric
37
   - CSSBox
38

  
39

  
40
This plugin can be configured to be preinstalled automatically, allowing 
41
"Script" type plugins to be installed during the application installation process. 
42
To do this, the following entries must be added to the "packages.properties" 
43
of gvspks::
44

  
45
    installers=scripts
46
    installer.scripts.initializer=org.gvsig.scripting.app.extension.ScriptsInstallerInitializer
47
    installer.scripts.package.code=org.gvsig.scripting.app.mainplugin
48
    installer.scripts.factory.name=Script
49
    installer.scripts.libs=lib
50

  
51
If the "installers" entry already exists, add "scripts" to the end separating 
52
it with a space.    
53
                            
54
]]></description>
55
    <parent>
56
        <groupId>org.gvsig</groupId>
57
        <artifactId>org.gvsig.scripting.app</artifactId>
58
        <version>2.3.53</version>
59
    </parent>
60
    <dependencies>
61
        <dependency>
62
            <groupId>org.gvsig</groupId>
63
            <artifactId>org.gvsig.tools.lib</artifactId>
64
            <scope>compile</scope>
65
        </dependency>
66
        <dependency>
67
            <groupId>org.gvsig</groupId>
68
            <artifactId>org.gvsig.tools.lib</artifactId>
69
            <type>test-jar</type>
70
            <scope>test</scope>
71
        </dependency>
72
        <dependency>
73
            <groupId>org.gvsig</groupId>
74
            <artifactId>org.gvsig.i18n</artifactId>
75
            <scope>compile</scope>
76
        </dependency>
77
        <dependency>
78
            <groupId>org.gvsig</groupId>
79
            <artifactId>org.gvsig.andami</artifactId>
80
            <scope>compile</scope>
81
        </dependency>
82
        <dependency>
83
            <groupId>org.gvsig</groupId>
84
            <artifactId>org.gvsig.app.document.table.app.mainplugin</artifactId>
85
            <scope>compile</scope>
86
        </dependency>
87
        <dependency>
88
            <groupId>org.gvsig</groupId>
89
            <artifactId>org.gvsig.app.mainplugin</artifactId>
90
            <scope>compile</scope>
91
        </dependency>
92
        <dependency>
93
            <groupId>org.gvsig</groupId>
94
            <artifactId>org.gvsig.tools.swing.impl</artifactId>
95
            <scope>compile</scope>
96
        </dependency>
97
        <dependency>
98
            <groupId>org.gvsig</groupId>
99
            <artifactId>org.gvsig.about.api</artifactId>
100
            <scope>compile</scope>
101
        </dependency>
102
        <dependency>
103
            <groupId>org.gvsig</groupId>
104
            <artifactId>org.gvsig.scripting.lib.api</artifactId>
105
            <scope>compile</scope>
106
        </dependency>
107
        <dependency>
108
            <groupId>org.gvsig</groupId>
109
            <artifactId>org.gvsig.scripting.swing.api</artifactId>
110
            <scope>compile</scope>
111
        </dependency>
112
        <dependency>
113
            <groupId>org.gvsig</groupId>
114
            <artifactId>org.gvsig.scripting.lib.impl</artifactId>
115
            <scope>compile</scope>
116
        </dependency>
117
        <dependency>
118
            <groupId>org.gvsig</groupId>
119
            <artifactId>org.gvsig.scripting.swing.impl</artifactId>
120
            <scope>compile</scope>
121
        </dependency>
122

  
123
        <!-- force adding -->
124
        <dependency>
125
            <groupId>org.ini4j</groupId>
126
            <artifactId>ini4j</artifactId>
127
            <scope>runtime</scope>
128
        </dependency>
129
        <dependency>
130
            <groupId>net.sourceforge.thinlet</groupId>
131
            <artifactId>thinlet</artifactId>
132
            <scope>runtime</scope>
133
        </dependency>
134
        <dependency>
135
            <groupId>org.gvsig</groupId>
136
            <artifactId>org.gvsig.scripting.thing</artifactId>
137
            <scope>runtime</scope>
138
        </dependency>
139
        <dependency>
140
            <groupId>com.jeta</groupId>
141
            <artifactId>abeille</artifactId>
142
            <type>tar.gz</type>
143
            <scope>runtime</scope>
144
        </dependency>
145
        <dependency>
146
            <groupId>org.jopendocument</groupId>
147
            <artifactId>jOpenDocument</artifactId>
148
            <scope>runtime</scope>
149
        </dependency>
150
        <dependency>
151
            <groupId>com.github.tbekolay.jnumeric</groupId>
152
            <artifactId>jnumeric</artifactId>
153
            <scope>runtime</scope>
154
        </dependency>
155
 
156
        <dependency>
157
            <groupId>org.apache.tika</groupId>
158
            <artifactId>tika-core</artifactId>
159
            <scope>runtime</scope>
160
        </dependency>
161

  
162
        <dependency>
163
            <groupId>org.python</groupId>
164
            <artifactId>${jython.artifactId}</artifactId>
165
            <scope>runtime</scope>
166
        </dependency>
167
        <dependency>
168
            <groupId>org.codehaus.groovy</groupId>
169
            <artifactId>groovy-all</artifactId>
170
            <scope>runtime</scope>
171
        </dependency>
172
        <dependency>
173
            <groupId>org.renjin</groupId>
174
            <artifactId>renjin-script-engine</artifactId>
175
            <classifier>jar-with-dependencies</classifier>
176
            <scope>runtime</scope>
177
        </dependency>      
178
        
179
        <dependency>
180
            <groupId>org.scala-lang</groupId>
181
            <artifactId>scala-dist</artifactId>
182
            <scope>runtime</scope>
183
        </dependency>
184
        <dependency>
185
            <groupId>org.scala-lang</groupId>
186
            <artifactId>scala-compiler</artifactId>
187
            <scope>runtime</scope>
188
        </dependency>
189
        <dependency>
190
            <groupId>org.scala-lang</groupId>
191
            <artifactId>scala-library</artifactId>
192
            <scope>runtime</scope>
193
        </dependency>
194
        <dependency>
195
            <groupId>org.scala-lang</groupId>
196
            <artifactId>scala-reflect</artifactId>
197
            <scope>runtime</scope>
198
        </dependency>
199
        <dependency>
200
            <groupId>org.scala-lang</groupId>
201
            <artifactId>scalap</artifactId>
202
            <scope>runtime</scope>
203
        </dependency>
204
        <dependency>
205
            <groupId>jline</groupId>
206
            <artifactId>jline</artifactId>
207
            <scope>runtime</scope>
208
        </dependency>
209
        <dependency>
210
            <groupId>net.sf.cssbox</groupId>
211
            <artifactId>swingbox</artifactId>
212
            <scope>runtime</scope>
213
        </dependency>
214
        <dependency>
215
            <groupId>net.sf.cssbox</groupId>
216
            <artifactId>cssbox</artifactId>
217
            <scope>runtime</scope>
218
        </dependency>
219
        
220
        <dependency>
221
            <groupId>net.sourceforge.nekohtml</groupId>
222
            <artifactId>nekohtml</artifactId>
223
            <scope>runtime</scope>
224
        </dependency>
225
        <dependency>
226
            <groupId>net.sf.cssbox</groupId>
227
            <artifactId>jstyleparser</artifactId>
228
            <scope>runtime</scope>
229
        </dependency>
230
        <dependency>
231
            <groupId>org.antlr</groupId>
232
            <artifactId>antlr-runtime</artifactId>
233
            <!-- Ojo que forzamos una version en concreto -->
234
            <version>3.5.2</version>
235
        </dependency>                    
236
    </dependencies>
237

  
238

  
239
    <properties>
240
        <gvsig.package.info.name>Scripting framework</gvsig.package.info.name>
241
        <gvsig.package.info.dependencies>required: org.gvsig.app.document.table.app.mainplugin -ge 2</gvsig.package.info.dependencies>
242
        <gvsig.package.info.poolURL>https://devel.gvsig.org/download/projects/gvsig-scripting/pool</gvsig.package.info.poolURL>
243
        <gvsig.package.info.sourcesURL>https://devel.gvsig.org/svn/gvsig-scripting</gvsig.package.info.sourcesURL>
244
        <gvsig.package.info.state>testing</gvsig.package.info.state>
245
        <gvsig.package.info.categories>Development</gvsig.package.info.categories>
246
        <gvsig.package.info.official>true</gvsig.package.info.official>
247

  
248
    </properties>
249

  
250
    <build>
251
        <plugins>
252

  
253
            <plugin>
254
                <groupId>org.apache.maven.plugins</groupId>
255
                <artifactId>maven-dependency-plugin</artifactId>
256
                <executions>
257
                    <execution>
258
                        <id>unpack</id>
259
                        <phase>process-sources</phase>
260
                        <goals>
261
                            <goal>unpack</goal>
262
                        </goals>
263
                        <configuration>
264
                            <artifactItems>
265
                                <artifactItem>
266
                                    <groupId>com.jeta</groupId>
267
                                    <artifactId>abeille</artifactId>
268
                                    <version>2.1.0.M3</version>
269
                                    <type>tar.gz</type>
270
                                    <overWrite>true</overWrite>
271
                                    <outputDirectory>target/abeille</outputDirectory>
272
                                </artifactItem>
273
                            </artifactItems>
274
                        </configuration>
275
                    </execution>
276
                </executions>
277
            </plugin>
278

  
279
        </plugins>
280
    </build>
281

  
282
</project>
org.gvsig.scripting/tags/org.gvsig.scripting-2.3.53/org.gvsig.scripting.app/org.gvsig.scripting.app.mainplugin/buildNumber.properties
1
#Wed Sep 27 08:31:44 CEST 2017
2
buildNumber=112
org.gvsig.scripting/tags/org.gvsig.scripting-2.3.53/org.gvsig.scripting.app/org.gvsig.scripting.app.mainplugin/src/test/java/org/gvsig/scripting/app/extension/AppTest.java
1
/* gvSIG. Geographic Information System of the Valencian Government
2
 *
3
 * Copyright (C) 2007-2008 Infrastructures and Transports Department
4
 * of the Valencian Government (CIT)
5
 * 
6
 * This program is free software; you can redistribute it and/or
7
 * modify it under the terms of the GNU General Public License
8
 * as published by the Free Software Foundation; either version 2
9
 * of the License, or (at your option) any later version.
10
 * 
11
 * This program is distributed in the hope that it will be useful,
12
 * but WITHOUT ANY WARRANTY; without even the implied warranty of
13
 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
14
 * GNU General Public License for more details.
15
 * 
16
 * You should have received a copy of the GNU General Public License
17
 * along with this program; if not, write to the Free Software
18
 * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, 
19
 * MA  02110-1301, USA.
20
 * 
21
 */
22

  
23
package org.gvsig.scripting.app.extension;
24

  
25
import junit.framework.Test;
26
import junit.framework.TestCase;
27
import junit.framework.TestSuite;
28

  
29
/**
30
 * Unit test for simple App.
31
 */
32
public class AppTest 
33
    extends TestCase
34
{
35
    /**
36
     * Create the test case
37
     *
38
     * @param testName name of the test case
39
     */
40
    public AppTest( String testName )
41
    {
42
        super( testName );
43
    }
44

  
45
    /**
46
     * @return the suite of tests being tested
47
     */
48
    public static Test suite()
49
    {
50
        return new TestSuite( AppTest.class );
51
    }
52

  
53
    /**
54
     * Rigourous Test :-)
55
     */
56
    public void testApp()
57
    {
58
        assertTrue( true );
59
    }
60
}
org.gvsig.scripting/tags/org.gvsig.scripting-2.3.53/org.gvsig.scripting.app/org.gvsig.scripting.app.mainplugin/src/main/resources-plugin/i18n/text.properties
1
_Scripting=Scripting
2
_Show_scripting_launcher=Abrir lanzador de scripts
3
_Show_scripting_composer=Abrir editor de scripts
4
_Show_scripting_jython_console=Abrir consola Jython
5

  
6
User=Usuario
7
System=Sistema
8

  
9
Accept=Aceptar
10
Cancel=Cancelar
11
Apply=Aplicar
12

  
13
Retrieving_data=Recibiendo datos...
14

  
15
File=Fichero
16
New=Nuevo
17
Close_document=Cerrar documento
18
Close_all_documents=Cerrar todos los documentos
19
Run=Ejecutar
20
Save=Guardar
21
Close=Cerrar
22
Close_current_tab=Cerrar pesta\u00f1a actual
23
Open_edition_mode=Abrir modo edici\u00f3n
24
Run_selected_script=Ejecutar script seleccionado
25
Delete_selected_script=Borrar script seleccionado
26
Refresh_directories=Actualizar carpetas
27
Move_files=Mover ficheros
28
Set_file_preferences=Editar preferencias de fichero
29

  
30

  
31
Edit=Editar
32
Cut=Cortar
33
Copy=Copiar
34
Paste=Pegar
35
Select_all=Seleccionar todo
36

  
37
Tools=Herramientas
38
Launcher=Lanzador de scripts
39
Scripting_Launcher=Lanzador de scripts
40
Scripting_Composer=Editor de scripts
41
Jython_Console=Consola Jython
42
Import_JavaDoc=Importar JavaDoc
43
JavaDoc=Ayuda de Java (JavaDoc)
44
Remove_JavaDoc=Eliminar JavaDoc
45
Help_contents=Contenido de la ayuda
46
About_scripts_editor=Acerca del editor de scripts
47
Get_help=Ayuda
48
Help=Ayuda
49
_Package_script=Empaquetar script...
50
_Package_help=Empaquetar ayuda...
51

  
52
Problems=Errores
53
Console=Consola
54

  
55
Description=Descripci\u00f3n
56
Resource=Recurso
57
Location=Ubicaci\u00f3n
58

  
59
no_line=sin l\u00ednea
60
Line=L\u00ednea
61

  
62
Welcome_message=Bienvenido al entorno de scripting
63

  
64
Error_opening_in_edition_mode_title=Error al abrir fichero
65
Error_opening_in_edition_mode=No se pudo abrir el fichero en modo edici\u00f3n
66

  
67
New_Script=Nuevo elemento
68
New_Script_Description=Crea un nuevo script, di\u00e1logo, proyecto, directorio
69

  
70
Deleting_JavaDocs_successfully_title=Operaci\u00f3n realizada con \u00e9xito
71
Deleting_JavaDocs_successfully=Eliminaci\u00f3n de los JavaDocs exitosa
72

  
73
Import_JavaDoc_title=Importar JavaDocs desde los directorios de sistema al ScriptingFramework JavaDoc
74
Remove_JavaDoc_title=Eliminar JavaDocs del ScriptingFramework JavaDoc
75

  
76
projects_modified_title=Proyectos sin guardar
77
projects_modified=Algunos proyectos han sido modificados.\u00bfSalvar cambios?
78
project_modified=ha sido modificado.\u00bfSalvar cambios?
79

  
80
Delete_all_title=Borrar el documento
81
Delete_all_message=Esta acci\u00f3n elimina el documento o el directorio con todo su contenido. \u00bf Desea continuar ?
82

  
83
About_us_title=Informaci\u00f3n de todos los contribuidores al proyecto gvSIG
84

  
85
Success=Operaci\u00f3n realizada con \u00e9xito
86
Error=Error
87
Error_renaming=Inesperado error renombrando el fichero
88
Error_moving=Inesperado error moviendo el fichero
89
Error_help=Selecciona una ayuda
90
Rename_succesfully=Renombrado del fichero realizado con \u00e9xito
91
Select_first=Debe seleccionar un fichero primero
92
help_key=No hay ayuda para el texto
93

  
94

  
95
script_filesystem=script en el \u00e1rbol de directorio
96
Move=Mover
97
move_desc=Cambia la ubicaci\u00f3n del fichero seleccionado
98
Rename=Renombrar
99
rename_desc=Cambia el nombre y otras propiedades del fichero seleccionado
100
Moving_succesfully=Reubicaci\u00f3n del fichero realizado con \u00e9xito
101

  
102
Dialog=Di\u00e1logo
103
Code=C\u00f3digo
104
Properties=Propiedades
105

  
106
current_name=Nombre actual
107
new_name=Nuevo name
108
rename_name_title=Cambiar el nombre del fichero
109
more_properties=M\u00e1s propiedades
110

  
111
Javadoc_remove=Selecciona el JavaDoc a eliminar
112
no_Javadoc_remove=No hay JavaDoc para eliminar
113

  
114
Name=Nombre
115
Version=Versi\u00f3n
116
Created_by=Creado por
117
Description=Descripci\u00f3n
118
Type=Tipo
119
Language=Lenguaje
120
Author=Autor
121
Move_from=Mover desde
122
Move_to=Destino
123
Browse=Abrir
124
Import_from=Importar desde
125

  
126
Name_blank=El nombre no puede estar en blanco
127
Name_exists=Este nombre ya existe. Debe elegir otro
128
Import_success=Los JavaDocs se han importado satisfactoriamente
129
JavaDoc_Error=Selecciona JavaDoc a importar
130

  
131
go_to_line_Xhorizontal_ellipsisX=Ir a la l\u00ednea\u2026
132
find_Xhorizontal_ellipsisX=Buscar\u2026
133
replace_Xhorizontal_ellipsisX=Reemplazar\u2026
134
_Searching_autorun_scripts_Xhorizontal_ellipsisX=Buscando scripts de autoarranque...
135
_Running_autorun_script_from_XnameX=Ejecutando script de autoarranque desde "{0}"
136
_The_script_XscriptnameX_is_modified=El script "{0}" ha sido modificado.
137
_Save_changes_XquestionX=\u00bf Guardar cambios ?
138
_Do_you_want_to_save_changes_XquestionX=\u00bf Desea guardar los cambios ?
org.gvsig.scripting/tags/org.gvsig.scripting-2.3.53/org.gvsig.scripting.app/org.gvsig.scripting.app.mainplugin/src/main/resources-plugin/i18n/text_en.properties
1
_Scripting=Scripting
2
_Show_scripting_launcher=Show scripting launcher
3
_Show_scripting_composer=Show scripting composer
4
_Show_scripting_jython_console=Show Jython console
5

  
6
User=User
7
System=System
8

  
9
Accept=Accept
10
Cancel=Cancel
11
Apply=Apply
12

  
13
Retrieving_data=Retrieving data...
14

  
15
File=File
16
New=New
17
Close_document=Close document
18
Close_all_documents=Cloase all documents
19
Run=Run
20
Save=Save
21
Close=Close
22
Close_current_tab=Close current tab
23
Open_edition_mode=Open edition mode
24
Run_selected_script=Run selected script
25
Delete_selected_script=Delete selected script
26
Refresh_directories=Refresh directories
27
Move_files=Move files
28
Set_file_preferences=Set file preferences
29
_Running_autorun_script_from_XnameX=Running autorun script from {0}
30

  
31
Edit=Edit
32
Cut=Cut
33
Copy=Copy
34
Paste=Paste
35
Select_all=Select all
36

  
37
Tools=Tools
38
Launcher=Scripting Launcher
39
Scripting_Launcher=Scripting Launcher
40
Scripting_Composer=Scripting Composer
41
Jython_Console=Jython console
42
Import_JavaDoc=Import JavaDoc
43
JavaDoc=Java Help (JavaDoc)
44
Remove_JavaDoc=Remove JavaDoc
45
Help_contents=Help contents
46
About_scripts_editor=About scripts editor
47
Get_help=Help
48
Help=Help
49
_Package_script=Package script...
50
_Package_help=Package help...
51

  
52
Problems=Errors
53
Console=Console
54

  
55
Description=Description
56
Resource=Resource
57
Location=Location
58

  
59
no_line=no line
60
Line=Line
61

  
62
Welcome_message=Welcome to the scripting framework
63

  
64
Error_opening_in_edition_mode_title=Error opening file in edition mode
65
Error_opening_in_edition_mode=The file can't be opened in edition mode
66

  
67
New_Script=New element
68
New_Script_Description=Create a new script, dialog, project, directory
69

  
70
Deleting_JavaDocs_successfully_title=Operation successful
71
Deleting_JavaDocs_successfully=Deleting JavaDocs successfully
72

  
73
Import_JavaDoc_title=Import JavaDocs from filesystem to ScriptingFramework JavaDoc
74
Remove_JavaDoc_title=Remove JavaDocs from ScriptingFramework JavaDoc
75

  
76
projects_modified_title=Projects without saving
77
projects_modified=Some projects have been modified. Save changes?
78
project_modified=has been modified. Save changes?
79

  
80
Delete_all_title=Delete document
81
Delete_all_message=This action removes the document or directory with all its content. Do you wish to continue ?
82

  
83
About_us_title=Information about all the gvSIG's contributors
84

  
85
Success=Operation done successfully
86
Error=Error
87
Error_renaming=Unexpected error renaming the file
88
Error_moving=Unexpected error moving the file
89
Error_help=Select help
90
Rename_succesfully=Renaming successfully
91
Select_first=Select a file first
92
help_key=There isn't any help to this text
93

  
94

  
95
script_filesystem=script filesystem
96
Move=Move
97
move_desc=Change location of selected file
98
Rename=Rename
99
rename_desc=Change the name and more properties of the selected file
100
Moving_succesfully=File moved succesfully
101

  
102
Dialog=Dialog
103
Code=Code
104
Properties=Properties
105

  
106
current_name=Current name
107
new_name=New name
108
rename_name_title=Change filename
109
more_properties=more properties
110

  
111
Javadoc_remove=Choose JavaDoc to delete
112
no_Javadoc_remove=There's no JavaDoc to delete
113

  
114
Name=Name
115
Version=Version
116
Created_by=Create by
117
Description=Description
118
Type=Type
119
Language=Language
120
Author=Author
121
Move_from=Move from
122
Move_to=Move to
123
Browse=Browse
124
Import_from=Import from
125

  
126
Name_blank=Name can't be blank
127
Name_exists=This name already exists. Choose another one
128
Import_success=JavaDocs imported successfully
129
JavaDoc_Error=Select JavaDoc to import
130

  
131

  
132
go_to_line_Xhorizontal_ellipsisX=Go To Line\u2026
133
find_Xhorizontal_ellipsisX=Find\u2026
134
replace_Xhorizontal_ellipsisX=Replace\u2026
135

  
136
_Searching_autorun_scripts_Xhorizontal_ellipsisX=Searching autorun scripts...
137
_Running_autorun_script_from_XnameX=Running autorun script from "{0}"
138
_The_script_XscriptnameX_is_modified=The script "{0}" has been modified.
139
_Save_changes_XquestionX=Save changes ?
140
_Do_you_want_to_save_changes_XquestionX=Do you want to save changes ?
org.gvsig.scripting/tags/org.gvsig.scripting-2.3.53/org.gvsig.scripting.app/org.gvsig.scripting.app.mainplugin/src/main/resources-plugin/License_Chalkwork_icons.txt
1
----------------------------------------------
2
CHALKWORK BASIC
3
by Dave Shea
4
mezzoblue.com/icons/chalkwork/basic
5
----------------------------------------------
6
CHALKWORK COMMERCE
7
by Dave Shea
8
mezzoblue.com/icons/chalkwork/commerce
9
----------------------------------------------
10
CHALKWORK EDITING CONTROLS
11
by Dave Shea
12
mezzoblue.com/icons/chalkwork/editing-controls
13
----------------------------------------------
14
CHALKWORK INFORMATION MANAGEMENT
15
by Dave Shea
16
mezzoblue.com/icons/chalkwork/information-management
17
----------------------------------------------
18
CHALKWORK HTML (Free Version)
19
by Dave Shea
20
mezzoblue.com/icons/chalkwork/html
21
----------------------------------------------
22

  
23
Thanks for your interest in the Chalkwork Family. Please consider subscribing to the Chalkwork news feed, which will announce new releases in the family as well as inform existing users of updates if any occur.
24

  
25
	http://mezzoblue.com/icons/chalkwork/news.xml
26

  
27
- Dave Shea
28
  mezzoblue.com
29
  @mezzoblue on Twitter
30

  
31

  
32

  
33

  
34
LICENSE AGREEMENT
35
----------------------------------------------
36
By downloading this icon set, you agree to abide by the Creative Commons Attribution-NonCommercial-ShareAlike 3.0 Unported License under which these icons are being made available for non-commercial use.
37

  
38
	Applicable Creative Commons License: http://creativecommons.org/licenses/by-nc-sa/3.0/
39
	Attribution and additional license information: http://www.mezzoblue.com/icons/license/#license-cc
40

  
41
By purchasing a Chalkwork Commercial License, you agree to abide by the Chalkwork Royalty-Free Stock Icon License Agreement under which these icons are being made available for commercial use.
42

  
43
	Chalkwork Commercial License: http://www.mezzoblue.com/icons/license/#license-cc
44

  
45
This notice must be included any time these icons are redistributed.
46

  
47

  
48

  
49

  
50
----------------------------------------------
51
ICON FOLDER INDEX
52
----------------------------------------------
53
The icon files are broken down by file format. Due to some formats resulting in higher quality results, those are considered the preferred files and are located in the folder titled 'High Quality'. This package should contain the following folders in this hierarchy:
54

  
55
High Quality
56
    ICNS (Mac)
57
    ICO (Windows)
58
    PNG
59
    TIF
60
Lower Quality
61
    BMP
62
    GIF
63

  
64
Within each of the second-level folders, you'll find 102 further folders, one for each icon and its variations. Depending on the file format, you may find multiple sizes within these folders along with any icon variations that may exist. Please note that ICO and ICNS files contain all applicable sizes within a single file, and that ICNS files do not support the 24x24 icon size.
65

  
66

  
67
----------------------------------------------
68
CHALKWORK INFORMATION MANAGEMENT ICON INDEX
69
* indicates that variations of this icon are provided within this set
70
---------------------------------------------------------------------
71

  
72
Ad
73
	- Ad (Dollars) *
74
	- Ad (Euros) *
75
	- Ad (Pounds) *
76
Address Book *
77
Announcement *
78
API
79
Archive *
80
Attachment *
81
Authenticate
82
Blog *
83
Bookmark *
84
Briefcase *
85
Category *
86
Chart (Area) *
87
Chart (Bar) *
88
Chart (Pie) *
89
Collapse
90
Colour Palette *
91
Continue
92
Control Panel
93
Conversation *
94
Create
95
Dashboard *
96
Database *
97
Dictionary *
98
Document (Area Chart) *
99
Document (Bar Chart) *
100
Document (Blank) *
101
Document (Form) *
102
Document (Photo) *
103
Document (Pie Chart) *
104
Document (Secure) *
105
Document (Shred)
106
Documents (x2) *
107
Documents (x3) *
108
Download
109
Draw
110
Entry *
111
Excerpt *
112
Expand
113
Export
114
Fax *
115
File *
116
	- File (Closed)
117
	- File (Open)
118
Filter *
119
Flag *
120
Flag (Black) *
121
Flag (Blue) *
122
Flag (Brown) *
123
Flag (Green) *
124
Flag (Light Blue) *
125
Flag (Orange) *
126
Flag (Pink) *
127
Flag (Purple) *
128
Flag (Red) *
129
Flag (White) *
130
Flag (Yellow) *
131
Formatting
132
Hierarchy *
133
Import
134
Inbox *
135
Index *
136
List *
137
Log *
138
Map *
139
Mobile Phone *
140
Moderate
141
Module *
142
News *
143
Notes *
144
Notification *
145
Office *
146
Package *
147
Password
148
Phone *
149
	- Phone (Batphone) *
150
	- Phone (Office) *
151
Plugin *
152
Preview
153
Publish
154
Read More
155
Rebuild
156
Relationship (Data) *
157
Relationship (People) *
158
Rotate Left
159
Rotate Right
160
Schedule *
161
	- Schedule (Noun)
162
	- Schedule (Verb)
163
Script *
164
Security *
165
Sign In
166
Sign Out
167
Sort Down
168
Sort Up
169
Spam *
170
Statistics *
171
Status *
172
	- Status (Green)
173
	- Status (Off)
174
	- Status (On)
175
	- Status (Red)
176
	- Status (Yellow)
177
Support *
178
Sync
179
Template *
180
Ticket *
181
Time Zone *
182
Tools *
183
Trackback
184
View (Columns)
185
View (Lists)
186
View (Thumbnails)
187
Weather *
188
Write
org.gvsig.scripting/tags/org.gvsig.scripting-2.3.53/org.gvsig.scripting.app/org.gvsig.scripting.app.mainplugin/src/main/resources-plugin/package.rst
1

  
2
This plugin provides support for scripting to gvSIG.
3
Among other things it contains:
4

  
5
- The gvSIG scripting engine
6
- The gvSIG script editor
7
- Script engines for:
8
   - Jython
9
   - Groovy
10
   - javascript
11
   - Renjin
12

  
13
- The script install module for the add-on manager.
14
- Utilities to generate packages of complements with our scripts.
15
- Python libraries as:
16
   - Six - Utilities for writing code that runs on Python 2 and 3
17
   - PyLint - Python source code analyzer
18
   - Pygments - syntax highlighting package
19
   - CSSUtils - CSS Cascading Style Sheets library
20
   - Docutils - Python Documentation Utilities
21
   - geopy - client for several popular geocoding web services
22
   - PyInliner - CSS-to-inline-styles conversion tool for HTML
23
   - Statistics - functions for calculating statistics of data
24
   - Cartodb - simple CartoDB client to perform requests against the CartoDB API
25

  
26
- Java libraries to use from scripting as:
27
   - Abeille forms deseigner
28
   - jOpenDocument
29
   - JNumeric
30
   - CSSBox
31

  
32
This plugin can be configured to be preinstalled automatically, allowing 
33
"Script" type plugins to be installed during the application installation process. 
34
To do this, the following entries must be added to the "packages.properties" 
35
of gvspks::
36

  
37
    installers=scripts
38
    installer.scripts.initializer=org.gvsig.scripting.app.extension.ScriptsInstallerInitializer
39
    installer.scripts.package.code=org.gvsig.scripting.app.mainplugin
40
    installer.scripts.factory.name=Script
41
    installer.scripts.libs=lib
42

  
43
If the "installers" entry already exists, add "scripts" to the end separating 
44
it with a space.
org.gvsig.scripting/tags/org.gvsig.scripting-2.3.53/org.gvsig.scripting.app/org.gvsig.scripting.app.mainplugin/src/main/resources-plugin/scripting/lib-2_0_0/geom.py
1
# -*- coding: utf-8 -*-
2
#
3
# File: gvsig.py
4
#
5
# Copyright (c) 2011 by Model Driven Development sl and Antonio Carrasco Valero
6
#
7
# GNU General Public License (GPL)
8
#
9
# This program is free software; you can redistribute it and/or
10
# modify it under the terms of the GNU General Public License
11
# as published by the Free Software Foundation; either version 2
12
# of the License, or (at your option) any later version.
13
#
14
# This program is distributed in the hope that it will be useful,
15
# but WITHOUT ANY WARRANTY; without even the implied warranty of
16
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
17
# GNU General Public License for more details.
18
#
19
# You should have received a copy of the GNU General Public License
20
# along with this program; if not, write to the Free Software
21
# Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA
22
# 02110-1301, USA.
23
#
24
#
25

  
26
"""
27
Utility functions to manage gvSIG geometries
28
"""
29

  
30
__author__ = """Antonio Carrasco Valero
31
Model Driven Development sl and Antonio Carrasco Valero
32
<carrasco@modeldd.org>
33
Victor Acevedo Royer <vacevedo@gvsig.com> <vacevedor@gmail.com>
34
"""
35

  
36
__docformat__ = 'plaintext'
37

  
38

  
39
from org.gvsig.fmap.geom import Geometry, GeometryLocator
40
from org.gvsig.fmap.geom.primitive import Point
41
from org.gvsig.tools import ToolsLocator
42

  
43

  
44
#GeometryTypes
45
AGGREGATE = Geometry.TYPES.AGGREGATE
46
ARC = Geometry.TYPES.ARC
47
CIRCLE = Geometry.TYPES.CIRCLE
48
CURVE = Geometry.TYPES.CURVE
49
ELLIPSE = Geometry.TYPES.ELLIPSE
50
ELLIPTICARC = Geometry.TYPES.ELLIPTICARC
51
GEOMETRY = Geometry.TYPES.GEOMETRY
52
MULTICURVE = Geometry.TYPES.MULTICURVE
53
MULTIPOINT = Geometry.TYPES.MULTIPOINT
54
MULTISOLID = Geometry.TYPES.MULTISOLID
55
MULTISURFACE = Geometry.TYPES.MULTISURFACE
56
NULL = Geometry.TYPES.NULL
57
POINT = Geometry.TYPES.POINT
58
SOLID =  Geometry.TYPES.SOLID
59
SPLINE = Geometry.TYPES.SPLINE
60
SURFACE = Geometry.TYPES.SURFACE
61

  
62
# Common named geometry types
63
POLYGON = Geometry.TYPES.SURFACE
64
LINE = Geometry.TYPES.CURVE
65
MULTILINE = Geometry.TYPES.MULTICURVE
66
MULTIPOLYGON = Geometry.TYPES.MULTISURFACE
67

  
68
# geometrySubTypes 
69
D2 = Geometry.SUBTYPES.GEOM2D
70
D2M = Geometry.SUBTYPES.GEOM2DM
71
D3 = Geometry.SUBTYPES.GEOM3D
72
D3M = Geometry.SUBTYPES.GEOM3DM
73
UNKNOWN = Geometry.SUBTYPES.UNKNOWN
74
 
75
def createGeometry(type, subtype=D2):
76
    """
77
    Returns a new geometry with a concrete type and subtype or None if can't 
78
    create geometry.
79
    :param type: geometry type
80
    :type type: string
81
    :param subtype: geometry subtype
82
    :type type: string
83
    :return: geometry
84
    :rtype: geometry
85
    """
86
    try:
87
        geometryManager = GeometryLocator.getGeometryManager()
88
        geometry = geometryManager.create(type, subtype)
89
    except:
90
        return None
91
    return geometry
92
  
93
def createPoint(x=0, y=0, subtype=D2):
94
    """
95
    Returns a new point with a subtype and sets the value for the X and the Y 
96
    coordinates (default 0,0) or None if can't create point
97
    :param x: X coordinate value 
98
    :param y: Y coordinate value
99
    :type x: double
100
    :type y: double
101
    :return: Point
102
    :rtype: Point      
103
    """
104
    try:
105
        geometryManager = GeometryLocator.getGeometryManager()
106
        point = geometryManager.createPoint(x, y, subtype)
107
    except:
108
        return None
109
        
110
    return point
111

  
112
def createMultiPoint(subtype=D2, points=None):
113
    """
114
    Returns a new multipoint with a subtype from a list of Points instances. 
115
    Also values of X and Y tuples like ([x1, y1], [x2, y2], ...., [xn, yn]) are 
116
    allowed. If not points returns empty multipoint geometry. If can't create 
117
    geometry return None.
118
    :param points: list of points
119
    :type points: list
120
    :return: multipoint
121
    :rtype: multipoint
122
    """
123
    multipoint = createGeometry(MULTIPOINT, subtype)
124
    if all(points, multipoint):
125
        try:
126
            for point in points: 
127
                multipoint.addPrimitive(point)
128
        except:
129
            return None
130
    
131
    return multipoint 
132

  
133
def createPolygon(subtype=D2, vertexes=None):  
134
    """
135
    Returns a new polygon with a subtype. Or None if can't create the geometry
136
    :return: polygon
137
    :rtype: Geometry    
138
    """  
139
    polygon = createGeometry(SURFACE, subtype)
140
    if all(vertexes, polygon):
141
        try:
142
            for vertex in vertexes:
143
                polygon.addPoint(vertex)
144
            polygon.closePrimitive()
145
        except:
146
            return None  
147
    return polygon
148

  
149
def createMultiPolygon(subtype=D2, polygons=None):  
150
    """
151
    Returns a new multipolygon with a subtype. or None if can't create geometry
152
    :return: multipolygon
153
    :rtype: Geometry
154
    """  
155
    multipolygon = createGeometry(MULTISURFACE, subtype)
156
    return multipolygon  
157
  
158
def createLine(subtype=D2, vertexes=None):  
159
    """
160
    Returns a new line with a subtype or None if can't create geometry
161
    :return: polygon
162
    :rtype: Geometry
163
    """  
164
    line = createGeometry(CURVE, subtype)
165
    return line
166

  
167
def createMultiLine(subtype=D2, lines = None):  
168
    """
169
    Create a new multiline with a subtype or None if can't create geometry
170
    :return: multiline
171
    :rtype: Geometry
172
    """  
173
    multiline = createGeometry(MULTILINE, subtype)
174
    return multiline
175
  
176
def createEnvelope(pointMax=None, pointMin=None, dimension=2):
177
    """
178
    Returns envelope as a minimum bounding box or rectangle. This envelope is 
179
    equivalent to the GM_Envelope specified in ISO 19107. 
180
    :param pointMax: 
181
    :type pointMax: geometry POINT
182
    :param pointMin: 
183
    :type pointMin: geometry POINT
184
    """
185
    geometryManager = GeometryLocator.getGeometryManager()
186
  
187
    if all((pointMax, pointMin)):
188
        envelope = geometryManager.createEnvelope(pointMax, pointMin)
189
    else:
190
        envelope = geometryManager.createEnvelope()    
191
  
192
    return envelope
193
    
194

  
195
def main():
196
  point = createPoint(1,1)
org.gvsig.scripting/tags/org.gvsig.scripting-2.3.53/org.gvsig.scripting.app/org.gvsig.scripting.app.mainplugin/src/main/resources-plugin/scripting/lib-2_0_0/simpleui.py
1
# -*- coding: utf-8 -*-
2
#
3
# File: simpleui.py
4
#
5
# Copyright (c) 2011 by Model Driven Development sl and Antonio Carrasco Valero
6
#
7
# GNU General Public License (GPL)
8
#
9
# This program is free software; you can redistribute it and/or
10
# modify it under the terms of the GNU General Public License
11
# as published by the Free Software Foundation; either version 2
12
# of the License, or (at your option) any later version.
13
#
14
# This program is distributed in the hope that it will be useful,
15
# but WITHOUT ANY WARRANTY; without even the implied warranty of
16
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
17
# GNU General Public License for more details.
18
#
19
# You should have received a copy of the GNU General Public License
20
# along with this program; if not, write to the Free Software
21
# Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA
22
# 02110-1301, USA.
23
#
24
#
25

  
26
__author__ = """Antonio Carrasco Valero
27
Model Driven Development sl and Antonio Carrasco Valero
28
<carrasco@modeldd.org>"""
29
__docformat__ = 'plaintext'
30

  
31

  
32
from gvsig import *
33

  
34
def loadViewsInCombo(dialog, combo):
35
  cleanCombo(dialog, combo)
36
  project = currentProject()
37
  print "project"
38
  views = project.getViews()
39
  print "views"
40
  if isinstance(combo, str):
41
    combo = dialog.find(combo)
42
  print "combo"
43
  if combo == None:
44
    return
45
  print "combo not None"
46
  for view in views:
47
    print "create view choice"
48
    ch = dialog.create("choice")  
49
    dialog.setString(ch, "name", view.getName())
50
    dialog.setString(ch, "text", view.getName())
51
    #FIXME
52
    #--------------------
53
    
54
    dialog.putProperty(ch, "view", View(view))
55
    #----------------------
56
    dialog.add(combo, ch)
57
  print "Finish add combo choices"
58
  
59

  
60
def loadLayersInCombo(dialog, combo, viewName):
61
  if isinstance(combo, str):
62
    combo = dialog.find(combo)
63
  p = currentProject()
64
  view = p.getView(viewName)
65

  
66
  if combo == None or view == None:
67
    return
68
  cleanCombo(dialog, combo)
69
  
70
  ls = view.getLayers()
71
  try:
72
    for i in xrange(len(ls)):
73
      l = ls.getLayer(i)
74
      ch = dialog.create("choice")  
75
      dialog.setString(ch, "name", l.getName())
76
      dialog.setString(ch, "text", l.getName())    #FIXME
77
      #--------------------
78
      dialog.putProperty(ch, "layer",Layer(l))
79
      #----------------------
80

  
81
      dialog.add(combo, ch)
82
  except Exception, ex:
83
    print "Error %s"%repr(ex)
84

  
85
  
86
  print "Finish add layers combo choices"
87

  
88
def cleanCombo(dialog, combo):
89
  print "cleanCombo"
90
  if isinstance(combo, str):
91
    combo = dialog.find(combo)
92
  if combo == None:
93
    return
94
  choices = dialog.getItems(combo)
95
  if len(choices) >0:
96
    for ch in choices:
97
      dialog.remove(ch)
98

  
99
def getSelectedView(dialog, combo):
100
  if isinstance(combo, str):
101
    combo = dialog.find(combo)
102
  choice = dialog.getSelectedItem(combo)
103
  if choice == None:
104
    return
105
  viewName = dialog.getString(choice,"name")
106
  #FIXME
107
  """
108
  project = currentProject()
109
  view = project.getView(viewName)
110
  """
111
  view = dialog.getProperty(choice, "view")
112
  return view
113

  
114
def getSelectedViewName(dialog, combo):
115
  v = getSelectedView(dialog, combo)
116
  return v.getName()
117

  
118
def getSelectedLayer(dialog, combo):
119
  if isinstance(combo, str):
120
    combo = dialog.find(combo)
121
  choice = dialog.getSelectedItem(combo)
122
  if choice == None:
123
    return
124
  #FIXME
125
  """
126
  layerName = dialog.getString(choice,"name")
127
  project = currentProject()
128
  layer = project.getView(layerName)
129
  """
130
  layer = dialog.getProperty(choice,"layer")
131
  print layer.getName()
132
  return layer
org.gvsig.scripting/tags/org.gvsig.scripting-2.3.53/org.gvsig.scripting.app/org.gvsig.scripting.app.mainplugin/src/main/resources-plugin/scripting/lib-2_0_0/commonsdialog.py
1
# -*- coding: utf-8 -*-
2
#
3
# File: commonsdialog.py
4
#
5
# Copyright (c) 2011 by Model Driven Development sl and Antonio Carrasco Valero
6
#
7
# GNU General Public License (GPL)
8
#
9
# This program is free software; you can redistribute it and/or
10
# modify it under the terms of the GNU General Public License
11
# as published by the Free Software Foundation; either version 2
12
# of the License, or (at your option) any later version.
13
#
14
# This program is distributed in the hope that it will be useful,
15
# but WITHOUT ANY WARRANTY; without even the implied warranty of
16
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
17
# GNU General Public License for more details.
18
#
19
# You should have received a copy of the GNU General Public License
20
# along with this program; if not, write to the Free Software
21
# Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA
22
# 02110-1301, USA.
23
#
24
#
25

  
26
__author__ = """Antonio Carrasco Valero
27
Model Driven Development sl and Antonio Carrasco Valero
28
<carrasco@modeldd.org>
29
Victor Acevedo Royer <vacevedo@gvsig.com> <vacevedor@gmail.com>
30
"""
31
__docformat__ = 'plaintext'
32

  
33

  
34
from javax.swing import JFileChooser
35
from javax.swing.filechooser import FileNameExtensionFilter
36

  
37
#from org.gvsig.app import ApplicationLocator      
38

  
39
from org.gvsig.andami.ui.mdiFrame import DefaultThreadSafeDialogs
40

  
41
#====================================
42
# SWING
43

  
44
#
45
#messageType options
46
FORBIDEN = 0
47
IDEA= 1
48
WARNING= 2
49
QUESTION= 3
50

  
51
#
52
#Confirmdialog optionType Options
53
YES_NO = 0
54
YES_NO_CANCEL = 1
55
ACEPT_CANCEL = 2
56

  
57
#filechooser options
58
OPEN_FILE = 0
59
OPEN_DIRECTORY = 1
60
SAVE_FILE = 2
61

  
62
#filechooser selectionMode
63
FILES_ONLY = JFileChooser.FILES_ONLY
64
DIRECTORIES_ONLY = JFileChooser.DIRECTORIES_ONLY
65

  
66

  
67
def msgbox(message, title="", messageType=IDEA):
68
    """Shows a message dialog with ok button only
69
    :param message: text to present in the dialog
70
    :param title: title of the dialog
71
    :param messageType: type of icon to use.
72
    """
73
    DefaultThreadSafeDialogs().messageDialog(message, title, messageType)
74

  
75
   
76
def inputbox(message, title="", messageType=IDEA, initialValue=""):
77
    """
78
    Shows a input dialog.
79
    :param message: text to present in the dialog
80
    :param title: title of the dialog
81
    :messageType: type of icon to use
82
    :initialValue: Initial value of the inputbox  
83
    """
84
    return DefaultThreadSafeDialogs().inputDialog(message, title, 
85
        messageType, initialValue) 
86
  
87
  
88
def confirmDialog(message, title="", optionType=YES_NO, messageType=IDEA):
89
    """
90
    Create a message dialog with options button
91
    :param message: text to present in the dialog
92
    :param title: title of the dialog
93
    :optionType: bottons to show
94
    :param messageType: type of icon to use.    
95
    """
96
    #0: yes/no option
97
    #1: yes/no/cancelar
98
    #2: accept/cancel
99
    return DefaultThreadSafeDialogs().confirmDialog(message, title, 
100
        optionType, messageType) 
101

  
102
def filechooser(option, title="", initialPath=None, 
103
        multiselection=False, filter = None, fileHidingEnabled=True):
104
    """
105
    Allows configuration parameters to filechooser dialogs
106
    :int option: file chooser selection mode. Allowed values:
107
        OPEN_FILE, OPEN_DIRECTORY, SAVE_FILE
108
    :String title: Window title
109
    :String initialPath: Initial path to the directory to open in the dialog
110
    :boolean multiselection: Allow select more than one object.
111
    :String[] filter: list of acepted extension files ("jpg", "png", "gif")
112
    :boolean fileHidingEnabled: True if hidden files are not displayed
113
    """ 
114
    #
115
    #Values for open files dialog
116
    dialogType = JFileChooser.OPEN_DIALOG
117
    selectionMode = FILES_ONLY
118
    
119
    if option == SAVE_FILE:
120
        dialogType = JFileChooser.SAVE_DIALOG
121
    elif option == OPEN_DIRECTORY:
122
        selectionMode = DIRECTORIES_ONLY
123

  
124
    initialPath = getJavaFile(initialPath)
125
   
126
    if filter:
127
        filter = FileNameExtensionFilter("Files", filter)
128
       
129
    return DefaultThreadSafeDialogs().showChooserDialog(
130
            title,
131
            dialogType,
132
            selectionMode,
133
            multiselection,
134
            initialPath,
135
            filter,
136
            fileHidingEnabled)
137
   
138
def openFileDialog(title='', initialPath=None):
139
    """
140
    Shows a window dialog to choose one file. 
141
    :param title: Window title. Default ''
142
    :type title: string
143
    :param initialPath: Initial path to open in window dialog
144
    :type initialPath: string
145
    """
146
  
147
    return DefaultThreadSafeDialogs().showOpenFileDialog(
148
        title, 
149
        getJavaFile(initialPath))
150

  
151
def openFolderDialog(title='', initialPath=None):
152
    """
153
    Shows a window dialog to choose one folder. 
154
    :param title: Window title. Default ''
155
    :type title: string
156
    :param initialPath: Initial path to open in window dialog
157
    :type initialPath: string
158
    """    
159
  
160
    return DefaultThreadSafeDialogs().showOpenDirectoryDialog(
161
        title, 
162
        getJavaFile(initialPath))
163
  
164
def saveFileDialog(title='', initialPath=None):
165
    """
166
    Shows a window dialog to choose one file. 
167
    :param title: Window title. Default ''
168
    :type title: string
169
    :param initialPath: Initial path to open in window dialog
170
    :type initialPath: string
171
    """    
172
    
173
    return DefaultThreadSafeDialogs().showSaveFileDialog(
174
        title, 
175
        getJavaFile(initialPath)
176
    )
177
  
178
def getJavaFile(path):
179
    """Returns a java File using parameter path.
180
    If path doesn't exists looks for user home folder and if can not find it, 
181
    returns path will be gvSIG instance directory.
182
    """
183
    #
184
    #Needs because DefaultThreadSafeDialogs files methods use a java File 
185
    #instance as initialPath parameter
186
    #
187
    import os
188
    import java.io.File as JFile  
189
  
190
    if path:
191
        path = os.path.normpath(path)
192
        if os.path.exists(path):
193
            return JFile(path)
194
        
195
    if os.environ.has_key('HOME'):
196
        return JFile(os.environ.get('HOME', os.getcwd()))
197

  
198
    if os.path.exists(os.path.expanduser("~")):
199
        return JFile(os.path.expanduser("~"))
200
    
201
    return JFile(os.getcwd())
202
    
203
    
org.gvsig.scripting/tags/org.gvsig.scripting-2.3.53/org.gvsig.scripting.app/org.gvsig.scripting.app.mainplugin/src/main/resources-plugin/scripting/lib-2_0_0/console/dis.py
1
"""Disassembler of Python byte code into mnemonics."""
2

  
3
import sys
4
import types
5

  
6
__all__ = ["dis","disassemble","distb","disco","opname","cmp_op",
7
           "hasconst","hasname","hasjrel","hasjabs","haslocal",
8
           "hascompare", "hasfree"]
9

  
10
def dis(x=None):
11
    """Disassemble classes, methods, functions, or code.
12

  
13
    With no argument, disassemble the last traceback.
14

  
15
    """
16
    if not x:
17
        distb()
18
        return
19
    if type(x) is types.InstanceType:
20
        x = x.__class__
21
    if hasattr(x, 'im_func'):
22
        x = x.im_func
23
    if hasattr(x, 'func_code'):
24
        x = x.func_code
25
    if hasattr(x, '__dict__'):
26
        items = x.__dict__.items()
27
        items.sort()
28
        for name, x1 in items:
29
            if type(x1) in (types.MethodType,
30
                            types.FunctionType,
31
                            types.CodeType):
32
                print "Disassembly of %s:" % name
33
                try:
34
                    dis(x1)
35
                except TypeError, msg:
36
                    print "Sorry:", msg
37
                print
38
    elif hasattr(x, 'co_code'):
39
        disassemble(x)
40
    else:
41
        raise TypeError, \
42
              "don't know how to disassemble %s objects" % \
43
              type(x).__name__
44

  
45
def distb(tb=None):
46
    """Disassemble a traceback (default: last traceback)."""
47
    if not tb:
48
        try:
49
            tb = sys.last_traceback
50
        except AttributeError:
51
            raise RuntimeError, "no last traceback to disassemble"
52
        while tb.tb_next: tb = tb.tb_next
53
    disassemble(tb.tb_frame.f_code, tb.tb_lasti)
54

  
... This diff was truncated because it exceeds the maximum size that can be displayed.

Also available in: Unified diff