Exemple #1
0
 def test_config(self):
     config_obj = ConfigurationObject(file=ConfigurationObject(
         seriesStart=5))
     self.assertTrue(
         FileModeConfig.has_from_config(config_obj, "seriesStart"))
     self.assertEqual(
         FileModeConfig.get_from_config(config_obj, "seriesStart"), 5)
Exemple #2
0
 def convert(_startup):
     _startup.__class__ = VistrailsStartup
     ConfigurationObject.convert(_startup.configuration)
     for _pkg in _startup.db_enabled_packages.db_packages:
         StartupPackage.convert(_pkg)
     for _pkg in _startup.db_disabled_packages.db_packages:
         StartupPackage.convert(_pkg)
Exemple #3
0
 def convert(_startup):
     _startup.__class__ = VistrailsStartup
     ConfigurationObject.convert(_startup.configuration)
     for _pkg in _startup.db_enabled_packages.db_packages:
         StartupPackage.convert(_pkg)
     for _pkg in _startup.db_disabled_packages.db_packages:
         StartupPackage.convert(_pkg)
Exemple #4
0
    def test_subclass_config(self):
        class AlteredFileModeConfig(FileModeConfig):
            mode_type = "file"
            _fields = [ConfigField("newattr", 3, int)]

        config_obj = ConfigurationObject(file=ConfigurationObject(
            seriesStart=5))
        self.assertEqual(
            AlteredFileModeConfig.get_from_config(config_obj, "seriesStart"),
            5)
Exemple #5
0
    def init(self, options_dict=None, args=[]):
        """ VistrailsApplicationSingleton(options_dict: dict, args: list)
                                          -> VistrailsApplicationSingleton
        Create the application with a dict of settings
        
        """
        warnings.simplefilter('once', VistrailsWarning, append=True)

        # options_dict overrides startup configuration
        if options_dict is not None:
            options_config = ConfigurationObject(**options_dict)
        else:
            options_config = None

        # command line options override both
        command_line_config = self.read_options(args)

        # startup takes care of all configurations
        self.startup = VistrailsStartup(options_config, command_line_config)

        self.keyChain = keychain.KeyChain()
        vistrails.core.interpreter.default.connect_to_configuration(
            self.temp_configuration)

        # now we want to open vistrails and point to a specific version

        self.check_all_requirements()

        if self.temp_configuration.check('staticRegistry'):
            self.registry = \
                self.create_registry(self.temp_configuration.staticRegistry)
        else:
            self.registry = self.create_registry(None)

        self.package_manager = PackageManager(self.registry, self.startup)
Exemple #6
0
 def test_simple_create(self):
     dir_name = tempfile.mkdtemp()
     options_config = ConfigurationObject(dotVistrails=dir_name)
     try:
         startup = VistrailsStartup(options_config, None)
         self.check_structure(dir_name)
     finally:
         shutil.rmtree(dir_name)
Exemple #7
0
 def test_create_dir_create(self):
     outer_dir_name = tempfile.mkdtemp()
     dir_name = os.path.join(outer_dir_name, '.vistrails')
     cl_config = ConfigurationObject(dotVistrails=dir_name)
     try:
         startup = VistrailsStartup(None, cl_config)
         self.check_structure(dir_name)
     finally:
         shutil.rmtree(outer_dir_name)
Exemple #8
0
 def test_cannot_create(self):
     (fd, fname) = tempfile.mkstemp()
     os.close(fd)
     config = ConfigurationObject(dotVistrails=fname)
     try:
         with self.assertRaises(ValueError):
             startup = VistrailsStartup(config, None)
     finally:
         os.unlink(fname)
Exemple #9
0
 def test_default_startup_xml(self):
     dir_name = tempfile.mkdtemp()
     config = ConfigurationObject(dotVistrails=dir_name)
     try:
         startup = VistrailsStartup(config, None)
         self.assertTrue(startup.configuration.executionLog)
         self.assertTrue(startup.configuration.autoSave)
         self.assertTrue(startup.temp_configuration.autoSave)
     finally:
         shutil.rmtree(dir_name)
