How to use is_dirty method in lisa

Best Python code snippet using lisa_python

auto_gen.py

Source:auto_gen.py Github

copy

Full Screen

1###############################################################################2##3## Copyright (C) 2014-2016, New York University.4## Copyright (C) 2011-2014, NYU-Poly.5## Copyright (C) 2006-2011, University of Utah.6## All rights reserved.7## Contact: contact@vistrails.org8##9## This file is part of VisTrails.10##11## "Redistribution and use in source and binary forms, with or without12## modification, are permitted provided that the following conditions are met:13##14## - Redistributions of source code must retain the above copyright notice,15## this list of conditions and the following disclaimer.16## - Redistributions in binary form must reproduce the above copyright17## notice, this list of conditions and the following disclaimer in the18## documentation and/or other materials provided with the distribution.19## - Neither the name of the New York University nor the names of its20## contributors may be used to endorse or promote products derived from21## this software without specific prior written permission.22##23## THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"24## AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO,25## THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR26## PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR27## CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL,28## EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO,29## PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS;30## OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY,31## WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR32## OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF33## ADVISED OF THE POSSIBILITY OF SUCH DAMAGE."34##35###############################################################################36"""generated automatically by auto_dao.py"""37from __future__ import division38import copy39class DBPortSpec(object):40 vtType = 'portSpec'41 def __init__(self, id=None, name=None, type=None, spec=None):42 self.__db_id = id43 self.__db_name = name44 self.__db_type = type45 self.__db_spec = spec46 self.is_dirty = True47 48 def __copy__(self):49 cp = DBPortSpec()50 cp.db_id = self.db_id51 cp.is_dirty = self.is_dirty52 cp.db_name = self.db_name53 cp.is_dirty = self.is_dirty54 cp.db_type = self.db_type55 cp.is_dirty = self.is_dirty56 cp.db_spec = self.db_spec57 cp.is_dirty = self.is_dirty58 return cp59 def db_children(self, parent=(None,None), orphan=False):60 children = []61 children.append((self, parent[0], parent[1]))62 return children63 def __get_db_id(self):64 return self.__db_id65 def __set_db_id(self, id):66 self.__db_id = id67 self.is_dirty = True68 db_id = property(__get_db_id, __set_db_id)69 def db_add_id(self, id):70 self.__db_id = id71 def db_change_id(self, id):72 self.__db_id = id73 def db_delete_id(self, id):74 self.__db_id = None75 76 def __get_db_name(self):77 return self.__db_name78 def __set_db_name(self, name):79 self.__db_name = name80 self.is_dirty = True81 db_name = property(__get_db_name, __set_db_name)82 def db_add_name(self, name):83 self.__db_name = name84 def db_change_name(self, name):85 self.__db_name = name86 def db_delete_name(self, name):87 self.__db_name = None88 89 def __get_db_type(self):90 return self.__db_type91 def __set_db_type(self, type):92 self.__db_type = type93 self.is_dirty = True94 db_type = property(__get_db_type, __set_db_type)95 def db_add_type(self, type):96 self.__db_type = type97 def db_change_type(self, type):98 self.__db_type = type99 def db_delete_type(self, type):100 self.__db_type = None101 102 def __get_db_spec(self):103 return self.__db_spec104 def __set_db_spec(self, spec):105 self.__db_spec = spec106 self.is_dirty = True107 db_spec = property(__get_db_spec, __set_db_spec)108 def db_add_spec(self, spec):109 self.__db_spec = spec110 def db_change_spec(self, spec):111 self.__db_spec = spec112 def db_delete_spec(self, spec):113 self.__db_spec = None114 115 def getPrimaryKey(self):116 return self.__db_id117class DBModule(object):118 vtType = 'module'119 def __init__(self, id=None, cache=None, name=None, location=None, functions=None, annotations=None, portSpecs=None):120 self.__db_id = id121 self.__db_cache = cache122 self.__db_name = name123 self.__db_location = location124 if functions is None:125 self.__db_functions = []126 else:127 self.__db_functions = functions128 if annotations is None:129 self.__db_annotations = {}130 else:131 self.__db_annotations = annotations132 if portSpecs is None:133 self.__db_portSpecs = []134 else:135 self.__db_portSpecs = portSpecs136 self.is_dirty = True137 138 def __copy__(self):139 cp = DBModule()140 cp.db_id = self.db_id141 cp.is_dirty = self.is_dirty142 cp.db_cache = self.db_cache143 cp.is_dirty = self.is_dirty144 cp.db_name = self.db_name145 cp.is_dirty = self.is_dirty146 cp.db_location = self.db_location147 cp.is_dirty = self.is_dirty148 if self.db_functions is None:149 cp.db_functions = None150 else:151 cp.db_functions = [copy.copy(v) for v in self.db_functions]152 cp.is_dirty = self.is_dirty153 if self.db_annotations is None:154 cp.db_annotations = None155 else:156 cp.db_annotations = dict([(k,copy.copy(v)) for (k,v) in self.db_annotations.iteritems()])157 cp.is_dirty = self.is_dirty158 if self.db_portSpecs is None:159 cp.db_portSpecs = None160 else:161 cp.db_portSpecs = [copy.copy(v) for v in self.db_portSpecs]162 cp.is_dirty = self.is_dirty163 return cp164 def db_children(self, parent=(None,None), orphan=False):165 children = []166 children.extend(self.db_location.db_children((self.vtType, self.db_id), orphan))167 if orphan:168 self.db_location = None169 for child in self.db_functions:170 children.extend(child.db_children((self.vtType, self.db_id), orphan))171 if orphan:172 self.db_functions = []173 for child in self.db_annotations.itervalues():174 children.extend(child.db_children((self.vtType, self.db_id), orphan))175 if orphan:176 self.db_annotations = {}177 for child in self.db_portSpecs:178 children.extend(child.db_children((self.vtType, self.db_id), orphan))179 if orphan:180 self.db_portSpecs = []181 children.append((self, parent[0], parent[1]))182 return children183 def __get_db_id(self):184 return self.__db_id185 def __set_db_id(self, id):186 self.__db_id = id187 self.is_dirty = True188 db_id = property(__get_db_id, __set_db_id)189 def db_add_id(self, id):190 self.__db_id = id191 def db_change_id(self, id):192 self.__db_id = id193 def db_delete_id(self, id):194 self.__db_id = None195 196 def __get_db_cache(self):197 return self.__db_cache198 def __set_db_cache(self, cache):199 self.__db_cache = cache200 self.is_dirty = True201 db_cache = property(__get_db_cache, __set_db_cache)202 def db_add_cache(self, cache):203 self.__db_cache = cache204 def db_change_cache(self, cache):205 self.__db_cache = cache206 def db_delete_cache(self, cache):207 self.__db_cache = None208 209 def __get_db_name(self):210 return self.__db_name211 def __set_db_name(self, name):212 self.__db_name = name213 self.is_dirty = True214 db_name = property(__get_db_name, __set_db_name)215 def db_add_name(self, name):216 self.__db_name = name217 def db_change_name(self, name):218 self.__db_name = name219 def db_delete_name(self, name):220 self.__db_name = None221 222 def __get_db_location(self):223 return self.__db_location224 def __set_db_location(self, location):225 self.__db_location = location226 self.is_dirty = True227 db_location = property(__get_db_location, __set_db_location)228 def db_add_location(self, location):229 self.__db_location = location230 def db_change_location(self, location):231 self.__db_location = location232 def db_delete_location(self, location):233 self.__db_location = None234 235 def __get_db_functions(self):236 return self.__db_functions237 def __set_db_functions(self, functions):238 self.__db_functions = functions239 self.is_dirty = True240 db_functions = property(__get_db_functions, __set_db_functions)241 def db_get_functions(self):242 return self.__db_functions243 def db_add_function(self, function):244 self.is_dirty = True245 self.__db_functions.append(function)246 def db_change_function(self, function):247 self.is_dirty = True248 found = False249 for i in xrange(len(self.__db_functions)):250 if self.__db_functions[i].db_id == function.db_id:251 self.__db_functions[i] = function252 found = True253 break254 if not found:255 self.__db_functions.append(function)256 def db_delete_function(self, function):257 self.is_dirty = True258 for i in xrange(len(self.__db_functions)):259 if self.__db_functions[i].db_id == function.db_id:260 del self.__db_functions[i]261 break262 def db_get_function(self, key):263 for i in xrange(len(self.__db_functions)):264 if self.__db_functions[i].db_id == key:265 return self.__db_functions[i]266 return None267 268 def __get_db_annotations(self):269 return self.__db_annotations270 def __set_db_annotations(self, annotations):271 self.__db_annotations = annotations272 self.is_dirty = True273 db_annotations = property(__get_db_annotations, __set_db_annotations)274 def db_get_annotations(self):275 return self.__db_annotations.values()276 def db_add_annotation(self, annotation):277 self.is_dirty = True278 self.__db_annotations[annotation.db_id] = annotation279 def db_change_annotation(self, annotation):280 self.is_dirty = True281 self.__db_annotations[annotation.db_id] = annotation282 def db_delete_annotation(self, annotation):283 self.is_dirty = True284 del self.__db_annotations[annotation.db_id]285 def db_get_annotation(self, key):286 if self.__db_annotations.has_key(key):287 return self.__db_annotations[key]288 return None289 290 def __get_db_portSpecs(self):291 return self.__db_portSpecs292 def __set_db_portSpecs(self, portSpecs):293 self.__db_portSpecs = portSpecs294 self.is_dirty = True295 db_portSpecs = property(__get_db_portSpecs, __set_db_portSpecs)296 def db_get_portSpecs(self):297 return self.__db_portSpecs298 def db_add_portSpec(self, portSpec):299 self.is_dirty = True300 self.__db_portSpecs.append(portSpec)301 def db_change_portSpec(self, portSpec):302 self.is_dirty = True303 found = False304 for i in xrange(len(self.__db_portSpecs)):305 if self.__db_portSpecs[i].db_id == portSpec.db_id:306 self.__db_portSpecs[i] = portSpec307 found = True308 break309 if not found:310 self.__db_portSpecs.append(portSpec)311 def db_delete_portSpec(self, portSpec):312 self.is_dirty = True313 for i in xrange(len(self.__db_portSpecs)):314 if self.__db_portSpecs[i].db_id == portSpec.db_id:315 del self.__db_portSpecs[i]316 break317 def db_get_portSpec(self, key):318 for i in xrange(len(self.__db_portSpecs)):319 if self.__db_portSpecs[i].db_id == key:320 return self.__db_portSpecs[i]321 return None322 323 def getPrimaryKey(self):324 return self.__db_id325class DBSession(object):326 vtType = 'session'327 def __init__(self, id=None, user=None, ip=None, visVersion=None, tsStart=None, tsEnd=None, machineId=None, wfExecs=None):328 self.__db_id = id329 self.__db_user = user330 self.__db_ip = ip331 self.__db_visVersion = visVersion332 self.__db_tsStart = tsStart333 self.__db_tsEnd = tsEnd334 self.__db_machineId = machineId335 if wfExecs is None:336 self.__db_wfExecs = {}337 else:338 self.__db_wfExecs = wfExecs339 self.is_dirty = True340 341 def __copy__(self):342 cp = DBSession()343 cp.db_id = self.db_id344 cp.is_dirty = self.is_dirty345 cp.db_user = self.db_user346 cp.is_dirty = self.is_dirty347 cp.db_ip = self.db_ip348 cp.is_dirty = self.is_dirty349 cp.db_visVersion = self.db_visVersion350 cp.is_dirty = self.is_dirty351 cp.db_tsStart = self.db_tsStart352 cp.is_dirty = self.is_dirty353 cp.db_tsEnd = self.db_tsEnd354 cp.is_dirty = self.is_dirty355 cp.db_machineId = self.db_machineId356 cp.is_dirty = self.is_dirty357 if self.db_wfExecs is None:358 cp.db_wfExecs = None359 else:360 cp.db_wfExecs = dict([(k,copy.copy(v)) for (k,v) in self.db_wfExecs.iteritems()])361 cp.is_dirty = self.is_dirty362 return cp363 def db_children(self, parent=(None,None), orphan=False):364 children = []365 for child in self.db_wfExecs.itervalues():366 children.extend(child.db_children((self.vtType, self.db_id), orphan))367 if orphan:368 self.db_wfExecs = {}369 children.extend(self.db_log.db_children((self.vtType, self.db_id), orphan))370 if orphan:371 self.db_log = None372 children.append((self, parent[0], parent[1]))373 return children374 def __get_db_id(self):375 return self.__db_id376 def __set_db_id(self, id):377 self.__db_id = id378 self.is_dirty = True379 db_id = property(__get_db_id, __set_db_id)380 def db_add_id(self, id):381 self.__db_id = id382 def db_change_id(self, id):383 self.__db_id = id384 def db_delete_id(self, id):385 self.__db_id = None386 387 def __get_db_user(self):388 return self.__db_user389 def __set_db_user(self, user):390 self.__db_user = user391 self.is_dirty = True392 db_user = property(__get_db_user, __set_db_user)393 def db_add_user(self, user):394 self.__db_user = user395 def db_change_user(self, user):396 self.__db_user = user397 def db_delete_user(self, user):398 self.__db_user = None399 400 def __get_db_ip(self):401 return self.__db_ip402 def __set_db_ip(self, ip):403 self.__db_ip = ip404 self.is_dirty = True405 db_ip = property(__get_db_ip, __set_db_ip)406 def db_add_ip(self, ip):407 self.__db_ip = ip408 def db_change_ip(self, ip):409 self.__db_ip = ip410 def db_delete_ip(self, ip):411 self.__db_ip = None412 413 def __get_db_visVersion(self):414 return self.__db_visVersion415 def __set_db_visVersion(self, visVersion):416 self.__db_visVersion = visVersion417 self.is_dirty = True418 db_visVersion = property(__get_db_visVersion, __set_db_visVersion)419 def db_add_visVersion(self, visVersion):420 self.__db_visVersion = visVersion421 def db_change_visVersion(self, visVersion):422 self.__db_visVersion = visVersion423 def db_delete_visVersion(self, visVersion):424 self.__db_visVersion = None425 426 def __get_db_tsStart(self):427 return self.__db_tsStart428 def __set_db_tsStart(self, tsStart):429 self.__db_tsStart = tsStart430 self.is_dirty = True431 db_tsStart = property(__get_db_tsStart, __set_db_tsStart)432 def db_add_tsStart(self, tsStart):433 self.__db_tsStart = tsStart434 def db_change_tsStart(self, tsStart):435 self.__db_tsStart = tsStart436 def db_delete_tsStart(self, tsStart):437 self.__db_tsStart = None438 439 def __get_db_tsEnd(self):440 return self.__db_tsEnd441 def __set_db_tsEnd(self, tsEnd):442 self.__db_tsEnd = tsEnd443 self.is_dirty = True444 db_tsEnd = property(__get_db_tsEnd, __set_db_tsEnd)445 def db_add_tsEnd(self, tsEnd):446 self.__db_tsEnd = tsEnd447 def db_change_tsEnd(self, tsEnd):448 self.__db_tsEnd = tsEnd449 def db_delete_tsEnd(self, tsEnd):450 self.__db_tsEnd = None451 452 def __get_db_machineId(self):453 return self.__db_machineId454 def __set_db_machineId(self, machineId):455 self.__db_machineId = machineId456 self.is_dirty = True457 db_machineId = property(__get_db_machineId, __set_db_machineId)458 def db_add_machineId(self, machineId):459 self.__db_machineId = machineId460 def db_change_machineId(self, machineId):461 self.__db_machineId = machineId462 def db_delete_machineId(self, machineId):463 self.__db_machineId = None464 465 def __get_db_wfExecs(self):466 return self.__db_wfExecs467 def __set_db_wfExecs(self, wfExecs):468 self.__db_wfExecs = wfExecs469 self.is_dirty = True470 db_wfExecs = property(__get_db_wfExecs, __set_db_wfExecs)471 def db_get_wfExecs(self):472 return self.__db_wfExecs.values()473 def db_add_wfExec(self, wfExec):474 self.is_dirty = True475 self.__db_wfExecs[wfExec.db_id] = wfExec476 def db_change_wfExec(self, wfExec):477 self.is_dirty = True478 self.__db_wfExecs[wfExec.db_id] = wfExec479 def db_delete_wfExec(self, wfExec):480 self.is_dirty = True481 del self.__db_wfExecs[wfExec.db_id]482 def db_get_wfExec(self, key):483 if self.__db_wfExecs.has_key(key):484 return self.__db_wfExecs[key]485 return None486 487 def getPrimaryKey(self):488 return self.__db_id489class DBPort(object):490 vtType = 'port'491 def __init__(self, id=None, type=None, moduleId=None, moduleName=None, sig=None):492 self.__db_id = id493 self.__db_type = type494 self.__db_moduleId = moduleId495 self.__db_moduleName = moduleName496 self.__db_sig = sig497 self.is_dirty = True498 499 def __copy__(self):500 cp = DBPort()501 cp.db_id = self.db_id502 cp.is_dirty = self.is_dirty503 cp.db_type = self.db_type504 cp.is_dirty = self.is_dirty505 cp.db_moduleId = self.db_moduleId506 cp.is_dirty = self.is_dirty507 cp.db_moduleName = self.db_moduleName508 cp.is_dirty = self.is_dirty509 cp.db_sig = self.db_sig510 cp.is_dirty = self.is_dirty511 return cp512 def db_children(self, parent=(None,None), orphan=False):513 children = []514 children.append((self, parent[0], parent[1]))515 return children516 def __get_db_id(self):517 return self.__db_id518 def __set_db_id(self, id):519 self.__db_id = id520 self.is_dirty = True521 db_id = property(__get_db_id, __set_db_id)522 def db_add_id(self, id):523 self.__db_id = id524 def db_change_id(self, id):525 self.__db_id = id526 def db_delete_id(self, id):527 self.__db_id = None528 529 def __get_db_type(self):530 return self.__db_type531 def __set_db_type(self, type):532 self.__db_type = type533 self.is_dirty = True534 db_type = property(__get_db_type, __set_db_type)535 def db_add_type(self, type):536 self.__db_type = type537 def db_change_type(self, type):538 self.__db_type = type539 def db_delete_type(self, type):540 self.__db_type = None541 542 def __get_db_moduleId(self):543 return self.__db_moduleId544 def __set_db_moduleId(self, moduleId):545 self.__db_moduleId = moduleId546 self.is_dirty = True547 db_moduleId = property(__get_db_moduleId, __set_db_moduleId)548 def db_add_moduleId(self, moduleId):549 self.__db_moduleId = moduleId550 def db_change_moduleId(self, moduleId):551 self.__db_moduleId = moduleId552 def db_delete_moduleId(self, moduleId):553 self.__db_moduleId = None554 555 def __get_db_moduleName(self):556 return self.__db_moduleName557 def __set_db_moduleName(self, moduleName):558 self.__db_moduleName = moduleName559 self.is_dirty = True560 db_moduleName = property(__get_db_moduleName, __set_db_moduleName)561 def db_add_moduleName(self, moduleName):562 self.__db_moduleName = moduleName563 def db_change_moduleName(self, moduleName):564 self.__db_moduleName = moduleName565 def db_delete_moduleName(self, moduleName):566 self.__db_moduleName = None567 568 def __get_db_sig(self):569 return self.__db_sig570 def __set_db_sig(self, sig):571 self.__db_sig = sig572 self.is_dirty = True573 db_sig = property(__get_db_sig, __set_db_sig)574 def db_add_sig(self, sig):575 self.__db_sig = sig576 def db_change_sig(self, sig):577 self.__db_sig = sig578 def db_delete_sig(self, sig):579 self.__db_sig = None580 581 def getPrimaryKey(self):582 return self.__db_id583class DBLog(object):584 vtType = 'log'585 def __init__(self, id=None, sessions=None, machines=None):586 self.__db_id = id587 if sessions is None:588 self.__db_sessions = {}589 else:590 self.__db_sessions = sessions591 if machines is None:592 self.__db_machines = {}593 else:594 self.__db_machines = machines595 self.is_dirty = True596 597 def __copy__(self):598 cp = DBLog()599 cp.db_id = self.db_id600 cp.is_dirty = self.is_dirty601 if self.db_sessions is None:602 cp.db_sessions = None603 else:604 cp.db_sessions = dict([(k,copy.copy(v)) for (k,v) in self.db_sessions.iteritems()])605 cp.is_dirty = self.is_dirty606 if self.db_machines is None:607 cp.db_machines = None608 else:609 cp.db_machines = dict([(k,copy.copy(v)) for (k,v) in self.db_machines.iteritems()])610 cp.is_dirty = self.is_dirty611 return cp612 def db_children(self, parent=(None,None), orphan=False):613 children = []614 for child in self.db_sessions.itervalues():615 children.extend(child.db_children((self.vtType, self.db_id), orphan))616 if orphan:617 self.db_sessions = {}618 for child in self.db_machines.itervalues():619 children.extend(child.db_children((self.vtType, self.db_id), orphan))620 if orphan:621 self.db_machines = {}622 children.append((self, parent[0], parent[1]))623 return children624 def __get_db_id(self):625 return self.__db_id626 def __set_db_id(self, id):627 self.__db_id = id628 self.is_dirty = True629 db_id = property(__get_db_id, __set_db_id)630 def db_add_id(self, id):631 self.__db_id = id632 def db_change_id(self, id):633 self.__db_id = id634 def db_delete_id(self, id):635 self.__db_id = None636 637 def __get_db_sessions(self):638 return self.__db_sessions639 def __set_db_sessions(self, sessions):640 self.__db_sessions = sessions641 self.is_dirty = True642 db_sessions = property(__get_db_sessions, __set_db_sessions)643 def db_get_sessions(self):644 return self.__db_sessions.values()645 def db_add_session(self, session):646 self.is_dirty = True647 self.__db_sessions[session.db_id] = session648 def db_change_session(self, session):649 self.is_dirty = True650 self.__db_sessions[session.db_id] = session651 def db_delete_session(self, session):652 self.is_dirty = True653 del self.__db_sessions[session.db_id]654 def db_get_session(self, key):655 if self.__db_sessions.has_key(key):656 return self.__db_sessions[key]657 return None658 659 def __get_db_machines(self):660 return self.__db_machines661 def __set_db_machines(self, machines):662 self.__db_machines = machines663 self.is_dirty = True664 db_machines = property(__get_db_machines, __set_db_machines)665 def db_get_machines(self):666 return self.__db_machines.values()667 def db_add_machine(self, machine):668 self.is_dirty = True669 self.__db_machines[machine.db_id] = machine670 def db_change_machine(self, machine):671 self.is_dirty = True672 self.__db_machines[machine.db_id] = machine673 def db_delete_machine(self, machine):674 self.is_dirty = True675 del self.__db_machines[machine.db_id]676 def db_get_machine(self, key):677 if self.__db_machines.has_key(key):678 return self.__db_machines[key]679 return None680 681 def getPrimaryKey(self):682 return self.__db_id683class DBMachine(object):684 vtType = 'machine'685 def __init__(self, id=None, name=None, os=None, architecture=None, processor=None, ram=None):686 self.__db_id = id687 self.__db_name = name688 self.__db_os = os689 self.__db_architecture = architecture690 self.__db_processor = processor691 self.__db_ram = ram692 self.is_dirty = True693 694 def __copy__(self):695 cp = DBMachine()696 cp.db_id = self.db_id697 cp.is_dirty = self.is_dirty698 cp.db_name = self.db_name699 cp.is_dirty = self.is_dirty700 cp.db_os = self.db_os701 cp.is_dirty = self.is_dirty702 cp.db_architecture = self.db_architecture703 cp.is_dirty = self.is_dirty704 cp.db_processor = self.db_processor705 cp.is_dirty = self.is_dirty706 cp.db_ram = self.db_ram707 cp.is_dirty = self.is_dirty708 return cp709 def db_children(self, parent=(None,None), orphan=False):710 children = []711 children.extend(self.db_log.db_children((self.vtType, self.db_id), orphan))712 if orphan:713 self.db_log = None714 children.append((self, parent[0], parent[1]))715 return children716 def __get_db_id(self):717 return self.__db_id718 def __set_db_id(self, id):719 self.__db_id = id720 self.is_dirty = True721 db_id = property(__get_db_id, __set_db_id)722 def db_add_id(self, id):723 self.__db_id = id724 def db_change_id(self, id):725 self.__db_id = id726 def db_delete_id(self, id):727 self.__db_id = None728 729 def __get_db_name(self):730 return self.__db_name731 def __set_db_name(self, name):732 self.__db_name = name733 self.is_dirty = True734 db_name = property(__get_db_name, __set_db_name)735 def db_add_name(self, name):736 self.__db_name = name737 def db_change_name(self, name):738 self.__db_name = name739 def db_delete_name(self, name):740 self.__db_name = None741 742 def __get_db_os(self):743 return self.__db_os744 def __set_db_os(self, os):745 self.__db_os = os746 self.is_dirty = True747 db_os = property(__get_db_os, __set_db_os)748 def db_add_os(self, os):749 self.__db_os = os750 def db_change_os(self, os):751 self.__db_os = os752 def db_delete_os(self, os):753 self.__db_os = None754 755 def __get_db_architecture(self):756 return self.__db_architecture757 def __set_db_architecture(self, architecture):758 self.__db_architecture = architecture759 self.is_dirty = True760 db_architecture = property(__get_db_architecture, __set_db_architecture)761 def db_add_architecture(self, architecture):762 self.__db_architecture = architecture763 def db_change_architecture(self, architecture):764 self.__db_architecture = architecture765 def db_delete_architecture(self, architecture):766 self.__db_architecture = None767 768 def __get_db_processor(self):769 return self.__db_processor770 def __set_db_processor(self, processor):771 self.__db_processor = processor772 self.is_dirty = True773 db_processor = property(__get_db_processor, __set_db_processor)774 def db_add_processor(self, processor):775 self.__db_processor = processor776 def db_change_processor(self, processor):777 self.__db_processor = processor778 def db_delete_processor(self, processor):779 self.__db_processor = None780 781 def __get_db_ram(self):782 return self.__db_ram783 def __set_db_ram(self, ram):784 self.__db_ram = ram785 self.is_dirty = True786 db_ram = property(__get_db_ram, __set_db_ram)787 def db_add_ram(self, ram):788 self.__db_ram = ram789 def db_change_ram(self, ram):790 self.__db_ram = ram791 def db_delete_ram(self, ram):792 self.__db_ram = None793 794 def getPrimaryKey(self):795 return self.__db_id796class DBAdd(object):797 vtType = 'add'798 def __init__(self, id=None, what=None, objectId=None, parentObjId=None, parentObjType=None, data=None):799 self.__db_id = id800 self.__db_what = what801 self.__db_objectId = objectId802 self.__db_parentObjId = parentObjId803 self.__db_parentObjType = parentObjType804 self.__db_data = data805 self.is_dirty = True806 807 def __copy__(self):808 cp = DBAdd()809 cp.db_id = self.db_id810 cp.is_dirty = self.is_dirty811 cp.db_what = self.db_what812 cp.is_dirty = self.is_dirty813 cp.db_objectId = self.db_objectId814 cp.is_dirty = self.is_dirty815 cp.db_parentObjId = self.db_parentObjId816 cp.is_dirty = self.is_dirty817 cp.db_parentObjType = self.db_parentObjType818 cp.is_dirty = self.is_dirty819 cp.db_data = self.db_data820 cp.is_dirty = self.is_dirty821 return cp822 def db_children(self, parent=(None,None), orphan=False):823 children = []824 children.extend(self.db_action.db_children((self.vtType, self.db_id), orphan))825 if orphan:826 self.db_action = None827 children.append((self, parent[0], parent[1]))828 return children829 def __get_db_id(self):830 return self.__db_id831 def __set_db_id(self, id):832 self.__db_id = id833 self.is_dirty = True834 db_id = property(__get_db_id, __set_db_id)835 def db_add_id(self, id):836 self.__db_id = id837 def db_change_id(self, id):838 self.__db_id = id839 def db_delete_id(self, id):840 self.__db_id = None841 842 def __get_db_what(self):843 return self.__db_what844 def __set_db_what(self, what):845 self.__db_what = what846 self.is_dirty = True847 db_what = property(__get_db_what, __set_db_what)848 def db_add_what(self, what):849 self.__db_what = what850 def db_change_what(self, what):851 self.__db_what = what852 def db_delete_what(self, what):853 self.__db_what = None854 855 def __get_db_objectId(self):856 return self.__db_objectId857 def __set_db_objectId(self, objectId):858 self.__db_objectId = objectId859 self.is_dirty = True860 db_objectId = property(__get_db_objectId, __set_db_objectId)861 def db_add_objectId(self, objectId):862 self.__db_objectId = objectId863 def db_change_objectId(self, objectId):864 self.__db_objectId = objectId865 def db_delete_objectId(self, objectId):866 self.__db_objectId = None867 868 def __get_db_parentObjId(self):869 return self.__db_parentObjId870 def __set_db_parentObjId(self, parentObjId):871 self.__db_parentObjId = parentObjId872 self.is_dirty = True873 db_parentObjId = property(__get_db_parentObjId, __set_db_parentObjId)874 def db_add_parentObjId(self, parentObjId):875 self.__db_parentObjId = parentObjId876 def db_change_parentObjId(self, parentObjId):877 self.__db_parentObjId = parentObjId878 def db_delete_parentObjId(self, parentObjId):879 self.__db_parentObjId = None880 881 def __get_db_parentObjType(self):882 return self.__db_parentObjType883 def __set_db_parentObjType(self, parentObjType):884 self.__db_parentObjType = parentObjType885 self.is_dirty = True886 db_parentObjType = property(__get_db_parentObjType, __set_db_parentObjType)887 def db_add_parentObjType(self, parentObjType):888 self.__db_parentObjType = parentObjType889 def db_change_parentObjType(self, parentObjType):890 self.__db_parentObjType = parentObjType891 def db_delete_parentObjType(self, parentObjType):892 self.__db_parentObjType = None893 894 def __get_db_data(self):895 return self.__db_data896 def __set_db_data(self, data):897 self.__db_data = data898 self.is_dirty = True899 db_data = property(__get_db_data, __set_db_data)900 def db_add_data(self, data):901 self.__db_data = data902 def db_change_data(self, data):903 self.__db_data = data904 def db_delete_data(self, data):905 self.__db_data = None906 907 def getPrimaryKey(self):908 return self.__db_id909class DBOther(object):910 vtType = 'other'911 def __init__(self, id=None, key=None, value=None):912 self.__db_id = id913 self.__db_key = key914 self.__db_value = value915 self.is_dirty = True916 917 def __copy__(self):918 cp = DBOther()919 cp.db_id = self.db_id920 cp.is_dirty = self.is_dirty921 cp.db_key = self.db_key922 cp.is_dirty = self.is_dirty923 cp.db_value = self.db_value924 cp.is_dirty = self.is_dirty925 return cp926 def db_children(self, parent=(None,None), orphan=False):927 children = []928 children.append((self, parent[0], parent[1]))929 return children930 def __get_db_id(self):931 return self.__db_id932 def __set_db_id(self, id):933 self.__db_id = id934 self.is_dirty = True935 db_id = property(__get_db_id, __set_db_id)936 def db_add_id(self, id):937 self.__db_id = id938 def db_change_id(self, id):939 self.__db_id = id940 def db_delete_id(self, id):941 self.__db_id = None942 943 def __get_db_key(self):944 return self.__db_key945 def __set_db_key(self, key):946 self.__db_key = key947 self.is_dirty = True948 db_key = property(__get_db_key, __set_db_key)949 def db_add_key(self, key):950 self.__db_key = key951 def db_change_key(self, key):952 self.__db_key = key953 def db_delete_key(self, key):954 self.__db_key = None955 956 def __get_db_value(self):957 return self.__db_value958 def __set_db_value(self, value):959 self.__db_value = value960 self.is_dirty = True961 db_value = property(__get_db_value, __set_db_value)962 def db_add_value(self, value):963 self.__db_value = value964 def db_change_value(self, value):965 self.__db_value = value966 def db_delete_value(self, value):967 self.__db_value = None968 969 def getPrimaryKey(self):970 return self.__db_id971class DBLocation(object):972 vtType = 'location'973 def __init__(self, id=None, x=None, y=None):974 self.__db_id = id975 self.__db_x = x976 self.__db_y = y977 self.is_dirty = True978 979 def __copy__(self):980 cp = DBLocation()981 cp.db_id = self.db_id982 cp.is_dirty = self.is_dirty983 cp.db_x = self.db_x984 cp.is_dirty = self.is_dirty985 cp.db_y = self.db_y986 cp.is_dirty = self.is_dirty987 return cp988 def db_children(self, parent=(None,None), orphan=False):989 children = []990 children.append((self, parent[0], parent[1]))991 return children992 def __get_db_id(self):993 return self.__db_id994 def __set_db_id(self, id):995 self.__db_id = id996 self.is_dirty = True997 db_id = property(__get_db_id, __set_db_id)998 def db_add_id(self, id):999 self.__db_id = id1000 def db_change_id(self, id):1001 self.__db_id = id1002 def db_delete_id(self, id):1003 self.__db_id = None1004 1005 def __get_db_x(self):1006 return self.__db_x1007 def __set_db_x(self, x):1008 self.__db_x = x1009 self.is_dirty = True1010 db_x = property(__get_db_x, __set_db_x)1011 def db_add_x(self, x):1012 self.__db_x = x1013 def db_change_x(self, x):1014 self.__db_x = x1015 def db_delete_x(self, x):1016 self.__db_x = None1017 1018 def __get_db_y(self):1019 return self.__db_y1020 def __set_db_y(self, y):1021 self.__db_y = y1022 self.is_dirty = True1023 db_y = property(__get_db_y, __set_db_y)1024 def db_add_y(self, y):1025 self.__db_y = y1026 def db_change_y(self, y):1027 self.__db_y = y1028 def db_delete_y(self, y):1029 self.__db_y = None1030 1031 def getPrimaryKey(self):1032 return self.__db_id1033class DBWfExec(object):1034 vtType = 'wfExec'1035 def __init__(self, id=None, tsStart=None, tsEnd=None, wfVersion=None, vistrailId=None, vistrailName=None, execRecs=None):1036 self.__db_id = id1037 self.__db_tsStart = tsStart1038 self.__db_tsEnd = tsEnd1039 self.__db_wfVersion = wfVersion1040 self.__db_vistrailId = vistrailId1041 self.__db_vistrailName = vistrailName1042 if execRecs is None:1043 self.__db_execRecs = {}1044 else:1045 self.__db_execRecs = execRecs1046 self.is_dirty = True1047 1048 def __copy__(self):1049 cp = DBWfExec()1050 cp.db_id = self.db_id1051 cp.is_dirty = self.is_dirty1052 cp.db_tsStart = self.db_tsStart1053 cp.is_dirty = self.is_dirty1054 cp.db_tsEnd = self.db_tsEnd1055 cp.is_dirty = self.is_dirty1056 cp.db_wfVersion = self.db_wfVersion1057 cp.is_dirty = self.is_dirty1058 cp.db_vistrailId = self.db_vistrailId1059 cp.is_dirty = self.is_dirty1060 cp.db_vistrailName = self.db_vistrailName1061 cp.is_dirty = self.is_dirty1062 if self.db_execRecs is None:1063 cp.db_execRecs = None1064 else:1065 cp.db_execRecs = dict([(k,copy.copy(v)) for (k,v) in self.db_execRecs.iteritems()])1066 cp.is_dirty = self.is_dirty1067 return cp1068 def db_children(self, parent=(None,None), orphan=False):1069 children = []1070 children.extend(self.db_session.db_children((self.vtType, self.db_id), orphan))1071 if orphan:1072 self.db_session = None1073 for child in self.db_execRecs.itervalues():1074 children.extend(child.db_children((self.vtType, self.db_id), orphan))1075 if orphan:1076 self.db_execRecs = {}1077 children.append((self, parent[0], parent[1]))1078 return children1079 def __get_db_id(self):1080 return self.__db_id1081 def __set_db_id(self, id):1082 self.__db_id = id1083 self.is_dirty = True1084 db_id = property(__get_db_id, __set_db_id)1085 def db_add_id(self, id):1086 self.__db_id = id1087 def db_change_id(self, id):1088 self.__db_id = id1089 def db_delete_id(self, id):1090 self.__db_id = None1091 1092 def __get_db_tsStart(self):1093 return self.__db_tsStart1094 def __set_db_tsStart(self, tsStart):1095 self.__db_tsStart = tsStart1096 self.is_dirty = True1097 db_tsStart = property(__get_db_tsStart, __set_db_tsStart)1098 def db_add_tsStart(self, tsStart):1099 self.__db_tsStart = tsStart1100 def db_change_tsStart(self, tsStart):1101 self.__db_tsStart = tsStart1102 def db_delete_tsStart(self, tsStart):1103 self.__db_tsStart = None1104 1105 def __get_db_tsEnd(self):1106 return self.__db_tsEnd1107 def __set_db_tsEnd(self, tsEnd):1108 self.__db_tsEnd = tsEnd1109 self.is_dirty = True1110 db_tsEnd = property(__get_db_tsEnd, __set_db_tsEnd)1111 def db_add_tsEnd(self, tsEnd):1112 self.__db_tsEnd = tsEnd1113 def db_change_tsEnd(self, tsEnd):1114 self.__db_tsEnd = tsEnd1115 def db_delete_tsEnd(self, tsEnd):1116 self.__db_tsEnd = None1117 1118 def __get_db_wfVersion(self):1119 return self.__db_wfVersion1120 def __set_db_wfVersion(self, wfVersion):1121 self.__db_wfVersion = wfVersion1122 self.is_dirty = True1123 db_wfVersion = property(__get_db_wfVersion, __set_db_wfVersion)1124 def db_add_wfVersion(self, wfVersion):1125 self.__db_wfVersion = wfVersion1126 def db_change_wfVersion(self, wfVersion):1127 self.__db_wfVersion = wfVersion1128 def db_delete_wfVersion(self, wfVersion):1129 self.__db_wfVersion = None1130 1131 def __get_db_vistrailId(self):1132 return self.__db_vistrailId1133 def __set_db_vistrailId(self, vistrailId):1134 self.__db_vistrailId = vistrailId1135 self.is_dirty = True1136 db_vistrailId = property(__get_db_vistrailId, __set_db_vistrailId)1137 def db_add_vistrailId(self, vistrailId):1138 self.__db_vistrailId = vistrailId1139 def db_change_vistrailId(self, vistrailId):1140 self.__db_vistrailId = vistrailId1141 def db_delete_vistrailId(self, vistrailId):1142 self.__db_vistrailId = None1143 1144 def __get_db_vistrailName(self):1145 return self.__db_vistrailName1146 def __set_db_vistrailName(self, vistrailName):1147 self.__db_vistrailName = vistrailName1148 self.is_dirty = True1149 db_vistrailName = property(__get_db_vistrailName, __set_db_vistrailName)1150 def db_add_vistrailName(self, vistrailName):1151 self.__db_vistrailName = vistrailName1152 def db_change_vistrailName(self, vistrailName):1153 self.__db_vistrailName = vistrailName1154 def db_delete_vistrailName(self, vistrailName):1155 self.__db_vistrailName = None1156 1157 def __get_db_execRecs(self):1158 return self.__db_execRecs1159 def __set_db_execRecs(self, execRecs):1160 self.__db_execRecs = execRecs1161 self.is_dirty = True1162 db_execRecs = property(__get_db_execRecs, __set_db_execRecs)1163 def db_get_execRecs(self):1164 return self.__db_execRecs.values()1165 def db_add_execRec(self, execRec):1166 self.is_dirty = True1167 self.__db_execRecs[execRec.db_id] = execRec1168 def db_change_execRec(self, execRec):1169 self.is_dirty = True1170 self.__db_execRecs[execRec.db_id] = execRec1171 def db_delete_execRec(self, execRec):1172 self.is_dirty = True1173 del self.__db_execRecs[execRec.db_id]1174 def db_get_execRec(self, key):1175 if self.__db_execRecs.has_key(key):1176 return self.__db_execRecs[key]1177 return None1178 1179 def getPrimaryKey(self):1180 return self.__db_id1181class DBParameter(object):1182 vtType = 'parameter'1183 def __init__(self, id=None, pos=None, name=None, type=None, val=None, alias=None):1184 self.__db_id = id1185 self.__db_pos = pos1186 self.__db_name = name1187 self.__db_type = type1188 self.__db_val = val1189 self.__db_alias = alias1190 self.is_dirty = True1191 1192 def __copy__(self):1193 cp = DBParameter()1194 cp.db_id = self.db_id1195 cp.is_dirty = self.is_dirty1196 cp.db_pos = self.db_pos1197 cp.is_dirty = self.is_dirty1198 cp.db_name = self.db_name1199 cp.is_dirty = self.is_dirty1200 cp.db_type = self.db_type1201 cp.is_dirty = self.is_dirty1202 cp.db_val = self.db_val1203 cp.is_dirty = self.is_dirty1204 cp.db_alias = self.db_alias1205 cp.is_dirty = self.is_dirty1206 return cp1207 def db_children(self, parent=(None,None), orphan=False):1208 children = []1209 children.append((self, parent[0], parent[1]))1210 return children1211 def __get_db_id(self):1212 return self.__db_id1213 def __set_db_id(self, id):1214 self.__db_id = id1215 self.is_dirty = True1216 db_id = property(__get_db_id, __set_db_id)1217 def db_add_id(self, id):1218 self.__db_id = id1219 def db_change_id(self, id):1220 self.__db_id = id1221 def db_delete_id(self, id):1222 self.__db_id = None1223 1224 def __get_db_pos(self):1225 return self.__db_pos1226 def __set_db_pos(self, pos):1227 self.__db_pos = pos1228 self.is_dirty = True1229 db_pos = property(__get_db_pos, __set_db_pos)1230 def db_add_pos(self, pos):1231 self.__db_pos = pos1232 def db_change_pos(self, pos):1233 self.__db_pos = pos1234 def db_delete_pos(self, pos):1235 self.__db_pos = None1236 1237 def __get_db_name(self):1238 return self.__db_name1239 def __set_db_name(self, name):1240 self.__db_name = name1241 self.is_dirty = True1242 db_name = property(__get_db_name, __set_db_name)1243 def db_add_name(self, name):1244 self.__db_name = name1245 def db_change_name(self, name):1246 self.__db_name = name1247 def db_delete_name(self, name):1248 self.__db_name = None1249 1250 def __get_db_type(self):1251 return self.__db_type1252 def __set_db_type(self, type):1253 self.__db_type = type1254 self.is_dirty = True1255 db_type = property(__get_db_type, __set_db_type)1256 def db_add_type(self, type):1257 self.__db_type = type1258 def db_change_type(self, type):1259 self.__db_type = type1260 def db_delete_type(self, type):1261 self.__db_type = None1262 1263 def __get_db_val(self):1264 return self.__db_val1265 def __set_db_val(self, val):1266 self.__db_val = val1267 self.is_dirty = True1268 db_val = property(__get_db_val, __set_db_val)1269 def db_add_val(self, val):1270 self.__db_val = val1271 def db_change_val(self, val):1272 self.__db_val = val1273 def db_delete_val(self, val):1274 self.__db_val = None1275 1276 def __get_db_alias(self):1277 return self.__db_alias1278 def __set_db_alias(self, alias):1279 self.__db_alias = alias1280 self.is_dirty = True1281 db_alias = property(__get_db_alias, __set_db_alias)1282 def db_add_alias(self, alias):1283 self.__db_alias = alias1284 def db_change_alias(self, alias):1285 self.__db_alias = alias1286 def db_delete_alias(self, alias):1287 self.__db_alias = None1288 1289 def getPrimaryKey(self):1290 return self.__db_id1291class DBFunction(object):1292 vtType = 'function'1293 def __init__(self, id=None, pos=None, name=None, parameters=None):1294 self.__db_id = id1295 self.__db_pos = pos1296 self.__db_name = name1297 if parameters is None:1298 self.__db_parameters = []1299 else:1300 self.__db_parameters = parameters1301 self.is_dirty = True1302 1303 def __copy__(self):1304 cp = DBFunction()1305 cp.db_id = self.db_id1306 cp.is_dirty = self.is_dirty1307 cp.db_pos = self.db_pos1308 cp.is_dirty = self.is_dirty1309 cp.db_name = self.db_name1310 cp.is_dirty = self.is_dirty1311 if self.db_parameters is None:1312 cp.db_parameters = None1313 else:1314 cp.db_parameters = [copy.copy(v) for v in self.db_parameters]1315 cp.is_dirty = self.is_dirty1316 return cp1317 def db_children(self, parent=(None,None), orphan=False):1318 children = []1319 for child in self.db_parameters:1320 children.extend(child.db_children((self.vtType, self.db_id), orphan))1321 if orphan:1322 self.db_parameters = []1323 children.append((self, parent[0], parent[1]))1324 return children1325 def __get_db_id(self):1326 return self.__db_id1327 def __set_db_id(self, id):1328 self.__db_id = id1329 self.is_dirty = True1330 db_id = property(__get_db_id, __set_db_id)1331 def db_add_id(self, id):1332 self.__db_id = id1333 def db_change_id(self, id):1334 self.__db_id = id1335 def db_delete_id(self, id):1336 self.__db_id = None1337 1338 def __get_db_pos(self):1339 return self.__db_pos1340 def __set_db_pos(self, pos):1341 self.__db_pos = pos1342 self.is_dirty = True1343 db_pos = property(__get_db_pos, __set_db_pos)1344 def db_add_pos(self, pos):1345 self.__db_pos = pos1346 def db_change_pos(self, pos):1347 self.__db_pos = pos1348 def db_delete_pos(self, pos):1349 self.__db_pos = None1350 1351 def __get_db_name(self):1352 return self.__db_name1353 def __set_db_name(self, name):1354 self.__db_name = name1355 self.is_dirty = True1356 db_name = property(__get_db_name, __set_db_name)1357 def db_add_name(self, name):1358 self.__db_name = name1359 def db_change_name(self, name):1360 self.__db_name = name1361 def db_delete_name(self, name):1362 self.__db_name = None1363 1364 def __get_db_parameters(self):1365 return self.__db_parameters1366 def __set_db_parameters(self, parameters):1367 self.__db_parameters = parameters1368 self.is_dirty = True1369 db_parameters = property(__get_db_parameters, __set_db_parameters)1370 def db_get_parameters(self):1371 return self.__db_parameters1372 def db_add_parameter(self, parameter):1373 self.is_dirty = True1374 self.__db_parameters.append(parameter)1375 def db_change_parameter(self, parameter):1376 self.is_dirty = True1377 found = False1378 for i in xrange(len(self.__db_parameters)):1379 if self.__db_parameters[i].db_id == parameter.db_id:1380 self.__db_parameters[i] = parameter1381 found = True1382 break1383 if not found:1384 self.__db_parameters.append(parameter)1385 def db_delete_parameter(self, parameter):1386 self.is_dirty = True1387 for i in xrange(len(self.__db_parameters)):1388 if self.__db_parameters[i].db_id == parameter.db_id:1389 del self.__db_parameters[i]1390 break1391 def db_get_parameter(self, key):1392 for i in xrange(len(self.__db_parameters)):1393 if self.__db_parameters[i].db_id == key:1394 return self.__db_parameters[i]1395 return None1396 1397 def getPrimaryKey(self):1398 return self.__db_id1399class DBWorkflow(object):1400 vtType = 'workflow'1401 def __init__(self, id=None, name=None, modules=None, connections=None, annotations=None, others=None):1402 self.__db_id = id1403 self.__db_name = name1404 if modules is None:1405 self.__db_modules = {}1406 else:1407 self.__db_modules = modules1408 if connections is None:1409 self.__db_connections = {}1410 else:1411 self.__db_connections = connections1412 if annotations is None:1413 self.__db_annotations = []1414 else:1415 self.__db_annotations = annotations1416 if others is None:1417 self.__db_others = []1418 else:1419 self.__db_others = others1420 self.is_dirty = True1421 1422 def __copy__(self):1423 cp = DBWorkflow()1424 cp.db_id = self.db_id1425 cp.is_dirty = self.is_dirty1426 cp.db_name = self.db_name1427 cp.is_dirty = self.is_dirty1428 if self.db_modules is None:1429 cp.db_modules = None1430 else:1431 cp.db_modules = dict([(k,copy.copy(v)) for (k,v) in self.db_modules.iteritems()])1432 cp.is_dirty = self.is_dirty1433 if self.db_connections is None:1434 cp.db_connections = None1435 else:1436 cp.db_connections = dict([(k,copy.copy(v)) for (k,v) in self.db_connections.iteritems()])1437 cp.is_dirty = self.is_dirty1438 if self.db_annotations is None:1439 cp.db_annotations = None1440 else:1441 cp.db_annotations = [copy.copy(v) for v in self.db_annotations]1442 cp.is_dirty = self.is_dirty1443 if self.db_others is None:1444 cp.db_others = None1445 else:1446 cp.db_others = [copy.copy(v) for v in self.db_others]1447 cp.is_dirty = self.is_dirty1448 return cp1449 def db_children(self, parent=(None,None), orphan=False):1450 children = []1451 for child in self.db_modules.itervalues():1452 children.extend(child.db_children((self.vtType, self.db_id), orphan))1453 if orphan:1454 self.db_modules = {}1455 for child in self.db_connections.itervalues():1456 children.extend(child.db_children((self.vtType, self.db_id), orphan))1457 if orphan:1458 self.db_connections = {}1459 for child in self.db_annotations:1460 children.extend(child.db_children((self.vtType, self.db_id), orphan))1461 if orphan:1462 self.db_annotations = []1463 for child in self.db_others:1464 children.extend(child.db_children((self.vtType, self.db_id), orphan))1465 if orphan:1466 self.db_others = []1467 children.append((self, parent[0], parent[1]))1468 return children1469 def __get_db_id(self):1470 return self.__db_id1471 def __set_db_id(self, id):1472 self.__db_id = id1473 self.is_dirty = True1474 db_id = property(__get_db_id, __set_db_id)1475 def db_add_id(self, id):1476 self.__db_id = id1477 def db_change_id(self, id):1478 self.__db_id = id1479 def db_delete_id(self, id):1480 self.__db_id = None1481 1482 def __get_db_name(self):1483 return self.__db_name1484 def __set_db_name(self, name):1485 self.__db_name = name1486 self.is_dirty = True1487 db_name = property(__get_db_name, __set_db_name)1488 def db_add_name(self, name):1489 self.__db_name = name1490 def db_change_name(self, name):1491 self.__db_name = name1492 def db_delete_name(self, name):1493 self.__db_name = None1494 1495 def __get_db_modules(self):1496 return self.__db_modules1497 def __set_db_modules(self, modules):1498 self.__db_modules = modules1499 self.is_dirty = True1500 db_modules = property(__get_db_modules, __set_db_modules)1501 def db_get_modules(self):1502 return self.__db_modules.values()1503 def db_add_module(self, module):1504 self.is_dirty = True1505 self.__db_modules[module.db_id] = module1506 def db_change_module(self, module):1507 self.is_dirty = True1508 self.__db_modules[module.db_id] = module1509 def db_delete_module(self, module):1510 self.is_dirty = True1511 del self.__db_modules[module.db_id]1512 def db_get_module(self, key):1513 if self.__db_modules.has_key(key):1514 return self.__db_modules[key]1515 return None1516 1517 def __get_db_connections(self):1518 return self.__db_connections1519 def __set_db_connections(self, connections):1520 self.__db_connections = connections1521 self.is_dirty = True1522 db_connections = property(__get_db_connections, __set_db_connections)1523 def db_get_connections(self):1524 return self.__db_connections.values()1525 def db_add_connection(self, connection):1526 self.is_dirty = True1527 self.__db_connections[connection.db_id] = connection1528 def db_change_connection(self, connection):1529 self.is_dirty = True1530 self.__db_connections[connection.db_id] = connection1531 def db_delete_connection(self, connection):1532 self.is_dirty = True1533 del self.__db_connections[connection.db_id]1534 def db_get_connection(self, key):1535 if self.__db_connections.has_key(key):1536 return self.__db_connections[key]1537 return None1538 1539 def __get_db_annotations(self):1540 return self.__db_annotations1541 def __set_db_annotations(self, annotations):1542 self.__db_annotations = annotations1543 self.is_dirty = True1544 db_annotations = property(__get_db_annotations, __set_db_annotations)1545 def db_get_annotations(self):1546 return self.__db_annotations1547 def db_add_annotation(self, annotation):1548 self.is_dirty = True1549 self.__db_annotations.append(annotation)1550 def db_change_annotation(self, annotation):1551 self.is_dirty = True1552 found = False1553 for i in xrange(len(self.__db_annotations)):1554 if self.__db_annotations[i].db_id == annotation.db_id:1555 self.__db_annotations[i] = annotation1556 found = True1557 break1558 if not found:1559 self.__db_annotations.append(annotation)1560 def db_delete_annotation(self, annotation):1561 self.is_dirty = True1562 for i in xrange(len(self.__db_annotations)):1563 if self.__db_annotations[i].db_id == annotation.db_id:1564 del self.__db_annotations[i]1565 break1566 def db_get_annotation(self, key):1567 for i in xrange(len(self.__db_annotations)):1568 if self.__db_annotations[i].db_id == key:1569 return self.__db_annotations[i]1570 return None1571 1572 def __get_db_others(self):1573 return self.__db_others1574 def __set_db_others(self, others):1575 self.__db_others = others1576 self.is_dirty = True1577 db_others = property(__get_db_others, __set_db_others)1578 def db_get_others(self):1579 return self.__db_others1580 def db_add_other(self, other):1581 self.is_dirty = True1582 self.__db_others.append(other)1583 def db_change_other(self, other):1584 self.is_dirty = True1585 found = False1586 for i in xrange(len(self.__db_others)):1587 if self.__db_others[i].db_id == other.db_id:1588 self.__db_others[i] = other1589 found = True1590 break1591 if not found:1592 self.__db_others.append(other)1593 def db_delete_other(self, other):1594 self.is_dirty = True1595 for i in xrange(len(self.__db_others)):1596 if self.__db_others[i].db_id == other.db_id:1597 del self.__db_others[i]1598 break1599 def db_get_other(self, key):1600 for i in xrange(len(self.__db_others)):1601 if self.__db_others[i].db_id == key:1602 return self.__db_others[i]1603 return None1604 1605 def getPrimaryKey(self):1606 return self.__db_id1607class DBAction(object):1608 vtType = 'action'1609 def __init__(self, id=None, prevId=None, date=None, user=None, operations=None):1610 self.__db_id = id1611 self.__db_prevId = prevId1612 self.__db_date = date1613 self.__db_user = user1614 if operations is None:1615 self.__db_operations = []1616 else:1617 self.__db_operations = operations1618 self.is_dirty = True1619 1620 def __copy__(self):1621 cp = DBAction()1622 cp.db_id = self.db_id1623 cp.is_dirty = self.is_dirty1624 cp.db_prevId = self.db_prevId1625 cp.is_dirty = self.is_dirty1626 cp.db_date = self.db_date1627 cp.is_dirty = self.is_dirty1628 cp.db_user = self.db_user1629 cp.is_dirty = self.is_dirty1630 if self.db_operations is None:1631 cp.db_operations = None1632 else:1633 cp.db_operations = [copy.copy(v) for v in self.db_operations]1634 cp.is_dirty = self.is_dirty1635 return cp1636 def db_children(self, parent=(None,None), orphan=False):1637 children = []1638 children.append((self, parent[0], parent[1]))1639 return children1640 def __get_db_id(self):1641 return self.__db_id1642 def __set_db_id(self, id):1643 self.__db_id = id1644 self.is_dirty = True1645 db_id = property(__get_db_id, __set_db_id)1646 def db_add_id(self, id):1647 self.__db_id = id1648 def db_change_id(self, id):1649 self.__db_id = id1650 def db_delete_id(self, id):1651 self.__db_id = None1652 1653 def __get_db_prevId(self):1654 return self.__db_prevId1655 def __set_db_prevId(self, prevId):1656 self.__db_prevId = prevId1657 self.is_dirty = True1658 db_prevId = property(__get_db_prevId, __set_db_prevId)1659 def db_add_prevId(self, prevId):1660 self.__db_prevId = prevId1661 def db_change_prevId(self, prevId):1662 self.__db_prevId = prevId1663 def db_delete_prevId(self, prevId):1664 self.__db_prevId = None1665 1666 def __get_db_date(self):1667 return self.__db_date1668 def __set_db_date(self, date):1669 self.__db_date = date1670 self.is_dirty = True1671 db_date = property(__get_db_date, __set_db_date)1672 def db_add_date(self, date):1673 self.__db_date = date1674 def db_change_date(self, date):1675 self.__db_date = date1676 def db_delete_date(self, date):1677 self.__db_date = None1678 1679 def __get_db_user(self):1680 return self.__db_user1681 def __set_db_user(self, user):1682 self.__db_user = user1683 self.is_dirty = True1684 db_user = property(__get_db_user, __set_db_user)1685 def db_add_user(self, user):1686 self.__db_user = user1687 def db_change_user(self, user):1688 self.__db_user = user1689 def db_delete_user(self, user):1690 self.__db_user = None1691 1692 def __get_db_operations(self):1693 return self.__db_operations1694 def __set_db_operations(self, operations):1695 self.__db_operations = operations1696 self.is_dirty = True1697 db_operations = property(__get_db_operations, __set_db_operations)1698 def db_get_operations(self):1699 return self.__db_operations1700 def db_add_operation(self, operation):1701 self.is_dirty = True1702 self.__db_operations.append(operation)1703 def db_change_operation(self, operation):1704 self.is_dirty = True1705 found = False1706 for i in xrange(len(self.__db_operations)):1707 if self.__db_operations[i].db_id == operation.db_id:1708 self.__db_operations[i] = operation1709 found = True1710 break1711 if not found:1712 self.__db_operations.append(operation)1713 def db_delete_operation(self, operation):1714 self.is_dirty = True1715 for i in xrange(len(self.__db_operations)):1716 if self.__db_operations[i].db_id == operation.db_id:1717 del self.__db_operations[i]1718 break1719 def db_get_operation(self, key):1720 for i in xrange(len(self.__db_operations)):1721 if self.__db_operations[i].db_id == key:1722 return self.__db_operations[i]1723 return None1724 1725 def getPrimaryKey(self):1726 return self.__db_id1727class DBAnnotation(object):1728 vtType = 'annotation'1729 def __init__(self, id=None, key=None, value=None):1730 self.__db_id = id1731 self.__db_key = key1732 self.__db_value = value1733 self.is_dirty = True1734 1735 def __copy__(self):1736 cp = DBAnnotation()1737 cp.db_id = self.db_id1738 cp.is_dirty = self.is_dirty1739 cp.db_key = self.db_key1740 cp.is_dirty = self.is_dirty1741 cp.db_value = self.db_value1742 cp.is_dirty = self.is_dirty1743 return cp1744 def db_children(self, parent=(None,None), orphan=False):1745 children = []1746 children.append((self, parent[0], parent[1]))1747 return children1748 def __get_db_id(self):1749 return self.__db_id1750 def __set_db_id(self, id):1751 self.__db_id = id1752 self.is_dirty = True1753 db_id = property(__get_db_id, __set_db_id)1754 def db_add_id(self, id):1755 self.__db_id = id1756 def db_change_id(self, id):1757 self.__db_id = id1758 def db_delete_id(self, id):1759 self.__db_id = None1760 1761 def __get_db_key(self):1762 return self.__db_key1763 def __set_db_key(self, key):1764 self.__db_key = key1765 self.is_dirty = True1766 db_key = property(__get_db_key, __set_db_key)1767 def db_add_key(self, key):1768 self.__db_key = key1769 def db_change_key(self, key):1770 self.__db_key = key1771 def db_delete_key(self, key):1772 self.__db_key = None1773 1774 def __get_db_value(self):1775 return self.__db_value1776 def __set_db_value(self, value):1777 self.__db_value = value1778 self.is_dirty = True1779 db_value = property(__get_db_value, __set_db_value)1780 def db_add_value(self, value):1781 self.__db_value = value1782 def db_change_value(self, value):1783 self.__db_value = value1784 def db_delete_value(self, value):1785 self.__db_value = None1786 1787 def getPrimaryKey(self):1788 return self.__db_id1789class DBChange(object):1790 vtType = 'change'1791 def __init__(self, id=None, what=None, oldObjId=None, newObjId=None, parentObjId=None, parentObjType=None, data=None):1792 self.__db_id = id1793 self.__db_what = what1794 self.__db_oldObjId = oldObjId1795 self.__db_newObjId = newObjId1796 self.__db_parentObjId = parentObjId1797 self.__db_parentObjType = parentObjType1798 self.__db_data = data1799 self.is_dirty = True1800 1801 def __copy__(self):1802 cp = DBChange()1803 cp.db_id = self.db_id1804 cp.is_dirty = self.is_dirty1805 cp.db_what = self.db_what1806 cp.is_dirty = self.is_dirty1807 cp.db_oldObjId = self.db_oldObjId1808 cp.is_dirty = self.is_dirty1809 cp.db_newObjId = self.db_newObjId1810 cp.is_dirty = self.is_dirty1811 cp.db_parentObjId = self.db_parentObjId1812 cp.is_dirty = self.is_dirty1813 cp.db_parentObjType = self.db_parentObjType1814 cp.is_dirty = self.is_dirty1815 cp.db_data = self.db_data1816 cp.is_dirty = self.is_dirty1817 return cp1818 def db_children(self, parent=(None,None), orphan=False):1819 children = []1820 children.extend(self.db_action.db_children((self.vtType, self.db_id), orphan))1821 if orphan:1822 self.db_action = None1823 children.append((self, parent[0], parent[1]))1824 return children1825 def __get_db_id(self):1826 return self.__db_id1827 def __set_db_id(self, id):1828 self.__db_id = id1829 self.is_dirty = True1830 db_id = property(__get_db_id, __set_db_id)1831 def db_add_id(self, id):1832 self.__db_id = id1833 def db_change_id(self, id):1834 self.__db_id = id1835 def db_delete_id(self, id):1836 self.__db_id = None1837 1838 def __get_db_what(self):1839 return self.__db_what1840 def __set_db_what(self, what):1841 self.__db_what = what1842 self.is_dirty = True1843 db_what = property(__get_db_what, __set_db_what)1844 def db_add_what(self, what):1845 self.__db_what = what1846 def db_change_what(self, what):1847 self.__db_what = what1848 def db_delete_what(self, what):1849 self.__db_what = None1850 1851 def __get_db_oldObjId(self):1852 return self.__db_oldObjId1853 def __set_db_oldObjId(self, oldObjId):1854 self.__db_oldObjId = oldObjId1855 self.is_dirty = True1856 db_oldObjId = property(__get_db_oldObjId, __set_db_oldObjId)1857 def db_add_oldObjId(self, oldObjId):1858 self.__db_oldObjId = oldObjId1859 def db_change_oldObjId(self, oldObjId):1860 self.__db_oldObjId = oldObjId1861 def db_delete_oldObjId(self, oldObjId):1862 self.__db_oldObjId = None1863 1864 def __get_db_newObjId(self):1865 return self.__db_newObjId1866 def __set_db_newObjId(self, newObjId):1867 self.__db_newObjId = newObjId1868 self.is_dirty = True1869 db_newObjId = property(__get_db_newObjId, __set_db_newObjId)1870 def db_add_newObjId(self, newObjId):1871 self.__db_newObjId = newObjId1872 def db_change_newObjId(self, newObjId):1873 self.__db_newObjId = newObjId1874 def db_delete_newObjId(self, newObjId):1875 self.__db_newObjId = None1876 1877 def __get_db_parentObjId(self):1878 return self.__db_parentObjId1879 def __set_db_parentObjId(self, parentObjId):1880 self.__db_parentObjId = parentObjId1881 self.is_dirty = True1882 db_parentObjId = property(__get_db_parentObjId, __set_db_parentObjId)1883 def db_add_parentObjId(self, parentObjId):1884 self.__db_parentObjId = parentObjId1885 def db_change_parentObjId(self, parentObjId):1886 self.__db_parentObjId = parentObjId1887 def db_delete_parentObjId(self, parentObjId):1888 self.__db_parentObjId = None1889 1890 def __get_db_parentObjType(self):1891 return self.__db_parentObjType1892 def __set_db_parentObjType(self, parentObjType):1893 self.__db_parentObjType = parentObjType1894 self.is_dirty = True1895 db_parentObjType = property(__get_db_parentObjType, __set_db_parentObjType)1896 def db_add_parentObjType(self, parentObjType):1897 self.__db_parentObjType = parentObjType1898 def db_change_parentObjType(self, parentObjType):1899 self.__db_parentObjType = parentObjType1900 def db_delete_parentObjType(self, parentObjType):1901 self.__db_parentObjType = None1902 1903 def __get_db_data(self):1904 return self.__db_data1905 def __set_db_data(self, data):1906 self.__db_data = data1907 self.is_dirty = True1908 db_data = property(__get_db_data, __set_db_data)1909 def db_add_data(self, data):1910 self.__db_data = data1911 def db_change_data(self, data):1912 self.__db_data = data1913 def db_delete_data(self, data):1914 self.__db_data = None1915 1916 def getPrimaryKey(self):1917 return self.__db_id1918class DBMacro(object):1919 vtType = 'macro'1920 def __init__(self, id=None, name=None, descrptn=None, actions=None):1921 self.__db_id = id1922 self.__db_name = name1923 self.__db_descrptn = descrptn1924 if actions is None:1925 self.__db_actions = {}1926 else:1927 self.__db_actions = actions1928 self.is_dirty = True1929 1930 def __copy__(self):1931 cp = DBMacro()1932 cp.db_id = self.db_id1933 cp.is_dirty = self.is_dirty1934 cp.db_name = self.db_name1935 cp.is_dirty = self.is_dirty1936 cp.db_descrptn = self.db_descrptn1937 cp.is_dirty = self.is_dirty1938 if self.db_actions is None:1939 cp.db_actions = None1940 else:1941 cp.db_actions = dict([(k,copy.copy(v)) for (k,v) in self.db_actions.iteritems()])1942 cp.is_dirty = self.is_dirty1943 return cp1944 def db_children(self, parent=(None,None), orphan=False):1945 children = []1946 for child in self.db_actions.itervalues():1947 children.extend(child.db_children((self.vtType, self.db_id), orphan))1948 if orphan:1949 self.db_actions = {}1950 children.extend(self.db_vistrail.db_children((self.vtType, self.db_id), orphan))1951 if orphan:1952 self.db_vistrail = None1953 children.append((self, parent[0], parent[1]))1954 return children1955 def __get_db_id(self):1956 return self.__db_id1957 def __set_db_id(self, id):1958 self.__db_id = id1959 self.is_dirty = True1960 db_id = property(__get_db_id, __set_db_id)1961 def db_add_id(self, id):1962 self.__db_id = id1963 def db_change_id(self, id):1964 self.__db_id = id1965 def db_delete_id(self, id):1966 self.__db_id = None1967 1968 def __get_db_name(self):1969 return self.__db_name1970 def __set_db_name(self, name):1971 self.__db_name = name1972 self.is_dirty = True1973 db_name = property(__get_db_name, __set_db_name)1974 def db_add_name(self, name):1975 self.__db_name = name1976 def db_change_name(self, name):1977 self.__db_name = name1978 def db_delete_name(self, name):1979 self.__db_name = None1980 1981 def __get_db_descrptn(self):1982 return self.__db_descrptn1983 def __set_db_descrptn(self, descrptn):1984 self.__db_descrptn = descrptn1985 self.is_dirty = True1986 db_descrptn = property(__get_db_descrptn, __set_db_descrptn)1987 def db_add_descrptn(self, descrptn):1988 self.__db_descrptn = descrptn1989 def db_change_descrptn(self, descrptn):1990 self.__db_descrptn = descrptn1991 def db_delete_descrptn(self, descrptn):1992 self.__db_descrptn = None1993 1994 def __get_db_actions(self):1995 return self.__db_actions1996 def __set_db_actions(self, actions):1997 self.__db_actions = actions1998 self.is_dirty = True1999 db_actions = property(__get_db_actions, __set_db_actions)2000 def db_get_actions(self):2001 return self.__db_actions.values()2002 def db_add_action(self, action):2003 self.is_dirty = True2004 self.__db_actions[action.db_id] = action2005 def db_change_action(self, action):2006 self.is_dirty = True2007 self.__db_actions[action.db_id] = action2008 def db_delete_action(self, action):2009 self.is_dirty = True2010 del self.__db_actions[action.db_id]2011 def db_get_action(self, key):2012 if self.__db_actions.has_key(key):2013 return self.__db_actions[key]2014 return None2015 2016 def getPrimaryKey(self):2017 return self.__db_id2018class DBConnection(object):2019 vtType = 'connection'2020 def __init__(self, id=None, ports=None):2021 self.__db_id = id2022 self.db_type_index = {}2023 if ports is None:2024 self.__db_ports = []2025 else:2026 self.__db_ports = ports2027 for v in self.__db_ports:2028 self.db_type_index[v.db_type] = v2029 self.is_dirty = True2030 2031 def __copy__(self):2032 cp = DBConnection()2033 cp.db_id = self.db_id2034 cp.is_dirty = self.is_dirty2035 if self.db_ports is None:2036 cp.db_ports = None2037 else:2038 cp.db_ports = [copy.copy(v) for v in self.db_ports]2039 for v in cp.__db_ports:2040 cp.db_type_index[v.db_type] = v2041 cp.is_dirty = self.is_dirty2042 return cp2043 def db_children(self, parent=(None,None), orphan=False):2044 children = []2045 for child in self.db_ports:2046 children.extend(child.db_children((self.vtType, self.db_id), orphan))2047 if orphan:2048 self.db_ports = []2049 children.append((self, parent[0], parent[1]))2050 return children2051 def __get_db_id(self):2052 return self.__db_id2053 def __set_db_id(self, id):2054 self.__db_id = id2055 self.is_dirty = True2056 db_id = property(__get_db_id, __set_db_id)2057 def db_add_id(self, id):2058 self.__db_id = id2059 def db_change_id(self, id):2060 self.__db_id = id2061 def db_delete_id(self, id):2062 self.__db_id = None2063 2064 def __get_db_ports(self):2065 return self.__db_ports2066 def __set_db_ports(self, ports):2067 self.__db_ports = ports2068 self.is_dirty = True2069 db_ports = property(__get_db_ports, __set_db_ports)2070 def db_get_ports(self):2071 return self.__db_ports2072 def db_add_port(self, port):2073 self.is_dirty = True2074 self.__db_ports.append(port)2075 self.db_type_index[port.db_type] = port2076 def db_change_port(self, port):2077 self.is_dirty = True2078 found = False2079 for i in xrange(len(self.__db_ports)):2080 if self.__db_ports[i].db_id == port.db_id:2081 self.__db_ports[i] = port2082 found = True2083 break2084 if not found:2085 self.__db_ports.append(port)2086 self.db_type_index[port.db_type] = port2087 def db_delete_port(self, port):2088 self.is_dirty = True2089 for i in xrange(len(self.__db_ports)):2090 if self.__db_ports[i].db_id == port.db_id:2091 del self.__db_ports[i]2092 break2093 del self.db_type_index[port.db_type]2094 def db_get_port(self, key):2095 for i in xrange(len(self.__db_ports)):2096 if self.__db_ports[i].db_id == key:2097 return self.__db_ports[i]2098 return None2099 def db_get_port_by_type(self, key):2100 return self.db_type_index[key]2101 2102 def getPrimaryKey(self):2103 return self.__db_id2104class DBTag(object):2105 vtType = 'tag'2106 def __init__(self, name=None, time=None):2107 self.__db_name = name2108 self.__db_time = time2109 self.is_dirty = True2110 2111 def __copy__(self):2112 cp = DBTag()2113 cp.db_name = self.db_name2114 cp.is_dirty = self.is_dirty2115 cp.db_time = self.db_time2116 cp.is_dirty = self.is_dirty2117 return cp2118 def db_children(self, parent=(None,None), orphan=False):2119 children = []2120 children.extend(self.db_vistrail.db_children((self.vtType, self.db_id), orphan))2121 if orphan:2122 self.db_vistrail = None2123 children.append((self, parent[0], parent[1]))2124 return children2125 def __get_db_name(self):2126 return self.__db_name2127 def __set_db_name(self, name):2128 self.__db_name = name2129 self.is_dirty = True2130 db_name = property(__get_db_name, __set_db_name)2131 def db_add_name(self, name):2132 self.__db_name = name2133 def db_change_name(self, name):2134 self.__db_name = name2135 def db_delete_name(self, name):2136 self.__db_name = None2137 2138 def __get_db_time(self):2139 return self.__db_time2140 def __set_db_time(self, time):2141 self.__db_time = time2142 self.is_dirty = True2143 db_time = property(__get_db_time, __set_db_time)2144 def db_add_time(self, time):2145 self.__db_time = time2146 def db_change_time(self, time):2147 self.__db_time = time2148 def db_delete_time(self, time):2149 self.__db_time = None2150 2151 def getPrimaryKey(self):2152 return self.__db_name2153class DBExecRec(object):2154 vtType = 'execRec'2155 def __init__(self, id=None, tsStart=None, tsEnd=None, moduleId=None, moduleName=None, annotations=None):2156 self.__db_id = id2157 self.__db_tsStart = tsStart2158 self.__db_tsEnd = tsEnd2159 self.__db_moduleId = moduleId2160 self.__db_moduleName = moduleName2161 if annotations is None:2162 self.__db_annotations = []2163 else:2164 self.__db_annotations = annotations2165 self.is_dirty = True2166 2167 def __copy__(self):2168 cp = DBExecRec()2169 cp.db_id = self.db_id2170 cp.is_dirty = self.is_dirty2171 cp.db_tsStart = self.db_tsStart2172 cp.is_dirty = self.is_dirty2173 cp.db_tsEnd = self.db_tsEnd2174 cp.is_dirty = self.is_dirty2175 cp.db_moduleId = self.db_moduleId2176 cp.is_dirty = self.is_dirty2177 cp.db_moduleName = self.db_moduleName2178 cp.is_dirty = self.is_dirty2179 if self.db_annotations is None:2180 cp.db_annotations = None2181 else:2182 cp.db_annotations = [copy.copy(v) for v in self.db_annotations]2183 cp.is_dirty = self.is_dirty2184 return cp2185 def db_children(self, parent=(None,None), orphan=False):2186 children = []2187 for child in self.db_annotations:2188 children.extend(child.db_children((self.vtType, self.db_id), orphan))2189 if orphan:2190 self.db_annotations = []2191 children.extend(self.db_wfExec.db_children((self.vtType, self.db_id), orphan))2192 if orphan:2193 self.db_wfExec = None2194 children.append((self, parent[0], parent[1]))2195 return children2196 def __get_db_id(self):2197 return self.__db_id2198 def __set_db_id(self, id):2199 self.__db_id = id2200 self.is_dirty = True2201 db_id = property(__get_db_id, __set_db_id)2202 def db_add_id(self, id):2203 self.__db_id = id2204 def db_change_id(self, id):2205 self.__db_id = id2206 def db_delete_id(self, id):2207 self.__db_id = None2208 2209 def __get_db_tsStart(self):2210 return self.__db_tsStart2211 def __set_db_tsStart(self, tsStart):2212 self.__db_tsStart = tsStart2213 self.is_dirty = True2214 db_tsStart = property(__get_db_tsStart, __set_db_tsStart)2215 def db_add_tsStart(self, tsStart):2216 self.__db_tsStart = tsStart2217 def db_change_tsStart(self, tsStart):2218 self.__db_tsStart = tsStart2219 def db_delete_tsStart(self, tsStart):2220 self.__db_tsStart = None2221 2222 def __get_db_tsEnd(self):2223 return self.__db_tsEnd2224 def __set_db_tsEnd(self, tsEnd):2225 self.__db_tsEnd = tsEnd2226 self.is_dirty = True2227 db_tsEnd = property(__get_db_tsEnd, __set_db_tsEnd)2228 def db_add_tsEnd(self, tsEnd):2229 self.__db_tsEnd = tsEnd2230 def db_change_tsEnd(self, tsEnd):2231 self.__db_tsEnd = tsEnd2232 def db_delete_tsEnd(self, tsEnd):2233 self.__db_tsEnd = None2234 2235 def __get_db_moduleId(self):2236 return self.__db_moduleId2237 def __set_db_moduleId(self, moduleId):2238 self.__db_moduleId = moduleId2239 self.is_dirty = True2240 db_moduleId = property(__get_db_moduleId, __set_db_moduleId)2241 def db_add_moduleId(self, moduleId):2242 self.__db_moduleId = moduleId2243 def db_change_moduleId(self, moduleId):2244 self.__db_moduleId = moduleId2245 def db_delete_moduleId(self, moduleId):2246 self.__db_moduleId = None2247 2248 def __get_db_moduleName(self):2249 return self.__db_moduleName2250 def __set_db_moduleName(self, moduleName):2251 self.__db_moduleName = moduleName2252 self.is_dirty = True2253 db_moduleName = property(__get_db_moduleName, __set_db_moduleName)2254 def db_add_moduleName(self, moduleName):2255 self.__db_moduleName = moduleName2256 def db_change_moduleName(self, moduleName):2257 self.__db_moduleName = moduleName2258 def db_delete_moduleName(self, moduleName):2259 self.__db_moduleName = None2260 2261 def __get_db_annotations(self):2262 return self.__db_annotations2263 def __set_db_annotations(self, annotations):2264 self.__db_annotations = annotations2265 self.is_dirty = True2266 db_annotations = property(__get_db_annotations, __set_db_annotations)2267 def db_get_annotations(self):2268 return self.__db_annotations2269 def db_add_annotation(self, annotation):2270 self.is_dirty = True2271 self.__db_annotations.append(annotation)2272 def db_change_annotation(self, annotation):2273 self.is_dirty = True2274 found = False2275 for i in xrange(len(self.__db_annotations)):2276 if self.__db_annotations[i].db_id == annotation.db_id:2277 self.__db_annotations[i] = annotation2278 found = True2279 break2280 if not found:2281 self.__db_annotations.append(annotation)2282 def db_delete_annotation(self, annotation):2283 self.is_dirty = True2284 for i in xrange(len(self.__db_annotations)):2285 if self.__db_annotations[i].db_id == annotation.db_id:2286 del self.__db_annotations[i]2287 break2288 def db_get_annotation(self, key):2289 for i in xrange(len(self.__db_annotations)):2290 if self.__db_annotations[i].db_id == key:2291 return self.__db_annotations[i]2292 return None2293 2294 def getPrimaryKey(self):2295 return self.__db_id2296class DBVistrail(object):2297 vtType = 'vistrail'2298 def __init__(self, id=None, version=None, name=None, dbHost=None, dbPort=None, dbName=None, actions=None, tags=None, macros=None):2299 self.__db_id = id2300 self.__db_version = version2301 self.__db_name = name2302 self.__db_dbHost = dbHost2303 self.__db_dbPort = dbPort2304 self.__db_dbName = dbName2305 if actions is None:2306 self.__db_actions = {}2307 else:2308 self.__db_actions = actions2309 if tags is None:2310 self.__db_tags = {}2311 else:2312 self.__db_tags = tags2313 if macros is None:2314 self.__db_macros = {}2315 else:2316 self.__db_macros = macros2317 self.is_dirty = True2318 2319 def __copy__(self):2320 cp = DBVistrail()2321 cp.db_id = self.db_id2322 cp.is_dirty = self.is_dirty2323 cp.db_version = self.db_version2324 cp.is_dirty = self.is_dirty2325 cp.db_name = self.db_name2326 cp.is_dirty = self.is_dirty2327 cp.db_dbHost = self.db_dbHost2328 cp.is_dirty = self.is_dirty2329 cp.db_dbPort = self.db_dbPort2330 cp.is_dirty = self.is_dirty2331 cp.db_dbName = self.db_dbName2332 cp.is_dirty = self.is_dirty2333 if self.db_actions is None:2334 cp.db_actions = None2335 else:2336 cp.db_actions = dict([(k,copy.copy(v)) for (k,v) in self.db_actions.iteritems()])2337 cp.is_dirty = self.is_dirty2338 if self.db_tags is None:2339 cp.db_tags = None2340 else:2341 cp.db_tags = dict([(k,copy.copy(v)) for (k,v) in self.db_tags.iteritems()])2342 cp.is_dirty = self.is_dirty2343 if self.db_macros is None:2344 cp.db_macros = None2345 else:2346 cp.db_macros = dict([(k,copy.copy(v)) for (k,v) in self.db_macros.iteritems()])2347 cp.is_dirty = self.is_dirty2348 return cp2349 def db_children(self, parent=(None,None), orphan=False):2350 children = []2351 for child in self.db_actions.itervalues():2352 children.extend(child.db_children((self.vtType, self.db_id), orphan))2353 if orphan:2354 self.db_actions = {}2355 for child in self.db_tags.itervalues():2356 children.extend(child.db_children((self.vtType, self.db_id), orphan))2357 if orphan:2358 self.db_tags = {}2359 for child in self.db_macros.itervalues():2360 children.extend(child.db_children((self.vtType, self.db_id), orphan))2361 if orphan:2362 self.db_macros = {}2363 children.append((self, parent[0], parent[1]))2364 return children2365 def __get_db_id(self):2366 return self.__db_id2367 def __set_db_id(self, id):2368 self.__db_id = id2369 self.is_dirty = True2370 db_id = property(__get_db_id, __set_db_id)2371 def db_add_id(self, id):2372 self.__db_id = id2373 def db_change_id(self, id):2374 self.__db_id = id2375 def db_delete_id(self, id):2376 self.__db_id = None2377 2378 def __get_db_version(self):2379 return self.__db_version2380 def __set_db_version(self, version):2381 self.__db_version = version2382 self.is_dirty = True2383 db_version = property(__get_db_version, __set_db_version)2384 def db_add_version(self, version):2385 self.__db_version = version2386 def db_change_version(self, version):2387 self.__db_version = version2388 def db_delete_version(self, version):2389 self.__db_version = None2390 2391 def __get_db_name(self):2392 return self.__db_name2393 def __set_db_name(self, name):2394 self.__db_name = name2395 self.is_dirty = True2396 db_name = property(__get_db_name, __set_db_name)2397 def db_add_name(self, name):2398 self.__db_name = name2399 def db_change_name(self, name):2400 self.__db_name = name2401 def db_delete_name(self, name):2402 self.__db_name = None2403 2404 def __get_db_dbHost(self):2405 return self.__db_dbHost2406 def __set_db_dbHost(self, dbHost):2407 self.__db_dbHost = dbHost2408 self.is_dirty = True2409 db_dbHost = property(__get_db_dbHost, __set_db_dbHost)2410 def db_add_dbHost(self, dbHost):2411 self.__db_dbHost = dbHost2412 def db_change_dbHost(self, dbHost):2413 self.__db_dbHost = dbHost2414 def db_delete_dbHost(self, dbHost):2415 self.__db_dbHost = None2416 2417 def __get_db_dbPort(self):2418 return self.__db_dbPort2419 def __set_db_dbPort(self, dbPort):2420 self.__db_dbPort = dbPort2421 self.is_dirty = True2422 db_dbPort = property(__get_db_dbPort, __set_db_dbPort)2423 def db_add_dbPort(self, dbPort):2424 self.__db_dbPort = dbPort2425 def db_change_dbPort(self, dbPort):2426 self.__db_dbPort = dbPort2427 def db_delete_dbPort(self, dbPort):2428 self.__db_dbPort = None2429 2430 def __get_db_dbName(self):2431 return self.__db_dbName2432 def __set_db_dbName(self, dbName):2433 self.__db_dbName = dbName2434 self.is_dirty = True2435 db_dbName = property(__get_db_dbName, __set_db_dbName)2436 def db_add_dbName(self, dbName):2437 self.__db_dbName = dbName2438 def db_change_dbName(self, dbName):2439 self.__db_dbName = dbName2440 def db_delete_dbName(self, dbName):2441 self.__db_dbName = None2442 2443 def __get_db_actions(self):2444 return self.__db_actions2445 def __set_db_actions(self, actions):2446 self.__db_actions = actions2447 self.is_dirty = True2448 db_actions = property(__get_db_actions, __set_db_actions)2449 def db_get_actions(self):2450 return self.__db_actions.values()2451 def db_add_action(self, action):2452 self.is_dirty = True2453 self.__db_actions[action.db_id] = action2454 def db_change_action(self, action):2455 self.is_dirty = True2456 self.__db_actions[action.db_id] = action2457 def db_delete_action(self, action):2458 self.is_dirty = True2459 del self.__db_actions[action.db_id]2460 def db_get_action(self, key):2461 if self.__db_actions.has_key(key):2462 return self.__db_actions[key]2463 return None2464 2465 def __get_db_tags(self):2466 return self.__db_tags2467 def __set_db_tags(self, tags):2468 self.__db_tags = tags2469 self.is_dirty = True2470 db_tags = property(__get_db_tags, __set_db_tags)2471 def db_get_tags(self):2472 return self.__db_tags.values()2473 def db_add_tag(self, tag):2474 self.is_dirty = True2475 self.__db_tags[tag.db_name] = tag2476 def db_change_tag(self, tag):2477 self.is_dirty = True2478 self.__db_tags[tag.db_name] = tag2479 def db_delete_tag(self, tag):2480 self.is_dirty = True2481 del self.__db_tags[tag.db_name]2482 def db_get_tag(self, key):2483 if self.__db_tags.has_key(key):2484 return self.__db_tags[key]2485 return None2486 2487 def __get_db_macros(self):2488 return self.__db_macros2489 def __set_db_macros(self, macros):2490 self.__db_macros = macros2491 self.is_dirty = True2492 db_macros = property(__get_db_macros, __set_db_macros)2493 def db_get_macros(self):2494 return self.__db_macros.values()2495 def db_add_macro(self, macro):2496 self.is_dirty = True2497 self.__db_macros[macro.db_id] = macro2498 def db_change_macro(self, macro):2499 self.is_dirty = True2500 self.__db_macros[macro.db_id] = macro2501 def db_delete_macro(self, macro):2502 self.is_dirty = True2503 del self.__db_macros[macro.db_id]2504 def db_get_macro(self, key):2505 if self.__db_macros.has_key(key):2506 return self.__db_macros[key]2507 return None2508 2509 def getPrimaryKey(self):2510 return self.__db_id2511class DBDelete(object):2512 vtType = 'delete'2513 def __init__(self, id=None, what=None, objectId=None, parentObjId=None, parentObjType=None):2514 self.__db_id = id2515 self.__db_what = what2516 self.__db_objectId = objectId2517 self.__db_parentObjId = parentObjId2518 self.__db_parentObjType = parentObjType2519 self.is_dirty = True2520 2521 def __copy__(self):2522 cp = DBDelete()2523 cp.db_id = self.db_id2524 cp.is_dirty = self.is_dirty2525 cp.db_what = self.db_what2526 cp.is_dirty = self.is_dirty2527 cp.db_objectId = self.db_objectId2528 cp.is_dirty = self.is_dirty2529 cp.db_parentObjId = self.db_parentObjId2530 cp.is_dirty = self.is_dirty2531 cp.db_parentObjType = self.db_parentObjType2532 cp.is_dirty = self.is_dirty2533 return cp2534 def db_children(self, parent=(None,None), orphan=False):2535 children = []2536 children.extend(self.db_action.db_children((self.vtType, self.db_id), orphan))2537 if orphan:2538 self.db_action = None2539 children.append((self, parent[0], parent[1]))2540 return children2541 def __get_db_id(self):2542 return self.__db_id2543 def __set_db_id(self, id):2544 self.__db_id = id2545 self.is_dirty = True2546 db_id = property(__get_db_id, __set_db_id)2547 def db_add_id(self, id):2548 self.__db_id = id2549 def db_change_id(self, id):2550 self.__db_id = id2551 def db_delete_id(self, id):2552 self.__db_id = None2553 2554 def __get_db_what(self):2555 return self.__db_what2556 def __set_db_what(self, what):2557 self.__db_what = what2558 self.is_dirty = True2559 db_what = property(__get_db_what, __set_db_what)2560 def db_add_what(self, what):2561 self.__db_what = what2562 def db_change_what(self, what):2563 self.__db_what = what2564 def db_delete_what(self, what):2565 self.__db_what = None2566 2567 def __get_db_objectId(self):2568 return self.__db_objectId2569 def __set_db_objectId(self, objectId):2570 self.__db_objectId = objectId2571 self.is_dirty = True2572 db_objectId = property(__get_db_objectId, __set_db_objectId)2573 def db_add_objectId(self, objectId):2574 self.__db_objectId = objectId2575 def db_change_objectId(self, objectId):2576 self.__db_objectId = objectId2577 def db_delete_objectId(self, objectId):2578 self.__db_objectId = None2579 2580 def __get_db_parentObjId(self):2581 return self.__db_parentObjId2582 def __set_db_parentObjId(self, parentObjId):2583 self.__db_parentObjId = parentObjId2584 self.is_dirty = True2585 db_parentObjId = property(__get_db_parentObjId, __set_db_parentObjId)2586 def db_add_parentObjId(self, parentObjId):2587 self.__db_parentObjId = parentObjId2588 def db_change_parentObjId(self, parentObjId):2589 self.__db_parentObjId = parentObjId2590 def db_delete_parentObjId(self, parentObjId):2591 self.__db_parentObjId = None2592 2593 def __get_db_parentObjType(self):2594 return self.__db_parentObjType2595 def __set_db_parentObjType(self, parentObjType):2596 self.__db_parentObjType = parentObjType2597 self.is_dirty = True2598 db_parentObjType = property(__get_db_parentObjType, __set_db_parentObjType)2599 def db_add_parentObjType(self, parentObjType):2600 self.__db_parentObjType = parentObjType2601 def db_change_parentObjType(self, parentObjType):2602 self.__db_parentObjType = parentObjType2603 def db_delete_parentObjType(self, parentObjType):2604 self.__db_parentObjType = None2605 2606 def getPrimaryKey(self):...

