## 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 xml.auto_gen import XMLDAOListBase from sql.auto_gen import SQLDAOListBase from vistrails.core.system import get_elementtree_library from vistrails.db import VistrailsDBException from vistrails.db.versions.v1_0_2 import version as my_version from vistrails.db.versions.v1_0_2.domain import DBGroup, DBWorkflow, DBVistrail, DBLog, \ DBRegistry ElementTree = get_elementtree_library() class DAOList(dict): def __init__(self): self['xml'] = XMLDAOListBase() self['sql'] = SQLDAOListBase() def parse_xml_file(self, filename): return ElementTree.parse(filename) def write_xml_file(self, filename, tree): def indent(elem, level=0): i = "\n" + level * " " if len(elem): if not elem.text or not elem.text.strip():
############################################################################## # Transfer Function Widget for VTK from PyQt4 import QtCore, QtGui from vistrails.gui.modules.constant_configuration import ConstantWidgetMixin from vistrails.core.modules.basic_modules import new_constant, init_constant, Module from vistrails.core.modules.module_registry import get_module_registry from vistrails.core.system import get_elementtree_library from vistrails.core.utils.color import ColorByName import vtk import math import pickle import copy import StringIO import unittest ElementTree = get_elementtree_library() from identifiers import identifier as vtk_pkg_identifier ################################################################################ # etc def clamp(v, mn, mx, eps=0.0): mne = mn + eps mxe = mx - eps if v < mne: return mn if v > mxe: return mx return v # Because of a Qt bug see # http://bugreports.qt.nokia.com/browse/QTBUG-17985 # We cannot set the scene from 0 to 1. In this case we will set it