Exemple #10
0
 def test_permissions(self):
     if systemType in ['Windows', 'Microsoft']:
         self.skipTest("chmod on Windows is limited")
     dir_name = tempfile.mkdtemp()
     config = ConfigurationObject(dotVistrails=dir_name)
     try:
         os.chmod(dir_name, stat.S_IRUSR)
         with self.assertRaises(IOError):
             startup = VistrailsStartup(config, None)
     finally:
         os.chmod(dir_name, stat.S_IRWXU)
         shutil.rmtree(dir_name)
Exemple #11
0
###############################################################################
""" This package defines a set of methods to deal with web services.
It requires suds library to be installed. Click on configure to add wsdl
urls to the package (use a ; to separate the urls).
"""
from __future__ import division

from vistrails.core.configuration import ConfigurationObject
import vistrails.core

identifier = 'org.vistrails.vistrails.sudswebservices'
name = 'SUDS Web Services'
version = '0.1.2'
old_identifiers = ['edu.utah.sci.vistrails.sudswebservices']
configuration = ConfigurationObject(wsdlList=(None, str),
                                    proxy_http=(None, str),
                                    cache_days=(None, int))


def can_handle_identifier(identifier):
    """ This package handles packages where identifier starts with SUDS#
    """
    return identifier.startswith('SUDS#')

def can_handle_vt_file(name):
    """ This package handles file in zipped .vt files that ends with
        "-wsdl-px"
        They are cached web service instances 
    """
    return name.endswith("-wsdl.px")
    
Exemple #12
0
# Set up configuration objects so that user settings are available.
try:
    from vistrails.core.configuration import ConfigurationObject

    # Try to get a project from environment variable for
    # setting up directory structure
    configuration = ConfigurationObject(
        #Path to MIP data
        drs_basepath='',
        #Path to QA/QC processed data
        authoritative_basepath='',
        #Path to put user files
        user_basepath='/local/%s/%s/' % (PROJECT, USER),
        #Execution Manager
        execution_manager='SimpleExecManager',
        #Execution Options
        execution_options='update',
        #Dummy run
        simulate_execution=False,
        #Data manager
        data_manager='SimpleDataManager',
        #Turn on debugging
        debug=False,
        #Path to CWSL Climate Toolkit
        cwsl_ctools_path='',
    )
except ImportError:
    # If vistrails is not in the PYTHONPATH, we are in testing mode.
    # use a dummy config object.
    configuration = DummyConfig({'cwsl_ctools_path': os.path.expanduser("~")})
##  - Redistributions in binary form must reproduce the above copyright
##    notice, this list of conditions and the following disclaimer in the
##    documentation and/or other materials provided with the distribution.
##  - Neither the name of the New York University nor the names of its
##    contributors may be used to endorse or promote products derived from
##    this software without specific prior written permission.
##
## THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
## AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO,
## THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR
## PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR
## CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL,
## EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO,
## PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS;
## OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY,
## WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR
## OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF
## ADVISED OF THE POSSIBILITY OF SUCH DAMAGE."
##
###############################################################################

from __future__ import division

from vistrails.core.configuration import ConfigurationObject

configuration = ConfigurationObject(rowCount=2,
                                    columnCount=3,
                                    dumpfileType='PNG',
                                    fixedCellSize=False)
# other possible value for dumpfileType is PDF
Exemple #14
0
## PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR
## CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL,
## EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO,
## PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS;
## OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY,
## WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR
## OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF
## ADVISED OF THE POSSIBILITY OF SUCH DAMAGE."
##
###############################################################################
from vistrails.core.configuration import ConfigurationObject

version = '0.3.1'
identifier = 'org.vistrails.vistrails.remoteq'
name = 'RemoteQ'

old_identifiers = ['org.vistrails.pbs', 'edu.utah.sci.vistrails.hadoop']

configuration = ConfigurationObject(server=(None, str),
                                    port=(None, int),
                                    password=True,
                                    username=(None, str),
                                    uris=(None, str),
                                    defaultFS=(None, str))