Full Screen

Full Screen

test_persistentlist.py

Source:test_persistentlist.py Github

copy

Full Screen

1from dumpling import PersistentList2def is_dirty(x):3 return x.__dumpling__.dirty4def test_setitem():5 l = PersistentList(range(5))6 assert not is_dirty(l)7 l[2] = 428 assert l == [0, 1, 42, 3, 4]9 assert is_dirty(l)10def test_setitem_model():11 l = PersistentList(range(5))12 assert not is_dirty(l)13 l.__dumpling__.top = top = DummyModel()14 l[2] = DummyModel()15 assert l[2].top is top16 assert top.dirty17def test_setlice():18 l = PersistentList()19 assert not is_dirty(l)20 l[:] = range(5)21 assert l == [0, 1, 2, 3, 4]22 assert is_dirty(l)23def test_setslice_models():24 l = PersistentList()25 assert not is_dirty(l)26 l[:] = (DummyModel(), DummyModel())27 assert l[0].top is l28 assert l[1].top is l29def test_delitem():30 l = PersistentList(range(5))31 assert not is_dirty(l)32 del l[2]33 assert l == [0, 1, 3, 4]34 assert is_dirty(l)35def test_delslice():36 l = PersistentList(range(5))37 assert not is_dirty(l)38 del l[2:4]39 assert l == [0, 1, 4]40 assert is_dirty(l)41def test_append():42 l = PersistentList()43 assert not is_dirty(l)44 l.append(42)45 assert l == [42]46 assert is_dirty(l)47def test_append_model():48 l = PersistentList()49 assert not is_dirty(l)50 l.append(DummyModel())51 assert l[0].top is l52def test_extend():53 l = PersistentList()54 assert not is_dirty(l)55 l.extend(range(5))56 assert l == [0, 1, 2, 3, 4]57 assert is_dirty(l)58def test_extend_models():59 l = PersistentList()60 assert not is_dirty(l)61 l.extend((DummyModel(), DummyModel()))62 assert l[0].top is l63 assert l[1].top is l64def test_insert():65 l = PersistentList(range(5))66 assert not is_dirty(l)67 l.insert(2, 42)68 assert l == [0, 1, 42, 2, 3, 4]69 assert is_dirty(l)70def test_insert_model():71 l = PersistentList(range(5))72 assert not is_dirty(l)73 l.insert(2, DummyModel())74 assert l[2].top is l75def test_pop():76 l = PersistentList(range(5))77 assert not is_dirty(l)78 assert l.pop(-1) == 479 assert l == [0, 1, 2, 3]80 assert is_dirty(l)81def test_remove():82 l = PersistentList(reversed(range(5)))83 assert not is_dirty(l)84 l.remove(1)85 assert l == [4, 3, 2, 0]86 assert is_dirty(l)87def test_reverse():88 l = PersistentList(range(5))89 assert not is_dirty(l)90 l.reverse()91 assert l == [4, 3, 2, 1, 0]92 assert is_dirty(l)93def test_sort():94 l = PersistentList((3, 1, 2, 0, 4))95 assert not is_dirty(l)96 l.sort()97 assert l == [0, 1, 2, 3, 4]98 assert is_dirty(l)99class DummyModel(object):100 top = None101 dirty = False102 def __init__(self):...

Full Screen

Full Screen

Automation Testing Tutorials

Learn to execute automation testing from scratch with LambdaTest Learning Hub. Right from setting up the prerequisites to run your first automation test, to following best practices and diving deeper into advanced test scenarios. LambdaTest Learning Hubs compile a list of step-by-step guides to help you be proficient with different test automation frameworks i.e. Selenium, Cypress, TestNG etc.

LambdaTest Learning Hubs:

YouTube

You could also refer to video tutorials over LambdaTest YouTube channel to get step by step demonstration from industry experts.

Run lisa automation tests on LambdaTest cloud grid

Perform automation testing on 3000+ real desktop and mobile devices online.

Try LambdaTest Now !!

Get 100 minutes of automation test minutes FREE!!

Next-Gen App & Browser Testing Cloud

Was this article helpful?

Helpful

NotHelpful