Examples of Python


Examples of org.geoserver.python.Python

    static PythonMapFormatAdapter adapter;
   
    @BeforeClass
    public static void setUpData() throws Exception {
        GeoServerResourceLoader loader = new GeoServerResourceLoader(new File("target"));
        py = new Python(loader);
       
        File f = new File("target", "foo_mapformat.py");
        FileUtils.copyURLToFile(PythonVectorFormatAdapterTest.class.getResource("foo_mapformat.py"), f);
        adapter = new PythonMapFormatAdapter(f, py);
    }
View Full Code Here

Examples of org.geoserver.python.Python

    static PythonVectorFormatAdapter adapter;
   
    @BeforeClass
    public static void setUpData() throws Exception {
        GeoServerResourceLoader loader = new GeoServerResourceLoader(new File("target"));
        py = new Python(loader);
       
        File f = new File("target", "foo_vectorformat.py");
        FileUtils.copyURLToFile(PythonVectorFormatAdapterTest.class.getResource("foo_vectorformat.py"), f);
        adapter = new PythonVectorFormatAdapter(f, py);
    }
View Full Code Here

Examples of org.geoserver.python.Python

    static PythonProcessAdapter adapter;
   
    @BeforeClass
    public static void setUpData() throws Exception {
        GeoServerResourceLoader loader = new GeoServerResourceLoader(new File("target"));
        py = new Python(loader);
       
        File f = new File("target", "foo_process.py");
        FileUtils.copyURLToFile(PythonProcessAdapterTest.class.getResource("foo_process.py"), f);
        adapter = new PythonProcessAdapter(f, py);
    }
View Full Code Here

Examples of org.geoserver.python.Python

    TextArea outputTextArea;
    String output = ">>> ";
    String input = "";
   
    public PythonConsolePage() {
        Python python = getGeoServerApplication().getBeanOfType(Python.class);
        python.interpreter();
        model = new PythonInterpreterDetachableModel();
       
        Form form = new Form("form");
        add(form);
       
View Full Code Here

Examples of org.geoserver.python.Python

    @BeforeClass
    public static void setUpData() throws Exception {
        DeleteDbFiles.execute("target", "foobar", true);
       
        GeoServerResourceLoader loader = new GeoServerResourceLoader(new File("target"));
        PythonInterpreter pi = new Python(loader).interpreter();
        pi.exec("from geoscript.workspace import H2");
        pi.exec("from geoscript.geom import Point");
        pi.exec("h2 = H2('foobar', 'target')");
        pi.exec("l = h2.create('bar', [('geom', Point, 'epsg:4326'), ('baz', str)])");
        pi.exec("l.add([Point(10,10), 'ten'])");
View Full Code Here

Examples of org.geoserver.python.Python

    Python py;
    SoftValueHashMap<String, PythonFilterFunctionAdapter> adapters = new SoftValueHashMap(10);
   
    public List<FunctionName> getFunctionNames() {
        FilterFactory ff = CommonFactoryFinder.getFilterFactory(null);
        Python py = py();
       
        List<FunctionName> names = new ArrayList<FunctionName>();
        try {
            File filterRoot = py.getFilterRoot();
            for (String file : filterRoot.list()) {
                if (file.endsWith(".py")) {
                    PythonFilterFunctionAdapter adapter =
                        new PythonFilterFunctionAdapter(new File(filterRoot, file), py);
                    for(String name : adapter.getNames()) {
View Full Code Here

Examples of org.geoserver.python.Python

   
    public Set<Name> getNames() {
        Python.LOGGER.fine("Performning process lookup");
        Set<Name> names = new TreeSet<Name>();
       
        Python py = py();
        try {
            File processRoot = py.getProcessRoot();
            for (String file : processRoot.list()) {
                if (file.endsWith(".py")) {
                    File f = new File(processRoot, file);
                    PythonProcessAdapter adapter = new PythonProcessAdapter(f, py);
                   
View Full Code Here

Examples of org.geoserver.python.Python

    static PythonFilterFunctionAdapter adapter;
   
    @BeforeClass
    public static void setUpData() throws Exception {
        GeoServerResourceLoader loader = new GeoServerResourceLoader(new File("target"));
        py = new Python(loader);
       
        File f = new File("target", "foo_function.py");
        FileUtils.copyURLToFile(PythonFilterFunctionAdapterTest.class.getResource("foo_function.py"), f);
        adapter = new PythonFilterFunctionAdapter(f, py);
    }
View Full Code Here

Examples of org.geoserver.python.Python

    static PythonDataStoreAdapter adapter;
   
    @BeforeClass
    public static void setUpData() throws Exception {
        GeoServerResourceLoader loader = new GeoServerResourceLoader(new File("target"));
        py = new Python(loader);
       
        File f = new File("target", "foo_process.py");
        FileUtils.copyURLToFile(PythonDataStoreAdapterTest.class.getResource("foo_datastore.py"), f);
        adapter = new PythonDataStoreAdapter(f, py);
    }
View Full Code Here

Examples of org.geoserver.python.Python

    Python py;
    SoftValueHashMap<Name, PythonFilterFunctionAdapter> adapters = new SoftValueHashMap(10);
   
    public List<FunctionName> getFunctionNames() {
        FilterFactory ff = CommonFactoryFinder.getFilterFactory(null);
        Python py = py();
       
        List<FunctionName> names = new ArrayList<FunctionName>();
        try {
            File filterRoot = py.getFilterRoot();
            for (String file : filterRoot.list()) {
                if (file.endsWith(".py")) {
                    PythonFilterFunctionAdapter adapter =
                        new PythonFilterFunctionAdapter(new File(filterRoot, file), py);
                    for(String name : adapter.getNames()) {
View Full Code Here
TOP
Copyright © 2018 www.massapi.com. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.