def package_requirements():
    import vistrails.core.requirements
    if not vistrails.core.requirements.python_module_exists('remoteq'):
        raise vistrails.core.requirements.MissingRequirement('remoteq')
Exemple #15
0
##    documentation and/or other materials provided with the distribution.
##  - Neither the name of the New York University nor the names of its
##    contributors may be used to endorse or promote products derived from
##    this software without specific prior written permission.
##
## THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
## AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO,
## THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR
## PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR
## CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL,
## EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO,
## PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS;
## OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY,
## WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR
## OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF
## ADVISED OF THE POSSIBILITY OF SUCH DAMAGE."
##
###############################################################################
from __future__ import division

from vistrails.core.configuration import ConfigurationObject

from identifiers import *

configuration = ConfigurationObject(global_db=(None, str),
                                    local_db=(None, str),
                                    git_bin=(None, str),
                                    search_dbs=(None, str),
                                    compress_by_default=False,
                                    debug=False)
Exemple #16
0
##  - Neither the name of the University of Utah nor the names of its
##    contributors may be used to endorse or promote products derived from
##    this software without specific prior written permission.
##
## THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
## AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO,
## THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR
## PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR
## CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL,
## EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO,
## PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS;
## OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY,
## WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR
## OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF
## ADVISED OF THE POSSIBILITY OF SUCH DAMAGE."
##
###############################################################################
"""ImageMagick package for VisTrails.

This package defines a set of modules that perform some of the
operations exposed by the ImageMagick package.

"""
from vistrails.core.configuration import ConfigurationObject

identifier = 'org.vistrails.vistrails.imagemagick'
name = 'ImageMagick'
version = '0.9.5'
old_identifiers = ['edu.utah.sci.vistrails.imagemagick']
configuration = ConfigurationObject(quiet=False, path=(None, str))
Exemple #17
0
##    this list of conditions and the following disclaimer.
##  - Redistributions in binary form must reproduce the above copyright
##    notice, this list of conditions and the following disclaimer in the
##    documentation and/or other materials provided with the distribution.
##  - Neither the name of the New York University nor the names of its
##    contributors may be used to endorse or promote products derived from
##    this software without specific prior written permission.
##
## THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
## AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO,
## THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR
## PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR
## CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL,
## EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO,
## PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS;
## OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY,
## WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR
## OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF
## ADVISED OF THE POSSIBILITY OF SUCH DAMAGE."
##
###############################################################################
""" This package provides a way to wrap command line tools into VisTrails modules
"""
from __future__ import division

from vistrails.core.configuration import ConfigurationObject

from identifiers import *

configuration = ConfigurationObject(env=(None, str))
Exemple #18
0
    * Adding http package to package dependencies
2010-01-27  (by VisTrails Team)
    * Updated package to version 0.9.2 
    * Supporting hierarchy of types (not fully tested yet)
    * Changing the default port names of modules to 'self', keeping the old 
      names (as optional ports) for backwards compatibility 
2010-01-25  (by VisTrails Team)
    * Updated package to version 0.9.1 
    * Expanded map of simple types
"""
from vistrails.core.configuration import ConfigurationObject
import vistrails.core

identifier = 'org.vistrails.vistrails.webservices'
name = 'Web Services'
version = '0.9.4'
old_identifiers = ['edu.utah.sci.vistrails.webservices']
configuration = ConfigurationObject(wsdlList=(None, str),
                                    showWarning=True)

def package_dependencies():
    return ['org.vistrails.vistrails.http']
    
def package_requirements():
    from vistrails.core.requirements import require_python_module
    require_python_module('ZSI', {
            'pip': 'zsi',
            'linux-debian': 'python-zsi',
            'linux-ubuntu': 'python-zsi',
            'linux-fedora': 'python-ZSI'})
Exemple #19
0
 def convert(_pkg):
     _pkg.__class__ = StartupPackage
     if _pkg.configuration is not None:
         ConfigurationObject.convert(_pkg.configuration)
     _pkg.prefix = None
Exemple #20
0
##  - Neither the name of the New York University nor the names of its
##    contributors may be used to endorse or promote products derived from
##    this software without specific prior written permission.
##
## THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
## AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO,
## THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR
## PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR
## CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL,
## EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO,
## PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS;
## OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY,
## WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR
## OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF
## ADVISED OF THE POSSIBILITY OF SUCH DAMAGE."
##
###############################################################################

from __future__ import division

from vistrails.core.configuration import ConfigurationObject

from .identifiers import *

configuration = ConfigurationObject(file_store=(None, str))


def package_requirements():
    from vistrails.core.requirements import require_python_module
    require_python_module('file_archive', {'pip': 'file_archive'})
Exemple #21
0
try:
    from vistrails.core.configuration import ConfigurationObject
except ImportError:
    from core.configuration import ConfigurationObject

name = "GeoDataPortal"
identifier = "gov.usgs.GeoDataPortal"
version = '0.0.2'

configuration = \
    ConfigurationObject(cur_session_folder = r'C:\temp\SAHM_workspace',
                        cur_WPS_URL = "default")
Exemple #22
0
    if not python_module_exists('shapely'):
        raise MissingRequirement('shapely')
    if not python_module_exists('pyproj'):
        raise MissingRequirement('pyproj')
    if not python_module_exists('scipy'):
        raise MissingRequirement('scipy')


if system.systemType in ['Microsoft', 'Windows']:
    #  on Windows the default location of these is relative to the python.exe
    pyloc = sys.executable
    configuration = \
        ConfigurationObject(output_dir=r'C:\temp\SAHM_workspace',
                            r_path=r'Central_R\R-3.2.0\bin',
                            maxent_path=r'Not Set',
                            java_path=r'java',
                            cur_session_folder=r"C:\temp\SAHM_workspace",
                            cur_processing_mode="multiple models simultaneously (1 core each)",
                            default_seed='1234',
                            verbose='True')
else:
    configuration = \
        ConfigurationObject(output_dir=r'C:\temp\SAHM_workspace',
                            r_path=r'Not Set',
                            maxent_path=r'Not Set',
                            java_path=r'java',
                            cur_session_folder=r"C:\temp\SAHM_workspace",
                            cur_processing_mode="multiple models simultaneously (1 core each)",
                            default_seed='1234',
                            verbose='True')
Exemple #23
0
# Copyright (C) 2014-2015 New York University
# This file is part of ReproZip which is released under the Revised BSD License
# See file LICENSE for full license details.

"""VisTrails package for reprounzip.

This package is the component loaded by VisTrails that provide the
reprounzip modules. A separate component, reprounzip-vistrails, is a plugin for
reprounzip that creates VisTrails pipelines that use this package.
"""

from __future__ import division

from vistrails.core.configuration import ConfigurationObject


identifier = 'io.github.vida-nyu.reprozip.reprounzip'
name = 'reprounzip'
version = '0.1'


configuration = ConfigurationObject(reprounzip_python='python')
Exemple #24
0
 def convert(_pkg):
     _pkg.__class__ = StartupPackage
     if _pkg.configuration is not None:
         ConfigurationObject.convert(_pkg.configuration)
     _pkg.prefix = None
Exemple #25
0
import os.path
import platform
import shutil
import sys
import copy

from PyQt4 import QtCore, QtGui
from vistrails.packages.spreadsheet.basic_widgets import SpreadsheetCell, CellLocation
from vistrails.packages.spreadsheet.spreadsheet_cell import QCellWidget
import vistrails.packages.spreadsheet

import pyalps

basic = vistrails.core.modules.basic_modules

config = ConfigurationObject()


##############################################################################
def _get_path(binary_file):

    if config.check('alpspath'):
        exename = os.path.join(config.alpspath, binary_file)
    else:
        exename = binary_file
    if platform.system() == 'Windows':
        return exename + '.exe'
    else:
        return exename