From waterbug at step.nasa.gov Mon Jul 2 00:31:59 2007 From: waterbug at step.nasa.gov (waterbug CVS) Date: Mon Jul 2 00:32:00 2007 Subject: [pangalactic-commits] Some new tests (wip). Message-ID: <200707020431.l624Vxpu014128@ned.gsfc.nasa.gov> Modified files: PanGalactic/pangalactic/meta/pgefobject.py 1.19 1.20 PanGalactic/pangalactic/test/runtests 1.30 1.31 PanGalactic/pangalactic/test/test_pgefobject.py 1.1 1.2 PanGalactic/pangalactic/test/utils4test.py 1.35 1.36 Log message: Some new tests (wip). Also, improved way of running trial (duh!). Index: PanGalactic/pangalactic/meta/pgefobject.py diff -u PanGalactic/pangalactic/meta/pgefobject.py:1.19 PanGalactic/pangalactic/meta/pgefobject.py:1.20 --- PanGalactic/pangalactic/meta/pgefobject.py:1.19 Thu Jun 28 01:35:04 2007 +++ PanGalactic/pangalactic/meta/pgefobject.py Mon Jul 2 00:31:56 2007 @@ -1,11 +1,11 @@ -# $Id: pgefobject.py,v 1.19 2007/06/28 05:35:04 waterbug Exp $ +# $Id: pgefobject.py,v 1.20 2007/07/02 04:31:56 waterbug Exp $ """ The Mother of all PanGalactic "domain objects". -@version: $Revision: 1.19 $ +@version: $Revision: 1.20 $ """ -__version__ = "$Revision: 1.19 $"[11:-2] +__version__ = "$Revision: 1.20 $"[11:-2] # Louie (messaging package) from louie import dispatcher @@ -207,7 +207,8 @@ @param kw: a dictionary of name:value pairs to be used in updates @type kw: L{dict} """ - self.__dict__.update(kw) + for name, value in kw.items(): + setattr(self, name, value) def clone(self, **kw): """ Index: PanGalactic/pangalactic/test/test_pgefobject.py diff -u PanGalactic/pangalactic/test/test_pgefobject.py:1.1 PanGalactic/pangalactic/test/test_pgefobject.py:1.2 --- PanGalactic/pangalactic/test/test_pgefobject.py:1.1 Mon Jun 25 00:14:47 2007 +++ PanGalactic/pangalactic/test/test_pgefobject.py Mon Jul 2 00:31:56 2007 @@ -1,4 +1,4 @@ -# $Id: test_pgefobject.py,v 1.1 2007/06/25 04:14:47 waterbug Exp $ +# $Id: test_pgefobject.py,v 1.2 2007/07/02 04:31:56 waterbug Exp $ """ Unit tests for pangalactic.meta.pgefobject @@ -10,10 +10,14 @@ from pangalactic.meta.interfaces import IPgefObject, IMofObject from pangalactic.meta.pgefobject import PgefObject from pangalactic.node.uberorb import orb +from pangalactic.test.utils4test import genRunId, genLinkedTestObjects testobject = PgefObject(orb.interfaces['Identifiable'], id='spam', id_ns='eggs') +run_id = genRunId() +test_id = 'TPO' + class PgefObjectTestCases(unittest.TestCase): @@ -30,4 +34,18 @@ expected = True self.assertEquals(expected, value) + def test_03_PgefObjectExtract(self): + """CASE: PgefObject instance extract method""" + # just tests that results are dictionaries that map the objects' + # property names to their cooked values + # NOTE: probably the best way to test the right things and ensure + # complete coverage is to create a test schema that contains a Property + # of each possible type, and use a PgefObject instance that has that + # schema as the test object -- compare the result (extract) value by + # value with the expected result (a dictionary that maps the property + # names to their cooked values). + value = 'somekindastring' + expected = 'somekindastring' + self.assertEquals(expected, value) + Index: PanGalactic/pangalactic/test/runtests diff -u PanGalactic/pangalactic/test/runtests:1.30 PanGalactic/pangalactic/test/runtests:1.31 --- PanGalactic/pangalactic/test/runtests:1.30 Tue Jan 9 02:11:59 2007 +++ PanGalactic/pangalactic/test/runtests Mon Jul 2 00:31:56 2007 @@ -1,14 +1,8 @@ #!/bin/sh -# $Id: runtests,v 1.30 2007/01/09 07:11:59 waterbug Exp $ +# $Id: runtests,v 1.31 2007/07/02 04:31:56 waterbug Exp $ -trial test_sql.py -trial test_datetimes.py -trial test_cook.py -trial test_uncook.py -trial test_registry.py -trial test_kb.py -trial test_objectcache.py +trial test_sql.py test_datetimes.py test_cook.py test_uncook.py test_registry.py test_kb.py test_objectcache.py test_pgefobject.py for x in \ test_extract.py \ Index: PanGalactic/pangalactic/test/utils4test.py diff -u PanGalactic/pangalactic/test/utils4test.py:1.35 PanGalactic/pangalactic/test/utils4test.py:1.36 --- PanGalactic/pangalactic/test/utils4test.py:1.35 Sun Jun 17 23:21:01 2007 +++ PanGalactic/pangalactic/test/utils4test.py Mon Jul 2 00:31:57 2007 @@ -1,4 +1,4 @@ -# $Id: utils4test.py,v 1.35 2007/06/18 03:21:01 waterbug Exp $ +# $Id: utils4test.py,v 1.36 2007/07/02 04:31:57 waterbug Exp $ """ Utilities for testing. @@ -181,7 +181,7 @@ **parmdict)] return objs -def genLinkedTestObjects(test_id, registry, printout=True, +def genLinkedTestObjects(test_id, registry, run_id=None, printout=True, id_ns='http://pangalactic.us/test/tmp/', addable=False, versionable=False, updateable=False): """ @@ -198,7 +198,7 @@ instances should have a base_id the same as an object of that type in PGER, to exercise the adding of a new version. """ - run_id = genRunId() + run_id = run_id or genRunId() test_objects = [] proj_oid = 'OTHER' + test_id pt1_id = 'Part-1.' + test_id From waterbug at step.nasa.gov Mon Jul 9 00:05:23 2007 From: waterbug at step.nasa.gov (waterbug CVS) Date: Mon Jul 9 00:05:25 2007 Subject: [pangalactic-commits] Beginnings of unit tests for PgefObject. Message-ID: <200707090405.l6945NC3014595@ned.gsfc.nasa.gov> Modified files: PanGalactic/pangalactic/test/utils4test.py 1.36 1.37 Log message: Beginnings of unit tests for PgefObject. Index: PanGalactic/pangalactic/test/utils4test.py diff -u PanGalactic/pangalactic/test/utils4test.py:1.36 PanGalactic/pangalactic/test/utils4test.py:1.37 --- PanGalactic/pangalactic/test/utils4test.py:1.36 Mon Jul 2 00:31:57 2007 +++ PanGalactic/pangalactic/test/utils4test.py Mon Jul 9 00:05:21 2007 @@ -1,4 +1,4 @@ -# $Id: utils4test.py,v 1.36 2007/07/02 04:31:57 waterbug Exp $ +# $Id: utils4test.py,v 1.37 2007/07/09 04:05:21 waterbug Exp $ """ Utilities for testing. @@ -6,8 +6,29 @@ from datetime import datetime from random import randint + +from zope.interface import Interface + from pangalactic.utils.datetimes import dtstamp from pangalactic.meta.pgefobject import PgefObject +from pangalactic.meta.pgefpropertyspec import PgefPropertySpec + + +class TestSchema(Interface): + """ + An Interface for test purposes. + """ + ## + # Ideally, this should iterate over the datatypes, creating a schema + # property for each. + ## + # id and id_ns are required for PgefObject + id = PgefPropertySpec(id='stringattr', id_ns='pgeftest', + domain='PgefObject', range='str', + property_type='datatype') + id_ns = PgefPropertySpec(id='stringattr', id_ns='pgeftest', + domain='PgefObject', range='str', + property_type='datatype') def genRunId(dt=None): From waterbug at step.nasa.gov Mon Jul 9 17:42:49 2007 From: waterbug at step.nasa.gov (waterbug CVS) Date: Mon Jul 9 17:42:51 2007 Subject: [pangalactic-commits] Loggers needed initializing. Message-ID: <200707092142.l69Lgn8s031154@ned.gsfc.nasa.gov> Modified files: PanGalactic/pangalactic/node/gui/dialogs/pgxnobjectwiz.py 1.21 1.22 Log message: Loggers needed initializing. Index: PanGalactic/pangalactic/node/gui/dialogs/pgxnobjectwiz.py diff -u PanGalactic/pangalactic/node/gui/dialogs/pgxnobjectwiz.py:1.21 PanGalactic/pangalactic/node/gui/dialogs/pgxnobjectwiz.py:1.22 --- PanGalactic/pangalactic/node/gui/dialogs/pgxnobjectwiz.py:1.21 Wed Jun 6 01:03:45 2007 +++ PanGalactic/pangalactic/node/gui/dialogs/pgxnobjectwiz.py Mon Jul 9 17:42:47 2007 @@ -1,12 +1,12 @@ -# $Id: pgxnobjectwiz.py,v 1.21 2007/06/06 05:03:45 waterbug Exp $ +# $Id: pgxnobjectwiz.py,v 1.22 2007/07/09 21:42:47 waterbug Exp $ """ PanGalaxian Object Wizard A wizard to assist creation and cloning of PanGalaxianObject instances. -@version: $Revision: 1.21 $ +@version: $Revision: 1.22 $ """ -__version__ = "$Revision: 1.21 $"[11:-2] +__version__ = "$Revision: 1.22 $"[11:-2] import logging from pprint import pprint @@ -88,6 +88,7 @@ def __init__(self, parent): wiz.PyWizardPage.__init__(self, parent) + self.log = logging.getLogger('IfaceSelPage') self.log.debug(' - IfaceSelectionPage') self.parent = parent self.prev = self.next = None @@ -139,6 +140,7 @@ wiz.PyWizardPage.__init__(self, parent) self.parent = parent self.prev = self.next = None + self.log = logging.getLogger('IdSelPage') fs = self.GetFont().GetPointSize() bold = wx.Font(fs+2, wx.SWISS, wx.NORMAL, wx.BOLD) self.sizer = makePageTitle(self, 'New Object Identification') From waterbug at step.nasa.gov Thu Jul 12 11:39:10 2007 From: waterbug at step.nasa.gov (waterbug CVS) Date: Thu Jul 12 11:39:12 2007 Subject: [pangalactic-commits] Such rules should be in properties. Message-ID: <200707121539.l6CFdAZV008306@ned.gsfc.nasa.gov> Modified files: PanGalactic/pangalactic/meta/pgefobject.py 1.20 1.21 Log message: Such rules should be in properties. Index: PanGalactic/pangalactic/meta/pgefobject.py diff -u PanGalactic/pangalactic/meta/pgefobject.py:1.20 PanGalactic/pangalactic/meta/pgefobject.py:1.21 --- PanGalactic/pangalactic/meta/pgefobject.py:1.20 Mon Jul 2 00:31:56 2007 +++ PanGalactic/pangalactic/meta/pgefobject.py Thu Jul 12 11:39:08 2007 @@ -1,11 +1,11 @@ -# $Id: pgefobject.py,v 1.20 2007/07/02 04:31:56 waterbug Exp $ +# $Id: pgefobject.py,v 1.21 2007/07/12 15:39:08 waterbug Exp $ """ The Mother of all PanGalactic "domain objects". -@version: $Revision: 1.20 $ +@version: $Revision: 1.21 $ """ -__version__ = "$Revision: 1.20 $"[11:-2] +__version__ = "$Revision: 1.21 $"[11:-2] # Louie (messaging package) from louie import dispatcher @@ -111,6 +111,8 @@ raise ValueError, e else: # "datatype" property setattr(self, a, val) + if not getattr(self, 'id', None) or not getattr(self, 'id_ns', None): + raise ValueError, 'id and id_ns must be non-null.' # If self.creator is supplied, use it; otherwise, 'local'. # If any one of the following are populated, they all should be: self.owner = (getattr(self, 'owner', None) or @@ -128,11 +130,6 @@ # instance), so generate a [create,mod]_datetime. self.create_datetime = dtstamp() self.mod_datetime = dtstamp() - self.id = getattr(self, 'id', None) or '-'.join([ - getattr(self, 'base_id'), - getattr(self, 'version', '0') or '0']) - if not getattr(self, 'id', None) or not getattr(self, 'id_ns', None): - raise ValueError, 'id and id_ns must be non-null.' ######################### # property: create_date From waterbug at step.nasa.gov Thu Jul 12 12:42:01 2007 From: waterbug at step.nasa.gov (waterbug CVS) Date: Thu Jul 12 12:42:03 2007 Subject: [pangalactic-commits] Some fixes to new obj creation, etc. ... Message-ID: <200707121642.l6CGg1fU009750@ned.gsfc.nasa.gov> Modified files: PanGalactic/NOTES 1.23 1.24 PanGalactic/TODO 1.132 1.133 PanGalactic/doc/PgefManual.txt 1.49 1.50 PanGalactic/pangalactic/node/pangalaxian.py 1.194 1.195 Log message: Some fixes to new obj creation, etc. ... more needed (self.user not totally working). Index: PanGalactic/NOTES diff -u PanGalactic/NOTES:1.23 PanGalactic/NOTES:1.24 --- PanGalactic/NOTES:1.23 Fri Jun 15 00:40:06 2007 +++ PanGalactic/NOTES Thu Jul 12 12:41:58 2007 @@ -36,7 +36,7 @@ - PgefObject ids (created by user) must have a namespace - default nsprefix for all locally user-created object ids is: - "sandbox:", which corresponds to the null ns uri (''). + "local:", which corresponds to the null ns uri (''). - when a nsprefix is selected in the New Object Wizard, it will be shown as either "local" or "global" nsprefix (global ones will correspond to full ns Index: PanGalactic/doc/PgefManual.txt diff -u PanGalactic/doc/PgefManual.txt:1.49 PanGalactic/doc/PgefManual.txt:1.50 --- PanGalactic/doc/PgefManual.txt:1.49 Thu Jun 14 02:35:15 2007 +++ PanGalactic/doc/PgefManual.txt Thu Jul 12 12:41:59 2007 @@ -7,8 +7,8 @@ :Author: Stephen Waterbury :Author: Ginny Keech -:Version: $Revision: 1.49 $ -:Date: $Date: 2007/06/14 06:35:15 $ +:Version: $Revision: 1.50 $ +:Date: $Date: 2007/07/12 16:41:59 $ .. contents:: Table of Contents @@ -1220,7 +1220,8 @@ * id_ns - The current namespace for ``id`` attributes of ``PgefObject`` instances + The current namespace prefix for ``id`` attributes of ``PgefObject`` + instances * loggedin @@ -1904,4 +1905,4 @@ .. _Interfaces: http://www.zope.org/Wikis/Interfaces/FrontPage .. _Interface: Interfaces_ -$Id: PgefManual.txt,v 1.49 2007/06/14 06:35:15 waterbug Exp $ +$Id: PgefManual.txt,v 1.50 2007/07/12 16:41:59 waterbug Exp $ Index: PanGalactic/TODO diff -u PanGalactic/TODO:1.132 PanGalactic/TODO:1.133 --- PanGalactic/TODO:1.132 Sun Jun 10 23:40:41 2007 +++ PanGalactic/TODO Thu Jul 12 12:41:58 2007 @@ -23,7 +23,7 @@ [-] also, make use of new 'meta' attribute to determine which namespaces are visible in a given context [-] 'id_ns' is a registered namespace prefix in the pgef namespace namespace - ('pgefns2') -- so it's namespace can be looked up in 'allspace'. + ('pgefns') -- so it's namespace can be looked up in 'allspace'. [-] *** BUG: PgxnObjectGrid rebuilds its whole notebook of grids every time its 'objs' attr is set -- this is very disruptive and unnecessary! (It makes the interface jump and changes the selected page.) Need to add or delete @@ -634,5 +634,5 @@ [+] one-many (aggregate attrs) -------------------------------------------------------------------------- -# $Id: TODO,v 1.132 2007/06/11 03:40:41 waterbug Exp $ +# $Id: TODO,v 1.133 2007/07/12 16:41:58 waterbug Exp $ Index: PanGalactic/pangalactic/node/pangalaxian.py diff -u PanGalactic/pangalactic/node/pangalaxian.py:1.194 PanGalactic/pangalactic/node/pangalaxian.py:1.195 --- PanGalactic/pangalactic/node/pangalaxian.py:1.194 Fri Jun 1 01:36:03 2007 +++ PanGalactic/pangalactic/node/pangalaxian.py Thu Jul 12 12:41:59 2007 @@ -2,16 +2,16 @@ # -*- coding: ANSI_X3.4-1968 -*- # generated by wxGlade 0.3.5.1 on Tue Feb 1 00:19:02 2005 -# $Id: pangalaxian.py,v 1.194 2007/06/01 05:36:03 waterbug Exp $ +# $Id: pangalaxian.py,v 1.195 2007/07/12 16:41:59 waterbug Exp $ """ Main application module for PanGalaxian, the PGEF GUI client. WE ARE THE PANGALAXIANS! :) -@version: $Revision: 1.194 $ +@version: $Revision: 1.195 $ """ -__version__ = "$Revision: 1.194 $"[11:-2] +__version__ = "$Revision: 1.195 $"[11:-2] # Python import logging @@ -308,10 +308,14 @@ readState(os.path.join(home, 'state')) # in case 'home' was omitted from the prefs file prefs['home'] = home - prefs['userid'] = prefs.get('userid', 'localuser') + prefs['userid'] = prefs.get('userid') or 'me' + state['id_ns'] = state.get('id_ns') or 'local' # TODO: create a temporary user Person object here that can be updated # later if necessary when logging in to services - useroid = prefs['userid'] + useroid = ':'.join(['local', prefs['userid']]) + self.user = PgefObject(orb.interfaces['Person'], id=prefs['userid'], + id_ns='local', oid=useroid) + orb.saveToCache(self.user) # cd to the user-selected home directory os.chdir(prefs['home']) # make sure we have a directory for user ontologies (there also needs to @@ -410,7 +414,6 @@ pass # FIXME: do something smart else: state['project'] = state.get('project') or prefs.get('defaultproject') - state['id_ns'] = state.get('project') # FIXME -- should be a real ns state['assemblies'] = state.get('assemblies', []) self.log.info(' - PanGalaxian: project = %s' % state['project']) # TODO: make 'secure' configurable @@ -587,16 +590,10 @@ props['id'] = wizard.new_id props['id_ns'] = wizard.ns dt = dtstamp() - # find user's Person object, or create a placeholder - user = orb.getObject(state['userid']) - if not user: - user = PgefObject(orb.interfaces['Person'], - oid=state['userid']) - orb.saveToCache(user) props['oid'] = generateOid(state['userid']) # FIXME - props['owner'] = user - props['creator'] = user - props['modifier'] = user + props['owner'] = self.user.oid + props['creator'] = self.user.oid + props['modifier'] = self.user.oid props['create_datetime'] = dt props['mod_datetime'] = dt new_obj = PgefObject(wizard.iface, **props) From waterbug at step.nasa.gov Thu Jul 12 17:49:58 2007 From: waterbug at step.nasa.gov (waterbug CVS) Date: Thu Jul 12 17:50:00 2007 Subject: [pangalactic-commits] Improvements to user obj and ns handling ... Message-ID: <200707122149.l6CLnwnD015333@ned.gsfc.nasa.gov> Modified files: PanGalactic/pangalactic/meta/interfaces.py 1.21 1.22 PanGalactic/pangalactic/meta/pgefobject.py 1.21 1.22 PanGalactic/pangalactic/node/pangalaxian.py 1.195 1.196 PanGalactic/pangalactic/node/gui/widgets/pgxnobject.py 1.152 1.153 PanGalactic/pangalactic/repo/pger.py 1.146 1.147 PanGalactic/pangalactic/test/test_pger_addFile.py 1.12 1.13 PanGalactic/pangalactic/utils/identity.py 1.3 None Log message: Improvements to user obj and ns handling ... need more, of course. Index: PanGalactic/pangalactic/meta/interfaces.py diff -u PanGalactic/pangalactic/meta/interfaces.py:1.21 PanGalactic/pangalactic/meta/interfaces.py:1.22 --- PanGalactic/pangalactic/meta/interfaces.py:1.21 Sun Jun 17 23:20:59 2007 +++ PanGalactic/pangalactic/meta/interfaces.py Thu Jul 12 17:49:52 2007 @@ -1,11 +1,11 @@ -# $Id: interfaces.py,v 1.21 2007/06/18 03:20:59 waterbug Exp $ +# $Id: interfaces.py,v 1.22 2007/07/12 21:49:52 waterbug Exp $ """ Interfaces for meta modules. -@version: $Revision: 1.21 $ +@version: $Revision: 1.22 $ """ -__version__ = "$Revision: 1.21 $"[11:-2] +__version__ = "$Revision: 1.22 $"[11:-2] from zope.interface import Interface, Attribute from zope.interface.interface import InterfaceClass @@ -132,6 +132,11 @@ methods) that represent characteristics of the domain thing that the PgefObject is supposed to represent.""") + id = Attribute("""An identifier of the object within some namespace.""") + + id_ns = Attribute("""The prefix label of the namespace within which the + object's id is defined.""") + def getSchemaName(): """ Get the __name__ of the _schema of this object. Index: PanGalactic/pangalactic/meta/pgefobject.py diff -u PanGalactic/pangalactic/meta/pgefobject.py:1.21 PanGalactic/pangalactic/meta/pgefobject.py:1.22 --- PanGalactic/pangalactic/meta/pgefobject.py:1.21 Thu Jul 12 11:39:08 2007 +++ PanGalactic/pangalactic/meta/pgefobject.py Thu Jul 12 17:49:52 2007 @@ -1,11 +1,11 @@ -# $Id: pgefobject.py,v 1.21 2007/07/12 15:39:08 waterbug Exp $ +# $Id: pgefobject.py,v 1.22 2007/07/12 21:49:52 waterbug Exp $ """ The Mother of all PanGalactic "domain objects". -@version: $Revision: 1.21 $ +@version: $Revision: 1.22 $ """ -__version__ = "$Revision: 1.21 $"[11:-2] +__version__ = "$Revision: 1.22 $"[11:-2] # Louie (messaging package) from louie import dispatcher @@ -16,7 +16,6 @@ # PanGalactic from pangalactic.meta.datatypes import cook from pangalactic.meta.interfaces import IPgefObject, IMofObject -from pangalactic.utils.identity import generateOid from pangalactic.utils.toolbox import isAString from pangalactic.utils.datetimes import dtstamp, getDate @@ -113,6 +112,7 @@ setattr(self, a, val) if not getattr(self, 'id', None) or not getattr(self, 'id_ns', None): raise ValueError, 'id and id_ns must be non-null.' + self.oid = ':'.join([self.id_ns, self.id]) # If self.creator is supplied, use it; otherwise, 'local'. # If any one of the following are populated, they all should be: self.owner = (getattr(self, 'owner', None) or @@ -223,11 +223,6 @@ newkw[p] = kw[p] else: newkw[p] = getattr(self, p) - # 'oid' can be overridden by kw, but must be different - if kw.get('oid') and (kw.get('oid') != getattr(self, 'oid')): - newkw['oid'] = kw['oid'] - else: - newkw['oid'] = generateOid(kw.get('owner') or kw.get('creator')) # if nothing is passed in for these, null them out for p in ['id', 'owner', 'creator', 'modifier']: newkw[p] = kw.get(p) or '' Index: PanGalactic/pangalactic/node/pangalaxian.py diff -u PanGalactic/pangalactic/node/pangalaxian.py:1.195 PanGalactic/pangalactic/node/pangalaxian.py:1.196 --- PanGalactic/pangalactic/node/pangalaxian.py:1.195 Thu Jul 12 12:41:59 2007 +++ PanGalactic/pangalactic/node/pangalaxian.py Thu Jul 12 17:49:53 2007 @@ -2,16 +2,16 @@ # -*- coding: ANSI_X3.4-1968 -*- # generated by wxGlade 0.3.5.1 on Tue Feb 1 00:19:02 2005 -# $Id: pangalaxian.py,v 1.195 2007/07/12 16:41:59 waterbug Exp $ +# $Id: pangalaxian.py,v 1.196 2007/07/12 21:49:53 waterbug Exp $ """ Main application module for PanGalaxian, the PGEF GUI client. WE ARE THE PANGALAXIANS! :) -@version: $Revision: 1.195 $ +@version: $Revision: 1.196 $ """ -__version__ = "$Revision: 1.195 $"[11:-2] +__version__ = "$Revision: 1.196 $"[11:-2] # Python import logging @@ -29,6 +29,7 @@ # PanGalactic from pangalactic.meta.pgefobject import PgefObject +from pangalactic.meta.names import allprefix from pangalactic.node import state, prefs from pangalactic.node import readState, readPrefs from pangalactic.node import writeState, writePrefs @@ -51,8 +52,6 @@ from pangalactic.node.gui.widgets.toolframe import ToolFrame from pangalactic.node.images import toolkitimages from pangalactic.node.uberorb import orb -from pangalactic.utils.identity import generateOid -from pangalactic.utils.identity import setOidBase from pangalactic.utils.io.import_assembly import getAssemblies from pangalactic.utils.datetimes import dtstamp @@ -310,12 +309,6 @@ prefs['home'] = home prefs['userid'] = prefs.get('userid') or 'me' state['id_ns'] = state.get('id_ns') or 'local' - # TODO: create a temporary user Person object here that can be updated - # later if necessary when logging in to services - useroid = ':'.join(['local', prefs['userid']]) - self.user = PgefObject(orb.interfaces['Person'], id=prefs['userid'], - id_ns='local', oid=useroid) - orb.saveToCache(self.user) # cd to the user-selected home directory os.chdir(prefs['home']) # make sure we have a directory for user ontologies (there also needs to @@ -392,18 +385,27 @@ int(state.get('window_h') or 600)) self.SetSize(size_state) wx.InitAllImageHandlers() + # TODO: create a temporary user Person object here that can be updated + # later if necessary when logging in to services + useroid = ':'.join(['local', prefs['userid']]) + self.user = orb.getLocalObject(useroid) + if not self.user: + self.user = PgefObject(orb.interfaces['Person'], id=prefs['userid'], + id_ns='local', oid=useroid, owner=useroid, + creator=useroid, modifier=useroid) + orb.saveToCache(self.user) # by default, if this client instance gets a passwd, it will hold - # onto it until it exits + # onto it self.hold_passwd = True - setOidBase(useroid) state['userid'] = prefs['userid'] passwds = prefs.get('passwds', {}) state['passwd'] = passwds.get('userid', '') - self.log.info(' - PanGalaxian: userid = "%s"' % state['userid']) - self.log.info(' passwd = "%s"' % state['passwd']) + self.log.info(' - initial settings:') + self.log.info(' + userid = "%s"' % state['userid']) + self.log.info(' + passwd = "%s"' % state['passwd']) # make sure some defaults are set # initially, not logged in: - self.log.info(" + initial setting: state['repo'] = ''") + self.log.info(" + state['repo'] = ''") state['repo'] = '' # set prefs['repolist'] from existing prefs, if any if not prefs.get('repolist'): @@ -588,9 +590,9 @@ props['cm_authority'] = orb.cache.objs[state['project']] else: props['id'] = wizard.new_id - props['id_ns'] = wizard.ns + props['id_ns'] = allprefix[wizard.ns] # FIXME dt = dtstamp() - props['oid'] = generateOid(state['userid']) # FIXME + props['oid'] = ':'.join([props['id_ns'], props['id']]) props['owner'] = self.user.oid props['creator'] = self.user.oid props['modifier'] = self.user.oid Index: PanGalactic/pangalactic/repo/pger.py diff -u PanGalactic/pangalactic/repo/pger.py:1.146 PanGalactic/pangalactic/repo/pger.py:1.147 --- PanGalactic/pangalactic/repo/pger.py:1.146 Sun Jun 17 23:21:00 2007 +++ PanGalactic/pangalactic/repo/pger.py Thu Jul 12 17:49:55 2007 @@ -1,10 +1,10 @@ -# $Id: pger.py,v 1.146 2007/06/18 03:21:00 waterbug Exp $ +# $Id: pger.py,v 1.147 2007/07/12 21:49:55 waterbug Exp $ """ The Pan Galactic Entropy Reverser -@version: $Revision: 1.146 $ +@version: $Revision: 1.147 $ """ -__version__ = "$Revision: 1.146 $"[11:-2] +__version__ = "$Revision: 1.147 $"[11:-2] import base64 import sys @@ -22,7 +22,6 @@ from pangalactic.repo.chronosynclastic import Infundibulum from pangalactic.utils import pgefexceptions from pangalactic.utils.datetimes import dt2str, dtstamp -from pangalactic.utils.identity import generateOid class Pger(MultiService): @@ -677,11 +676,6 @@ # the PanGalaxian client encodes all content content = base64.decodestring(content) encoded = ' (decoded)' - if not rheaders.has_key('oid'): - rheaders['oid'] = generateOid(requestor) - elif rheaders['oid'].find('local') == 0: - # if oid begins with "local", generate a new one - rheaders['oid'] = generateOid(requestor) if not rheaders.get('filenames'): rheaders['filenames'] = rheaders['oid'] if rheaders['filenames'].find(', ') > -1: Index: PanGalactic/pangalactic/node/gui/widgets/pgxnobject.py diff -u PanGalactic/pangalactic/node/gui/widgets/pgxnobject.py:1.152 PanGalactic/pangalactic/node/gui/widgets/pgxnobject.py:1.153 --- PanGalactic/pangalactic/node/gui/widgets/pgxnobject.py:1.152 Fri Jun 1 01:36:04 2007 +++ PanGalactic/pangalactic/node/gui/widgets/pgxnobject.py Thu Jul 12 17:49:54 2007 @@ -1,10 +1,10 @@ -# $Id: pgxnobject.py,v 1.152 2007/06/01 05:36:04 waterbug Exp $ +# $Id: pgxnobject.py,v 1.153 2007/07/12 21:49:54 waterbug Exp $ """ PanGalaxianObject (a C{PgefObject} viewer/editor) -@version: $Revision: 1.152 $ +@version: $Revision: 1.153 $ """ -__version__ = "$Revision: 1.152 $"[11:-2] +__version__ = "$Revision: 1.153 $"[11:-2] import logging from copy import deepcopy @@ -18,6 +18,7 @@ # PanGalactic from pangalactic.meta.pgefobject import PgefObject +from pangalactic.meta.names import allprefix from pangalactic.node import state, prefs from pangalactic.node.gui.dialogs.pgxnobjectwiz import PgxnObjectWizard from pangalactic.node.gui.widgets.pgxnstatusbar import PgxnStatusBar @@ -25,7 +26,6 @@ from pangalactic.node.images import toolkitimages from pangalactic.node.uberorb import orb from pangalactic.utils.datetimes import dtstamp -from pangalactic.utils.identity import generateOid from pangalactic.utils.toolbox import isAString @@ -566,7 +566,6 @@ wizard = PgxnObjectWizard(self, iface=self.obj._schema) if wizard.RunWizard(wizard.page1): view_props = deepcopy(self.view) - view_props['oid'] = generateOid(prefs.get('userid')) if self.obj._schema.__name__ in orb.versionables: view_props['base_id'] = wizard.new_id view_props['id'] = ' '.join([wizard.new_id, '(working version)']) @@ -574,7 +573,8 @@ view_props['iteration'] = 0 else: view_props['id'] = wizard.new_id - view_props['id_ns'] = wizard.ns + view_props['id_ns'] = allprefix[wizard.ns] # FIXME + self.log.debug(' + id_ns: %s' % view_props['id_ns']) view_props['owner'] = prefs.get('userid') view_props['creator'] = prefs.get('userid') view_props['modifier'] = prefs.get('userid') @@ -584,7 +584,7 @@ cloned_obj = self.obj.clone(**view_props) spawnPgxnObject(cloned_obj, editing=True) else: - self.log.debug(' - Cloning operation was cancelled') + self.log.debug(' + cloning operation cancelled') wizard.Destroy() def onFreeze(self, event): Index: PanGalactic/pangalactic/test/test_pger_addFile.py diff -u PanGalactic/pangalactic/test/test_pger_addFile.py:1.12 PanGalactic/pangalactic/test/test_pger_addFile.py:1.13 --- PanGalactic/pangalactic/test/test_pger_addFile.py:1.12 Mon Feb 12 19:02:47 2007 +++ PanGalactic/pangalactic/test/test_pger_addFile.py Thu Jul 12 17:49:55 2007 @@ -1,16 +1,16 @@ -# $Id: test_pger_addFile.py,v 1.12 2007/02/13 00:02:47 waterbug Exp $ +# $Id: test_pger_addFile.py,v 1.13 2007/07/12 21:49:55 waterbug Exp $ """ Functional test for PGER.addFile() """ import base64 +import time from pprint import pprint from twisted.internet import reactor -from pangalactic.utils.identity import generateOid from pangalactic.repo.pger import PGER -fileoid = generateOid('TEST.TPaF') +fileoid = '.'.join(['TEST.TPaF', str(time.time())]) headers = {} headers['oid'] = fileoid headers['user-agent'] = 'PanGalaxian' From waterbug at step.nasa.gov Thu Jul 12 23:13:46 2007 From: waterbug at step.nasa.gov (waterbug CVS) Date: Thu Jul 12 23:13:48 2007 Subject: [pangalactic-commits] Some test fixes ... need more ... Message-ID: <200707130313.l6D3DkrS017063@ned.gsfc.nasa.gov> Modified files: PanGalactic/pangalactic/test/utils4test.py 1.37 1.38 Log message: Some test fixes ... need more ... Index: PanGalactic/pangalactic/test/utils4test.py diff -u PanGalactic/pangalactic/test/utils4test.py:1.37 PanGalactic/pangalactic/test/utils4test.py:1.38 --- PanGalactic/pangalactic/test/utils4test.py:1.37 Mon Jul 9 00:05:21 2007 +++ PanGalactic/pangalactic/test/utils4test.py Thu Jul 12 23:13:45 2007 @@ -1,4 +1,4 @@ -# $Id: utils4test.py,v 1.37 2007/07/09 04:05:21 waterbug Exp $ +# $Id: utils4test.py,v 1.38 2007/07/13 03:13:45 waterbug Exp $ """ Utilities for testing. @@ -42,6 +42,15 @@ dt = datetime.utcnow() return dt.isoformat('.') +def genId(base_id, test_id, run_id): + """ + Generate a unique identifier for a test object. + + @param base_id: an arbitrary base string + @type base_id: C{str} + """ + return '.'.join([base_id, test_id, run_id]) + def genVal(schema_name, registry, prop_id, test_id, run_id=None, ordinal=0): """ Generate a dummy value for a C{PgefPropertySpec} of an Interface, for @@ -126,11 +135,11 @@ if not dt: dt = genRunId() obj.id = obj.id or "id-%s-%s" % (obj._schema.__name__, dt) obj.oid = obj.oid or "oid-%s-%s" % (obj._schema.__name__, dt) - obj.id_ns = 'http://pangalactic.us/test/tmp/' + obj.id_ns = 'pgeftest' testperson = PgefObject(_schema=registry.interfaces['Person'], oid='Fester.Bestertester@earth.milkyway.univ', - id='Fester Bestertester', - id_ns='http://pangalactic.us/test/tmp/', + id='Fester.Bestertester', + id_ns='pgeftest', name='Fester Bestertester', creator='admin', record_creator='admin') @@ -148,9 +157,8 @@ if not getattr(obj, a): setattr(obj, a, testperson) -def initTestObject(schema_name, registry, test_id='', - id_ns='http://pangalactic.us/test/tmp/', - ordinal=0, **kw): +def initTestObject(schema_name, registry, id, test_id='', + id_ns='pgeftest', ordinal=0, **kw): if not test_id: test_id = 'NoTestID' for p in registry.interfaces[schema_name]: @@ -158,6 +166,7 @@ kw[p] = genVal(schema_name, registry, p, test_id, ordinal=ordinal) kw['id_ns'] = id_ns + kw['id'] = id test_obj = PgefObject(_schema=registry.interfaces[schema_name], **kw) popTestData(test_obj, registry) return test_obj @@ -190,6 +199,7 @@ schema = registry.interfaces[schema_name] if not run_id: run_id = genRunId() + objs = [] for ordinal in range(inst_count): parmdict = dict([(a, genVal(schema_name, registry, @@ -198,13 +208,15 @@ run_id, ordinal)) for a in schema]) - objs = [initTestObject(schema_name, registry, test_id, - **parmdict)] + id = '-'.join([schema_name, str(ordinal)]) + obj = initTestObject(schema_name, registry, id, test_id, + **parmdict) + objs.append(obj) return objs def genLinkedTestObjects(test_id, registry, run_id=None, printout=True, - id_ns='http://pangalactic.us/test/tmp/', - addable=False, versionable=False, updateable=False): + id_ns='pgeftest', addable=False, versionable=False, + updateable=False): """ Generate a collection of test objects some of which have others as attributes. For testing of versioned objects, use versionable=True. Some @@ -221,141 +233,110 @@ """ run_id = run_id or genRunId() test_objects = [] - proj_oid = 'OTHER' + test_id - pt1_id = 'Part-1.' + test_id - pt2_id = 'Part-2.' + test_id - pt3_id = 'FX CAP' + proj_id = genId('Project', test_id, run_id) + pt1_id = genId('Part-1', test_id, run_id) + pt2_id = genId('Part-2', test_id, run_id) + pt3_id = genId('FX CAP', test_id, run_id) pt3_base_id = 'FX-CAP' pt3_name = 'Flux Capacitor' pt_name = 'Mr. Dynamo ' + test_id + file1_id = genId('file-1', test_id, run_id) + file2_id = genId('file-2', test_id, run_id) + rep1_id = genId('representation-1', test_id, run_id) mo1_name = test_id + '-Model-1, Version A' - mo1_id = test_id + '-Mechanical-Model-1' - pm1_id = test_id + '-HiFi-MCAD-Model-1' + mo1_id = genId('Mechanical-Model-1', test_id, run_id) + pm1_id = genId('HiFi-MCAD-Model-1', test_id, run_id) mo2_name = test_id + '-Model-2, Version A' - mo2_id = test_id + '-Mechanical-Model-2' - pm2_id = test_id + '-HiFi-MCAD-Model-2' + mo2_id = genId('Mechanical-Model-2', test_id, run_id) + pm2_id = genId('HiFi-MCAD-Model-2', test_id, run_id) mo3_name = test_id + '-Model-3, Version A' - mo3_id = test_id + '-Mechanical-Model-3' - pm3_id = test_id + '-HiFi-MCAD-Model-3' + mo3_id = genId('Mechanical-Model-3', test_id, run_id) + pm3_id = genId('HiFi-MCAD-Model-3', test_id, run_id) mo4_name = test_id + '-Model-4, Version A' - mo4_id = test_id + '-Mechanical-Model-4' - pm4_id = test_id + '-HiFi-MCAD-Model-4' + mo4_id = genId('Mechanical-Model-4', test_id, run_id) + pm4_id = genId('HiFi-MCAD-Model-4', test_id, run_id) - mime1 = initTestObject('Mime', registry, test_id=test_id, - oid=genVal('Mime', registry, 'oid', test_id, run_id, 1), - id_ns=id_ns, - media_type='model', media_subtype='p21') + mime1 = initTestObject('Mime', registry, 'model/p21', test_id=test_id, + id_ns=id_ns, media_type='model', media_subtype='p21') # Meaning we don't care about adding or versioning (the default) ... if not versionable and not addable and not updateable: test_objects.append(mime1) - zaphod = initTestObject('Person', registry, test_id=test_id, - oid='zaphod@hog.univ', - name='Zaphod Beeblebrox') + zaphod = initTestObject('Person', registry, 'zaphod.beeblebrox', + test_id=test_id, id_ns=id_ns, name='Zaphod Beeblebrox') if not addable and not versionable and updateable: test_objects.append(zaphod) - file1 = initTestObject('FileLink', registry, test_id=test_id, - oid=genVal('FileLink', registry, 'oid', test_id, run_id, 1), - id_ns=id_ns, - role='system model', - user_file_name='thingy.p21', bytes=42000, - mime_type=mime1, owner=zaphod) + file1 = initTestObject('FileLink', registry, file1_id, test_id=test_id, + id_ns=id_ns, role='system model', + user_file_name='thingy.p21', bytes=42000, mime_type=mime1, + owner=zaphod) if not versionable and not updateable: test_objects.append(file1) - file2 = initTestObject('FileLink', registry, test_id=test_id, - oid=genVal('FileLink', registry, 'oid', test_id, run_id, 2), - id_ns=id_ns, - role='referenced part', + file2 = initTestObject('FileLink', registry, file2_id, test_id=test_id, + id_ns=id_ns, role='referenced part', user_file_name='thingy_libpart1.p21', bytes=12345, mime_type=mime1, owner=zaphod) if not versionable and not updateable: test_objects.append(file2) - rep1 = initTestObject('Representation', registry, test_id=test_id, - oid=genVal('Representation', registry, - 'oid', test_id, run_id, 1), - id='STEP Part 21', - id_ns=id_ns, - files=[file1, file2], - rep_purpose='exchange', + rep1 = initTestObject('Representation', registry, rep1_id, test_id=test_id, + id_ns=id_ns, files=[file1, file2], rep_purpose='exchange', generable=False, composable=True, is_object_source=True, owner=zaphod) if not versionable and not updateable: test_objects.append(rep1) - p = initTestObject('Project', registry, test_id=test_id, - oid='OTHEROTHER', id='OTHEROTHER', - name='The Other Other Project') + p = initTestObject('Project', registry, proj_id, test_id=test_id, + id_ns=id_ns, name='The Project') if not addable and not versionable and updateable: test_objects.append(p) - pt1 = initTestObject('Part', registry, test_id=test_id, - oid=genVal('Part', registry, 'oid', test_id, run_id, 1), - id_ns=id_ns, - id='x1', version='A', iteration=0, + pt1 = initTestObject('Part', registry, pt1_id, test_id=test_id, + id_ns=id_ns, version='A', iteration=0, name='Part 1A', cm_authority=p, owner=zaphod) if versionable and not updateable: test_objects.append(pt1) - pt2 = initTestObject('Part', registry, test_id=test_id, - oid=genVal('Part', registry, 'oid', test_id, run_id, 2), - id_ns=id_ns, - id='x1', version='B', iteration=1, + pt2 = initTestObject('Part', registry, pt2_id, test_id=test_id, + id_ns=id_ns, version='B', iteration=1, name='Part 1B', cm_authority=p, owner=zaphod) if versionable and not updateable: test_objects.append(pt2) - pt3 = initTestObject('Part', registry, id=pt3_id, base_id=pt3_base_id, - oid=genVal('Part', registry, 'oid', test_id, run_id, 3), + pt3 = initTestObject('Part', registry, pt3_id, base_id=pt3_base_id, id_ns='http://pangalactic.us/test/lib/', version='working', iteration=0, name=pt3_name, cm_authority='H2G2', owner=zaphod) if versionable and not updateable: test_objects.append(pt3) - mo1 = initTestObject('Model', registry, test_id=test_id, - oid=genVal('Model', registry, 'oid', test_id, run_id, 1), - id_ns=id_ns, - cm_authority=p, id=mo1_id, name=mo1_name, + mo1 = initTestObject('Model', registry, mo1_id, test_id=test_id, + id_ns=id_ns, cm_authority=p, name=mo1_name, owner=zaphod) if versionable and not updateable: test_objects.append(mo1) - mo2 = initTestObject('Model', registry, test_id=test_id, - oid=genVal('Model', registry, 'oid', test_id, run_id, 2), - id_ns=id_ns, - cm_authority=p, id=mo2_id, name=mo2_name, + mo2 = initTestObject('Model', registry, mo2_id, test_id=test_id, + id_ns=id_ns, cm_authority=p, name=mo2_name, owner=zaphod) if versionable and not updateable: test_objects.append(mo2) - mo3 = initTestObject('Model', registry, test_id=test_id, - oid=genVal('Model', registry, 'oid', test_id, run_id, 3), - id_ns=id_ns, - cm_authority=p, id=mo3_id, name=mo3_name, + mo3 = initTestObject('Model', registry, mo3_id, test_id=test_id, + id_ns=id_ns, cm_authority=p, name=mo3_name, owner=zaphod) if versionable and not updateable: test_objects.append(mo3) - mo4 = initTestObject('Model', registry, test_id=test_id, - oid=genVal('Model', registry, 'oid', test_id, run_id, 4), - id_ns=id_ns, - cm_authority=p, id=mo4_id, name=mo4_name, + mo4 = initTestObject('Model', registry, mo4_id, test_id=test_id, + id_ns=id_ns, cm_authority=p, name=mo4_name, representations=[rep1], owner=zaphod) if versionable and not updateable: test_objects.append(mo4) - pm1 = initTestObject('PartModel', registry, test_id=test_id, - oid=genVal('PartModel', registry, 'oid', test_id, run_id, 1), - id_ns=id_ns, - part=pt1, model=mo1) + pm1 = initTestObject('PartModel', registry, pm1_id, test_id=test_id, + id_ns=id_ns, part=pt1, model=mo1) if not versionable and not updateable: test_objects.append(pm1) - pm2 = initTestObject('PartModel', registry, test_id=test_id, - oid=genVal('PartModel', registry, 'oid', test_id, run_id, 2), - id_ns=id_ns, - part=pt1, model=mo2) + pm2 = initTestObject('PartModel', registry, pm2_id, test_id=test_id, + id_ns=id_ns, part=pt1, model=mo2) if not versionable and not updateable: test_objects.append(pm2) - pm3 = initTestObject('PartModel', registry, test_id=test_id, - oid=genVal('PartModel', registry, 'oid', test_id, run_id, 3), - id_ns=id_ns, - part=pt2, model=mo3) + pm3 = initTestObject('PartModel', registry, pm3_id, test_id=test_id, + id_ns=id_ns, part=pt2, model=mo3) if not versionable and not updateable: test_objects.append(pm3) - pm4 = initTestObject('PartModel', registry, test_id=test_id, - oid=genVal('PartModel', registry, 'oid', test_id, run_id, 4), - id_ns=id_ns, - part=pt2, model=mo4) + pm4 = initTestObject('PartModel', registry, pm4_id, test_id=test_id, + id_ns=id_ns, part=pt2, model=mo4) if not versionable and not updateable: test_objects.append(pm4) if printout and not addable and not versionable and not updateable: From waterbug at step.nasa.gov Fri Jul 13 00:39:37 2007 From: waterbug at step.nasa.gov (waterbug CVS) Date: Fri Jul 13 00:39:39 2007 Subject: [pangalactic-commits] More attempted fixes; not so successful. Message-ID: <200707130439.l6D4dbtO017166@ned.gsfc.nasa.gov> Modified files: PanGalactic/pangalactic/test/test_chronosynclastic_addRecords.py 1.17 1.18 PanGalactic/pangalactic/test/test_pger_updateObjects.py 1.3 1.4 Log message: More attempted fixes; not so successful. Index: PanGalactic/pangalactic/test/test_chronosynclastic_addRecords.py diff -u PanGalactic/pangalactic/test/test_chronosynclastic_addRecords.py:1.17 PanGalactic/pangalactic/test/test_chronosynclastic_addRecords.py:1.18 --- PanGalactic/pangalactic/test/test_chronosynclastic_addRecords.py:1.17 Mon Feb 12 19:02:47 2007 +++ PanGalactic/pangalactic/test/test_chronosynclastic_addRecords.py Fri Jul 13 00:39:35 2007 @@ -1,4 +1,4 @@ -# $Id: test_chronosynclastic_addRecords.py,v 1.17 2007/02/13 00:02:47 waterbug Exp $ +# $Id: test_chronosynclastic_addRecords.py,v 1.18 2007/07/13 04:39:35 waterbug Exp $ """ Test for inserting a row using pangalactic.repo.pgerdb module @@ -27,23 +27,22 @@ print error reactor.stop() -def ifNone(x, oid): +def ifNone(x, id): if not x: q = sql.buildSelect('_organization', 0, - ('_oid', '=', oid)) + ('_id', '=', id)) res = inf._runQueryMapped(*q) res.addCallbacks(success, failure) testid = 'ORG' + tmpid testname = 'Another Other Operation [_addRecords test %s]' % tmpid -testoid = testid o = initTestObject( 'Organization', - registry=inf.registry, - oid=testoid, + inf.registry, + testid, name=testname, - id=testid, id_ns='http://pangalactic.us/test/tmp/', + id_ns='pgeftest', record_owner='Fester.Bestertester@earth.milkyway.univ', record_creator='Fester.Bestertester@earth.milkyway.univ', create_datetime=dtstamp()) @@ -51,7 +50,7 @@ recs = inf._extracts2Records([extr]) out = inf._addRecords(recs, 'Fester.Bestertester@earth.milkyway.univ') -out.addCallback(lambda x: ifNone(x, testoid)) +out.addCallback(lambda x: ifNone(x, testid)) reactor.run() Index: PanGalactic/pangalactic/test/test_pger_updateObjects.py diff -u PanGalactic/pangalactic/test/test_pger_updateObjects.py:1.3 PanGalactic/pangalactic/test/test_pger_updateObjects.py:1.4 --- PanGalactic/pangalactic/test/test_pger_updateObjects.py:1.3 Mon Feb 12 19:02:47 2007 +++ PanGalactic/pangalactic/test/test_pger_updateObjects.py Fri Jul 13 00:39:35 2007 @@ -17,7 +17,7 @@ def success(result): pprint(result) - # print '\nAdded %s objects (as extracts).\n' % len(result) + print '\nAdded %s objects (as extracts).\n' % len(result) reactor.stop() def failure(error): From waterbug at step.nasa.gov Fri Jul 13 12:08:29 2007 From: waterbug at step.nasa.gov (waterbug CVS) Date: Fri Jul 13 12:08:32 2007 Subject: [pangalactic-commits] assertEquals -> failUnlessEqual Message-ID: <200707131608.l6DG8TYm022828@ned.gsfc.nasa.gov> Modified files: PanGalactic/pangalactic/test/test_cook.py 1.1 1.2 PanGalactic/pangalactic/test/test_datetimes.py 1.3 1.4 PanGalactic/pangalactic/test/test_kb.py 1.2 1.3 PanGalactic/pangalactic/test/test_objectcache.py 1.1 1.2 PanGalactic/pangalactic/test/test_pgefobject.py 1.2 1.3 PanGalactic/pangalactic/test/test_registry.py 1.29 1.30 PanGalactic/pangalactic/test/test_sql.py 1.36 1.37 PanGalactic/pangalactic/test/test_uncook.py 1.6 1.7 Log message: assertEquals -> failUnlessEqual Index: PanGalactic/pangalactic/test/test_sql.py diff -u PanGalactic/pangalactic/test/test_sql.py:1.36 PanGalactic/pangalactic/test/test_sql.py:1.37 --- PanGalactic/pangalactic/test/test_sql.py:1.36 Sat Dec 9 16:32:54 2006 +++ PanGalactic/pangalactic/test/test_sql.py Fri Jul 13 12:08:26 2007 @@ -1,4 +1,4 @@ -# $Id: test_sql.py,v 1.36 2006/12/09 21:32:54 waterbug Exp $ +# $Id: test_sql.py,v 1.37 2007/07/13 16:08:26 waterbug Exp $ """ Unit tests for pangalactic.utils.sql @@ -19,14 +19,14 @@ cmd = buildSelect('_part', 0, ('_id_ns', '=', 'TEST')) expected = ('SELECT * FROM ONLY _part WHERE _id_ns = %s', ('TEST',)) - self.assertEquals(expected, cmd) + self.failUnlessEqual(expected, cmd) def test_02_equals_with_spec(self): """CASE: one string col; '=' op; spec result cols""" cmd = buildSelect('_part', 0, ('_id_ns', '=', 'TEST'), spec=['_oid']) expected = ('SELECT _oid FROM ONLY _part WHERE _id_ns = %s', ('TEST',)) - self.assertEquals(expected, cmd) + self.failUnlessEqual(expected, cmd) def test_03_equals_with_spec_and_distinct(self): """CASE: one string col; '=' op; spec result cols; distinct""" @@ -34,7 +34,7 @@ spec=['_base_id'], distinct=True) expected = ('SELECT DISTINCT _base_id FROM ONLY _part WHERE _id_ns = %s', ('TEST',)) - self.assertEquals(expected, cmd) + self.failUnlessEqual(expected, cmd) def test_04_equals_and_like(self): """CASE: several string cols; like and '='""" @@ -43,7 +43,7 @@ ('_name', 'like', 'Mr. F') ) expected = ('SELECT * FROM ONLY _part WHERE _id_ns = %s AND _name ILIKE %s', ('TEST', '%Mr. F%')) - self.assertEquals(expected, cmd) + self.failUnlessEqual(expected, cmd) def test_05_equals_and_like_with_spec(self): """CASE: several string cols; like and '='; spec result cols""" @@ -53,7 +53,7 @@ spec=['_id', '_id_ns'] ) expected = ('SELECT _id, _id_ns FROM ONLY _part WHERE _id_ns = %s AND _name ILIKE %s', ('TEST', '%Mr. F%')) - self.assertEquals(expected, cmd) + self.failUnlessEqual(expected, cmd) def test_06_null_and_not_null(self): """CASE: 'IS NULL' and 'IS NOT NULL'""" @@ -62,7 +62,7 @@ ('_record_create_datetime', 'IS NOT', 'NULL') ) expected = ('SELECT * FROM ONLY _document WHERE _publish_date IS NULL AND _record_create_datetime IS NOT NULL',) - self.assertEquals(expected, cmd) + self.failUnlessEqual(expected, cmd) def test_07_boolean(self): """CASE: booleans""" @@ -71,7 +71,7 @@ ('_validated_flag', 'boolean', 0) ) expected = ('SELECT * FROM ONLY _part WHERE _change_flag AND NOT _validated_flag',) - self.assertEquals(expected, cmd) + self.failUnlessEqual(expected, cmd) def test_08_in_sequence(self): """CASE: one column and a sequence of values""" @@ -81,7 +81,7 @@ "XG4-D-02-05", "XG4-D-02-07"))) expected = ("SELECT * FROM ONLY _alert WHERE _doc_number in ('XG4-D-02-03', 'XG4-D-02-05', 'XG4-D-02-07')",) - self.assertEquals(expected, cmd) + self.failUnlessEqual(expected, cmd) def test_09_not_in_sequence(self): """CASE: one column and a negated sequence of values""" @@ -91,7 +91,7 @@ "XG4-D-02-05", "XG4-D-02-07"))) expected = ("SELECT * FROM ONLY _alert WHERE _doc_number not in ('XG4-D-02-03', 'XG4-D-02-05', 'XG4-D-02-07')",) - self.assertEquals(expected, cmd) + self.failUnlessEqual(expected, cmd) def test_10_not_in_null_sequence(self): """CASE: one column and a negated sequence of values""" @@ -99,7 +99,7 @@ ('_doc_number', 'not in', ())) expected = ("SELECT * FROM ONLY _alert WHERE _doc_number not in ()",) - self.assertEquals(expected, cmd) + self.failUnlessEqual(expected, cmd) def test_11_date_interval(self): """CASE: date interval""" @@ -108,7 +108,7 @@ ('_doc_issue_date', '<', '2002-05-01') ) expected = ('SELECT * FROM ONLY _alert WHERE _doc_issue_date > %s AND _doc_issue_date < %s', ('2002-04-01', '2002-05-01')) - self.assertEquals(expected, cmd) + self.failUnlessEqual(expected, cmd) def test_12_sort(self): """CASE: order by one column""" @@ -116,7 +116,7 @@ ('_publish_datetime', '>', '2002-04-01'), orderby='_publish_datetime') expected = ('SELECT * FROM ONLY _document WHERE _publish_datetime > %s ORDER BY _publish_datetime', ('2002-04-01',)) - self.assertEquals(expected, cmd) + self.failUnlessEqual(expected, cmd) def test_13_multi_sort(self): """CASE: order by multiple cols""" @@ -125,7 +125,7 @@ orderby=('_doc_issue_date', '_doc_designator') ) expected = ('SELECT * FROM ONLY _alert WHERE _doc_issue_date > %s ORDER BY _doc_issue_date, _doc_designator', ('2002-04-01',)) - self.assertEquals(expected, cmd) + self.failUnlessEqual(expected, cmd) def test_14_buildInsert(self): """CASE: INSERT statement + param list""" @@ -136,9 +136,9 @@ a = ('INSERT INTO _part (_id_ns, _id) VALUES (%s, %s)', ('TEST', '123')) b = ('INSERT INTO _part (_id, _id_ns) VALUES (%s, %s)', ('123', 'TEST')) try: - self.assertEquals(a, result) + self.failUnlessEqual(a, result) except: - self.assertEquals(b, result) + self.failUnlessEqual(b, result) def test_15_buildTransactionalInsert(self): """CASE: INSERT a list of records""" @@ -185,5 +185,5 @@ # print 'Command:' # print cmd expected = ("""('SET CONSTRAINTS ALL DEFERRED;\nINSERT INTO _model (_modifier, _iteration, _representations, _security_mask, _create_datetime, _record_modifier, _oid, _record_creator, _name, _owner, _id_ns, _record_owner, _mod_datetime, _is_head, _id, _creator) VALUES (%s, %s, %s, %s, %s, %s, %s, %s, %s, %s, %s, %s, %s, %s, %s, %s); INSERT INTO _part (_modifier, _iteration, _security_mask, _create_datetime, _record_modifier, _oid, _record_creator, _name, _owner, _id_ns, _record_owner, _mod_datetime, _is_head, _quantity, _id, _creator) VALUES (%s, %s, %s, %s, %s, %s, %s, %s, %s, %s, %s, %s, %s, %s, %s, %s); ', ('test', 0, 'test-rep1-oid, test-rep2-oid', 0, '2005-01-01 00:00:00.00', 'test', 'TEST-Model-oid', 'test', 'Test-Model, Version A', 'test', 'http://pangalactic.us/test/lib/', 'test', '2005-01-01 00:00:00.00', True, 'Test-Mechanical-Model', 'test', 'test', 0, 0, '2005-01-01 00:00:00.00', 'test', 'TEST.Part-oid', 'test', 'Test Mr. Dynamo', 'test', 'http://pangalactic.us/test/lib/', 'test', '2005-01-01 00:00:00.00', True, 1, 'Test-Part', 'test'))""") - # self.assertEquals(expected, cmd) + # self.failUnlessEqual(expected, cmd) Index: PanGalactic/pangalactic/test/test_registry.py diff -u PanGalactic/pangalactic/test/test_registry.py:1.29 PanGalactic/pangalactic/test/test_registry.py:1.30 --- PanGalactic/pangalactic/test/test_registry.py:1.29 Tue Jun 5 00:35:20 2007 +++ PanGalactic/pangalactic/test/test_registry.py Fri Jul 13 12:08:26 2007 @@ -102,7 +102,7 @@ version='0') value = [pv._schema, pv.abbreviation, pv.base_id, pv.description, pv.domain, pv.functional, pv.id, pv.id_ns, pv.inverse_functional, pv.iteration, pv.name, pv.property_type, pv.range, pv.security_mask, pv.version, kv._schema, kv.abbreviation, kv.base_id, kv.bases, kv.description, kv.id, kv.id_ns, kv.iteration, kv.name, kv.security_mask, kv.version] expected = [pe._schema, pe.abbreviation, pe.base_id, pe.description, pe.domain, pe.functional, pe.id, pe.id_ns, pe.inverse_functional, pe.iteration, pe.name, pe.property_type, pe.range, pe.security_mask, pe.version, ke._schema, ke.abbreviation, ke.base_id, ke.bases, ke.description, ke.id, ke.id_ns, ke.iteration, ke.name, ke.security_mask, ke.version] - self.assertEquals(expected, value) + self.failUnlessEqual(expected, value) # def test_02_createPmofObjectFromExtract(self): # """ @@ -110,4 +110,4 @@ # """ # value = # expected = -# self.assertEquals(expected, value) +# self.failUnlessEqual(expected, value) Index: PanGalactic/pangalactic/test/test_kb.py diff -u PanGalactic/pangalactic/test/test_kb.py:1.2 PanGalactic/pangalactic/test/test_kb.py:1.3 --- PanGalactic/pangalactic/test/test_kb.py:1.2 Fri Dec 29 17:12:08 2006 +++ PanGalactic/pangalactic/test/test_kb.py Fri Jul 13 12:08:26 2007 @@ -1,4 +1,4 @@ -# $Id: test_kb.py,v 1.2 2006/12/29 22:12:08 waterbug Exp $ +# $Id: test_kb.py,v 1.3 2007/07/13 16:08:26 waterbug Exp $ """ Unit tests for pangalactic.meta.kb @@ -19,25 +19,25 @@ """CASE: fixFunkyUris""" value = kb.fixFunkyUris('file:/x/y/z') expected = 'file:///x/y/z' - self.assertEquals(expected, value) + self.failUnlessEqual(expected, value) def test_02_fixFunkyUris_double_slash(self): """CASE: fixFunkyUris""" value = kb.fixFunkyUris('file://x/y/z') expected = 'file:///x/y/z' - self.assertEquals(expected, value) + self.failUnlessEqual(expected, value) def test_03_fixFunkyUris_triple_slash(self): """CASE: fixFunkyUris""" value = kb.fixFunkyUris('file:///x/y/z') expected = 'file:///x/y/z' - self.assertEquals(expected, value) + self.failUnlessEqual(expected, value) def test_04_getOntologyName(self): """CASE: getOntologyName""" value = k.getOntologyName(source) expected = u'space_mission' - self.assertEquals(expected, value) + self.failUnlessEqual(expected, value) def test_05_createInterfacesFromSource(self): """CASE: createInterfacesFromSource""" @@ -45,6 +45,6 @@ nsprefix='space_mission', to_python='.') # expected = u'space_mission' - # self.assertEquals(expected, value) + # self.failUnlessEqual(expected, value) Index: PanGalactic/pangalactic/test/test_pgefobject.py diff -u PanGalactic/pangalactic/test/test_pgefobject.py:1.2 PanGalactic/pangalactic/test/test_pgefobject.py:1.3 --- PanGalactic/pangalactic/test/test_pgefobject.py:1.2 Mon Jul 2 00:31:56 2007 +++ PanGalactic/pangalactic/test/test_pgefobject.py Fri Jul 13 12:08:26 2007 @@ -1,4 +1,4 @@ -# $Id: test_pgefobject.py,v 1.2 2007/07/02 04:31:56 waterbug Exp $ +# $Id: test_pgefobject.py,v 1.3 2007/07/13 16:08:26 waterbug Exp $ """ Unit tests for pangalactic.meta.pgefobject @@ -26,13 +26,13 @@ value = (IPgefObject.implementedBy(PgefObject) and IMofObject.implementedBy(PgefObject)) expected = True - self.assertEquals(expected, value) + self.failUnlessEqual(expected, value) def test_02_PgefObjectInstanceProvidesSchemaInterface(self): """CASE: PgefObject instance provides its _schema interface""" value = orb.interfaces['Identifiable'].providedBy(testobject) expected = True - self.assertEquals(expected, value) + self.failUnlessEqual(expected, value) def test_03_PgefObjectExtract(self): """CASE: PgefObject instance extract method""" @@ -46,6 +46,6 @@ # names to their cooked values). value = 'somekindastring' expected = 'somekindastring' - self.assertEquals(expected, value) + self.failUnlessEqual(expected, value) Index: PanGalactic/pangalactic/test/test_cook.py diff -u PanGalactic/pangalactic/test/test_cook.py:1.1 PanGalactic/pangalactic/test/test_cook.py:1.2 --- PanGalactic/pangalactic/test/test_cook.py:1.1 Thu Jan 18 15:39:18 2007 +++ PanGalactic/pangalactic/test/test_cook.py Fri Jul 13 12:08:26 2007 @@ -1,4 +1,4 @@ -# $Id: test_cook.py,v 1.1 2007/01/18 20:39:18 waterbug Exp $ +# $Id: test_cook.py,v 1.2 2007/07/13 16:08:26 waterbug Exp $ """ Unit tests for pangalactic.meta.pgefdatatype.cook @@ -16,61 +16,61 @@ """CASE: String (Functional)""" value = dt.cook('spam') expected = 'spam' - self.assertEquals(expected, value) + self.failUnlessEqual(expected, value) def test_02_cookStrings(self): """CASE: String (NonFunctional)""" value = dt.cook(set(['spam', 'eggs', 'bacon'])) expected = set(['spam', 'eggs', 'bacon']) - self.assertEquals(expected, value) + self.failUnlessEqual(expected, value) def test_03_cookInt(self): """CASE: String (Functional)""" value = dt.cook(42) expected = '42' - self.assertEquals(expected, value) + self.failUnlessEqual(expected, value) def test_04_cookInts(self): """CASE: Integer (NonFunctional)""" value = dt.cook(set([21, 34, 55])) expected = set(['21', '34', '55']) - self.assertEquals(expected, value) + self.failUnlessEqual(expected, value) def test_05_cookFloat(self): """CASE: Float (Functional)""" value = dt.cook(4.2) expected = '4.2' - self.assertEquals(expected, value) + self.failUnlessEqual(expected, value) def test_06_cookFloats(self): """CASE: Float (NonFunctional)""" value = dt.cook(set([2.1, 3.4, 5.5])) expected = set(['2.1', '3.4', '5.5']) - self.assertEquals(expected, value) + self.failUnlessEqual(expected, value) def test_07_cookBool(self): """CASE: Bool (Functional)""" value = dt.cook(True) expected = 'True' - self.assertEquals(expected, value) + self.failUnlessEqual(expected, value) def test_08_cookBool(self): """CASE: Bool (Functional)""" value = dt.cook(False) expected = 'False' - self.assertEquals(expected, value) + self.failUnlessEqual(expected, value) def test_09_cookBools(self): """CASE: Bool (NonFunctional)""" value = dt.cook(set([True, False, False])) expected = set(['True', 'False', 'False']) - self.assertEquals(expected, value) + self.failUnlessEqual(expected, value) def test_10_cookDatetime(self): """CASE: Datetime (Functional)""" value = dt.cook(datetime(2006, 12, 9, 11, 20, 49, tzinfo=utc_tz)) expected = '2006-12-09 11:20:49 UTC' - self.assertEquals(expected, value) + self.failUnlessEqual(expected, value) def test_11_cookDatetimes(self): """CASE: Datetime (NonFunctional)""" @@ -80,5 +80,5 @@ expected = set(['2006-12-09 11:20:49 UTC', '2005-01-10 10:00:00 UTC', '2004-01-01 00:00:00 UTC']) - self.assertEquals(expected, value) + self.failUnlessEqual(expected, value) Index: PanGalactic/pangalactic/test/test_uncook.py diff -u PanGalactic/pangalactic/test/test_uncook.py:1.6 PanGalactic/pangalactic/test/test_uncook.py:1.7 --- PanGalactic/pangalactic/test/test_uncook.py:1.6 Wed Jan 17 06:01:54 2007 +++ PanGalactic/pangalactic/test/test_uncook.py Fri Jul 13 12:08:26 2007 @@ -1,4 +1,4 @@ -# $Id: test_uncook.py,v 1.6 2007/01/17 11:01:54 waterbug Exp $ +# $Id: test_uncook.py,v 1.7 2007/07/13 16:08:26 waterbug Exp $ """ Unit tests for pangalactic.meta.pgefdatatype uncook functions @@ -16,55 +16,55 @@ """CASE: String (Functional)""" value = dt.UNCOOKERS[('str', True)]('spam') expected = 'spam' - self.assertEquals(expected, value) + self.failUnlessEqual(expected, value) def test_02_uncookStrings(self): """CASE: String (NonFunctional)""" value = dt.UNCOOKERS[('str', False)](['spam', 'eggs', 'bacon']) expected = set(['spam', 'eggs', 'bacon']) - self.assertEquals(expected, value) + self.failUnlessEqual(expected, value) def test_03_uncookInt(self): """CASE: String (Functional)""" value = dt.UNCOOKERS[('int', True)]('42') expected = 42 - self.assertEquals(expected, value) + self.failUnlessEqual(expected, value) def test_04_uncookInts(self): """CASE: Integer (NonFunctional)""" value = dt.UNCOOKERS[('int', False)](['21', '34', '55']) expected = set([21, 34, 55]) - self.assertEquals(expected, value) + self.failUnlessEqual(expected, value) def test_05_uncookFloat(self): """CASE: Float (Functional)""" value = dt.UNCOOKERS[('float', True)]('4.2') expected = 4.2 - self.assertEquals(expected, value) + self.failUnlessEqual(expected, value) def test_06_uncookFloats(self): """CASE: Float (NonFunctional)""" value = dt.UNCOOKERS[('float', False)](['2.1', '3.4', '5.5']) expected = set([2.1, 3.4, 5.5]) - self.assertEquals(expected, value) + self.failUnlessEqual(expected, value) def test_07_uncookBool(self): """CASE: Bool (Functional)""" value = dt.UNCOOKERS[('bool', True)]('True') expected = True - self.assertEquals(expected, value) + self.failUnlessEqual(expected, value) def test_08_uncookBools(self): """CASE: Bool (NonFunctional)""" value = dt.UNCOOKERS[('bool', False)](['True', '', 'False']) expected = set([True, False, False]) - self.assertEquals(expected, value) + self.failUnlessEqual(expected, value) def test_09_uncookDatetime(self): """CASE: Datetime (Functional)""" value = dt.UNCOOKERS[('datetime', True)]('2006-12-09 11:20:49 UTC') expected = datetime(2006, 12, 9, 11, 20, 49, tzinfo=utc_tz) - self.assertEquals(expected, value) + self.failUnlessEqual(expected, value) def test_10_uncookDatetimes(self): """CASE: Datetime (NonFunctional)""" @@ -74,70 +74,70 @@ expected = set([datetime(2006, 12, 9, 11, 20, 49, tzinfo=utc_tz), datetime(2005, 1, 10, 10, 0, 0, tzinfo=utc_tz), datetime(2004, 1, 1, 0, 0, 0, tzinfo=utc_tz)]) - self.assertEquals(expected, value) + self.failUnlessEqual(expected, value) def test_11_uncookString_idempotency(self): """CASE: Idempotency of String (Functional)""" value = dt.UNCOOKERS[('str', True)]( dt.UNCOOKERS[('str', True)]('spam')) expected = 'spam' - self.assertEquals(expected, value) + self.failUnlessEqual(expected, value) def test_12_uncookStrings_idempotency(self): """CASE: Idempotency of String (NonFunctional)""" value = dt.UNCOOKERS[('str', False)]( dt.UNCOOKERS[('str', False)](['spam', 'eggs', 'bacon'])) expected = set(['spam', 'eggs', 'bacon']) - self.assertEquals(expected, value) + self.failUnlessEqual(expected, value) def test_13_uncookInt_idempotency(self): """CASE: Idempotency of String (Functional)""" value = dt.UNCOOKERS[('int', True)]( dt.UNCOOKERS[('int', True)]('42')) expected = 42 - self.assertEquals(expected, value) + self.failUnlessEqual(expected, value) def test_14_uncookInts_idempotency(self): """CASE: Idempotency of Integer (NonFunctional)""" value = dt.UNCOOKERS[('int', False)]( dt.UNCOOKERS[('int', False)](['21', '34', '55'])) expected = set([21, 34, 55]) - self.assertEquals(expected, value) + self.failUnlessEqual(expected, value) def test_15_uncookFloat_idempotency(self): """CASE: Idempotency of Float (Functional)""" value = dt.UNCOOKERS[('float', True)]( dt.UNCOOKERS[('float', True)]('4.2')) expected = 4.2 - self.assertEquals(expected, value) + self.failUnlessEqual(expected, value) def test_16_uncookFloats_idempotency(self): """CASE: Idempotency of Float (NonFunctional)""" value = dt.UNCOOKERS[('float', False)]( dt.UNCOOKERS[('float', False)](['2.1', '3.4', '5.5'])) expected = set([2.1, 3.4, 5.5]) - self.assertEquals(expected, value) + self.failUnlessEqual(expected, value) def test_17_uncookBool_idempotency(self): """CASE: Idempotency of Bool (Functional)""" value = dt.UNCOOKERS[('bool', True)]( dt.UNCOOKERS[('bool', True)]('True')) expected = True - self.assertEquals(expected, value) + self.failUnlessEqual(expected, value) def test_18_uncookBools_idempotency(self): """CASE: Idempotency of Bool (NonFunctional)""" value = dt.UNCOOKERS[('bool', False)]( dt.UNCOOKERS[('bool', False)](['True', '', 'False'])) expected = set([True, False, False]) - self.assertEquals(expected, value) + self.failUnlessEqual(expected, value) def test_19_uncookDatetime_idempotency(self): """CASE: Idempotency of Datetime (Functional)""" value = dt.UNCOOKERS[('datetime', True)]( dt.UNCOOKERS[('datetime', True)]('2006-12-09 11:20:49 UTC')) expected = datetime(2006, 12, 9, 11, 20, 49, tzinfo=utc_tz) - self.assertEquals(expected, value) + self.failUnlessEqual(expected, value) def test_20_uncookDatetimes_idempotency(self): """CASE: Idempotency of Datetime (NonFunctional)""" @@ -148,5 +148,5 @@ expected = set([datetime(2006, 12, 9, 11, 20, 49, tzinfo=utc_tz), datetime(2005, 1, 10, 10, 0, 0, tzinfo=utc_tz), datetime(2004, 1, 1, 0, 0, 0, tzinfo=utc_tz)]) - self.assertEquals(expected, value) + self.failUnlessEqual(expected, value) Index: PanGalactic/pangalactic/test/test_objectcache.py diff -u PanGalactic/pangalactic/test/test_objectcache.py:1.1 PanGalactic/pangalactic/test/test_objectcache.py:1.2 --- PanGalactic/pangalactic/test/test_objectcache.py:1.1 Thu Jan 18 15:39:18 2007 +++ PanGalactic/pangalactic/test/test_objectcache.py Fri Jul 13 12:08:26 2007 @@ -1,4 +1,4 @@ -# $Id: test_objectcache.py,v 1.1 2007/01/18 20:39:18 waterbug Exp $ +# $Id: test_objectcache.py,v 1.2 2007/07/13 16:08:26 waterbug Exp $ """ Unit tests for pangalactic.node.cache @@ -27,7 +27,7 @@ """CASE: cache initialized with all registered interfaces""" value = set(c.interfaces) expected = set(r.interfaces) - self.assertEquals(expected, value) + self.failUnlessEqual(expected, value) def test_02_saveObjects(self): """CASE: save objects (and retrieve by oids)""" @@ -36,6 +36,6 @@ c.saveObjects(objs) value = set([c.objs[oid] for oid in odict]) expected = set(objs) - self.assertEquals(expected, value) + self.failUnlessEqual(expected, value) Index: PanGalactic/pangalactic/test/test_datetimes.py diff -u PanGalactic/pangalactic/test/test_datetimes.py:1.3 PanGalactic/pangalactic/test/test_datetimes.py:1.4 --- PanGalactic/pangalactic/test/test_datetimes.py:1.3 Tue Dec 19 03:26:36 2006 +++ PanGalactic/pangalactic/test/test_datetimes.py Fri Jul 13 12:08:26 2007 @@ -1,4 +1,4 @@ -# $Id: test_datetimes.py,v 1.3 2006/12/19 08:26:36 waterbug Exp $ +# $Id: test_datetimes.py,v 1.4 2007/07/13 16:08:26 waterbug Exp $ """ Unit tests for pangalactic.meta.kb @@ -18,49 +18,49 @@ '2006/12/17', '12/17/2006']] expected = [date(2006, 12, 17) for x in range(4)] - self.assertEquals(expected, value) + self.failUnlessEqual(expected, value) def test_02_date2str(self): """CASE: date2str (convert date to string)""" value = datetimes.date2str(date(2006, 12, 17)) expected = '2006-12-17' - self.assertEquals(expected, value) + self.failUnlessEqual(expected, value) def test_03_str2dt(self): """CASE: str2dt (convert string to datetime)""" value = datetimes.str2dt('2006-12-17 12:38:14 UTC') expected = datetime(2006, 12, 17, 12, 38, 14, tzinfo=datetimes.utc_tz) - self.assertEquals(expected, value) + self.failUnlessEqual(expected, value) def test_04_str2dt_no_tz(self): """CASE: str2dt (convert string to datetime w/o timezone info)""" value = datetimes.str2dt('2006-12-17 12:38:14') expected = datetime(2006, 12, 17, 12, 38, 14) - self.assertEquals(expected, value) + self.failUnlessEqual(expected, value) def test_05_dt2str(self): """CASE: date2str (convert date to string)""" value = datetimes.dt2str(datetime(2006, 12, 17, 12, 38, 14, tzinfo=datetimes.utc_tz)) expected = '2006-12-17 12:38:14 UTC' - self.assertEquals(expected, value) + self.failUnlessEqual(expected, value) def test_06_dt2str_no_tz(self): """CASE: date2str (convert date to string w/o timezone info)""" value = datetimes.dt2str(datetime(2006, 12, 17, 12, 38, 14)) expected = '2006-12-17 12:38:14' - self.assertEquals(expected, value) + self.failUnlessEqual(expected, value) def test_07_str2time(self): """CASE: str2time (converts string to time)""" value = datetimes.str2time('12:38:14') expected = time(12, 38, 14) - self.assertEquals(expected, value) + self.failUnlessEqual(expected, value) def test_08_time2str(self): """CASE: time2str (converts time to string)""" value = datetimes.time2str(time(12, 38, 14)) expected = '12:38:14' - self.assertEquals(expected, value) + self.failUnlessEqual(expected, value) From waterbug at step.nasa.gov Fri Jul 13 17:17:12 2007 From: waterbug at step.nasa.gov (waterbug CVS) Date: Fri Jul 13 17:17:13 2007 Subject: [pangalactic-commits] Begin conversion of sandbox data ... Message-ID: <200707132117.l6DLHC6p027244@ned.gsfc.nasa.gov> Modified files: PanGalactic/src/sql/insertACUs.sql 1.17 1.18 PanGalactic/src/sql/insertDocuments.sql 1.35 1.36 Log message: Begin conversion of sandbox data ... to new oid scheme. Index: PanGalactic/src/sql/insertACUs.sql diff -u PanGalactic/src/sql/insertACUs.sql:1.17 PanGalactic/src/sql/insertACUs.sql:1.18 --- PanGalactic/src/sql/insertACUs.sql:1.17 Fri Jan 20 16:01:11 2006 +++ PanGalactic/src/sql/insertACUs.sql Fri Jul 13 17:17:11 2007 @@ -1,6 +1,6 @@ -/* PGER Demo NAUO data. */ +/* PGER Sandbox NAUO data. */ -/* $Id: insertACUs.sql,v 1.17 2006/01/20 21:01:11 waterbug Exp $ */ +/* $Id: insertACUs.sql,v 1.18 2007/07/13 21:17:11 waterbug Exp $ */ BEGIN; SET CONSTRAINTS ALL DEFERRED; @@ -28,24 +28,24 @@ ) VALUES ( -'banzai@banzai.earth.1036203962.41', -- _oid +'sandbox:acu-1', -- _oid 'acu-1', -- _id -'http://pangalactic.us/test/lib/', -- _id_ns +'sandbox', -- _id_ns '0', -- _security_mask -'banzai@banzai.earth', -- _record_owner -'banzai@banzai.earth', -- _record_creator +'sandbox:buckaroo.banzai', -- _record_owner +'sandbox:buckaroo.banzai', -- _record_creator '2002-09-09 01:06:51', -- _record_create_datetime -'banzai@banzai.earth', -- _record_modifier +'sandbox:buckaroo.banzai', -- _record_modifier '2002-09-09 01:06:51', -- _record_mod_datetime -'banzai@banzai.earth', -- _owner -'banzai@banzai.earth', -- _creator +'sandbox:buckaroo.banzai', -- _owner +'sandbox:buckaroo.banzai', -- _creator '2002-09-09 01:06:51', -- _create_datetime -'banzai@banzai.earth', -- _modifier +'sandbox:buckaroo.banzai', -- _modifier '2002-09-09 01:06:51', -- _mod_datetime '', -- _name 'DriveMod1', -- _ref_designator -'TEST.HOG.1-CAD.1', -- _parent -'TEST.IDrive.1-CAD.1' -- _child +'sandbox:HOG.1-CAD.1', -- _parent +'sandbox:IDrive.1-CAD.1' -- _child ); INSERT INTO _acu @@ -71,24 +71,24 @@ ) VALUES ( -'banzai@banzai.earth.1036203962.42', -- _oid +'sandbox:acu-2', -- _oid 'acu-2', -- _id -'http://pangalactic.us/test/lib/', -- _id_ns +'sandbox', -- _id_ns '0', -- _security_mask -'banzai@banzai.earth', -- _record_owner -'banzai@banzai.earth', -- _record_creator +'sandbox:buckaroo.banzai', -- _record_owner +'sandbox:buckaroo.banzai', -- _record_creator '2002-09-09 01:06:51', -- _record_create_datetime -'banzai@banzai.earth', -- _record_modifier +'sandbox:buckaroo.banzai', -- _record_modifier '2002-09-09 01:06:51', -- _record_mod_datetime -'banzai@banzai.earth', -- _owner -'banzai@banzai.earth', -- _creator +'sandbox:buckaroo.banzai', -- _owner +'sandbox:buckaroo.banzai', -- _creator '2002-09-09 01:06:51', -- _create_datetime -'banzai@banzai.earth', -- _modifier +'sandbox:buckaroo.banzai', -- _modifier '2002-09-09 01:06:51', -- _mod_datetime '', -- _name 'Brain1', -- _ref_designator -'TEST.HOG.1-CAD.1', -- _parent -'TEST.B57SMB.1-CAD.1' -- _child +'sandbox:HOG.1-CAD.1', -- _parent +'sandbox:B57SMB.1-CAD.1' -- _child ); INSERT INTO _acu @@ -114,24 +114,24 @@ ) VALUES ( -'banzai@banzai.earth.1036203962.43', -- _oid +'sandbox:acu-3', -- _oid 'acu-3', -- _id -'http://pangalactic.us/test/lib/', -- _id_ns +'sandbox', -- _id_ns '0', -- _security_mask -'banzai@banzai.earth', -- _record_owner -'banzai@banzai.earth', -- _record_creator +'sandbox:buckaroo.banzai', -- _record_owner +'sandbox:buckaroo.banzai', -- _record_creator '2002-09-09 01:06:51', -- _record_create_datetime -'banzai@banzai.earth', -- _record_modifier +'sandbox:buckaroo.banzai', -- _record_modifier '2002-09-09 01:06:51', -- _record_mod_datetime -'banzai@banzai.earth', -- _owner -'banzai@banzai.earth', -- _creator +'sandbox:buckaroo.banzai', -- _owner +'sandbox:buckaroo.banzai', -- _creator '2002-09-09 01:06:51', -- _create_datetime -'banzai@banzai.earth', -- _modifier +'sandbox:buckaroo.banzai', -- _modifier '2002-09-09 01:06:51', -- _mod_datetime '', -- _name 'Flux1', -- _ref_designator -'TEST.HOG.1-CAD.1', -- _parent -'TEST.FX-CAP.1-CAD.1' -- _child +'sandbox:HOG.1-CAD.1', -- _parent +'sandbox:FX-CAP.1-CAD.1' -- _child ); INSERT INTO _acu @@ -157,24 +157,24 @@ ) VALUES ( -'banzai@banzai.earth.1036203962.44', -- _oid +'sandbox:acu-4', -- _oid 'acu-4', -- _id -'http://pangalactic.us/test/lib/', -- _id_ns +'sandbox', -- _id_ns '0', -- _security_mask -'banzai@banzai.earth', -- _record_owner -'banzai@banzai.earth', -- _record_creator +'sandbox:buckaroo.banzai', -- _record_owner +'sandbox:buckaroo.banzai', -- _record_creator '2002-09-09 01:06:51', -- _record_create_datetime -'banzai@banzai.earth', -- _record_modifier +'sandbox:buckaroo.banzai', -- _record_modifier '2002-09-09 01:06:51', -- _record_mod_datetime -'banzai@banzai.earth', -- _owner -'banzai@banzai.earth', -- _creator +'sandbox:buckaroo.banzai', -- _owner +'sandbox:buckaroo.banzai', -- _creator '2002-09-09 01:06:51', -- _create_datetime -'banzai@banzai.earth', -- _modifier +'sandbox:buckaroo.banzai', -- _modifier '2002-09-09 01:06:51', -- _mod_datetime '', -- _name 'Pwr1', -- _ref_designator -'TEST.HOG.1-CAD.1', -- _parent -'TEST.MF Series A.1-CAD.1' -- _child +'sandbox:HOG.1-CAD.1', -- _parent +'sandbox:MF Series A.1-CAD.1' -- _child ); INSERT INTO _acu @@ -200,24 +200,24 @@ ) VALUES ( -'banzai@banzai.earth.1036203962.45', -- _oid +'sandbox:acu-5', -- _oid 'acu-5', -- _id -'http://pangalactic.us/test/lib/', -- _id_ns +'sandbox', -- _id_ns '0', -- _security_mask -'banzai@banzai.earth', -- _record_owner -'banzai@banzai.earth', -- _record_creator +'sandbox:buckaroo.banzai', -- _record_owner +'sandbox:buckaroo.banzai', -- _record_creator '2002-09-09 01:06:51', -- _record_create_datetime -'banzai@banzai.earth', -- _record_modifier +'sandbox:buckaroo.banzai', -- _record_modifier '2002-09-09 01:06:51', -- _record_mod_datetime -'banzai@banzai.earth', -- _owner -'banzai@banzai.earth', -- _creator +'sandbox:buckaroo.banzai', -- _owner +'sandbox:buckaroo.banzai', -- _creator '2002-09-09 01:06:51', -- _create_datetime -'banzai@banzai.earth', -- _modifier +'sandbox:buckaroo.banzai', -- _modifier '2002-09-09 01:06:51', -- _mod_datetime '', -- _name 'OTh1', -- _ref_designator -'TEST.HOG.1-CAD.1', -- _parent -'TEST.OO-1.1-CAD.1' -- _child +'sandbox:HOG.1-CAD.1', -- _parent +'sandbox:OO-1.1-CAD.1' -- _child ); INSERT INTO _acu @@ -243,24 +243,24 @@ ) VALUES ( -'banzai@banzai.earth.1036203962.46', -- _oid +'sandbox:acu-6', -- _oid 'acu-6', -- _id -'http://pangalactic.us/test/lib/', -- _id_ns +'sandbox', -- _id_ns '0', -- _security_mask -'banzai@banzai.earth', -- _record_owner -'banzai@banzai.earth', -- _record_creator +'sandbox:buckaroo.banzai', -- _record_owner +'sandbox:buckaroo.banzai', -- _record_creator '2002-09-09 01:06:51', -- _record_create_datetime -'banzai@banzai.earth', -- _record_modifier +'sandbox:buckaroo.banzai', -- _record_modifier '2002-09-09 01:06:51', -- _record_mod_datetime -'banzai@banzai.earth', -- _owner -'banzai@banzai.earth', -- _creator +'sandbox:buckaroo.banzai', -- _owner +'sandbox:buckaroo.banzai', -- _creator '2002-09-09 01:06:51', -- _create_datetime -'banzai@banzai.earth', -- _modifier +'sandbox:buckaroo.banzai', -- _modifier '2002-09-09 01:06:51', -- _mod_datetime '', -- _name 'TwAssy1', -- _ref_designator -'TEST.OO-1.1-CAD.1', -- _parent -'TEST.BTA-20.1-CAD.1' -- _child +'sandbox:OO-1.1-CAD.1', -- _parent +'sandbox:BTA-20.1-CAD.1' -- _child ); INSERT INTO _acu @@ -286,24 +286,24 @@ ) VALUES ( -'banzai@banzai.earth.1036203962.47', -- _oid +'sandbox:acu-7', -- _oid 'acu-7', -- _id -'http://pangalactic.us/test/lib/', -- _id_ns +'sandbox', -- _id_ns '0', -- _security_mask -'banzai@banzai.earth', -- _record_owner -'banzai@banzai.earth', -- _record_creator +'sandbox:buckaroo.banzai', -- _record_owner +'sandbox:buckaroo.banzai', -- _record_creator '2002-09-09 01:06:51', -- _record_create_datetime -'banzai@banzai.earth', -- _record_modifier +'sandbox:buckaroo.banzai', -- _record_modifier '2002-09-09 01:06:51', -- _record_mod_datetime -'banzai@banzai.earth', -- _owner -'banzai@banzai.earth', -- _creator +'sandbox:buckaroo.banzai', -- _owner +'sandbox:buckaroo.banzai', -- _creator '2002-09-09 01:06:51', -- _create_datetime -'banzai@banzai.earth', -- _modifier +'sandbox:buckaroo.banzai', -- _modifier '2002-09-09 01:06:51', -- _mod_datetime '', -- _name 'Tw1', -- _ref_designator -'TEST.BTA-20.1-CAD.1', -- _parent -'TEST.MMT-01.1-CAD.1' -- _child +'sandbox:BTA-20.1-CAD.1', -- _parent +'sandbox:MMT-01.1-CAD.1' -- _child ); INSERT INTO _acu @@ -329,24 +329,24 @@ ) VALUES ( -'banzai@banzai.earth.1036203962.48', -- _oid +'sandbox:acu-8', -- _oid 'acu-8', -- _id -'http://pangalactic.us/test/lib/', -- _id_ns +'sandbox', -- _id_ns '0', -- _security_mask -'banzai@banzai.earth', -- _record_owner -'banzai@banzai.earth', -- _record_creator +'sandbox:buckaroo.banzai', -- _record_owner +'sandbox:buckaroo.banzai', -- _record_creator '2002-09-09 01:06:51', -- _record_create_datetime -'banzai@banzai.earth', -- _record_modifier +'sandbox:buckaroo.banzai', -- _record_modifier '2002-09-09 01:06:51', -- _record_mod_datetime -'banzai@banzai.earth', -- _owner -'banzai@banzai.earth', -- _creator +'sandbox:buckaroo.banzai', -- _owner +'sandbox:buckaroo.banzai', -- _creator '2002-09-09 01:06:51', -- _create_datetime -'banzai@banzai.earth', -- _modifier +'sandbox:buckaroo.banzai', -- _modifier '2002-09-09 01:06:51', -- _mod_datetime '', -- _name 'H1', -- _ref_designator -'TEST.BTA-20.1-CAD.1', -- _parent -'TEST.HM.200.1-CAD.1' -- _child +'sandbox:BTA-20.1-CAD.1', -- _parent +'sandbox:HM.200.1-CAD.1' -- _child ); END; Index: PanGalactic/src/sql/insertDocuments.sql diff -u PanGalactic/src/sql/insertDocuments.sql:1.35 PanGalactic/src/sql/insertDocuments.sql:1.36 --- PanGalactic/src/sql/insertDocuments.sql:1.35 Thu Nov 23 14:37:24 2006 +++ PanGalactic/src/sql/insertDocuments.sql Fri Jul 13 17:17:11 2007 @@ -1,6 +1,6 @@ /* PGER Demo Document insertion. */ -/* $Id: insertDocuments.sql,v 1.35 2006/11/23 19:37:24 waterbug Exp $ */ +/* $Id: insertDocuments.sql,v 1.36 2007/07/13 21:17:11 waterbug Exp $ */ BEGIN; SET CONSTRAINTS ALL DEFERRED; @@ -40,23 +40,23 @@ ) VALUES ( -'TEST.DOC-01.1', +'sandbox:DOC-01.1', 'Document', -- _schema_name 'DOC-01.1', -- id -'http://pangalactic.us/test/lib/', -- id_ns +'sandbox', -- id_ns 0, -- security_mask 'Test Document 01.1', -- name 'Document 1.1 (Test)', -- description 'Document 01 v.1 blah blah (Test)', -- comment -'smallberries@yoyodyne.planet10', -- record_owner -'smallberries@yoyodyne.planet10', -- record_creator +'sandbox:john.smallberries', -- record_owner +'sandbox:john.smallberries', -- record_creator '2002-09-10 01:00:00', -- record_create_datetime -'smallberries@yoyodyne.planet10', -- record_modifier +'sandbox:john.smallberries', -- record_modifier '2002-09-10 01:00:00', -- record_mod_datetime -'smallberries@yoyodyne.planet10', -- owner -'smallberries@yoyodyne.planet10', -- creator +'sandbox:john.smallberries', -- owner +'sandbox:john.smallberries', -- creator '2002-09-09 01:06:51', -- create_datetime -'smallberries@yoyodyne.planet10', -- modifier +'sandbox:john.smallberries', -- modifier '2002-09-09 01:06:51', -- mod_datetime '', -- representations 'DOC-01', -- base_id @@ -64,11 +64,11 @@ 'v1.1', -- version 1, -- version_sequence 'False', -- is_head -'H2G2', -- cm_authority +'sandbox:H2G2', -- cm_authority 'root', -- structural_role 'This document describes the universe and gives 3 examples', -- abstract 'Blah blah universe blah blah blah', -- content -'text/plain', -- content_mime_type +'mime:text/plain', -- content_mime_type '2002-09-09 01:06:51' -- publish_datetime ); @@ -107,35 +107,35 @@ ) VALUES ( -'TEST.DOC-01.2', +'sandbox:DOC-01.2', 'Document', -- _schema_name 'DOC-01.2', -- id -'http://pangalactic.us/test/lib/', -- id_ns +'sandbox', -- id_ns 0, -- security_mask 'Test Document 1.2', -- name 'Document 01 (Test) v.2', -- description 'Document 01 blah blah (Test)', -- comment -'smallberries@yoyodyne.planet10', -- record_owner -'smallberries@yoyodyne.planet10', -- record_creator +'sandbox:john.smallberries', -- record_owner +'sandbox:john.smallberries', -- record_creator '2002-09-10 01:00:00', -- record_create_datetime -'smallberries@yoyodyne.planet10', -- record_modifier +'sandbox:john.smallberries', -- record_modifier '2002-09-10 01:00:00', -- record_mod_datetime -'smallberries@yoyodyne.planet10', -- owner -'smallberries@yoyodyne.planet10', -- creator +'sandbox:john.smallberries', -- owner +'sandbox:john.smallberries', -- creator '2002-09-09 01:06:51', -- create_datetime -'smallberries@yoyodyne.planet10', -- modifier +'sandbox:john.smallberries', -- modifier '2002-09-09 01:06:51', -- mod_datetime -'TEST.Representation.1, TEST.Representation.2', -- representations +'sandbox:Representation.1, sandbox:Representation.2', -- representations 'DOC-01', -- base_id 0, -- iteration 'v1.2', -- version 2, -- version_sequence 'True', -- is_head -'H2G2', -- cm_authority +'sandbox:H2G2', -- cm_authority 'root', -- structural_role 'This document describes the universe and gives 3 - no 4! - 4 examples', -- abstract 'The Universe is like, huge. More huge than you can imagine. Talking really, really, really big. You could say (as Ed Sullivan often did) it is a really big shoe.', -- content -'text/plain', -- content_mime_type +'mime:text/plain', -- content_mime_type '2002-09-09 01:06:51' -- publish_datetime ); @@ -167,25 +167,25 @@ ) VALUES ( -'TEST.Representation.1', +'sandbox:Representation.1', 'Representation', -- _schema_name 'HTML Slides', -- id -'http://pangalactic.us/test/lib/', -- id_ns +'sandbox', -- id_ns 0, -- security_mask -'TEST.Representation.1', -- name +'sandbox:Representation.1', -- name 'HTML document representation of DOC-01, v1.2 (Test)', -- description 'HTML narrative document format', -- comment -'smallberries@yoyodyne.planet10', -- record_owner -'smallberries@yoyodyne.planet10', -- record_creator +'sandbox:john.smallberries', -- record_owner +'sandbox:john.smallberries', -- record_creator '2002-09-10 01:00:00', -- record_create_datetime -'smallberries@yoyodyne.planet10', -- record_modifier +'sandbox:john.smallberries', -- record_modifier '2002-09-10 01:00:00', -- record_mod_datetime -'smallberries@yoyodyne.planet10', -- owner -'smallberries@yoyodyne.planet10', -- creator +'sandbox:john.smallberries', -- owner +'sandbox:john.smallberries', -- creator '2002-09-09 01:06:51', -- create_datetime -'smallberries@yoyodyne.planet10', -- modifier +'sandbox:john.smallberries', -- modifier '2002-09-09 01:06:51', -- mod_datetime -'TEST.FileLink.1, TEST.FileLink.2', -- files +'sandbox:FileLink.1, sandbox:FileLink.2', -- files 'presentation', -- rep_purpose 'True', -- is_generable 'False', -- is_composable @@ -220,25 +220,25 @@ ) VALUES ( -'TEST.Representation.2', +'sandbox:Representation.2', 'Representation', -- _schema_name 'HTML Documentation', -- id -'http://pangalactic.us/test/lib/', -- id_ns +'sandbox', -- id_ns 0, -- security_mask -'TEST.Representation.2', -- name +'sandbox:Representation.2', -- name 'HTML Slides for DOC-01, v1.2 (Test)', -- description 'Slide presentation of document contents', -- comment -'smallberries@yoyodyne.planet10', -- record_owner -'smallberries@yoyodyne.planet10', -- record_creator +'sandbox:john.smallberries', -- record_owner +'sandbox:john.smallberries', -- record_creator '2002-09-10 01:00:00', -- record_create_datetime -'smallberries@yoyodyne.planet10', -- record_modifier +'sandbox:john.smallberries', -- record_modifier '2002-09-10 01:00:00', -- record_mod_datetime -'smallberries@yoyodyne.planet10', -- owner -'smallberries@yoyodyne.planet10', -- creator +'sandbox:john.smallberries', -- owner +'sandbox:john.smallberries', -- creator '2002-09-09 01:06:51', -- create_datetime -'smallberries@yoyodyne.planet10', -- modifier +'sandbox:john.smallberries', -- modifier '2002-09-09 01:06:51', -- mod_datetime -'TEST.FileLink.3, TEST.FileLink.4', -- files +'sandbox:FileLink.3, sandbox:FileLink.4', -- files 'presentation', -- rep_purpose 'True', -- is_generable 'False', -- is_composable @@ -276,23 +276,23 @@ ) VALUES ( -'TEST.FileLink.3', +'sandbox:FileLink.3', 'FileLink', -- _schema_name 'FileLink.3', -- id -'http://pangalactic.us/test/lib/', -- id_ns +'sandbox', -- id_ns 0, -- security_mask 'TEST-Document01v1.2.html', -- name 'HTML file, DOC-01, v1.2 (Test)', -- description 'HTML file of DOC-01, v1.2 (Test)', -- comment -'smallberries@yoyodyne.planet10', -- record_owner -'smallberries@yoyodyne.planet10', -- record_creator +'sandbox:john.smallberries', -- record_owner +'sandbox:john.smallberries', -- record_creator '2002-09-10 01:00:00', -- record_create_datetime -'smallberries@yoyodyne.planet10', -- record_modifier +'sandbox:john.smallberries', -- record_modifier '2002-09-10 01:00:00', -- record_mod_datetime -'smallberries@yoyodyne.planet10', -- owner -'smallberries@yoyodyne.planet10', -- creator +'sandbox:john.smallberries', -- owner +'sandbox:john.smallberries', -- creator '2002-09-09 01:06:51', -- create_datetime -'smallberries@yoyodyne.planet10', -- modifier +'sandbox:john.smallberries', -- modifier '2002-09-09 01:06:51', -- mod_datetime 'content', -- file_role 0, -- file_sequence @@ -301,7 +301,7 @@ 'Document01v1.2.html', -- user_file_name 'True', -- is_secured 12345, -- bytes -'text/html' -- mime_type +'mime:text/html' -- mime_type ); INSERT INTO _file_link @@ -335,23 +335,23 @@ ) VALUES ( -'TEST.FileLink.4', +'sandbox:FileLink.4', 'FileLink', -- _schema_name 'FileLink.4', -- id -'http://pangalactic.us/test/lib/', -- id_ns +'sandbox', -- id_ns 0, -- security_mask 'TEST-Document01v1.2.css', -- name 'CSS file, DOC-01, v1.2 (Test)', -- description 'CSS file of DOC-01, v1.2 (Test)', -- comment -'smallberries@yoyodyne.planet10', -- record_owner -'smallberries@yoyodyne.planet10', -- record_creator +'sandbox:john.smallberries', -- record_owner +'sandbox:john.smallberries', -- record_creator '2002-09-10 01:00:00', -- record_create_datetime -'smallberries@yoyodyne.planet10', -- record_modifier +'sandbox:john.smallberries', -- record_modifier '2002-09-10 01:00:00', -- record_mod_datetime -'smallberries@yoyodyne.planet10', -- owner -'smallberries@yoyodyne.planet10', -- creator +'sandbox:john.smallberries', -- owner +'sandbox:john.smallberries', -- creator '2002-09-09 01:06:51', -- create_datetime -'smallberries@yoyodyne.planet10', -- modifier +'sandbox:john.smallberries', -- modifier '2002-09-09 01:06:51', -- mod_datetime 'content', -- file_role 0, -- file_sequence @@ -360,7 +360,7 @@ 'Document01v1.2.css', -- user_file_name 'True', -- is_secured 12345, -- bytes -'text/css' -- mime_type +'mime:text/css' -- mime_type ); INSERT INTO _object_document @@ -389,26 +389,26 @@ ) VALUES ( -'TEST.OBJDOC-01', +'sandbox:OBJDOC-01', 'ObjectDocument', -- _schema_name 'OBJDOC-01', -- id -'http://pangalactic.us/test/lib/', -- id_ns +'sandbox', -- id_ns 0, -- security_mask 'Test ObjectDocument 01', -- name 'ObjectDocument 01 (Test)', -- description 'ObjectDocument 01 blah blah (Test)', -- comment -'smallberries@yoyodyne.planet10', -- record_owner -'smallberries@yoyodyne.planet10', -- record_creator +'sandbox:john.smallberries', -- record_owner +'sandbox:john.smallberries', -- record_creator '2002-09-10 01:00:00', -- record_create_datetime -'smallberries@yoyodyne.planet10', -- record_modifier +'sandbox:john.smallberries', -- record_modifier '2002-09-10 01:00:00', -- record_mod_datetime -'smallberries@yoyodyne.planet10', -- owner -'smallberries@yoyodyne.planet10', -- creator +'sandbox:john.smallberries', -- owner +'sandbox:john.smallberries', -- creator '2002-09-09 01:06:51', -- create_datetime -'smallberries@yoyodyne.planet10', -- modifier +'sandbox:john.smallberries', -- modifier '2002-09-09 01:06:51', -- mod_datetime -'TEST.HOG.1-CAD.1', -- parent -'TEST.DOC-01.1', -- child +'sandbox:HOG.1-CAD.1', -- parent +'sandbox:DOC-01.1', -- child 'Requirements Doc' -- documentation_purpose ); @@ -438,26 +438,26 @@ ) VALUES ( -'TEST.OBJDOC-02', +'sandbox:OBJDOC-02', 'ObjectDocument', -- _schema_name 'OBJDOC-01.1', -- id -'http://pangalactic.us/test/lib/', -- id_ns +'sandbox', -- id_ns 0, -- security_mask 'Test ObjectDocument 01', -- name 'ObjectDocument 01 (Test)', -- description 'ObjectDocument 01 blah blah (Test)', -- comment -'smallberries@yoyodyne.planet10', -- record_owner -'smallberries@yoyodyne.planet10', -- record_creator +'sandbox:john.smallberries', -- record_owner +'sandbox:john.smallberries', -- record_creator '2002-09-10 01:00:00', -- record_create_datetime -'smallberries@yoyodyne.planet10', -- record_modifier +'sandbox:john.smallberries', -- record_modifier '2002-09-10 01:00:00', -- record_mod_datetime -'smallberries@yoyodyne.planet10', -- owner -'smallberries@yoyodyne.planet10', -- creator +'sandbox:john.smallberries', -- owner +'sandbox:john.smallberries', -- creator '2002-09-09 01:06:51', -- create_datetime -'smallberries@yoyodyne.planet10', -- modifier +'sandbox:john.smallberries', -- modifier '2002-09-09 01:06:51', -- mod_datetime -'TEST.HOG.1-CAD.1', -- parent -'TEST.DOC-01.2', -- child +'sandbox:HOG.1-CAD.1', -- parent +'sandbox:DOC-01.2', -- child 'Requirements Doc' -- documentation_purpose ); @@ -492,23 +492,23 @@ ) VALUES ( -'TEST.FileLink.1', +'sandbox:FileLink.1', 'FileLink', -- _schema_name 'FileLink.1', -- id -'http://pangalactic.us/test/lib/', -- id_ns +'sandbox', -- id_ns 0, -- security_mask 'TEST-Document01v1.1.html', -- name 'HTML file, DOC-01, v1.1 (Test)', -- description 'HTML file of DOC-01, v1.1 (Test)', -- comment -'smallberries@yoyodyne.planet10', -- record_owner -'smallberries@yoyodyne.planet10', -- record_creator +'sandbox:john.smallberries', -- record_owner +'sandbox:john.smallberries', -- record_creator '2002-09-10 01:00:00', -- record_create_datetime -'smallberries@yoyodyne.planet10', -- record_modifier +'sandbox:john.smallberries', -- record_modifier '2002-09-10 01:00:00', -- record_mod_datetime -'smallberries@yoyodyne.planet10', -- owner -'smallberries@yoyodyne.planet10', -- creator +'sandbox:john.smallberries', -- owner +'sandbox:john.smallberries', -- creator '2002-09-09 01:06:51', -- create_datetime -'smallberries@yoyodyne.planet10', -- modifier +'sandbox:john.smallberries', -- modifier '2002-09-09 01:06:51', -- mod_datetime 'content', -- file_role 0, -- file_sequence @@ -517,7 +517,7 @@ 'Document01v1.1.txt', -- user_file_name 'True', -- is_secured 12345, -- bytes -'text/html' -- mime_type +'mime:text/html' -- mime_type ); INSERT INTO _file_link @@ -551,23 +551,23 @@ ) VALUES ( -'TEST.FileLink.2', +'sandbox:FileLink.2', 'FileLink', -- _schema_name 'FileLink.2', -- id -'http://pangalactic.us/test/lib/', -- id_ns +'sandbox', -- id_ns 0, -- security_mask 'TEST-Document01v1.1.css', -- name 'CSS file, DOC-01, v1.1 (Test)', -- description 'CSS file for DOC-01, v1.1 (Test)', -- comment -'smallberries@yoyodyne.planet10', -- record_owner -'smallberries@yoyodyne.planet10', -- record_creator +'sandbox:john.smallberries', -- record_owner +'sandbox:john.smallberries', -- record_creator '2002-09-10 01:00:00', -- record_create_datetime -'smallberries@yoyodyne.planet10', -- record_modifier +'sandbox:john.smallberries', -- record_modifier '2002-09-10 01:00:00', -- record_mod_datetime -'smallberries@yoyodyne.planet10', -- owner -'smallberries@yoyodyne.planet10', -- creator +'sandbox:john.smallberries', -- owner +'sandbox:john.smallberries', -- creator '2002-09-09 01:06:51', -- create_datetime -'smallberries@yoyodyne.planet10', -- modifier +'sandbox:john.smallberries', -- modifier '2002-09-09 01:06:51', -- mod_datetime 'stylesheet', -- file_role 0, -- file_sequence @@ -576,7 +576,7 @@ 'Document01v1.1.css', -- user_file_name 'True', -- is_secured 12345, -- bytes -'text/css' -- mime_type +'mime:text/css' -- mime_type ); END; From waterbug at step.nasa.gov Fri Jul 13 17:19:31 2007 From: waterbug at step.nasa.gov (waterbug CVS) Date: Fri Jul 13 17:19:33 2007 Subject: [pangalactic-commits] A real trial-based unit test module for PGER (!). Message-ID: <200707132119.l6DLJVwo027296@ned.gsfc.nasa.gov> Modified files: PanGalactic/pangalactic/test/test_pger.py 1.6 1.7 PanGalactic/pangalactic/test/utils4test.py 1.38 1.39 Log message: A real trial-based unit test module for PGER (!). Index: PanGalactic/pangalactic/test/test_pger.py diff -u /dev/null PanGalactic/pangalactic/test/test_pger.py:1.7 --- /dev/null Fri Jul 13 17:19:31 2007 +++ PanGalactic/pangalactic/test/test_pger.py Fri Jul 13 17:19:29 2007 @@ -0,0 +1,49 @@ +""" +Functional test for pangalactic.repo.pger module +""" +from twisted.trial import unittest +from pangalactic.repo.pger import PGER +from pangalactic.test.utils4test import genLinkedTestObjects + + +def success(result): + return result + +def failure(f): + return f + +r = PGER.db.registry +testobjs = genLinkedTestObjects('PGER', + +class PgerTestCases(unittest.TestCase): + + def test_01_changePassword(self): + """ + CASE: changePassword + + (Note: this should really be a VGER [not PGER] operation.) + """ + d = PGER.changePassword( + 'admin', 'zaphod@hog.univ', 'sekret') + expected = ('Password changed for user zaphod@hog.univ ' + '(requestor: admin).') + d.addCallbacks(lambda output: self.failUnlessEqual(output, expected), + failure) + return d + + def test_02_addObjects(self): + """ + CASE: addObjects + """ + value = '' + expected = '' + self.failUnlessEqual(expected, value) + + def test_02_getObjectByOids(self): + """ + CASE: getObjectByOids + """ + value = '' + expected = '' + self.failUnlessEqual(expected, value) + Index: PanGalactic/pangalactic/test/utils4test.py diff -u PanGalactic/pangalactic/test/utils4test.py:1.38 PanGalactic/pangalactic/test/utils4test.py:1.39 --- PanGalactic/pangalactic/test/utils4test.py:1.38 Thu Jul 12 23:13:45 2007 +++ PanGalactic/pangalactic/test/utils4test.py Fri Jul 13 17:19:29 2007 @@ -1,4 +1,4 @@ -# $Id: utils4test.py,v 1.38 2007/07/13 03:13:45 waterbug Exp $ +# $Id: utils4test.py,v 1.39 2007/07/13 21:19:29 waterbug Exp $ """ Utilities for testing. @@ -224,8 +224,8 @@ base_id's the same as the baseline PGER test population, to enable testing of adding new versions of existing objects. - Note that "addable" here means "requires objects that can be added without - getting a primary key violation", so its oid can't be in PGER. + Note that "addable" here means "objects that can be added without getting a + primary key violation", so its oid can't be in PGER. For "versionable", the object must have a unique oid also, and at least some instances should have a base_id the same as an object of that type in PGER, @@ -339,6 +339,10 @@ id_ns=id_ns, part=pt2, model=mo4) if not versionable and not updateable: test_objects.append(pm4) + addables = set([file1, file2, rep1, pt1, pt2, pt3, mo1, mo2, mo3, mo4, pm1, + pm2, pm3, pm4]) + versionables = set([pt1, pt2, pt3, mo1, mo2, mo3, mo4]) + updateables = set([file1, file2, rep1, pm1, pm2, pm3, pm4]) if printout and not addable and not versionable and not updateable: print """test objects (adding and versioning are not issues): =============================================================== From waterbug at step.nasa.gov Fri Jul 13 17:23:26 2007 From: waterbug at step.nasa.gov (waterbug CVS) Date: Fri Jul 13 17:23:28 2007 Subject: [pangalactic-commits] Forgot to save this before the last commit. Message-ID: <200707132123.l6DLNQ7d027529@ned.gsfc.nasa.gov> Modified files: PanGalactic/pangalactic/test/utils4test.py 1.39 1.40 Log message: Forgot to save this before the last commit. Index: PanGalactic/pangalactic/test/utils4test.py diff -u PanGalactic/pangalactic/test/utils4test.py:1.39 PanGalactic/pangalactic/test/utils4test.py:1.40 --- PanGalactic/pangalactic/test/utils4test.py:1.39 Fri Jul 13 17:19:29 2007 +++ PanGalactic/pangalactic/test/utils4test.py Fri Jul 13 17:23:24 2007 @@ -1,4 +1,4 @@ -# $Id: utils4test.py,v 1.39 2007/07/13 21:19:29 waterbug Exp $ +# $Id: utils4test.py,v 1.40 2007/07/13 21:23:24 waterbug Exp $ """ Utilities for testing. @@ -227,9 +227,8 @@ Note that "addable" here means "objects that can be added without getting a primary key violation", so its oid can't be in PGER. - For "versionable", the object must have a unique oid also, and at least some - instances should have a base_id the same as an object of that type in PGER, - to exercise the adding of a new version. + For "versionable" objects, there must be an object of that type in PGER with + the same base_id, to exercise the adding of a new version. """ run_id = run_id or genRunId() test_objects = [] From waterbug at step.nasa.gov Fri Jul 13 23:56:02 2007 From: waterbug at step.nasa.gov (waterbug CVS) Date: Fri Jul 13 23:56:04 2007 Subject: [pangalactic-commits] Updated tests and test data ... Message-ID: <200707140356.l6E3u2p1029343@ned.gsfc.nasa.gov> Modified files: PanGalactic/pangalactic/meta/names.py 1.45 1.46 PanGalactic/pangalactic/test/test_chronosynclastic_addObjects.py 1.17 1.18 PanGalactic/pangalactic/test/test_chronosynclastic_addRecords.py 1.18 1.19 PanGalactic/pangalactic/test/test_chronosynclastic_getObjectsByOids.py 1.4 1.5 PanGalactic/pangalactic/test/test_chronosynclastic_getRefdRowKeys.py 1.9 1.10 PanGalactic/pangalactic/test/test_chronosynclastic_getResultByRowKey.py 1.6 1.7 PanGalactic/pangalactic/test/test_chronosynclastic_record2RowKey.py 1.14 1.15 PanGalactic/pangalactic/test/test_chronosynclastic_runQueryMapToRowKeys.py 1.4 1.5 PanGalactic/pangalactic/test/test_chronosynclastic_search.py 1.4 1.5 PanGalactic/pangalactic/test/test_chronosynclastic_searchWithCount.py 1.4 1.5 PanGalactic/pangalactic/test/test_chronosynclastic_searchWithDistinct.py 1.5 1.6 PanGalactic/pangalactic/test/test_chronosynclastic_searchWithSpec.py 1.6 1.7 PanGalactic/pangalactic/test/test_chronosynclastic_updateObjects.py 1.12 1.13 PanGalactic/pangalactic/test/test_pger_addFile.py 1.13 1.14 PanGalactic/pangalactic/test/test_pger_addObjectsE.py 1.16 1.17 PanGalactic/pangalactic/test/test_pger_addObjectsO.py 1.16 1.17 PanGalactic/pangalactic/test/test_pger_getNames.py 1.5 1.6 PanGalactic/pangalactic/test/test_pger_getObjectsByOids.py 1.5 1.6 PanGalactic/pangalactic/test/test_pger_getObjectsE.py 1.11 1.12 PanGalactic/pangalactic/test/test_pger_getObjectsO.py 1.14 1.15 PanGalactic/pangalactic/test/test_pger_updateObjects.py 1.4 1.5 PanGalactic/pangalactic/test/test_xmlrpc_addObjects.py 1.15 1.16 PanGalactic/pangalactic/test/test_xmlrpc_getCount.py 1.5 1.6 PanGalactic/pangalactic/test/test_xmlrpc_getNames.py 1.4 1.5 PanGalactic/pangalactic/test/test_xmlrpc_getObjects.py 1.19 1.20 PanGalactic/pangalactic/test/test_xmlrpc_getObjectsByOids.py 1.15 1.16 PanGalactic/pangalactic/test/test_xmlrpc_search.py 1.14 1.15 PanGalactic/pangalactic/test/test_xmlrpc_updateObjects.py 1.3 1.4 PanGalactic/pangalactic/test/utils4test.py 1.40 1.41 PanGalactic/src/sql/insertMediaTypes.sql 1.15 1.16 PanGalactic/src/sql/insertModels.sql 1.20 1.21 PanGalactic/src/sql/insertOrganizations.sql 1.3 1.4 PanGalactic/src/sql/insertPartModels.sql 1.7 1.8 PanGalactic/src/sql/insertParts.sql 1.18 1.19 PanGalactic/src/sql/insertRefData.sql 1.28 1.29 PanGalactic/src/sql/insertTestData.sql 1.25 1.26 Log message: Updated tests and test data ... to be consistent with new oid = id_ns + id scheme. Just one test is failing (test_pger_updateObjects), which probably has to do with the data generated by utils4test. Index: PanGalactic/pangalactic/test/test_xmlrpc_updateObjects.py diff -u PanGalactic/pangalactic/test/test_xmlrpc_updateObjects.py:1.3 PanGalactic/pangalactic/test/test_xmlrpc_updateObjects.py:1.4 --- PanGalactic/pangalactic/test/test_xmlrpc_updateObjects.py:1.3 Mon Feb 12 19:02:47 2007 +++ PanGalactic/pangalactic/test/test_xmlrpc_updateObjects.py Fri Jul 13 23:55:57 2007 @@ -10,7 +10,7 @@ from pangalactic.repo.pgerxmlrpc import PgerXmlrpcService from pangalactic.test.utils4test import genLinkedTestObjects -xmlrpcsrv = PgerXmlrpcService(PGER, userid='Fester.Bestertester@earth.milkyway.univ') +xmlrpcsrv = PgerXmlrpcService(PGER, userid='test:fester.bestertester') r = PGER.db.registry # create test objects Index: PanGalactic/pangalactic/test/test_xmlrpc_getCount.py diff -u PanGalactic/pangalactic/test/test_xmlrpc_getCount.py:1.5 PanGalactic/pangalactic/test/test_xmlrpc_getCount.py:1.6 --- PanGalactic/pangalactic/test/test_xmlrpc_getCount.py:1.5 Mon Feb 12 19:02:47 2007 +++ PanGalactic/pangalactic/test/test_xmlrpc_getCount.py Fri Jul 13 23:55:57 2007 @@ -1,4 +1,4 @@ -# $Id: test_xmlrpc_getCount.py,v 1.5 2007/02/13 00:02:47 waterbug Exp $ +# $Id: test_xmlrpc_getCount.py,v 1.6 2007/07/14 03:55:57 waterbug Exp $ """ Functional test for PgerXmlrpcService.getCount() @@ -22,7 +22,7 @@ xmlsrv = PgerXmlrpcService() res = xmlsrv.xmlrpc_getCount(schema_name, 0, 1, - [('id_ns', '=', 'http://pangalactic.us/test/lib/')]) + [('id_ns', '=', 'sandbox')]) res.addCallbacks(success, failure) reactor.run() # start the main loop Index: PanGalactic/pangalactic/test/test_chronosynclastic_record2RowKey.py diff -u PanGalactic/pangalactic/test/test_chronosynclastic_record2RowKey.py:1.14 PanGalactic/pangalactic/test/test_chronosynclastic_record2RowKey.py:1.15 --- PanGalactic/pangalactic/test/test_chronosynclastic_record2RowKey.py:1.14 Mon Feb 12 19:02:47 2007 +++ PanGalactic/pangalactic/test/test_chronosynclastic_record2RowKey.py Fri Jul 13 23:55:57 2007 @@ -7,13 +7,13 @@ p = PgefObject(infum.registry.interfaces['Project'], id='THINGY', - id_ns='http://pangalactic.us/test/tmp/', + id_ns='test', name='Thingy Project') popTestData(p, registry=infum.registry) pt = PgefObject(infum.registry.interfaces['Part'], cm_authority=p, id='foo', - id_ns='http://pangalactic.us/test/tmp/', + id_ns='test', name='Mr. Foo') popTestData(pt, registry=infum.registry) Index: PanGalactic/pangalactic/test/utils4test.py diff -u PanGalactic/pangalactic/test/utils4test.py:1.40 PanGalactic/pangalactic/test/utils4test.py:1.41 --- PanGalactic/pangalactic/test/utils4test.py:1.40 Fri Jul 13 17:23:24 2007 +++ PanGalactic/pangalactic/test/utils4test.py Fri Jul 13 23:55:57 2007 @@ -1,4 +1,4 @@ -# $Id: utils4test.py,v 1.40 2007/07/13 21:23:24 waterbug Exp $ +# $Id: utils4test.py,v 1.41 2007/07/14 03:55:57 waterbug Exp $ """ Utilities for testing. @@ -23,10 +23,10 @@ # property for each. ## # id and id_ns are required for PgefObject - id = PgefPropertySpec(id='stringattr', id_ns='pgeftest', + id = PgefPropertySpec(id='stringattr', id_ns='test', domain='PgefObject', range='str', property_type='datatype') - id_ns = PgefPropertySpec(id='stringattr', id_ns='pgeftest', + id_ns = PgefPropertySpec(id='stringattr', id_ns='test', domain='PgefObject', range='str', property_type='datatype') @@ -135,11 +135,11 @@ if not dt: dt = genRunId() obj.id = obj.id or "id-%s-%s" % (obj._schema.__name__, dt) obj.oid = obj.oid or "oid-%s-%s" % (obj._schema.__name__, dt) - obj.id_ns = 'pgeftest' + obj.id_ns = 'test' testperson = PgefObject(_schema=registry.interfaces['Person'], - oid='Fester.Bestertester@earth.milkyway.univ', + oid='test:fester.bestertester', id='Fester.Bestertester', - id_ns='pgeftest', + id_ns='test', name='Fester Bestertester', creator='admin', record_creator='admin') @@ -158,7 +158,7 @@ setattr(obj, a, testperson) def initTestObject(schema_name, registry, id, test_id='', - id_ns='pgeftest', ordinal=0, **kw): + id_ns='test', ordinal=0, **kw): if not test_id: test_id = 'NoTestID' for p in registry.interfaces[schema_name]: @@ -215,7 +215,7 @@ return objs def genLinkedTestObjects(test_id, registry, run_id=None, printout=True, - id_ns='pgeftest', addable=False, versionable=False, + id_ns='test', addable=False, versionable=False, updateable=False): """ Generate a collection of test objects some of which have others as @@ -299,7 +299,7 @@ pt3 = initTestObject('Part', registry, pt3_id, base_id=pt3_base_id, id_ns='http://pangalactic.us/test/lib/', version='working', iteration=0, - name=pt3_name, cm_authority='H2G2', owner=zaphod) + name=pt3_name, cm_authority='sandbox:H2G2', owner=zaphod) if versionable and not updateable: test_objects.append(pt3) mo1 = initTestObject('Model', registry, mo1_id, test_id=test_id, Index: PanGalactic/pangalactic/test/test_pger_updateObjects.py diff -u PanGalactic/pangalactic/test/test_pger_updateObjects.py:1.4 PanGalactic/pangalactic/test/test_pger_updateObjects.py:1.5 --- PanGalactic/pangalactic/test/test_pger_updateObjects.py:1.4 Fri Jul 13 00:39:35 2007 +++ PanGalactic/pangalactic/test/test_pger_updateObjects.py Fri Jul 13 23:55:57 2007 @@ -24,7 +24,7 @@ print error reactor.stop() -res = PGER.updateObjects('Fester.Bestertester@earth.milkyway.univ', extracts) +res = PGER.updateObjects('test:fester.bestertester', extracts) res.addCallbacks(success, failure) reactor.run() Index: PanGalactic/pangalactic/test/test_chronosynclastic_getRefdRowKeys.py diff -u PanGalactic/pangalactic/test/test_chronosynclastic_getRefdRowKeys.py:1.9 PanGalactic/pangalactic/test/test_chronosynclastic_getRefdRowKeys.py:1.10 --- PanGalactic/pangalactic/test/test_chronosynclastic_getRefdRowKeys.py:1.9 Mon Feb 12 19:02:47 2007 +++ PanGalactic/pangalactic/test/test_chronosynclastic_getRefdRowKeys.py Fri Jul 13 23:55:57 2007 @@ -1,4 +1,4 @@ -# $Id: test_chronosynclastic_getRefdRowKeys.py,v 1.9 2007/02/13 00:02:47 waterbug Exp $ +# $Id: test_chronosynclastic_getRefdRowKeys.py,v 1.10 2007/07/14 03:55:57 waterbug Exp $ """ Functional test for pangalactic.repo.chronosynclastic module @@ -35,8 +35,7 @@ inf = I() -out = inf._selectByObjectSchema(schema_name, 0, ('id_ns', 'like', 'test')) - +out = inf._selectByObjectSchema(schema_name, 0, ('id_ns', 'like', 'sandbox')) out.addCallbacks(success, failure) reactor.run() Index: PanGalactic/pangalactic/test/test_chronosynclastic_search.py diff -u PanGalactic/pangalactic/test/test_chronosynclastic_search.py:1.4 PanGalactic/pangalactic/test/test_chronosynclastic_search.py:1.5 --- PanGalactic/pangalactic/test/test_chronosynclastic_search.py:1.4 Mon Feb 12 19:02:47 2007 +++ PanGalactic/pangalactic/test/test_chronosynclastic_search.py Fri Jul 13 23:55:57 2007 @@ -1,4 +1,4 @@ -# $Id: test_chronosynclastic_search.py,v 1.4 2007/02/13 00:02:47 waterbug Exp $ +# $Id: test_chronosynclastic_search.py,v 1.5 2007/07/14 03:55:57 waterbug Exp $ """ Functional test for pangalactic.repo.chronosynclastic module @@ -26,7 +26,7 @@ schema_name='Actor', refs=1, subtypes=1, - args=[['id_ns', '=', 'http://pangalactic.us/test/lib/']]) + args=[['id_ns', '=', 'test']]) res.addCallbacks(success, failure) reactor.run() # start the main loop Index: PanGalactic/pangalactic/meta/names.py diff -u PanGalactic/pangalactic/meta/names.py:1.45 PanGalactic/pangalactic/meta/names.py:1.46 --- PanGalactic/pangalactic/meta/names.py:1.45 Tue Jun 5 00:40:01 2007 +++ PanGalactic/pangalactic/meta/names.py Fri Jul 13 23:55:56 2007 @@ -1,11 +1,11 @@ -# $Id: names.py,v 1.45 2007/06/05 04:40:01 waterbug Exp $ +# $Id: names.py,v 1.46 2007/07/14 03:55:56 waterbug Exp $ """ Objects and services for handling identifiers, addresses, and namespaces. -@version: $Revision: 1.45 $ +@version: $Revision: 1.46 $ """ -__version__ = "$Revision: 1.45 $"[11:-2] +__version__ = "$Revision: 1.46 $"[11:-2] try: @@ -208,21 +208,31 @@ meta=10, uri='http://www.w3.org/2002/07/owl#')) -# 'pgeftest' namespace +# 'test' namespace # PGEF permanent test object namespace. This namespace is intended to include # *only* the id's of test objects included in the initial set up of PGER -- # currently created by SQL scripts called from the script # PanGalactic/src/sql/populate_pgerdb.sh. NOTE: insertion of other names into # this namespace may cause some unit tests to fail. -registerNamespace(PgefNamespace(id='pgeftest', +registerNamespace(PgefNamespace(id='test', meta=0, - uri='http://pangalactic.us/test/lib/')) + uri='http://pangalactic.us/test/')) -# 'pgeftesttmp' namespace +# 'sandbox' namespace +# PGEF permanent sandbox (demo) namespace. This namespace is intended to +# include the id's of demo objects included in the initial set up of PGER -- +# currently created by SQL scripts called from the script +# PanGalactic/src/sql/populate_pgerdb.sh. NOTE: insertion of other names into +# this namespace should be okay (if not, it's a bug ;). +registerNamespace(PgefNamespace(id='sandbox', + meta=0, + uri='http://pangalactic.us/sandbox/')) + +# 'testtmp' namespace # PGEF temporary test object namespace (for objects created during test runs). # NOTE: insertion of other names into this namespace may cause some unit tests # to fail. -registerNamespace(PgefNamespace(id='pgeftesttmp', +registerNamespace(PgefNamespace(id='testtmp', meta=0, uri='http://pangalactic.us/test/tmp/')) Index: PanGalactic/src/sql/insertOrganizations.sql diff -u PanGalactic/src/sql/insertOrganizations.sql:1.3 PanGalactic/src/sql/insertOrganizations.sql:1.4 --- PanGalactic/src/sql/insertOrganizations.sql:1.3 Mon Oct 2 05:47:06 2006 +++ PanGalactic/src/sql/insertOrganizations.sql Fri Jul 13 23:55:58 2007 @@ -1,6 +1,6 @@ /* PGERDB reference data initialization. */ -/* $Id: insertOrganizations.sql,v 1.3 2006/10/02 09:47:06 waterbug Exp $ */ +/* $Id: insertOrganizations.sql,v 1.4 2007/07/14 03:55:58 waterbug Exp $ */ /* This script sets up the default identification contexts for * PGEF objects, and is required before the PGERDB can be @@ -21,12 +21,12 @@ ) VALUES ( - 'PGANA', + 'sandbox:PGANA', 'Organization', 'PGANA', - 'http://pangalactic.us/objects/', - 'admin', - 'admin', + 'sandbox', + 'pgefobjects:admin', + 'pgefobjects:admin', 'Pan Galactic Assigned Names Authority' ); @@ -42,12 +42,12 @@ ) VALUES ( - 'IANA', + 'pgefobjects:IANA', 'Organization', 'IANA', - 'http://pangalactic.us/objects/', - 'admin', - 'admin', + 'pgefobjects', + 'pgefobjects:admin', + 'pgefobjects:admin', 'Internet Assigned Numbers Authority' ); @@ -69,12 +69,12 @@ ) VALUES ( - 'TO1', + 'test:TO1', 'Organization', 'TO1', - 'http://pangalactic.us/test/lib', - 'admin', - 'admin', + 'test', + 'pgefobjects:admin', + 'pgefobjects:admin', 'TORG1', 'Test Organization 1', 1, @@ -96,12 +96,12 @@ ) VALUES ( - 'DLA', + 'pgefobjects:DLA', 'Organization', 'DLA', - 'http://pangalactic.us/objects/', - 'admin', - 'admin', + 'pgefobjects', + 'pgefobjects:admin', + 'pgefobjects:admin', 'Defense Logistics Agency' ); @@ -118,12 +118,12 @@ ) VALUES ( - 'DLIS', + 'pgefobjects:DLIS', 'Organization', 'DLIS', - 'http://pangalactic.us/objects/', - 'admin', - 'admin', + 'pgefobjects', + 'pgefobjects:admin', + 'pgefobjects:admin', 'Defense Logistics Information Service', 'DLA' ); @@ -141,12 +141,12 @@ ) VALUES ( - 'GIDEP', + 'pgefobjects:GIDEP', 'Organization', 'GIDEP', - 'http://pangalactic.us/objects/', - 'admin', - 'admin', + 'pgefobjects', + 'pgefobjects:admin', + 'pgefobjects:admin', 'Government Industry Data Exchange Program', 'GIDEP' ); @@ -195,7 +195,7 @@ ) VALUES ( -'YOYOD', 'Organization', 'YOYOD', 'http://pangalactic.us/test/lib', '0', 'Yoyodyne Propulsion Systems', '', '', 'admin', 'admin', '2003-02-25 22:18:15.275408-05', 'admin', '2003-02-25 22:18:15.275408-05', 'admin', 'admin', '2003-02-25 22:18:15.275408-05', 'admin', '2003-02-25 22:18:15.275408-05', 'YOYODYNE', 'Yoyodyne Propulsion Systems', '', '', '', '', '1', '', '', 'Grovers Mills', 'NJ', '', '', '', '', '', '', '', '', '', '' +'sandbox:YOYOD', 'Organization', 'YOYOD', 'sandbox', '0', 'Yoyodyne Propulsion Systems', '', '', 'pgefobjects:admin', 'pgefobjects:admin', '2003-02-25 22:18:15.275408-05', 'pgefobjects:admin', '2003-02-25 22:18:15.275408-05', 'pgefobjects:admin', 'pgefobjects:admin', '2003-02-25 22:18:15.275408-05', 'pgefobjects:admin', '2003-02-25 22:18:15.275408-05', 'YOYODYNE', 'Yoyodyne Propulsion Systems', '', '', '', '', '1', '', '', 'Grovers Mills', 'NJ', '', '', '', '', '', '', '', '', '', '' ); INSERT INTO _organization @@ -242,7 +242,7 @@ ) VALUES ( -'BOZOI', 'Organization', 'BOZOI', 'http://pangalactic.us/test/lib', '0', 'Bozo International', '', '', 'admin', 'admin', '2003-02-25 22:18:15.275408-05', 'admin', '2003-02-25 22:18:15.275408-05', 'admin', 'admin', '2003-02-25 22:18:15.275408-05', 'admin', '2003-02-25 22:18:15.275408-05', 'BOZOI', 'Bozo International', '', '', '', '', '1', '', '', 'Paris', 'TX', '', '', 'BOZOI', '', '', '', '', '', '', '' +'sandbox:BOZOI', 'Organization', 'BOZOI', 'sandbox', '0', 'Bozo International', '', '', 'pgefobjects:admin', 'pgefobjects:admin', '2003-02-25 22:18:15.275408-05', 'pgefobjects:admin', '2003-02-25 22:18:15.275408-05', 'pgefobjects:admin', 'pgefobjects:admin', '2003-02-25 22:18:15.275408-05', 'pgefobjects:admin', '2003-02-25 22:18:15.275408-05', 'BOZOI', 'Bozo International', '', '', '', '', '1', '', '', 'Paris', 'TX', '', '', 'BOZOI', '', '', '', '', '', '', '' ); INSERT INTO _organization @@ -289,7 +289,7 @@ ) VALUES ( -'BANZA', 'Organization', 'BANZA', 'http://pangalactic.us/test/lib', '0', 'Banzai Institute', '', '', 'admin', 'admin', '2003-02-25 22:18:15.275408-05', 'admin', '2003-02-25 22:18:15.275408-05', 'admin', 'admin', '2003-02-25 22:18:15.275408-05', 'admin', '2003-02-25 22:18:15.275408-05', 'BANZAI', 'Banzai Institute', '', '', '', '', '1', '', '', 'Holland Township', 'NJ', '', '', 'BOZOI', '', '', '', '', '', '', '' +'sandbox:BANZA', 'Organization', 'BANZA', 'sandbox', '0', 'Banzai Institute', '', '', 'pgefobjects:admin', 'pgefobjects:admin', '2003-02-25 22:18:15.275408-05', 'pgefobjects:admin', '2003-02-25 22:18:15.275408-05', 'pgefobjects:admin', 'pgefobjects:admin', '2003-02-25 22:18:15.275408-05', 'pgefobjects:admin', '2003-02-25 22:18:15.275408-05', 'BANZAI', 'Banzai Institute', '', '', '', '', '1', '', '', 'Holland Township', 'NJ', '', '', 'BOZOI', '', '', '', '', '', '', '' ); INSERT INTO _organization @@ -311,12 +311,12 @@ ) VALUES ( - 'FGII', + 'sandbox:FGII', 'Organization', 'FGII', - 'http://pangalactic.us/test/lib', - 'admin', - 'admin', + 'sandbox', + 'pgefobjects:admin', + 'pgefobjects:admin', 'FGII', 'Froggy Gremlin Industries, Inc.', 'Froggy Gremlin Industries, Inc.', Index: PanGalactic/pangalactic/test/test_chronosynclastic_getObjectsByOids.py diff -u PanGalactic/pangalactic/test/test_chronosynclastic_getObjectsByOids.py:1.4 PanGalactic/pangalactic/test/test_chronosynclastic_getObjectsByOids.py:1.5 --- PanGalactic/pangalactic/test/test_chronosynclastic_getObjectsByOids.py:1.4 Mon Feb 12 19:02:47 2007 +++ PanGalactic/pangalactic/test/test_chronosynclastic_getObjectsByOids.py Fri Jul 13 23:55:57 2007 @@ -1,4 +1,4 @@ -# $Id: test_chronosynclastic_getObjectsByOids.py,v 1.4 2007/02/13 00:02:47 waterbug Exp $ +# $Id: test_chronosynclastic_getObjectsByOids.py,v 1.5 2007/07/14 03:55:57 waterbug Exp $ """ Functional test for pangalactic.repo.chronosynclastic module @@ -23,29 +23,29 @@ reactor.stop() fum = Fum() -oids = ['banzai@banzai.earth', - 'bigboote@yoyodyne.planet10', - 'smallberries@yoyodyne.planet10', - 'lizardo@yoyodyne.planet10', - 'H2G2', - 'OTHER', - 'OTHEROTHER', - 'TEST.DOC-01.1', - 'TEST.DOC-01.2', - 'TEST.BTA-20.1', - 'TEST.HM.200.1', - 'TEST.FX-CAP.1', - 'TEST.HOG.1', - 'TEST.BTA-20.1-CAD.1', - 'TEST.HM.200.1-CAD.1', - 'TEST.FX-CAP.1-CAD.1', - 'TEST.HOG.1-CAD.1', - 'TEST.Representation.1', - 'TEST.Representation.2', - 'TEST.FileLink.1', - 'TEST.FileLink.2', - 'TEST.FileLink.3', - 'TEST.FileLink.4'] +oids = ['sandbox:buckaroo.banzai', + 'sandbox:john.bigboote', + 'sandbox:john.smallberries', + 'sandbox:john.whorfin', + 'sandbox:H2G2', + 'sandbox:OTHER', + 'sandbox:OTHEROTHER', + 'sandbox:DOC-01.1', + 'sandbox:DOC-01.2', + 'sandbox:BTA-20.1', + 'sandbox:HM.200.1', + 'sandbox:FX-CAP.1', + 'sandbox:HOG.1', + 'sandbox:BTA-20.1-CAD.1', + 'sandbox:HM.200.1-CAD.1', + 'sandbox:FX-CAP.1-CAD.1', + 'sandbox:HOG.1-CAD.1', + 'sandbox:Representation.1', + 'sandbox:Representation.2', + 'sandbox:FileLink.1', + 'sandbox:FileLink.2', + 'sandbox:FileLink.3', + 'sandbox:FileLink.4'] res = fum.getObjectsByOids(requestor='test', oids=oids) res.addCallbacks(success, failure) Index: PanGalactic/pangalactic/test/test_xmlrpc_getObjectsByOids.py diff -u PanGalactic/pangalactic/test/test_xmlrpc_getObjectsByOids.py:1.15 PanGalactic/pangalactic/test/test_xmlrpc_getObjectsByOids.py:1.16 --- PanGalactic/pangalactic/test/test_xmlrpc_getObjectsByOids.py:1.15 Mon Feb 12 19:02:47 2007 +++ PanGalactic/pangalactic/test/test_xmlrpc_getObjectsByOids.py Fri Jul 13 23:55:57 2007 @@ -1,4 +1,4 @@ -# $Id: test_xmlrpc_getObjectsByOids.py,v 1.15 2007/02/13 00:02:47 waterbug Exp $ +# $Id: test_xmlrpc_getObjectsByOids.py,v 1.16 2007/07/14 03:55:57 waterbug Exp $ """ Functional test for PgerXmlrpcService.xmlrpc_getObjects @@ -20,32 +20,30 @@ # ORB = UberORB(debug=True) ORB.initCache(home='_trial_temp') -xmlsrv = PgerXmlrpcService(userid='Fester.Bestertester@earth.milkyway.univ') - -oids = ['banzai@banzai.earth', - 'bigboote@yoyodyne.planet10', - 'smallberries@yoyodyne.planet10', - 'lizardo@yoyodyne.planet10', - 'H2G2', - 'OTHER', - 'OTHEROTHER', - 'TEST.DOC-01.1', - 'TEST.DOC-01.2', - 'TEST.BTA-20.1', - 'TEST.HM.200.1', - 'TEST.FX-CAP.1', - 'TEST.HOG.1', - 'TEST.BTA-20.1-CAD.1', - 'TEST.HM.200.1-CAD.1', - 'TEST.FX-CAP.1-CAD.1', - 'TEST.HOG.1-CAD.1', - 'TEST.Representation.1', - 'TEST.Representation.2', - 'TEST.FileLink.1', - 'TEST.FileLink.2', - 'TEST.FileLink.3', - 'TEST.FileLink.4' - ] +xmlsrv = PgerXmlrpcService(userid='test:fester.bestertester') +oids = ['sandbox:buckaroo.banzai', + 'sandbox:john.bigboote', + 'sandbox:john.smallberries', + 'sandbox:john.whorfin', + 'sandbox:H2G2', + 'sandbox:OTHER', + 'sandbox:OTHEROTHER', + 'sandbox:DOC-01.1', + 'sandbox:DOC-01.2', + 'sandbox:BTA-20.1', + 'sandbox:HM.200.1', + 'sandbox:FX-CAP.1', + 'sandbox:HOG.1', + 'sandbox:BTA-20.1-CAD.1', + 'sandbox:HM.200.1-CAD.1', + 'sandbox:FX-CAP.1-CAD.1', + 'sandbox:HOG.1-CAD.1', + 'sandbox:Representation.1', + 'sandbox:Representation.2', + 'sandbox:FileLink.1', + 'sandbox:FileLink.2', + 'sandbox:FileLink.3', + 'sandbox:FileLink.4'] def success(extracts): # print "\n*** XMLRPC Command:" Index: PanGalactic/pangalactic/test/test_xmlrpc_search.py diff -u PanGalactic/pangalactic/test/test_xmlrpc_search.py:1.14 PanGalactic/pangalactic/test/test_xmlrpc_search.py:1.15 --- PanGalactic/pangalactic/test/test_xmlrpc_search.py:1.14 Mon Feb 12 19:02:47 2007 +++ PanGalactic/pangalactic/test/test_xmlrpc_search.py Fri Jul 13 23:55:57 2007 @@ -1,4 +1,4 @@ -# $Id: test_xmlrpc_search.py,v 1.14 2007/02/13 00:02:47 waterbug Exp $ +# $Id: test_xmlrpc_search.py,v 1.15 2007/07/14 03:55:57 waterbug Exp $ """ Functional test for PgerXmlrpcService.search() @@ -22,7 +22,7 @@ reactor.stop() xmlsrv = PgerXmlrpcService() -res = xmlsrv.xmlrpc_search(schema_name, 0, 0, [('owner', 'like', 'lizardo')], +res = xmlsrv.xmlrpc_search(schema_name, 0, 0, [('owner', 'like', 'banzai')], None) res.addCallbacks(success, failure) Index: PanGalactic/pangalactic/test/test_pger_getObjectsE.py diff -u PanGalactic/pangalactic/test/test_pger_getObjectsE.py:1.11 PanGalactic/pangalactic/test/test_pger_getObjectsE.py:1.12 --- PanGalactic/pangalactic/test/test_pger_getObjectsE.py:1.11 Mon Feb 12 19:02:47 2007 +++ PanGalactic/pangalactic/test/test_pger_getObjectsE.py Fri Jul 13 23:55:57 2007 @@ -1,4 +1,4 @@ -# $Id: test_pger_getObjectsE.py,v 1.11 2007/02/13 00:02:47 waterbug Exp $ +# $Id: test_pger_getObjectsE.py,v 1.12 2007/07/14 03:55:57 waterbug Exp $ """ Functional test for PGER.getObjects() with extracts returned @@ -19,7 +19,7 @@ res = PGER.getObjects(requestor='test', schema_name='Representation', - id_ns='http://pangalactic.us/test/lib/') + id_ns='sandbox') res.addCallbacks(success, failure) reactor.run() # start the main loop Index: PanGalactic/pangalactic/test/test_chronosynclastic_searchWithDistinct.py diff -u PanGalactic/pangalactic/test/test_chronosynclastic_searchWithDistinct.py:1.5 PanGalactic/pangalactic/test/test_chronosynclastic_searchWithDistinct.py:1.6 --- PanGalactic/pangalactic/test/test_chronosynclastic_searchWithDistinct.py:1.5 Mon Feb 12 19:02:47 2007 +++ PanGalactic/pangalactic/test/test_chronosynclastic_searchWithDistinct.py Fri Jul 13 23:55:57 2007 @@ -1,4 +1,4 @@ -# $Id: test_chronosynclastic_searchWithDistinct.py,v 1.5 2007/02/13 00:02:47 waterbug Exp $ +# $Id: test_chronosynclastic_searchWithDistinct.py,v 1.6 2007/07/14 03:55:57 waterbug Exp $ """ Functional test for pangalactic.repo.chronosynclastic module @@ -29,7 +29,7 @@ refs=False, subtypes=True, distinct=True, - args=[['id_ns', '=', 'http://pangalactic.us/test/lib/']], + args=[['id_ns', '=', 'sandbox']], spec=['base_id']) res.addCallbacks(success, failure) Index: PanGalactic/pangalactic/test/test_chronosynclastic_updateObjects.py diff -u PanGalactic/pangalactic/test/test_chronosynclastic_updateObjects.py:1.12 PanGalactic/pangalactic/test/test_chronosynclastic_updateObjects.py:1.13 --- PanGalactic/pangalactic/test/test_chronosynclastic_updateObjects.py:1.12 Mon Feb 12 19:02:47 2007 +++ PanGalactic/pangalactic/test/test_chronosynclastic_updateObjects.py Fri Jul 13 23:55:57 2007 @@ -1,4 +1,4 @@ -# $Id: test_chronosynclastic_updateObjects.py,v 1.12 2007/02/13 00:02:47 waterbug Exp $ +# $Id: test_chronosynclastic_updateObjects.py,v 1.13 2007/07/14 03:55:57 waterbug Exp $ """ Test for inserting a row using pangalactic.repo.pgerdb module @@ -29,7 +29,7 @@ out = inf.updateObjects(requestor='test', schema_name='Organization', - oids=['TO1'], # Test Organization 1 + oids=['test:TO1'], # Test Organization 1 updates={'name':testnameupd}) out.addCallbacks(success, failure) reactor.run() Index: PanGalactic/pangalactic/test/test_chronosynclastic_searchWithSpec.py diff -u PanGalactic/pangalactic/test/test_chronosynclastic_searchWithSpec.py:1.6 PanGalactic/pangalactic/test/test_chronosynclastic_searchWithSpec.py:1.7 --- PanGalactic/pangalactic/test/test_chronosynclastic_searchWithSpec.py:1.6 Mon Feb 12 19:02:47 2007 +++ PanGalactic/pangalactic/test/test_chronosynclastic_searchWithSpec.py Fri Jul 13 23:55:57 2007 @@ -1,4 +1,4 @@ -# $Id: test_chronosynclastic_searchWithSpec.py,v 1.6 2007/02/13 00:02:47 waterbug Exp $ +# $Id: test_chronosynclastic_searchWithSpec.py,v 1.7 2007/07/14 03:55:57 waterbug Exp $ """ Functional test for pangalactic.repo.chronosynclastic module @@ -28,7 +28,7 @@ schema_name='Identifiable', refs=0, subtypes=1, - args=[['id_ns', '=', 'http://pangalactic.us/test/lib/']], + args=[['id_ns', '=', 'test']], spec=['id', 'id_ns']) res.addCallbacks(success, failure) Index: PanGalactic/pangalactic/test/test_chronosynclastic_searchWithCount.py diff -u PanGalactic/pangalactic/test/test_chronosynclastic_searchWithCount.py:1.4 PanGalactic/pangalactic/test/test_chronosynclastic_searchWithCount.py:1.5 --- PanGalactic/pangalactic/test/test_chronosynclastic_searchWithCount.py:1.4 Mon Feb 12 19:02:47 2007 +++ PanGalactic/pangalactic/test/test_chronosynclastic_searchWithCount.py Fri Jul 13 23:55:57 2007 @@ -1,4 +1,4 @@ -# $Id: test_chronosynclastic_searchWithCount.py,v 1.4 2007/02/13 00:02:47 waterbug Exp $ +# $Id: test_chronosynclastic_searchWithCount.py,v 1.5 2007/07/14 03:55:57 waterbug Exp $ """ Functional test for pangalactic.repo.chronosynclastic module @@ -26,7 +26,7 @@ schema_name='Identifiable', refs=0, subtypes=1, - args=[['id_ns', '=', 'http://pangalactic.us/test/lib/']], + args=[['id_ns', '=', 'sandbox']], count=True) res.addCallbacks(success, failure) Index: PanGalactic/pangalactic/test/test_pger_getNames.py diff -u PanGalactic/pangalactic/test/test_pger_getNames.py:1.5 PanGalactic/pangalactic/test/test_pger_getNames.py:1.6 --- PanGalactic/pangalactic/test/test_pger_getNames.py:1.5 Mon Feb 12 19:02:47 2007 +++ PanGalactic/pangalactic/test/test_pger_getNames.py Fri Jul 13 23:55:57 2007 @@ -1,4 +1,4 @@ -# $Id: test_pger_getNames.py,v 1.5 2007/02/13 00:02:47 waterbug Exp $ +# $Id: test_pger_getNames.py,v 1.6 2007/07/14 03:55:57 waterbug Exp $ """ Functional test for PGER.getNames() @@ -19,7 +19,7 @@ print error reactor.stop() -out = PGER.getNames('test', 'http://pangalactic.us/test/lib/') +out = PGER.getNames('test', 'sandbox') out.addCallbacks(success, failure) Index: PanGalactic/pangalactic/test/test_pger_getObjectsByOids.py diff -u PanGalactic/pangalactic/test/test_pger_getObjectsByOids.py:1.5 PanGalactic/pangalactic/test/test_pger_getObjectsByOids.py:1.6 --- PanGalactic/pangalactic/test/test_pger_getObjectsByOids.py:1.5 Mon Feb 12 19:02:47 2007 +++ PanGalactic/pangalactic/test/test_pger_getObjectsByOids.py Fri Jul 13 23:55:57 2007 @@ -1,4 +1,4 @@ -# $Id: test_pger_getObjectsByOids.py,v 1.5 2007/02/13 00:02:47 waterbug Exp $ +# $Id: test_pger_getObjectsByOids.py,v 1.6 2007/07/14 03:55:57 waterbug Exp $ """ Functional test for PGER.getObjects(..., oids=...) @@ -8,9 +8,34 @@ from twisted.internet import reactor from pangalactic.repo.pger import PGER +oids = ['sandbox:buckaroo.banzai', + 'sandbox:john.bigboote', + 'sandbox:john.smallberries', + 'sandbox:john.whorfin', + 'sandbox:H2G2', + 'sandbox:OTHER', + 'sandbox:OTHEROTHER', + 'sandbox:DOC-01.1', + 'sandbox:DOC-01.2', + 'sandbox:BTA-20.1', + 'sandbox:HM.200.1', + 'sandbox:FX-CAP.1', + 'sandbox:HOG.1', + 'sandbox:BTA-20.1-CAD.1', + 'sandbox:HM.200.1-CAD.1', + 'sandbox:FX-CAP.1-CAD.1', + 'sandbox:HOG.1-CAD.1', + 'sandbox:Representation.1', + 'sandbox:Representation.2', + 'sandbox:FileLink.1', + 'sandbox:FileLink.2', + 'sandbox:FileLink.3', + 'sandbox:FileLink.4' + ] + def success(objectlist): pprint(objectlist) - print 'expected: 24' + print 'expected: %s' % str(len(oids)) print 'got: %s' % str(len(objectlist)) reactor.stop() @@ -18,32 +43,7 @@ print error reactor.stop() -res = PGER.getObjectsByOids(requestor='test', - oids=['zaphod@hog.univ', - 'banzai@banzai.earth', - 'bigboote@yoyodyne.planet10', - 'smallberries@yoyodyne.planet10', - 'lizardo@yoyodyne.planet10', - 'H2G2', - 'OTHER', - 'OTHEROTHER', - 'TEST.DOC-01.1', - 'TEST.DOC-01.2', - 'TEST.BTA-20.1', - 'TEST.HM.200.1', - 'TEST.FX-CAP.1', - 'TEST.HOG.1', - 'TEST.BTA-20.1-CAD.1', - 'TEST.HM.200.1-CAD.1', - 'TEST.FX-CAP.1-CAD.1', - 'TEST.HOG.1-CAD.1', - 'TEST.Representation.1', - 'TEST.Representation.2', - 'TEST.FileLink.1', - 'TEST.FileLink.2', - 'TEST.FileLink.3', - 'TEST.FileLink.4' - ]) +res = PGER.getObjectsByOids(requestor='test', oids=oids) res.addCallbacks(success, failure) reactor.run() # start the main loop Index: PanGalactic/pangalactic/test/test_pger_addFile.py diff -u PanGalactic/pangalactic/test/test_pger_addFile.py:1.13 PanGalactic/pangalactic/test/test_pger_addFile.py:1.14 --- PanGalactic/pangalactic/test/test_pger_addFile.py:1.13 Thu Jul 12 17:49:55 2007 +++ PanGalactic/pangalactic/test/test_pger_addFile.py Fri Jul 13 23:55:57 2007 @@ -1,4 +1,4 @@ -# $Id: test_pger_addFile.py,v 1.13 2007/07/12 21:49:55 waterbug Exp $ +# $Id: test_pger_addFile.py,v 1.14 2007/07/14 03:55:57 waterbug Exp $ """ Functional test for PGER.addFile() @@ -10,7 +10,7 @@ from twisted.internet import reactor from pangalactic.repo.pger import PGER -fileoid = '.'.join(['TEST.TPaF', str(time.time())]) +fileoid = '.'.join(['test:TPaF.txt', str(time.time())]) headers = {} headers['oid'] = fileoid headers['user-agent'] = 'PanGalaxian' @@ -29,7 +29,7 @@ print error reactor.stop() -added = PGER.addFile('Fester.Bestertester@earth.milkyway.univ', headers, text) +added = PGER.addFile('test:fester.bestertester', headers, text) added.addCallbacks(success, failure) reactor.run() Index: PanGalactic/pangalactic/test/test_xmlrpc_addObjects.py diff -u PanGalactic/pangalactic/test/test_xmlrpc_addObjects.py:1.15 PanGalactic/pangalactic/test/test_xmlrpc_addObjects.py:1.16 --- PanGalactic/pangalactic/test/test_xmlrpc_addObjects.py:1.15 Mon Feb 12 19:02:47 2007 +++ PanGalactic/pangalactic/test/test_xmlrpc_addObjects.py Fri Jul 13 23:55:57 2007 @@ -1,4 +1,4 @@ -# $Id: test_xmlrpc_addObjects.py,v 1.15 2007/02/13 00:02:47 waterbug Exp $ +# $Id: test_xmlrpc_addObjects.py,v 1.16 2007/07/14 03:55:57 waterbug Exp $ """ Functional test for PgerXmlrpcService.xmlrpc_addObjects @@ -10,7 +10,7 @@ from pangalactic.repo.pgerxmlrpc import PgerXmlrpcService from pangalactic.test.utils4test import genLinkedTestObjects -xmlrpcsrv = PgerXmlrpcService(userid='Fester.Bestertester@earth.milkyway.univ') +xmlrpcsrv = PgerXmlrpcService(userid='test:fester.bestertester') test_objects = genLinkedTestObjects('TXaO', PGER.db.registry, addable=True) extracts = [o.extract() for o in test_objects] Index: PanGalactic/pangalactic/test/test_pger_addObjectsE.py diff -u PanGalactic/pangalactic/test/test_pger_addObjectsE.py:1.16 PanGalactic/pangalactic/test/test_pger_addObjectsE.py:1.17 --- PanGalactic/pangalactic/test/test_pger_addObjectsE.py:1.16 Mon Feb 12 19:02:47 2007 +++ PanGalactic/pangalactic/test/test_pger_addObjectsE.py Fri Jul 13 23:55:57 2007 @@ -23,7 +23,7 @@ print error reactor.stop() -res = PGER.addObjects('Fester.Bestertester@earth.milkyway.univ', extracts) +res = PGER.addObjects('test:fester.bestertester', extracts) res.addCallbacks(success, failure) reactor.run() Index: PanGalactic/pangalactic/test/test_pger_getObjectsO.py diff -u PanGalactic/pangalactic/test/test_pger_getObjectsO.py:1.14 PanGalactic/pangalactic/test/test_pger_getObjectsO.py:1.15 --- PanGalactic/pangalactic/test/test_pger_getObjectsO.py:1.14 Mon Feb 12 19:02:47 2007 +++ PanGalactic/pangalactic/test/test_pger_getObjectsO.py Fri Jul 13 23:55:57 2007 @@ -1,4 +1,4 @@ -# $Id: test_pger_getObjectsO.py,v 1.14 2007/02/13 00:02:47 waterbug Exp $ +# $Id: test_pger_getObjectsO.py,v 1.15 2007/07/14 03:55:57 waterbug Exp $ """ Functional test for PGER.getObjects() @@ -34,7 +34,7 @@ out = PGER.getObjects(requestor='test', schema_name='Part', - id_ns='http://pangalactic.us/test/lib/') + id_ns='sandbox') out.addCallbacks(success, failure) reactor.run() Index: PanGalactic/pangalactic/test/test_chronosynclastic_runQueryMapToRowKeys.py diff -u PanGalactic/pangalactic/test/test_chronosynclastic_runQueryMapToRowKeys.py:1.4 PanGalactic/pangalactic/test/test_chronosynclastic_runQueryMapToRowKeys.py:1.5 --- PanGalactic/pangalactic/test/test_chronosynclastic_runQueryMapToRowKeys.py:1.4 Mon Feb 12 19:02:47 2007 +++ PanGalactic/pangalactic/test/test_chronosynclastic_runQueryMapToRowKeys.py Fri Jul 13 23:55:57 2007 @@ -1,4 +1,4 @@ -# $Id: test_chronosynclastic_runQueryMapToRowKeys.py,v 1.4 2007/02/13 00:02:47 waterbug Exp $ +# $Id: test_chronosynclastic_runQueryMapToRowKeys.py,v 1.5 2007/07/14 03:55:57 waterbug Exp $ """ Functional test for pangalactic.repo.chronosynclastic module @@ -24,7 +24,7 @@ fum = Fum() sqlargs = sql.buildSelect('_actor', 1, # subtypes! - ['_id_ns', '=', 'http://pangalactic.us/test/lib/']) + ['_id_ns', '=', 'sandbox']) res = fum._runQueryMapToRowKeys(*sqlargs) res.addCallbacks(success, failure) Index: PanGalactic/pangalactic/test/test_xmlrpc_getNames.py diff -u PanGalactic/pangalactic/test/test_xmlrpc_getNames.py:1.4 PanGalactic/pangalactic/test/test_xmlrpc_getNames.py:1.5 --- PanGalactic/pangalactic/test/test_xmlrpc_getNames.py:1.4 Mon Feb 12 19:02:47 2007 +++ PanGalactic/pangalactic/test/test_xmlrpc_getNames.py Fri Jul 13 23:55:57 2007 @@ -1,4 +1,4 @@ -# $Id: test_xmlrpc_getNames.py,v 1.4 2007/02/13 00:02:47 waterbug Exp $ +# $Id: test_xmlrpc_getNames.py,v 1.5 2007/07/14 03:55:57 waterbug Exp $ """ Functional test for PgerXmlrpcService.getNames() @@ -22,7 +22,7 @@ xmlsrv = PgerXmlrpcService() -res = xmlsrv.xmlrpc_getNames('http://pangalactic.us/test/lib/') +res = xmlsrv.xmlrpc_getNames('sandbox') res.addCallbacks(success, failure) reactor.run() Index: PanGalactic/pangalactic/test/test_xmlrpc_getObjects.py diff -u PanGalactic/pangalactic/test/test_xmlrpc_getObjects.py:1.19 PanGalactic/pangalactic/test/test_xmlrpc_getObjects.py:1.20 --- PanGalactic/pangalactic/test/test_xmlrpc_getObjects.py:1.19 Mon Feb 12 19:02:47 2007 +++ PanGalactic/pangalactic/test/test_xmlrpc_getObjects.py Fri Jul 13 23:55:57 2007 @@ -1,4 +1,4 @@ -# $Id: test_xmlrpc_getObjects.py,v 1.19 2007/02/13 00:02:47 waterbug Exp $ +# $Id: test_xmlrpc_getObjects.py,v 1.20 2007/07/14 03:55:57 waterbug Exp $ """ Functional test for PgerXmlrpcService.xmlrpc_getObjects @@ -11,13 +11,13 @@ from pangalactic.repo.pgerxmlrpc import PgerXmlrpcService schema_name = 'PanGalacticObject' -xmlsrv = PgerXmlrpcService(userid='Fester.Bestertester@earth.milkyway.univ') +xmlsrv = PgerXmlrpcService(userid='test:fester.bestertester') # need UberORB's cache because getObjects checks it U = UberORB(debug=True) if os.path.exists('_trial_temp'): U.initCache(home='_trial_temp') -parms = {'id_ns': 'http://pangalactic.us/test/lib/'} +parms = {'id_ns': 'sandbox'} def success(extracts): print "\n*** XMLRPC Command:" Index: PanGalactic/pangalactic/test/test_chronosynclastic_addRecords.py diff -u PanGalactic/pangalactic/test/test_chronosynclastic_addRecords.py:1.18 PanGalactic/pangalactic/test/test_chronosynclastic_addRecords.py:1.19 --- PanGalactic/pangalactic/test/test_chronosynclastic_addRecords.py:1.18 Fri Jul 13 00:39:35 2007 +++ PanGalactic/pangalactic/test/test_chronosynclastic_addRecords.py Fri Jul 13 23:55:57 2007 @@ -1,4 +1,4 @@ -# $Id: test_chronosynclastic_addRecords.py,v 1.18 2007/07/13 04:39:35 waterbug Exp $ +# $Id: test_chronosynclastic_addRecords.py,v 1.19 2007/07/14 03:55:57 waterbug Exp $ """ Test for inserting a row using pangalactic.repo.pgerdb module @@ -42,14 +42,14 @@ inf.registry, testid, name=testname, - id_ns='pgeftest', - record_owner='Fester.Bestertester@earth.milkyway.univ', - record_creator='Fester.Bestertester@earth.milkyway.univ', + id_ns='test', + record_owner='test:fester.bestertester', + record_creator='test:fester.bestertester', create_datetime=dtstamp()) extr = o.extract() recs = inf._extracts2Records([extr]) -out = inf._addRecords(recs, 'Fester.Bestertester@earth.milkyway.univ') +out = inf._addRecords(recs, 'test:fester.bestertester') out.addCallback(lambda x: ifNone(x, testid)) reactor.run() Index: PanGalactic/pangalactic/test/test_chronosynclastic_addObjects.py diff -u PanGalactic/pangalactic/test/test_chronosynclastic_addObjects.py:1.17 PanGalactic/pangalactic/test/test_chronosynclastic_addObjects.py:1.18 --- PanGalactic/pangalactic/test/test_chronosynclastic_addObjects.py:1.17 Mon Feb 12 19:02:47 2007 +++ PanGalactic/pangalactic/test/test_chronosynclastic_addObjects.py Fri Jul 13 23:55:57 2007 @@ -1,4 +1,4 @@ -# $Id: test_chronosynclastic_addObjects.py,v 1.17 2007/02/13 00:02:47 waterbug Exp $ +# $Id: test_chronosynclastic_addObjects.py,v 1.18 2007/07/14 03:55:57 waterbug Exp $ """ Test for pangalactic.repo.chronosynclastic addObjects method @@ -30,7 +30,7 @@ test_objects = genLinkedTestObjects('TCaO', inf.registry, addable=True) extracts = [o.extract() for o in test_objects] -out = inf.addObjects(requestor='Fester.Bestertester@earth.milkyway.univ', +out = inf.addObjects(requestor='test:fester.bestertester', extracts=extracts) out.addCallbacks(success, failure) Index: PanGalactic/src/sql/insertRefData.sql diff -u PanGalactic/src/sql/insertRefData.sql:1.28 PanGalactic/src/sql/insertRefData.sql:1.29 --- PanGalactic/src/sql/insertRefData.sql:1.28 Fri Dec 30 15:54:04 2005 +++ PanGalactic/src/sql/insertRefData.sql Fri Jul 13 23:55:58 2007 @@ -1,6 +1,6 @@ /* PGER reference data initialization. */ -/* $Id: insertRefData.sql,v 1.28 2005/12/30 20:54:04 waterbug Exp $ */ +/* $Id: insertRefData.sql,v 1.29 2007/07/14 03:55:58 waterbug Exp $ */ /* This script sets up some reference data, including the default * identification contexts for PGEF objects, and is required before the @@ -24,14 +24,14 @@ ) VALUES ( - 'admin', + 'pgefobjects:admin', 'Person', 'admin', - 'http://pangalactic.us/pgef/objects/', + 'pgefobjects', 'Admin', - 'admin', - 'admin', - 'admin', + 'pgefobjects:admin', + 'pgefobjects:admin', + 'pgefobjects:admin', 'PGANA', '1' ); @@ -42,30 +42,7 @@ ) VALUES ( - 'admin' -); - -INSERT INTO _project -( - _oid, - __schema_name, - _id, - _id_ns, - _record_owner, - _record_creator, - _name, - _description -) -VALUES -( - 'NoProject', - 'Project', - 'NoProject', - 'http://pangalactic.us/pgef/objects/', - 'admin', - 'admin', - '(no project)', - 'A project for things that have no project' + 'pgefobjects:admin' ); END; Index: PanGalactic/pangalactic/test/test_pger_addObjectsO.py diff -u PanGalactic/pangalactic/test/test_pger_addObjectsO.py:1.16 PanGalactic/pangalactic/test/test_pger_addObjectsO.py:1.17 --- PanGalactic/pangalactic/test/test_pger_addObjectsO.py:1.16 Mon Feb 12 19:02:47 2007 +++ PanGalactic/pangalactic/test/test_pger_addObjectsO.py Fri Jul 13 23:55:57 2007 @@ -1,4 +1,4 @@ -# $Id: test_pger_addObjectsO.py,v 1.16 2007/02/13 00:02:47 waterbug Exp $ +# $Id: test_pger_addObjectsO.py,v 1.17 2007/07/14 03:55:57 waterbug Exp $ """ Functional test for PGER.addObjects() @@ -22,7 +22,7 @@ print error reactor.stop() -dts = PGER.addObjects(requestor='Fester.Bestertester@earth.milkyway.univ', +dts = PGER.addObjects(requestor='test:fester.bestertester', objects=test_objects, input='objects', ret='objects') Index: PanGalactic/src/sql/insertMediaTypes.sql diff -u PanGalactic/src/sql/insertMediaTypes.sql:1.15 PanGalactic/src/sql/insertMediaTypes.sql:1.16 --- PanGalactic/src/sql/insertMediaTypes.sql:1.15 Thu Nov 23 14:37:24 2006 +++ PanGalactic/src/sql/insertMediaTypes.sql Fri Jul 13 23:55:58 2007 @@ -1,6 +1,6 @@ /* -$Id: insertMediaTypes.sql,v 1.15 2006/11/23 19:37:24 waterbug Exp $ +$Id: insertMediaTypes.sql,v 1.16 2007/07/14 03:55:58 waterbug Exp $ MEDIA TYPES @@ -6870,9 +6870,10 @@ ); UPDATE _mime set + _id_ns = 'mime', _id = _oid, - _id_ns = 'http://www.iana.org/assignments/media-types/', - _name = _oid, + _name = _id, + _oid = 'mime:' || _oid, _creator = 'admin', _modifier = 'admin', _record_create_datetime = CURRENT_TIMESTAMP, Index: PanGalactic/pangalactic/test/test_chronosynclastic_getResultByRowKey.py diff -u PanGalactic/pangalactic/test/test_chronosynclastic_getResultByRowKey.py:1.6 PanGalactic/pangalactic/test/test_chronosynclastic_getResultByRowKey.py:1.7 --- PanGalactic/pangalactic/test/test_chronosynclastic_getResultByRowKey.py:1.6 Mon Feb 12 19:02:47 2007 +++ PanGalactic/pangalactic/test/test_chronosynclastic_getResultByRowKey.py Fri Jul 13 23:55:57 2007 @@ -1,4 +1,4 @@ -# $Id: test_chronosynclastic_getResultByRowKey.py,v 1.6 2007/02/13 00:02:47 waterbug Exp $ +# $Id: test_chronosynclastic_getResultByRowKey.py,v 1.7 2007/07/14 03:55:57 waterbug Exp $ """ Test for getResultByRowKey @@ -14,11 +14,11 @@ inf = I() -rk1 = ['_project', 'H2G2'] +rk1 = ['_project', 'sandbox:H2G2'] -rk2 = ['_part', 'TEST.HOG.1'] +rk2 = ['_part', 'sandbox:HOG.1'] -rk3 = ['_model', 'TEST.IDrive.1-CAD.1'] +rk3 = ['_model', 'sandbox:IDrive.1-CAD.1'] def success(result): print 'results are:' Index: PanGalactic/src/sql/insertModels.sql diff -u PanGalactic/src/sql/insertModels.sql:1.20 PanGalactic/src/sql/insertModels.sql:1.21 --- PanGalactic/src/sql/insertModels.sql:1.20 Thu Nov 23 14:37:24 2006 +++ PanGalactic/src/sql/insertModels.sql Fri Jul 13 23:55:58 2007 @@ -1,6 +1,6 @@ /* PGER Demo Model data inserts. */ -/* $Id: insertModels.sql,v 1.20 2006/11/23 19:37:24 waterbug Exp $ */ +/* $Id: insertModels.sql,v 1.21 2007/07/14 03:55:58 waterbug Exp $ */ BEGIN; SET CONSTRAINTS ALL DEFERRED; @@ -37,17 +37,17 @@ ) VALUES ( -'TEST.MMT-01.1-CAD.1', +'sandbox:MMT-01.1-CAD.1', 'Model', -- __schema_name 'MMT-01.1-CAD.1', -- _id -'http://pangalactic.us/test/lib/', -- _id_ns +'sandbox', -- _id_ns '0', -- _security_mask 'Model of Twanger, Magic, Megawatt', -- _description 'Blah blah Twanger', -- _comment -'bigboote@yoyodyne.planet10', -- _record_owner -'bigboote@yoyodyne.planet10', -- _record_creator +'sandbox:john.bigboote', -- _record_owner +'sandbox:john.bigboote', -- _record_creator '2002-09-09 01:00:00', -- _record_create_datetime -'bigboote@yoyodyne.planet10', -- _record_modifier +'sandbox:john.bigboote', -- _record_modifier '2002-09-09 01:00:00', -- _record_mod_datetime 'smallberries@yoyodyne.planet10', -- _owner 'smallberries@yoyodyne.planet10', -- _creator @@ -60,7 +60,7 @@ 'A', -- _version 1, -- _version_sequence True, -- _is_head -'H2G2', -- _cm_authority +'sandbox:H2G2', -- _cm_authority 'Mechanical', -- _frame_of_reference 'administrative data', -- _definition_context 'all' -- _life_cycle_stage @@ -98,17 +98,17 @@ ) VALUES ( -'TEST.BTA-20.1-CAD.1', +'sandbox:BTA-20.1-CAD.1', 'Model', -- __schema_name 'BTA-20.1-CAD.1', -- _id -'http://pangalactic.us/test/lib/', -- _id_ns +'sandbox', -- _id_ns '0', -- _security_mask 'Preliminary Twanging Assembly', -- _description 'Blah blah blah Blooper Twanging Assy.', -- _comment -'bigboote@yoyodyne.planet10', -- _record_owner -'bigboote@yoyodyne.planet10', -- _record_creator +'sandbox:john.bigboote', -- _record_owner +'sandbox:john.bigboote', -- _record_creator '2002-09-09 01:00:00', -- _record_create_datetime -'bigboote@yoyodyne.planet10', -- _record_modifier +'sandbox:john.bigboote', -- _record_modifier '2002-09-09 01:00:00', -- _record_mod_datetime 'smallberries@yoyodyne.planet10', -- _owner 'smallberries@yoyodyne.planet10', -- _creator @@ -121,7 +121,7 @@ 'A', -- _version 1, -- _version_sequence True, -- _is_head -'H2G2', -- _cm_authority +'sandbox:H2G2', -- _cm_authority 'Mechanical', -- _frame_of_reference 'administrative data', -- _definition_context 'all' -- _life_cycle_stage @@ -159,17 +159,17 @@ ) VALUES ( -'TEST.HM.200.1-CAD.1', +'sandbox:HM.200.1-CAD.1', 'Model', -- __schema_name 'HM.200-CAD.1', -- _id -'http://pangalactic.us/test/lib/', -- _id_ns +'sandbox', -- _id_ns '0', -- _security_mask 'Mabob, Hoogie', -- _description 'Blah blah blah Hoogie Mabob', -- _comment -'bigboote@yoyodyne.planet10', -- _record_owner -'bigboote@yoyodyne.planet10', -- _record_creator +'sandbox:john.bigboote', -- _record_owner +'sandbox:john.bigboote', -- _record_creator '2002-09-09 01:00:00', -- _record_create_datetime -'bigboote@yoyodyne.planet10', -- _record_modifier +'sandbox:john.bigboote', -- _record_modifier '2002-09-09 01:00:00', -- _record_mod_datetime 'smallberries@yoyodyne.planet10', -- _owner 'smallberries@yoyodyne.planet10', -- _creator @@ -182,7 +182,7 @@ 'A', -- _version 1, -- _version_sequence True, -- _is_head -'H2G2', -- _cm_authority +'sandbox:H2G2', -- _cm_authority 'Mechanical', -- _frame_of_reference 'administrative data', -- _definition_context 'all' -- _life_cycle_stage @@ -220,22 +220,22 @@ ) VALUES ( -'TEST.IDrive.1-CAD.1', +'sandbox:IDrive.1-CAD.1', 'Model', -- __schema_name 'IDrive.1-CAD.1', -- _id -'http://pangalactic.us/test/lib/', -- _id_ns +'sandbox', -- _id_ns '0', -- _security_mask 'Drive, Improbability', -- _description 'Blah Improbability Drive', -- _comment -'bigboote@yoyodyne.planet10', -- _record_owner -'bigboote@yoyodyne.planet10', -- _record_creator +'sandbox:john.bigboote', -- _record_owner +'sandbox:john.bigboote', -- _record_creator '2002-09-09 01:00:00', -- _record_create_datetime -'bigboote@yoyodyne.planet10', -- _record_modifier +'sandbox:john.bigboote', -- _record_modifier '2002-09-09 01:00:00', -- _record_mod_datetime -'bigboote@yoyodyne.planet10', -- _owner -'bigboote@yoyodyne.planet10', -- _creator +'sandbox:john.bigboote', -- _owner +'sandbox:john.bigboote', -- _creator '2002-09-09 01:06:51', -- _create_datetime -'bigboote@yoyodyne.planet10', -- _modifier +'sandbox:john.bigboote', -- _modifier '2002-09-09 01:06:51', -- _mod_datetime 'Drive, Improbability, v3B', -- _name 'IDrive.1-CAD', -- _base_id @@ -243,7 +243,7 @@ 'A', -- _version 1, -- _version_sequence True, -- _is_head -'H2G2', -- _cm_authority +'sandbox:H2G2', -- _cm_authority 'Mechanical', -- _frame_of_reference 'administrative data', -- _definition_context 'all' -- _life_cycle_stage @@ -281,22 +281,22 @@ ) VALUES ( -'TEST.B57SMB.1-CAD.1', +'sandbox:B57SMB.1-CAD.1', 'Model', -- __schema_name 'B57SMB.1-CAD.1', -- _id -'http://pangalactic.us/test/lib/', -- _id_ns +'sandbox', -- _id_ns '0', -- _security_mask 'Computer, Hyper-Quantum, Subfemto', -- _description 'Blah blah blah Powerful Computer', -- _comment -'bigboote@yoyodyne.planet10', -- _record_owner -'bigboote@yoyodyne.planet10', -- _record_creator +'sandbox:john.bigboote', -- _record_owner +'sandbox:john.bigboote', -- _record_creator '2002-09-09 01:00:00', -- _record_create_datetime -'bigboote@yoyodyne.planet10', -- _record_modifier +'sandbox:john.bigboote', -- _record_modifier '2002-09-09 01:00:00', -- _record_mod_datetime -'bigboote@yoyodyne.planet10', -- _owner -'bigboote@yoyodyne.planet10', -- _creator +'sandbox:john.bigboote', -- _owner +'sandbox:john.bigboote', -- _creator '2002-09-09 01:06:51', -- _create_datetime -'bigboote@yoyodyne.planet10', -- _modifier +'sandbox:john.bigboote', -- _modifier '2002-09-09 01:06:51', -- _mod_datetime 'Bambleweeny 57 Sub-Meson Brain (Mechanical Design)', -- _name 'B57SMB.1-CAD', -- _base_id @@ -304,7 +304,7 @@ 'A', -- _version 1, -- _version_sequence True, -- _is_head -'H2G2', -- _cm_authority +'sandbox:H2G2', -- _cm_authority 'Mechanical', -- _frame_of_reference 'administrative data', -- _definition_context 'all' -- _life_cycle_stage @@ -342,22 +342,22 @@ ) VALUES ( -'TEST.FX-CAP.1-CAD.1', +'sandbox:FX-CAP.1-CAD.1', 'Model', -- __schema_name 'FX-CAP.1-CAD.1', -- _id -'http://pangalactic.us/test/lib/', -- _id_ns +'sandbox', -- _id_ns '0', -- _security_mask 'Capacitor, Flux', -- _description 'Blah Blah Flux Capacitor', -- _comment -'bigboote@yoyodyne.planet10', -- _record_owner -'bigboote@yoyodyne.planet10', -- _record_creator +'sandbox:john.bigboote', -- _record_owner +'sandbox:john.bigboote', -- _record_creator '2002-09-09 01:00:00', -- _record_create_datetime -'bigboote@yoyodyne.planet10', -- _record_modifier +'sandbox:john.bigboote', -- _record_modifier '2002-09-09 01:00:00', -- _record_mod_datetime -'bigboote@yoyodyne.planet10', -- _owner -'bigboote@yoyodyne.planet10', -- _creator +'sandbox:john.bigboote', -- _owner +'sandbox:john.bigboote', -- _creator '2002-09-09 01:06:51', -- _create_datetime -'bigboote@yoyodyne.planet10', -- _modifier +'sandbox:john.bigboote', -- _modifier '2002-09-09 01:06:51', -- _mod_datetime 'FX-v4 Flux Capacitor (MCAD, Preliminary)', -- _name 'FX-CAP.1-CAD', -- _base_id @@ -365,7 +365,7 @@ 'A', -- _version 1, -- _version_sequence True, -- _is_head -'H2G2', -- _cm_authority +'sandbox:H2G2', -- _cm_authority 'Mechanical', -- _frame_of_reference 'administrative data', -- _definition_context 'all' -- _life_cycle_stage @@ -403,10 +403,10 @@ ) VALUES ( -'TEST.HOG.1-CAD.1', +'sandbox:HOG.1-CAD.1', 'Model', -- __schema_name 'HOG.1-CAD.1', -- _id -'http://pangalactic.us/test/lib/', -- _id_ns +'sandbox', -- _id_ns '0', -- _security_mask 'Heart of Gold Spacecraft', -- _description 'Blah Blah Heart of Gold', -- _comment @@ -426,7 +426,7 @@ 'A', -- _version 1, -- _version_sequence True, -- _is_head -'H2G2', -- _cm_authority +'sandbox:H2G2', -- _cm_authority 'Mechanical', -- _frame_of_reference 'administrative data', -- _definition_context 'all' -- _life_cycle_stage @@ -464,10 +464,10 @@ ) VALUES ( -'TEST.MF Series A.1-CAD.1', +'sandbox:MF Series A.1-CAD.1', 'Model', -- __schema_name 'MF Series A.1-CAD.1', -- _id -'http://pangalactic.us/test/lib/', -- _id_ns +'sandbox', -- _id_ns '0', -- _security_mask 'Mr. Fusion A10K version 1 3D MCAD Model', -- _description 'Mr. Fusion A10K version 1 3D Mechanical CAD Design Model, Blah Blah', -- _comment @@ -487,7 +487,7 @@ 'A', -- _version 1, -- _version_sequence True, -- _is_head -'H2G2', -- _cm_authority +'sandbox:H2G2', -- _cm_authority 'Mechanical', -- _frame_of_reference 'administrative data', -- _definition_context 'all' -- _life_cycle_stage @@ -525,10 +525,10 @@ ) VALUES ( -'TEST.OO-1.1-CAD.1', +'sandbox:OO-1.1-CAD.1', 'Model', -- __schema_name 'OO-1.1-CAD.1', -- _id -'http://pangalactic.us/test/lib/', -- _id_ns +'sandbox', -- _id_ns '0', -- _security_mask 'Overthruster, Oscillation', -- _description 'Oscillation Overthruster', -- _comment @@ -548,7 +548,7 @@ 'A', -- _version 1, -- _version_sequence True, -- _is_head -'H2G2', -- _cm_authority +'sandbox:H2G2', -- _cm_authority 'Mechanical', -- _frame_of_reference 'administrative data', -- _definition_context 'all' -- _life_cycle_stage @@ -586,17 +586,17 @@ ) VALUES ( -'TEST.OO-Def-1.1-CAD.1', +'sandbox:OO-Def-1.1-CAD.1', 'Model', -- __schema_name 'OO-Def-1.1-CAD.1', -- _id -'http://pangalactic.us/test/lib/', -- _id_ns +'sandbox', -- _id_ns '0', -- _security_mask 'Overthruster, Oscillation', -- _description 'Def Oscillation Overthruster', -- _comment -'bigboote@yoyodyne.planet10', -- _record_owner -'bigboote@yoyodyne.planet10', -- _record_creator +'sandbox:john.bigboote', -- _record_owner +'sandbox:john.bigboote', -- _record_creator '2002-09-09 01:00:00', -- _record_create_datetime -'bigboote@yoyodyne.planet10', -- _record_modifier +'sandbox:john.bigboote', -- _record_modifier '2002-09-09 01:00:00', -- _record_mod_datetime 'lizardo@yoyodyne.planet10', -- _owner 'lizardo@yoyodyne.planet10', -- _creator @@ -609,7 +609,7 @@ 'A', -- _version 1, -- _version_sequence True, -- _is_head -'H2G2', -- _cm_authority +'sandbox:H2G2', -- _cm_authority 'Mechanical', -- _frame_of_reference 'administrative data', -- _definition_context 'all' -- _life_cycle_stage Index: PanGalactic/src/sql/insertParts.sql diff -u PanGalactic/src/sql/insertParts.sql:1.18 PanGalactic/src/sql/insertParts.sql:1.19 --- PanGalactic/src/sql/insertParts.sql:1.18 Thu Nov 23 14:37:24 2006 +++ PanGalactic/src/sql/insertParts.sql Fri Jul 13 23:55:58 2007 @@ -1,6 +1,6 @@ /* PGER Demo Part data insertion. */ -/* $Id: insertParts.sql,v 1.18 2006/11/23 19:37:24 waterbug Exp $ */ +/* $Id: insertParts.sql,v 1.19 2007/07/14 03:55:58 waterbug Exp $ */ BEGIN; SET CONSTRAINTS ALL DEFERRED; @@ -32,20 +32,20 @@ ) VALUES ( -'TEST.MMT-01.1', -- _oid +'sandbox:MMT-01.1', -- _oid 'Part', -- __schema_name 'MMT-01.1', -- _id -'http://pangalactic.us/test/lib/', -- _id_ns +'sandbox', -- _id_ns '0', -- _security_mask 'Twanger, Magic, Heavy-Duty', -- _description 'Prototype Plasma-Drive Magic Twanger', -- _comment -'smallberries@yoyodyne.planet10', -- _record_owner -'smallberries@yoyodyne.planet10', -- _record_creator -'smallberries@yoyodyne.planet10', -- _record_modifier -'smallberries@yoyodyne.planet10', -- _owner -'smallberries@yoyodyne.planet10', -- _creator +'sandbox:john.smallberries', -- _record_owner +'sandbox:john.smallberries', -- _record_creator +'sandbox:john.smallberries', -- _record_modifier +'sandbox:john.smallberries', -- _owner +'sandbox:john.smallberries', -- _creator '2002-09-09 01:06:51', -- _create_datetime -'smallberries@yoyodyne.planet10', -- _modifier +'sandbox:john.smallberries', -- _modifier '2002-09-09 01:06:51', -- _mod_datetime 'Megawatt Magic Twanger', -- _name 'MMT-01', -- _base_id @@ -53,7 +53,7 @@ '1.0', -- _version 1, -- _version_sequence True, -- _is_head -'H2G2' -- _cm_authority +'sandbox:H2G2' -- _cm_authority ); INSERT INTO _part @@ -83,20 +83,20 @@ ) VALUES ( -'TEST.BTA-20.1', -- _oid +'sandbox:BTA-20.1', -- _oid 'Part', -- __schema_name 'BTA-20.1', -- _id -'http://pangalactic.us/test/lib/', -- _id_ns +'sandbox', -- _id_ns '0', -- _security_mask 'Twanging Assembly, Blooper', -- _description 'Twanging Assembly with custom Blooper modules', -- _comment -'smallberries@yoyodyne.planet10', -- _record_owner -'smallberries@yoyodyne.planet10', -- _record_creator -'smallberries@yoyodyne.planet10', -- _record_modifier -'smallberries@yoyodyne.planet10', -- _owner -'smallberries@yoyodyne.planet10', -- _creator +'sandbox:john.smallberries', -- _record_owner +'sandbox:john.smallberries', -- _record_creator +'sandbox:john.smallberries', -- _record_modifier +'sandbox:john.smallberries', -- _owner +'sandbox:john.smallberries', -- _creator '2002-09-09 01:06:51', -- _create_datetime -'smallberries@yoyodyne.planet10', -- _modifier +'sandbox:john.smallberries', -- _modifier '2002-09-09 01:06:51', -- _mod_datetime 'Blooper Twanging Assembly', -- _name 'BTA-20', -- _base_id @@ -104,7 +104,7 @@ 'A', -- _version 1, -- _version_sequence True, -- _is_head -'H2G2' -- _cm_authority +'sandbox:H2G2' -- _cm_authority ); INSERT INTO _part @@ -134,20 +134,20 @@ ) VALUES ( -'TEST.HM.200.1', -- _oid +'sandbox:HM.200.1', -- _oid 'Part', -- __schema_name 'HM.200.1', -- _id -'http://pangalactic.us/test/lib/', -- _id_ns +'sandbox', -- _id_ns '0', -- _security_mask 'Mabob, Hoogie', -- _description 'Deluxe Hoogie Mabob Assembly', -- _comment -'smallberries@yoyodyne.planet10', -- _record_owner -'smallberries@yoyodyne.planet10', -- _record_creator -'smallberries@yoyodyne.planet10', -- _record_modifier -'smallberries@yoyodyne.planet10', -- _owner -'smallberries@yoyodyne.planet10', -- _creator +'sandbox:john.smallberries', -- _record_owner +'sandbox:john.smallberries', -- _record_creator +'sandbox:john.smallberries', -- _record_modifier +'sandbox:john.smallberries', -- _owner +'sandbox:john.smallberries', -- _creator '2002-09-09 01:06:51', -- _create_datetime -'smallberries@yoyodyne.planet10', -- _modifier +'sandbox:john.smallberries', -- _modifier '2002-09-09 01:06:51', -- _mod_datetime 'Hoogie Mabob', -- _name 'HM.200', -- _base_id @@ -155,7 +155,7 @@ '1.2', -- _version 3, -- _version_sequence True, -- _is_head -'H2G2' -- _cm_authority +'sandbox:H2G2' -- _cm_authority ); INSERT INTO _part @@ -185,20 +185,20 @@ ) VALUES ( -'TEST.IDrive.1', -- _oid +'sandbox:IDrive.1', -- _oid 'Part', -- __schema_name 'IDrive.1', -- _id -'http://pangalactic.us/test/lib/', -- _id_ns +'sandbox', -- _id_ns '0', -- _security_mask 'Drive, Improbability', -- _description 'Improbability Drive Unit, VROOM VROOM!', -- _comment -'bigboote@yoyodyne.planet10', -- _record_owner -'bigboote@yoyodyne.planet10', -- _record_creator -'bigboote@yoyodyne.planet10', -- _record_modifier -'bigboote@yoyodyne.planet10', -- _owner -'bigboote@yoyodyne.planet10', -- _creator +'sandbox:john.bigboote', -- _record_owner +'sandbox:john.bigboote', -- _record_creator +'sandbox:john.bigboote', -- _record_modifier +'sandbox:john.bigboote', -- _owner +'sandbox:john.bigboote', -- _creator '2002-09-09 01:06:51', -- _create_datetime -'bigboote@yoyodyne.planet10', -- _modifier +'sandbox:john.bigboote', -- _modifier '2002-09-09 01:06:51', -- _mod_datetime 'Improbability Drive', -- _name 'IDrive', -- _base_id @@ -206,7 +206,7 @@ '3B', -- _version 5, -- _version_sequence True, -- _is_head -'H2G2' -- _cm_authority +'sandbox:H2G2' -- _cm_authority ); INSERT INTO _part @@ -236,20 +236,20 @@ ) VALUES ( -'TEST.B57SMB.1', -- _oid +'sandbox:B57SMB.1', -- _oid 'Part', -- __schema_name 'B57SMB.1', -- _id -'http://pangalactic.us/test/lib/', -- _id_ns +'sandbox', -- _id_ns '0', -- _security_mask 'Computer, Hyper-Quantum, Subfemto', -- _description 'Ridiculously Powerful But Tiny Computer', -- _comment -'bigboote@yoyodyne.planet10', -- _record_owner -'bigboote@yoyodyne.planet10', -- _record_creator -'bigboote@yoyodyne.planet10', -- _record_modifier -'bigboote@yoyodyne.planet10', -- _owner -'bigboote@yoyodyne.planet10', -- _creator +'sandbox:john.bigboote', -- _record_owner +'sandbox:john.bigboote', -- _record_creator +'sandbox:john.bigboote', -- _record_modifier +'sandbox:john.bigboote', -- _owner +'sandbox:john.bigboote', -- _creator '2002-09-09 01:06:51', -- _create_datetime -'bigboote@yoyodyne.planet10', -- _modifier +'sandbox:john.bigboote', -- _modifier '2002-09-09 01:06:51', -- _mod_datetime 'Bambleweeny 57 Sub-Meson Brain', -- _name 'B57SMB', -- _base_id @@ -257,7 +257,7 @@ '33', -- _version 33, -- _version_sequence True, -- _is_head -'H2G2' -- _cm_authority +'sandbox:H2G2' -- _cm_authority ); INSERT INTO _part @@ -287,20 +287,20 @@ ) VALUES ( -'TEST.FX-CAP.1', -- _oid +'sandbox:FX-CAP.1', -- _oid 'Part', -- __schema_name 'FX-CAP.1', -- _id -'http://pangalactic.us/test/lib/',-- _id_ns +'sandbox', -- _id_ns '0', -- _security_mask 'Capacitor, Flux', -- _description 'Quantum Chromolytic Flux Capacitor', -- _comment -'bigboote@yoyodyne.planet10', -- _record_owner -'bigboote@yoyodyne.planet10', -- _record_creator -'bigboote@yoyodyne.planet10', -- _record_modifier -'bigboote@yoyodyne.planet10', -- _owner -'bigboote@yoyodyne.planet10', -- _creator +'sandbox:john.bigboote', -- _record_owner +'sandbox:john.bigboote', -- _record_creator +'sandbox:john.bigboote', -- _record_modifier +'sandbox:john.bigboote', -- _owner +'sandbox:john.bigboote', -- _creator '2002-09-09 01:06:51', -- _create_datetime -'bigboote@yoyodyne.planet10', -- _modifier +'sandbox:john.bigboote', -- _modifier '2002-09-09 01:06:51', -- _mod_datetime 'Flux Capacitor', -- _name 'FX-CAP', -- _base_id @@ -308,7 +308,7 @@ '4', -- _version 5, -- _version_sequence True, -- _is_head -'H2G2' -- _cm_authority +'sandbox:H2G2' -- _cm_authority ); INSERT INTO _part @@ -338,20 +338,20 @@ ) VALUES ( -'TEST.HOG.1', -- _oid +'sandbox:HOG.1', -- _oid 'Part', -- __schema_name 'HOG.1', -- _id -'http://pangalactic.us/test/lib/', -- _id_ns +'sandbox', -- _id_ns '0', -- _security_mask 'Space Hog', -- _description 'Really Big Spacecraft', -- _comment -'banzai@banzai.earth', -- _record_owner -'banzai@banzai.earth', -- _record_creator -'banzai@banzai.earth', -- _record_modifier -'banzai@banzai.earth', -- _owner -'banzai@banzai.earth', -- _creator +'sandbox:buckaroo.banzai', -- _record_owner +'sandbox:buckaroo.banzai', -- _record_creator +'sandbox:buckaroo.banzai', -- _record_modifier +'sandbox:buckaroo.banzai', -- _owner +'sandbox:buckaroo.banzai', -- _creator '2002-09-09 01:06:51', -- _create_datetime -'banzai@banzai.earth', -- _modifier +'sandbox:buckaroo.banzai', -- _modifier '2002-09-09 01:06:51', -- _mod_datetime 'Heart of Gold', -- _name 'HOG', -- _base_id @@ -359,7 +359,7 @@ '42', -- _version 42, -- _version_sequence True, -- _is_head -'H2G2' -- _cm_authority +'sandbox:H2G2' -- _cm_authority ); INSERT INTO _part @@ -389,20 +389,20 @@ ) VALUES ( -'TEST.MF Series A.1', -- _oid +'sandbox:MF Series A.1', -- _oid 'Part', -- __schema_name 'MF Series A.1', -- _id -'http://pangalactic.us/test/lib/', -- _id_ns +'sandbox', -- _id_ns '0', -- _security_mask 'Fusion Power Source, MF Series', -- _description 'Omni-Fuel, Compact Semi-Portable Fusion Power Module', -- _comment -'banzai@banzai.earth', -- _record_owner -'banzai@banzai.earth', -- _record_creator -'banzai@banzai.earth', -- _record_modifier -'banzai@banzai.earth', -- _owner -'banzai@banzai.earth', -- _creator +'sandbox:buckaroo.banzai', -- _record_owner +'sandbox:buckaroo.banzai', -- _record_creator +'sandbox:buckaroo.banzai', -- _record_modifier +'sandbox:buckaroo.banzai', -- _owner +'sandbox:buckaroo.banzai', -- _creator '2002-09-09 01:06:51', -- _create_datetime -'banzai@banzai.earth', -- _modifier +'sandbox:buckaroo.banzai', -- _modifier '2002-09-09 01:06:51', -- _mod_datetime 'Mr. Fusion', -- _name 'MF Series A', -- _base_id @@ -410,7 +410,7 @@ 'A10K', -- _version 42, -- _version_sequence True, -- _is_head -'H2G2' -- _cm_authority +'sandbox:H2G2' -- _cm_authority ); INSERT INTO _part @@ -440,20 +440,20 @@ ) VALUES ( -'TEST.OO-1.1', -- _oid +'sandbox:OO-1.1', -- _oid 'Part', -- __schema_name 'OO-1.1', -- _id -'http://pangalactic.us/test/lib/',-- _id_ns +'sandbox', -- _id_ns '0', -- _security_mask 'Overthruster, Oscillation', -- _description 'Oscillation Overthruster, Class 1', -- _comment -'banzai@banzai.earth', -- _record_owner -'banzai@banzai.earth', -- _record_creator -'banzai@banzai.earth', -- _record_modifier -'banzai@banzai.earth', -- _owner -'banzai@banzai.earth', -- _creator +'sandbox:buckaroo.banzai', -- _record_owner +'sandbox:buckaroo.banzai', -- _record_creator +'sandbox:buckaroo.banzai', -- _record_modifier +'sandbox:buckaroo.banzai', -- _owner +'sandbox:buckaroo.banzai', -- _creator '2002-09-09 01:06:51', -- _create_datetime -'banzai@banzai.earth', -- _modifier +'sandbox:buckaroo.banzai', -- _modifier '2002-09-09 01:06:51', -- _mod_datetime 'Oscillation Overthruster', -- _name 'OO-1', -- _base_id @@ -461,7 +461,7 @@ 'A', -- _version 2, -- _version_sequence True, -- _is_head -'H2G2' -- _cm_authority +'sandbox:H2G2' -- _cm_authority ); INSERT INTO _part @@ -491,20 +491,20 @@ ) VALUES ( -'TEST.OO-Def-1.1', -- _oid +'sandbox:OO-Def-1.1', -- _oid 'Part', -- __schema_name 'OO-Def-1.1', -- _id -'http://pangalactic.us/test/lib/', -- _id_ns +'sandbox', -- _id_ns '0', -- _security_mask 'Overthruster, Oscillation, Defective', -- _description 'DO NOT USE This Oscillation Overthruster!!', -- _comment -'lizardo@yoyodyne.planet10', -- _record_owner -'lizardo@yoyodyne.planet10', -- _record_creator -'lizardo@yoyodyne.planet10', -- _record_modifier -'lizardo@yoyodyne.planet10', -- _owner -'lizardo@yoyodyne.planet10', -- _creator +'sandbox:john.whorfin', -- _record_owner +'sandbox:john.whorfin', -- _record_creator +'sandbox:john.whorfin', -- _record_modifier +'sandbox:john.whorfin', -- _owner +'sandbox:john.whorfin', -- _creator '2002-09-09 01:06:51', -- _create_datetime -'lizardo@yoyodyne.planet10', -- _modifier +'sandbox:john.whorfin', -- _modifier '2002-09-09 01:06:51', -- _mod_datetime 'Defective Oscillation Overthruster', -- _name 'OO-Def-1', -- _base_id @@ -512,7 +512,7 @@ '666', -- _version 2, -- _version_sequence True, -- _is_head -'H2G2' -- _cm_authority +'sandbox:H2G2' -- _cm_authority ); END; Index: PanGalactic/src/sql/insertPartModels.sql diff -u PanGalactic/src/sql/insertPartModels.sql:1.7 PanGalactic/src/sql/insertPartModels.sql:1.8 --- PanGalactic/src/sql/insertPartModels.sql:1.7 Fri Jan 20 16:01:11 2006 +++ PanGalactic/src/sql/insertPartModels.sql Fri Jul 13 23:55:58 2007 @@ -1,6 +1,6 @@ /* PGER Demo PartModel data inserts. */ -/* $Id: insertPartModels.sql,v 1.7 2006/01/20 21:01:11 waterbug Exp $ */ +/* $Id: insertPartModels.sql,v 1.8 2007/07/14 03:55:58 waterbug Exp $ */ BEGIN; SET CONSTRAINTS ALL DEFERRED; @@ -28,24 +28,24 @@ ) VALUES ( -'TEST.PartModel.MMT-01.1-CAD.1', +'sandbox:PartModel.MMT-01.1-CAD.1', 'PartModel', -- __schema_name 'MMT-01.1-CAD.1', -- _id -'http://pangalactic.us/test/lib/', -- _id_ns +'sandbox', -- _id_ns '0', -- _security_mask 'Model of Twanger, Magic, Megawatt', -- _description 'Blah blah Twanger', -- _comment -'bigboote@yoyodyne.planet10', -- _record_owner -'bigboote@yoyodyne.planet10', -- _record_creator -'bigboote@yoyodyne.planet10', -- _record_modifier -'smallberries@yoyodyne.planet10', -- _owner -'smallberries@yoyodyne.planet10', -- _creator +'sandbox:john.bigboote', -- _record_owner +'sandbox:john.bigboote', -- _record_creator +'sandbox:john.bigboote', -- _record_modifier +'sandbox:john.smallberries', -- _owner +'sandbox:john.smallberries', -- _creator '2002-09-09 01:06:51', -- _create_datetime -'smallberries@yoyodyne.planet10', -- _modifier +'sandbox:john.smallberries', -- _modifier '2002-09-09 01:06:51', -- _mod_datetime 'Megawatt Magic Twanger Design Model', -- _name -'TEST.MMT-01.1', -- _parent -'TEST.MMT-01.1-CAD.1' -- _child +'sandbox:MMT-01.1', -- _parent +'sandbox:MMT-01.1-CAD.1' -- _child ); INSERT INTO _part_model @@ -71,24 +71,24 @@ ) VALUES ( -'TEST.PartModel.BTA-20.1-CAD.1', +'sandbox:PartModel.BTA-20.1-CAD.1', 'PartModel', -- __schema_name 'BTA-20.1-CAD.1', -- _id -'http://pangalactic.us/test/lib/', -- _id_ns +'sandbox', -- _id_ns '0', -- _security_mask 'Preliminary Twanging Assembly', -- _description 'Blah blah blah Blooper Twanging Assy.', -- _comment -'bigboote@yoyodyne.planet10', -- _record_owner -'bigboote@yoyodyne.planet10', -- _record_creator -'bigboote@yoyodyne.planet10', -- _record_modifier -'smallberries@yoyodyne.planet10', -- _owner -'smallberries@yoyodyne.planet10', -- _creator +'sandbox:john.bigboote', -- _record_owner +'sandbox:john.bigboote', -- _record_creator +'sandbox:john.bigboote', -- _record_modifier +'sandbox:john.smallberries', -- _owner +'sandbox:john.smallberries', -- _creator '2002-09-09 01:06:51', -- _create_datetime -'smallberries@yoyodyne.planet10', -- _modifier +'sandbox:john.smallberries', -- _modifier '2002-09-09 01:06:51', -- _mod_datetime 'Blooper Twanging Assembly, Preliminary Design', -- _name -'TEST.BTA-20.1', -- _parent -'TEST.BTA-20.1-CAD.1' -- _child +'sandbox:BTA-20.1', -- _parent +'sandbox:BTA-20.1-CAD.1' -- _child ); INSERT INTO _part_model @@ -114,24 +114,24 @@ ) VALUES ( -'TEST.PartModel.HM.200.1-CAD.1', +'sandbox:PartModel.HM.200.1-CAD.1', 'PartModel', -- __schema_name 'HM.200-CAD.1', -- _id -'http://pangalactic.us/test/lib/', -- _id_ns +'sandbox', -- _id_ns '0', -- _security_mask 'Mabob, Hoogie', -- _description 'Blah blah blah Hoogie Mabob', -- _comment -'bigboote@yoyodyne.planet10', -- _record_owner -'bigboote@yoyodyne.planet10', -- _record_creator -'bigboote@yoyodyne.planet10', -- _record_modifier -'smallberries@yoyodyne.planet10', -- _owner -'smallberries@yoyodyne.planet10', -- _creator +'sandbox:john.bigboote', -- _record_owner +'sandbox:john.bigboote', -- _record_creator +'sandbox:john.bigboote', -- _record_modifier +'sandbox:john.smallberries', -- _owner +'sandbox:john.smallberries', -- _creator '2002-09-09 01:06:51', -- _create_datetime -'smallberries@yoyodyne.planet10', -- _modifier +'sandbox:john.smallberries', -- _modifier '2002-09-09 01:06:51', -- _mod_datetime 'Hoogie Mabob v1.2', -- _name -'TEST.HM.200.1', -- _parent -'TEST.HM.200.1-CAD.1' -- _child +'sandbox:HM.200.1', -- _parent +'sandbox:HM.200.1-CAD.1' -- _child ); INSERT INTO _part_model @@ -157,24 +157,24 @@ ) VALUES ( -'TEST.PartModel.IDrive.1-CAD.1', +'sandbox:PartModel.IDrive.1-CAD.1', 'PartModel', -- __schema_name 'IDrive.1-CAD.1', -- _id -'http://pangalactic.us/test/lib/', -- _id_ns +'sandbox', -- _id_ns '0', -- _security_mask 'Drive, Improbability', -- _description 'Blah Improbability Drive', -- _comment -'bigboote@yoyodyne.planet10', -- _record_owner -'bigboote@yoyodyne.planet10', -- _record_creator -'bigboote@yoyodyne.planet10', -- _record_modifier -'bigboote@yoyodyne.planet10', -- _owner -'bigboote@yoyodyne.planet10', -- _creator +'sandbox:john.bigboote', -- _record_owner +'sandbox:john.bigboote', -- _record_creator +'sandbox:john.bigboote', -- _record_modifier +'sandbox:john.bigboote', -- _owner +'sandbox:john.bigboote', -- _creator '2002-09-09 01:06:51', -- _create_datetime -'bigboote@yoyodyne.planet10', -- _modifier +'sandbox:john.bigboote', -- _modifier '2002-09-09 01:06:51', -- _mod_datetime 'Drive, Improbability, v3B', -- _name -'TEST.IDrive.1', -- _parent -'TEST.IDrive.1-CAD.1' -- _child +'sandbox:IDrive.1', -- _parent +'sandbox:IDrive.1-CAD.1' -- _child ); INSERT INTO _part_model @@ -200,24 +200,24 @@ ) VALUES ( -'TEST.PartModel.B57SMB.1-CAD.1', +'sandbox:PartModel.B57SMB.1-CAD.1', 'PartModel', -- __schema_name 'B57SMB.1-CAD.1', -- _id -'http://pangalactic.us/test/lib/', -- _id_ns +'sandbox', -- _id_ns '0', -- _security_mask 'Computer, Hyper-Quantum, Subfemto', -- _description 'Blah blah blah Powerful Computer', -- _comment -'bigboote@yoyodyne.planet10', -- _record_owner -'bigboote@yoyodyne.planet10', -- _record_creator -'bigboote@yoyodyne.planet10', -- _record_modifier -'bigboote@yoyodyne.planet10', -- _owner -'bigboote@yoyodyne.planet10', -- _creator +'sandbox:john.bigboote', -- _record_owner +'sandbox:john.bigboote', -- _record_creator +'sandbox:john.bigboote', -- _record_modifier +'sandbox:john.bigboote', -- _owner +'sandbox:john.bigboote', -- _creator '2002-09-09 01:06:51', -- _create_datetime -'bigboote@yoyodyne.planet10', -- _modifier +'sandbox:john.bigboote', -- _modifier '2002-09-09 01:06:51', -- _mod_datetime 'Bambleweeny 57 Sub-Meson Brain (Mechanical Design)', -- _name -'TEST.B57SMB.1', -- _parent -'TEST.B57SMB.1-CAD.1' -- _child +'sandbox:B57SMB.1', -- _parent +'sandbox:B57SMB.1-CAD.1' -- _child ); INSERT INTO _part_model @@ -243,24 +243,24 @@ ) VALUES ( -'TEST.PartModel.FX-CAP.1-CAD.1', +'sandbox:PartModel.FX-CAP.1-CAD.1', 'PartModel', -- __schema_name 'FX-CAP.1-CAD.1', -- _id -'http://pangalactic.us/test/lib/', -- _id_ns +'sandbox', -- _id_ns '0', -- _security_mask 'Capacitor, Flux', -- _description 'Blah Blah Flux Capacitor', -- _comment -'bigboote@yoyodyne.planet10', -- _record_owner -'bigboote@yoyodyne.planet10', -- _record_creator -'bigboote@yoyodyne.planet10', -- _record_modifier -'bigboote@yoyodyne.planet10', -- _owner -'bigboote@yoyodyne.planet10', -- _creator +'sandbox:john.bigboote', -- _record_owner +'sandbox:john.bigboote', -- _record_creator +'sandbox:john.bigboote', -- _record_modifier +'sandbox:john.bigboote', -- _owner +'sandbox:john.bigboote', -- _creator '2002-09-09 01:06:51', -- _create_datetime -'bigboote@yoyodyne.planet10', -- _modifier +'sandbox:john.bigboote', -- _modifier '2002-09-09 01:06:51', -- _mod_datetime 'FX-v4 Flux Capacitor (MCAD, Preliminary)', -- _name -'TEST.FX-CAP.1', -- _parent -'TEST.FX-CAP.1-CAD.1' -- _child +'sandbox:FX-CAP.1', -- _parent +'sandbox:FX-CAP.1-CAD.1' -- _child ); INSERT INTO _part_model @@ -286,24 +286,24 @@ ) VALUES ( -'TEST.PartModel.HOG.1-CAD.1', +'sandbox:PartModel.HOG.1-CAD.1', 'PartModel', -- __schema_name 'HOG.1-CAD.1', -- _id -'http://pangalactic.us/test/lib/', -- _id_ns +'sandbox', -- _id_ns '0', -- _security_mask 'Heart of Gold Spacecraft', -- _description 'Blah Blah Heart of Gold', -- _comment -'banzai@banzai.earth', -- _record_owner -'banzai@banzai.earth', -- _record_creator -'banzai@banzai.earth', -- _record_modifier -'banzai@banzai.earth', -- _owner -'banzai@banzai.earth', -- _creator +'sandbox:buckaroo.banzai', -- _record_owner +'sandbox:buckaroo.banzai', -- _record_creator +'sandbox:buckaroo.banzai', -- _record_modifier +'sandbox:buckaroo.banzai', -- _owner +'sandbox:buckaroo.banzai', -- _creator '2002-09-09 01:06:51', -- _create_datetime -'banzai@banzai.earth', -- _modifier +'sandbox:buckaroo.banzai', -- _modifier '2002-09-09 01:06:51', -- _mod_datetime 'HOG-42 Spacecraft (Digital Mock-Up)', -- _name -'TEST.HOG.1', -- _parent -'TEST.HOG.1-CAD.1' -- _child +'sandbox:HOG.1', -- _parent +'sandbox:HOG.1-CAD.1' -- _child ); INSERT INTO _part_model @@ -329,24 +329,24 @@ ) VALUES ( -'TEST.PartModel.MF Series A.1-CAD.1', +'sandbox:PartModel.MF Series A.1-CAD.1', 'PartModel', -- __schema_name 'MF Series A.1-CAD.1', -- _id -'http://pangalactic.us/test/lib/', -- _id_ns +'sandbox', -- _id_ns '0', -- _security_mask 'Mr. Fusion A10K version 1 3D MCAD Model', -- _description 'Mr. Fusion A10K version 1 3D Mechanical CAD Design Model, Blah Blah', -- _comment -'banzai@banzai.earth', -- _record_owner -'banzai@banzai.earth', -- _record_creator -'banzai@banzai.earth', -- _record_modifier -'banzai@banzai.earth', -- _owner -'banzai@banzai.earth', -- _creator +'sandbox:buckaroo.banzai', -- _record_owner +'sandbox:buckaroo.banzai', -- _record_creator +'sandbox:buckaroo.banzai', -- _record_modifier +'sandbox:buckaroo.banzai', -- _owner +'sandbox:buckaroo.banzai', -- _creator '2002-09-09 01:06:51', -- _create_datetime -'banzai@banzai.earth', -- _modifier +'sandbox:buckaroo.banzai', -- _modifier '2002-09-09 01:06:51', -- _mod_datetime 'Mr. Fusion A10K (Mechanical Design)', -- _name -'TEST.MF Series A.1', -- _parent -'TEST.MF Series A.1-CAD.1' -- _child +'sandbox:MF Series A.1', -- _parent +'sandbox:MF Series A.1-CAD.1' -- _child ); INSERT INTO _part_model @@ -372,24 +372,24 @@ ) VALUES ( -'TEST.PartModel.OO-1.1-CAD.1', +'sandbox:PartModel.OO-1.1-CAD.1', 'PartModel', -- __schema_name 'OO-1.1-CAD.1', -- _id -'http://pangalactic.us/test/lib/', -- _id_ns +'sandbox', -- _id_ns '0', -- _security_mask 'Overthruster, Oscillation', -- _description 'Oscillation Overthruster', -- _comment -'banzai@banzai.earth', -- _record_owner -'banzai@banzai.earth', -- _record_creator -'banzai@banzai.earth', -- _record_modifier -'banzai@banzai.earth', -- _owner -'banzai@banzai.earth', -- _creator +'sandbox:buckaroo.banzai', -- _record_owner +'sandbox:buckaroo.banzai', -- _record_creator +'sandbox:buckaroo.banzai', -- _record_modifier +'sandbox:buckaroo.banzai', -- _owner +'sandbox:buckaroo.banzai', -- _creator '2002-09-09 01:06:51', -- _create_datetime -'banzai@banzai.earth', -- _modifier +'sandbox:buckaroo.banzai', -- _modifier '2002-09-09 01:06:51', -- _mod_datetime 'Oscillation Overthruster OO-1-A (MCAD)', -- _name -'TEST.OO-1.1', -- _parent -'TEST.OO-1.1-CAD.1' -- _child +'sandbox:OO-1.1', -- _parent +'sandbox:OO-1.1-CAD.1' -- _child ); INSERT INTO _part_model @@ -415,24 +415,24 @@ ) VALUES ( -'TEST.PartModel.OO-Def-1.1-CAD.1', +'sandbox:PartModel.OO-Def-1.1-CAD.1', 'PartModel', -- __schema_name 'OO-Def-1.1-CAD.1', -- _id -'http://pangalactic.us/test/lib/', -- _id_ns +'sandbox', -- _id_ns '0', -- _security_mask 'Overthruster, Oscillation', -- _description 'Def Oscillation Overthruster', -- _comment -'bigboote@yoyodyne.planet10', -- _record_owner -'bigboote@yoyodyne.planet10', -- _record_creator -'bigboote@yoyodyne.planet10', -- _record_modifier -'lizardo@yoyodyne.planet10', -- _owner -'lizardo@yoyodyne.planet10', -- _creator +'sandbox:john.bigboote', -- _record_owner +'sandbox:john.bigboote', -- _record_creator +'sandbox:john.bigboote', -- _record_modifier +'sandbox:john.whorfin', -- _owner +'sandbox:john.whorfin', -- _creator '2002-09-09 01:06:51', -- _create_datetime -'lizardo@yoyodyne.planet10', -- _modifier +'sandbox:john.whorfin', -- _modifier '2002-09-09 01:06:51', -- _mod_datetime 'Oscillation Overthruster, Defective, v.57 (Design)', -- _name -'TEST.OO-Def-1.1', -- _parent -'TEST.OO-Def-1.1-CAD.1' -- _child +'sandbox:OO-Def-1.1', -- _parent +'sandbox:OO-Def-1.1-CAD.1' -- _child ); END; Index: PanGalactic/src/sql/insertTestData.sql diff -u PanGalactic/src/sql/insertTestData.sql:1.25 PanGalactic/src/sql/insertTestData.sql:1.26 --- PanGalactic/src/sql/insertTestData.sql:1.25 Sat Jul 29 15:12:05 2006 +++ PanGalactic/src/sql/insertTestData.sql Fri Jul 13 23:55:58 2007 @@ -1,7 +1,7 @@ /* Test data initialization script. * */ -/* $Id: insertTestData.sql,v 1.25 2006/07/29 19:12:05 waterbug Exp $ */ +/* $Id: insertTestData.sql,v 1.26 2007/07/14 03:55:58 waterbug Exp $ */ /* TODO: Add the following 'Roles' and assign them ... 'Just Some Guy' @@ -26,12 +26,12 @@ ) VALUES ( - 'H2G2', + 'sandbox:H2G2', 'Project', 'H2G2', - 'http://pangalactic.us/test/lib/', - 'admin', - 'admin', + 'sandbox', + 'pgefobjects:admin', + 'pgefobjects:admin', 'Hitchhikers Guide to the Galaxy' ); @@ -47,13 +47,13 @@ ) VALUES ( - 'OTHER', + 'sandbox:OTHER', 'Project', 'OTHER', - 'http://pangalactic.us/test/lib/', - 'admin', - 'admin', - 'The Other Test Project' + 'sandbox', + 'pgefobjects:admin', + 'pgefobjects:admin', + 'The Other Project' ); INSERT INTO _project @@ -68,13 +68,13 @@ ) VALUES ( - 'OTHEROTHER', + 'sandbox:OTHEROTHER', 'Project', 'OTHEROTHER', - 'http://pangalactic.us/test/lib/', - 'admin', - 'admin', - 'The Other Other Test Project' + 'sandbox', + 'pgefobjects:admin', + 'pgefobjects:admin', + 'The Other Other Project' ); INSERT INTO _person @@ -99,16 +99,16 @@ ) VALUES ( - 'Fester.Bestertester@earth.milkyway.univ', + 'test:fester.bestertester', 'Person', - 'Fester Bestertester', - 'http://pangalactic.us/test/lib/', - 'admin', - 'admin', - 'admin', - 'admin', - 'admin', - 'admin', + 'fester.bestertester', + 'test', + 'pgefobjects:admin', + 'pgefobjects:admin', + 'pgefobjects:admin', + 'pgefobjects:admin', + 'pgefobjects:admin', + 'pgefobjects:admin', 'Fester.Bestertester@earth.milkyway.univ', 'Fester', 'D', @@ -124,7 +124,7 @@ ) VALUES ( - 'Fester.Bestertester@earth.milkyway.univ' + 'test:fester.bestertester' ); INSERT INTO _person @@ -149,16 +149,16 @@ ) VALUES ( - 'zaphod@hog.univ', + 'sandbox:zaphod.beeblebrox', 'Person', - 'Zaphod Beeblebrox', - 'http://pangalactic.us/test/lib/', - 'admin', - 'admin', - 'admin', - 'admin', - 'admin', - 'admin', + 'zaphod.beeblebrox', + 'sandbox', + 'pgefobjects:admin', + 'pgefobjects:admin', + 'pgefobjects:admin', + 'pgefobjects:admin', + 'pgefobjects:admin', + 'pgefobjects:admin', 'zaphod@hog.univ', 'Zaphod', 'Z', @@ -174,7 +174,7 @@ ) VALUES ( - 'zaphod@hog.univ' + 'sandbox:zaphod.beeblebrox' ); INSERT INTO _person @@ -195,12 +195,12 @@ ) VALUES ( - 'banzai@banzai.earth', + 'sandbox:buckaroo.banzai', 'Person', - 'banzai@banzai.earth', - 'http://pangalactic.us/test/lib/', - 'admin', - 'admin', + 'buckaroo.banzai', + 'sandbox', + 'pgefobjects:admin', + 'pgefobjects:admin', 'banzai@banzai.earth', 'Buckaroo', '', @@ -216,7 +216,7 @@ ) VALUES ( - 'banzai@banzai.earth' + 'sandbox:buckaroo.banzai' ); INSERT INTO _person @@ -236,12 +236,12 @@ ) VALUES ( - 'bigboote@yoyodyne.planet10', + 'sandbox:john.bigboote', 'Person', - 'bigboote@yoyodyne.planet10', - 'http://pangalactic.us/test/lib/', - 'admin', - 'admin', + 'john.bigboote', + 'sandbox', + 'pgefobjects:admin', + 'pgefobjects:admin', 'bigboote@yoyodyne.planet10', 'John', '', @@ -256,7 +256,7 @@ ) VALUES ( - 'bigboote@yoyodyne.planet10' + 'sandbox:john.bigboote' ); INSERT INTO _person @@ -276,12 +276,12 @@ ) VALUES ( - 'smallberries@yoyodyne.planet10', + 'sandbox:john.smallberries', 'Person', - 'smallberries@yoyodyne.planet10', - 'http://pangalactic.us/test/lib/', - 'admin', - 'admin', + 'john.smallberries', + 'sandbox', + 'pgefobjects:admin', + 'pgefobjects:admin', 'smallberries@yoyodyne.planet10', 'John', '', @@ -296,7 +296,7 @@ ) VALUES ( - 'smallberries@yoyodyne.planet10' + 'sandbox:john.smallberries' ); INSERT INTO _person @@ -316,12 +316,12 @@ ) VALUES ( - 'lizardo@yoyodyne.planet10', + 'sandbox:john.whorfin', 'Person', - 'lizardo@yoyodyne.planet10', - 'http://pangalactic.us/test/lib/', - 'admin', - 'admin', + 'john.whorfin', + 'sandbox', + 'pgefobjects:admin', + 'pgefobjects:admin', 'lizardo@yoyodyne.planet10', 'John', '', @@ -336,7 +336,7 @@ ) VALUES ( - 'lizardo@yoyodyne.planet10' + 'sandbox:john.whorfin' ); END; From waterbug at step.nasa.gov Sun Jul 15 14:38:45 2007 From: waterbug at step.nasa.gov (waterbug CVS) Date: Sun Jul 15 14:38:46 2007 Subject: [pangalactic-commits] Fixes the *updateObjects tests. Message-ID: <200707151838.l6FIcjbm015231@ned.gsfc.nasa.gov> Modified files: PanGalactic/TODO 1.133 1.134 PanGalactic/pangalactic/test/test_xmlrpc_updateObjects.py 1.4 1.5 PanGalactic/pangalactic/test/utils4test.py 1.41 1.42 PanGalactic/src/sql/insertTestData.sql 1.26 1.27 Log message: Fixes the *updateObjects tests. Index: PanGalactic/TODO diff -u PanGalactic/TODO:1.133 PanGalactic/TODO:1.134 --- PanGalactic/TODO:1.133 Thu Jul 12 12:41:58 2007 +++ PanGalactic/TODO Sun Jul 15 14:38:41 2007 @@ -38,6 +38,8 @@ specific notebook pages), or add rows as necessary [-] change dispatcher's 'updates received' message and listeners in the same way +[-] *** BUG: p.pger.Pger.updateObjects should check whether the objects to be + updated exist (currently, gives a traceback if they don't) [*] ENHANCEMENTS: give PanGalaxianObject some reasonable defaults: [-] new oids: each object will have a local oid in the following default canonical format: @@ -634,5 +636,5 @@ [+] one-many (aggregate attrs) -------------------------------------------------------------------------- -# $Id: TODO,v 1.133 2007/07/12 16:41:58 waterbug Exp $ +# $Id: TODO,v 1.134 2007/07/15 18:38:41 waterbug Exp $ Index: PanGalactic/src/sql/insertTestData.sql diff -u PanGalactic/src/sql/insertTestData.sql:1.26 PanGalactic/src/sql/insertTestData.sql:1.27 --- PanGalactic/src/sql/insertTestData.sql:1.26 Fri Jul 13 23:55:58 2007 +++ PanGalactic/src/sql/insertTestData.sql Sun Jul 15 14:38:43 2007 @@ -1,7 +1,7 @@ /* Test data initialization script. * */ -/* $Id: insertTestData.sql,v 1.26 2007/07/14 03:55:58 waterbug Exp $ */ +/* $Id: insertTestData.sql,v 1.27 2007/07/15 18:38:43 waterbug Exp $ */ /* TODO: Add the following 'Roles' and assign them ... 'Just Some Guy' @@ -26,55 +26,13 @@ ) VALUES ( - 'sandbox:H2G2', + 'test:TEST', 'Project', - 'H2G2', - 'sandbox', - 'pgefobjects:admin', - 'pgefobjects:admin', - 'Hitchhikers Guide to the Galaxy' -); - -INSERT INTO _project -( - _oid, - __schema_name, - _id, - _id_ns, - _record_owner, - _record_creator, - _name -) -VALUES -( - 'sandbox:OTHER', - 'Project', - 'OTHER', - 'sandbox', - 'pgefobjects:admin', - 'pgefobjects:admin', - 'The Other Project' -); - -INSERT INTO _project -( - _oid, - __schema_name, - _id, - _id_ns, - _record_owner, - _record_creator, - _name -) -VALUES -( - 'sandbox:OTHEROTHER', - 'Project', - 'OTHEROTHER', - 'sandbox', + 'TEST', + 'test', 'pgefobjects:admin', 'pgefobjects:admin', - 'The Other Other Project' + 'The Testing Project' ); INSERT INTO _person @@ -127,217 +85,5 @@ 'test:fester.bestertester' ); -INSERT INTO _person -( - _oid, - __schema_name, - _id, - _id_ns, - _owner, - _creator, - _modifier, - _record_owner, - _record_creator, - _record_modifier, - _email, - _fname, - _mi_or_name, - _lname, - _org, - _phone, - _god -) -VALUES -( - 'sandbox:zaphod.beeblebrox', - 'Person', - 'zaphod.beeblebrox', - 'sandbox', - 'pgefobjects:admin', - 'pgefobjects:admin', - 'pgefobjects:admin', - 'pgefobjects:admin', - 'pgefobjects:admin', - 'pgefobjects:admin', - 'zaphod@hog.univ', - 'Zaphod', - 'Z', - 'Beeblebrox', - 'TO1', - '1-800-ZAPHODB', - '0' -); - -INSERT INTO _passwd -( - _oid -) -VALUES -( - 'sandbox:zaphod.beeblebrox' -); - -INSERT INTO _person -( - _oid, - __schema_name, - _id, - _id_ns, - _record_owner, - _record_creator, - _email, - _fname, - _mi_or_name, - _lname, - _org, - _phone, - _god -) -VALUES -( - 'sandbox:buckaroo.banzai', - 'Person', - 'buckaroo.banzai', - 'sandbox', - 'pgefobjects:admin', - 'pgefobjects:admin', - 'banzai@banzai.earth', - 'Buckaroo', - '', - 'Banzai', - 'BANZA', - 'banzafone', - '0' -); - -INSERT INTO _passwd -( - _oid -) -VALUES -( - 'sandbox:buckaroo.banzai' -); - -INSERT INTO _person -( - _oid, - __schema_name, - _id, - _id_ns, - _record_owner, - _record_creator, - _email, - _fname, - _mi_or_name, - _lname, - _org, - _phone -) -VALUES -( - 'sandbox:john.bigboote', - 'Person', - 'john.bigboote', - 'sandbox', - 'pgefobjects:admin', - 'pgefobjects:admin', - 'bigboote@yoyodyne.planet10', - 'John', - '', - 'Bigboote', - 'YOYOD', - 'yoyofone' -); - -INSERT INTO _passwd -( - _oid -) -VALUES -( - 'sandbox:john.bigboote' -); - -INSERT INTO _person -( - _oid, - __schema_name, - _id, - _id_ns, - _record_owner, - _record_creator, - _email, - _fname, - _mi_or_name, - _lname, - _org, - _phone -) -VALUES -( - 'sandbox:john.smallberries', - 'Person', - 'john.smallberries', - 'sandbox', - 'pgefobjects:admin', - 'pgefobjects:admin', - 'smallberries@yoyodyne.planet10', - 'John', - '', - 'Smallberries', - 'YOYOD', - 'yoyofone' -); - -INSERT INTO _passwd -( - _oid -) -VALUES -( - 'sandbox:john.smallberries' -); - -INSERT INTO _person -( - _oid, - __schema_name, - _id, - _id_ns, - _record_owner, - _record_creator, - _email, - _fname, - _mi_or_name, - _lname, - _org, - _phone -) -VALUES -( - 'sandbox:john.whorfin', - 'Person', - 'john.whorfin', - 'sandbox', - 'pgefobjects:admin', - 'pgefobjects:admin', - 'lizardo@yoyodyne.planet10', - 'John', - '', - 'Whorfin', - 'YOYOD', - 'yoyofone' -); - -INSERT INTO _passwd -( - _oid -) -VALUES -( - 'sandbox:john.whorfin' -); - END; Index: PanGalactic/pangalactic/test/utils4test.py diff -u PanGalactic/pangalactic/test/utils4test.py:1.41 PanGalactic/pangalactic/test/utils4test.py:1.42 --- PanGalactic/pangalactic/test/utils4test.py:1.41 Fri Jul 13 23:55:57 2007 +++ PanGalactic/pangalactic/test/utils4test.py Sun Jul 15 14:38:42 2007 @@ -1,4 +1,4 @@ -# $Id: utils4test.py,v 1.41 2007/07/14 03:55:57 waterbug Exp $ +# $Id: utils4test.py,v 1.42 2007/07/15 18:38:42 waterbug Exp $ """ Utilities for testing. @@ -232,7 +232,7 @@ """ run_id = run_id or genRunId() test_objects = [] - proj_id = genId('Project', test_id, run_id) + proj_id = 'TEST' pt1_id = genId('Part-1', test_id, run_id) pt2_id = genId('Part-2', test_id, run_id) pt3_id = genId('FX CAP', test_id, run_id) @@ -260,66 +260,66 @@ # Meaning we don't care about adding or versioning (the default) ... if not versionable and not addable and not updateable: test_objects.append(mime1) - zaphod = initTestObject('Person', registry, 'zaphod.beeblebrox', - test_id=test_id, id_ns=id_ns, name='Zaphod Beeblebrox') + fester = initTestObject('Person', registry, 'fester.bestertester', + test_id=test_id, id_ns=id_ns, name='Fester Bestertester') if not addable and not versionable and updateable: - test_objects.append(zaphod) + test_objects.append(fester) file1 = initTestObject('FileLink', registry, file1_id, test_id=test_id, id_ns=id_ns, role='system model', user_file_name='thingy.p21', bytes=42000, mime_type=mime1, - owner=zaphod) + owner=fester) if not versionable and not updateable: test_objects.append(file1) file2 = initTestObject('FileLink', registry, file2_id, test_id=test_id, id_ns=id_ns, role='referenced part', user_file_name='thingy_libpart1.p21', bytes=12345, - mime_type=mime1, owner=zaphod) + mime_type=mime1, owner=fester) if not versionable and not updateable: test_objects.append(file2) rep1 = initTestObject('Representation', registry, rep1_id, test_id=test_id, id_ns=id_ns, files=[file1, file2], rep_purpose='exchange', generable=False, composable=True, - is_object_source=True, owner=zaphod) + is_object_source=True, owner=fester) if not versionable and not updateable: test_objects.append(rep1) p = initTestObject('Project', registry, proj_id, test_id=test_id, - id_ns=id_ns, name='The Project') + id_ns=id_ns, name='The Testing Project') if not addable and not versionable and updateable: test_objects.append(p) pt1 = initTestObject('Part', registry, pt1_id, test_id=test_id, id_ns=id_ns, version='A', iteration=0, - name='Part 1A', cm_authority=p, owner=zaphod) + name='Part 1A', cm_authority=p, owner=fester) if versionable and not updateable: test_objects.append(pt1) pt2 = initTestObject('Part', registry, pt2_id, test_id=test_id, id_ns=id_ns, version='B', iteration=1, - name='Part 1B', cm_authority=p, owner=zaphod) + name='Part 1B', cm_authority=p, owner=fester) if versionable and not updateable: test_objects.append(pt2) pt3 = initTestObject('Part', registry, pt3_id, base_id=pt3_base_id, id_ns='http://pangalactic.us/test/lib/', version='working', iteration=0, - name=pt3_name, cm_authority='sandbox:H2G2', owner=zaphod) + name=pt3_name, cm_authority='sandbox:H2G2', owner=fester) if versionable and not updateable: test_objects.append(pt3) mo1 = initTestObject('Model', registry, mo1_id, test_id=test_id, id_ns=id_ns, cm_authority=p, name=mo1_name, - owner=zaphod) + owner=fester) if versionable and not updateable: test_objects.append(mo1) mo2 = initTestObject('Model', registry, mo2_id, test_id=test_id, id_ns=id_ns, cm_authority=p, name=mo2_name, - owner=zaphod) + owner=fester) if versionable and not updateable: test_objects.append(mo2) mo3 = initTestObject('Model', registry, mo3_id, test_id=test_id, id_ns=id_ns, cm_authority=p, name=mo3_name, - owner=zaphod) + owner=fester) if versionable and not updateable: test_objects.append(mo3) mo4 = initTestObject('Model', registry, mo4_id, test_id=test_id, id_ns=id_ns, cm_authority=p, name=mo4_name, - representations=[rep1], owner=zaphod) + representations=[rep1], owner=fester) if versionable and not updateable: test_objects.append(mo4) pm1 = initTestObject('PartModel', registry, pm1_id, test_id=test_id, @@ -346,7 +346,7 @@ print """test objects (adding and versioning are not issues): =============================================================== 1 Mime ............. mime1 - 1 Person ........... zaphod + 1 Person ........... fester 2 FileLinks ........ file1, file2 1 Representation ... rep1 1 Project .......... p @@ -377,7 +377,7 @@ if printout and updateable: print """Test objects are: =============================================================== - 1 Person ........... zaphod + 1 Person ........... fester 1 Project .......... p (OTHEROTHER) =============================================================== (%s objects) Index: PanGalactic/pangalactic/test/test_xmlrpc_updateObjects.py diff -u PanGalactic/pangalactic/test/test_xmlrpc_updateObjects.py:1.4 PanGalactic/pangalactic/test/test_xmlrpc_updateObjects.py:1.5 --- PanGalactic/pangalactic/test/test_xmlrpc_updateObjects.py:1.4 Fri Jul 13 23:55:57 2007 +++ PanGalactic/pangalactic/test/test_xmlrpc_updateObjects.py Sun Jul 15 14:38:42 2007 @@ -10,7 +10,7 @@ from pangalactic.repo.pgerxmlrpc import PgerXmlrpcService from pangalactic.test.utils4test import genLinkedTestObjects -xmlrpcsrv = PgerXmlrpcService(PGER, userid='test:fester.bestertester') +xmlrpcsrv = PgerXmlrpcService(userid='test:fester.bestertester') r = PGER.db.registry # create test objects From waterbug at step.nasa.gov Sun Jul 15 14:41:06 2007 From: waterbug at step.nasa.gov (waterbug CVS) Date: Sun Jul 15 14:41:07 2007 Subject: [pangalactic-commits] Additional mods for new *updateObjects tests. Message-ID: <200707151841.l6FIf6Vr015263@ned.gsfc.nasa.gov> Modified files: PanGalactic/src/sql/insertSandboxData.sql None 1.1 PanGalactic/src/sql/populate_pgerdb.sh 1.12 1.13 Log message: Additional mods for new *updateObjects tests. Index: PanGalactic/src/sql/populate_pgerdb.sh diff -u PanGalactic/src/sql/populate_pgerdb.sh:1.12 PanGalactic/src/sql/populate_pgerdb.sh:1.13 --- PanGalactic/src/sql/populate_pgerdb.sh:1.12 Thu Dec 15 19:57:21 2005 +++ PanGalactic/src/sql/populate_pgerdb.sh Sun Jul 15 14:41:05 2007 @@ -1,11 +1,12 @@ #!/bin/bash -# $Id: populate_pgerdb.sh,v 1.12 2005/12/16 00:57:21 waterbug Exp $ +# $Id: populate_pgerdb.sh,v 1.13 2007/07/15 18:41:05 waterbug Exp $ psql pgerdb < insertRefData.sql psql pgerdb < insertMediaTypes.sql psql pgerdb < insertOrganizations.sql psql pgerdb < insertTestData.sql +psql pgerdb < insertSandboxData.sql # python fscdatamunge.py psql pgerdb < insertParts.sql psql pgerdb < insertModels.sql From waterbug at step.nasa.gov Mon Jul 16 01:23:17 2007 From: waterbug at step.nasa.gov (waterbug CVS) Date: Mon Jul 16 01:23:19 2007 Subject: [pangalactic-commits] Added obj.extract() test to test_pgefobject ... Message-ID: <200707160523.l6G5NHLC016491@ned.gsfc.nasa.gov> Modified files: PanGalactic/pangalactic/test/test_pgefobject.py 1.3 1.4 PanGalactic/pangalactic/test/utils4test.py 1.42 1.43 Log message: Added obj.extract() test to test_pgefobject ... still need to get float working. Index: PanGalactic/pangalactic/test/utils4test.py diff -u PanGalactic/pangalactic/test/utils4test.py:1.42 PanGalactic/pangalactic/test/utils4test.py:1.43 --- PanGalactic/pangalactic/test/utils4test.py:1.42 Sun Jul 15 14:38:42 2007 +++ PanGalactic/pangalactic/test/utils4test.py Mon Jul 16 01:23:15 2007 @@ -1,4 +1,4 @@ -# $Id: utils4test.py,v 1.42 2007/07/15 18:38:42 waterbug Exp $ +# $Id: utils4test.py,v 1.43 2007/07/16 05:23:15 waterbug Exp $ """ Utilities for testing. @@ -23,12 +23,30 @@ # property for each. ## # id and id_ns are required for PgefObject - id = PgefPropertySpec(id='stringattr', id_ns='test', + id = PgefPropertySpec(id='id', id_ns='test', domain='PgefObject', range='str', property_type='datatype') - id_ns = PgefPropertySpec(id='stringattr', id_ns='test', + id_ns = PgefPropertySpec(id='id_ns', id_ns='test', domain='PgefObject', range='str', property_type='datatype') + stringprop = PgefPropertySpec(id='stringprop', id_ns='test', + domain='PgefObject', range='str', + property_type='datatype') + intprop = PgefPropertySpec(id='intprop', id_ns='test', + domain='PgefObject', range='int', + property_type='datatype') + # floatprop = PgefPropertySpec(id='floatprop', id_ns='test', + # domain='PgefObject', range='int', + # property_type='datatype') + boolprop = PgefPropertySpec(id='boolprop', id_ns='test', + domain='PgefObject', range='float', + property_type='datatype') + datetimeprop = PgefPropertySpec(id='datetimeprop', id_ns='test', + domain='PgefObject', range='datetime', + property_type='datatype') + objectprop = PgefPropertySpec(id='objectprop', id_ns='test', + domain='PgefObject', range='Identifiable', + property_type='object') def genRunId(dt=None): Index: PanGalactic/pangalactic/test/test_pgefobject.py diff -u PanGalactic/pangalactic/test/test_pgefobject.py:1.3 PanGalactic/pangalactic/test/test_pgefobject.py:1.4 --- PanGalactic/pangalactic/test/test_pgefobject.py:1.3 Fri Jul 13 12:08:26 2007 +++ PanGalactic/pangalactic/test/test_pgefobject.py Mon Jul 16 01:23:15 2007 @@ -1,9 +1,11 @@ -# $Id: test_pgefobject.py,v 1.3 2007/07/13 16:08:26 waterbug Exp $ +# $Id: test_pgefobject.py,v 1.4 2007/07/16 05:23:15 waterbug Exp $ """ Unit tests for pangalactic.meta.pgefobject """ +from datetime import datetime + from twisted.trial import unittest import zope.interface as zi @@ -11,10 +13,15 @@ from pangalactic.meta.pgefobject import PgefObject from pangalactic.node.uberorb import orb from pangalactic.test.utils4test import genRunId, genLinkedTestObjects +from pangalactic.test.utils4test import TestSchema -testobject = PgefObject(orb.interfaces['Identifiable'], - id='spam', id_ns='eggs') +dt = datetime(2006, 12, 17, 12, 38, 14) +refobject = PgefObject(orb.interfaces['Identifiable'], id='spam', id_ns='test') +testobject = PgefObject(TestSchema, id='eggs', id_ns='test', stringprop='Ni', + intprop=42, boolprop=True, + datetimeprop=dt, objectprop=refobject) +floatprop = 3.141592 run_id = genRunId() test_id = 'TPO' @@ -30,7 +37,7 @@ def test_02_PgefObjectInstanceProvidesSchemaInterface(self): """CASE: PgefObject instance provides its _schema interface""" - value = orb.interfaces['Identifiable'].providedBy(testobject) + value = TestSchema.providedBy(testobject) expected = True self.failUnlessEqual(expected, value) @@ -44,8 +51,11 @@ # schema as the test object -- compare the result (extract) value by # value with the expected result (a dictionary that maps the property # names to their cooked values). - value = 'somekindastring' - expected = 'somekindastring' + value = testobject.extract() + expected = {'_schema_name' : 'TestSchema', 'id' : 'eggs', + 'id_ns' : 'test', 'stringprop' : 'Ni', 'intprop' : '42', + 'boolprop' : 'True', + 'datetimeprop' : '2006-12-17 12:38:14', + 'objectprop' : 'test:spam'} self.failUnlessEqual(expected, value) - From waterbug at step.nasa.gov Mon Jul 16 09:54:21 2007 From: waterbug at step.nasa.gov (waterbug CVS) Date: Mon Jul 16 09:54:22 2007 Subject: [pangalactic-commits] Fix for test_chr_runQueryMapped (all tests pass now!). Message-ID: <200707161354.l6GDsLdX021694@ned.gsfc.nasa.gov> Modified files: PanGalactic/pangalactic/test/test_chronosynclastic_runQueryMapped.py 1.6 1.7 Log message: Fix for test_chr_runQueryMapped (all tests pass now!). Index: PanGalactic/pangalactic/test/test_chronosynclastic_runQueryMapped.py diff -u PanGalactic/pangalactic/test/test_chronosynclastic_runQueryMapped.py:1.6 PanGalactic/pangalactic/test/test_chronosynclastic_runQueryMapped.py:1.7 --- PanGalactic/pangalactic/test/test_chronosynclastic_runQueryMapped.py:1.6 Mon Feb 12 19:02:47 2007 +++ PanGalactic/pangalactic/test/test_chronosynclastic_runQueryMapped.py Mon Jul 16 09:54:19 2007 @@ -1,4 +1,4 @@ -# $Id: test_chronosynclastic_runQueryMapped.py,v 1.6 2007/02/13 00:02:47 waterbug Exp $ +# $Id: test_chronosynclastic_runQueryMapped.py,v 1.7 2007/07/16 13:54:19 waterbug Exp $ """ Functional test for pangalactic.repo.pgerdb module @@ -29,7 +29,7 @@ inf = Infundibulum() q = sql.buildSelect('_representation', 0, - ('_id_ns', 'LIKE', 'test')) + ('_id_ns', 'LIKE', 'sandbox')) res = inf._runQueryMapped(*q) res.addCallbacks(success, failure) From waterbug at step.nasa.gov Mon Jul 16 11:46:13 2007 From: waterbug at step.nasa.gov (waterbug CVS) Date: Mon Jul 16 11:46:14 2007 Subject: [pangalactic-commits] Put float property back in test_pgefobject. Message-ID: <200707161546.l6GFkDnT023359@ned.gsfc.nasa.gov> Modified files: PanGalactic/pangalactic/test/test_pgefobject.py 1.4 1.5 PanGalactic/pangalactic/test/utils4test.py 1.43 1.44 Log message: Put float property back in test_pgefobject. Index: PanGalactic/pangalactic/test/test_pgefobject.py diff -u PanGalactic/pangalactic/test/test_pgefobject.py:1.4 PanGalactic/pangalactic/test/test_pgefobject.py:1.5 --- PanGalactic/pangalactic/test/test_pgefobject.py:1.4 Mon Jul 16 01:23:15 2007 +++ PanGalactic/pangalactic/test/test_pgefobject.py Mon Jul 16 11:46:11 2007 @@ -1,4 +1,4 @@ -# $Id: test_pgefobject.py,v 1.4 2007/07/16 05:23:15 waterbug Exp $ +# $Id: test_pgefobject.py,v 1.5 2007/07/16 15:46:11 waterbug Exp $ """ Unit tests for pangalactic.meta.pgefobject @@ -7,21 +7,56 @@ from datetime import datetime from twisted.trial import unittest -import zope.interface as zi +from zope.interface import Interface from pangalactic.meta.interfaces import IPgefObject, IMofObject from pangalactic.meta.pgefobject import PgefObject +from pangalactic.meta.pgefpropertyspec import PgefPropertySpec from pangalactic.node.uberorb import orb from pangalactic.test.utils4test import genRunId, genLinkedTestObjects -from pangalactic.test.utils4test import TestSchema + + +class TestSchema(Interface): + """ + An Interface for test purposes. + """ + ## + # Ideally, this should iterate over the datatypes, creating a schema + # property for each. + ## + # id and id_ns are required for PgefObject + id = PgefPropertySpec(id='id', id_ns='test', + domain='PgefObject', range='str', + property_type='datatype') + id_ns = PgefPropertySpec(id='id_ns', id_ns='test', + domain='PgefObject', range='str', + property_type='datatype') + stringprop = PgefPropertySpec(id='stringprop', id_ns='test', + domain='PgefObject', range='str', + property_type='datatype') + intprop = PgefPropertySpec(id='intprop', id_ns='test', + domain='PgefObject', range='int', + property_type='datatype') + floatprop = PgefPropertySpec(id='floatprop', id_ns='test', + domain='PgefObject', range='int', + property_type='datatype') + boolprop = PgefPropertySpec(id='boolprop', id_ns='test', + domain='PgefObject', range='float', + property_type='datatype') + datetimeprop = PgefPropertySpec(id='datetimeprop', id_ns='test', + domain='PgefObject', range='datetime', + property_type='datatype') + objectprop = PgefPropertySpec(id='objectprop', id_ns='test', + domain='PgefObject', range='Identifiable', + property_type='object') dt = datetime(2006, 12, 17, 12, 38, 14) refobject = PgefObject(orb.interfaces['Identifiable'], id='spam', id_ns='test') testobject = PgefObject(TestSchema, id='eggs', id_ns='test', stringprop='Ni', - intprop=42, boolprop=True, + intprop=42, boolprop=True, floatprop = 3.141592, datetimeprop=dt, objectprop=refobject) -floatprop = 3.141592 + run_id = genRunId() test_id = 'TPO' @@ -54,7 +89,7 @@ value = testobject.extract() expected = {'_schema_name' : 'TestSchema', 'id' : 'eggs', 'id_ns' : 'test', 'stringprop' : 'Ni', 'intprop' : '42', - 'boolprop' : 'True', + 'boolprop' : 'True', 'floatprop' : '3.141592', 'datetimeprop' : '2006-12-17 12:38:14', 'objectprop' : 'test:spam'} self.failUnlessEqual(expected, value) Index: PanGalactic/pangalactic/test/utils4test.py diff -u PanGalactic/pangalactic/test/utils4test.py:1.43 PanGalactic/pangalactic/test/utils4test.py:1.44 --- PanGalactic/pangalactic/test/utils4test.py:1.43 Mon Jul 16 01:23:15 2007 +++ PanGalactic/pangalactic/test/utils4test.py Mon Jul 16 11:46:11 2007 @@ -1,4 +1,4 @@ -# $Id: utils4test.py,v 1.43 2007/07/16 05:23:15 waterbug Exp $ +# $Id: utils4test.py,v 1.44 2007/07/16 15:46:11 waterbug Exp $ """ Utilities for testing. @@ -7,46 +7,8 @@ from datetime import datetime from random import randint -from zope.interface import Interface - from pangalactic.utils.datetimes import dtstamp from pangalactic.meta.pgefobject import PgefObject -from pangalactic.meta.pgefpropertyspec import PgefPropertySpec - - -class TestSchema(Interface): - """ - An Interface for test purposes. - """ - ## - # Ideally, this should iterate over the datatypes, creating a schema - # property for each. - ## - # id and id_ns are required for PgefObject - id = PgefPropertySpec(id='id', id_ns='test', - domain='PgefObject', range='str', - property_type='datatype') - id_ns = PgefPropertySpec(id='id_ns', id_ns='test', - domain='PgefObject', range='str', - property_type='datatype') - stringprop = PgefPropertySpec(id='stringprop', id_ns='test', - domain='PgefObject', range='str', - property_type='datatype') - intprop = PgefPropertySpec(id='intprop', id_ns='test', - domain='PgefObject', range='int', - property_type='datatype') - # floatprop = PgefPropertySpec(id='floatprop', id_ns='test', - # domain='PgefObject', range='int', - # property_type='datatype') - boolprop = PgefPropertySpec(id='boolprop', id_ns='test', - domain='PgefObject', range='float', - property_type='datatype') - datetimeprop = PgefPropertySpec(id='datetimeprop', id_ns='test', - domain='PgefObject', range='datetime', - property_type='datatype') - objectprop = PgefPropertySpec(id='objectprop', id_ns='test', - domain='PgefObject', range='Identifiable', - property_type='object') def genRunId(dt=None): From waterbug at step.nasa.gov Wed Jul 18 00:14:16 2007 From: waterbug at step.nasa.gov (waterbug CVS) Date: Wed Jul 18 00:14:18 2007 Subject: [pangalactic-commits] Small edit I missed. Message-ID: <200707180414.l6I4EGQU014090@ned.gsfc.nasa.gov> Modified files: PanGalactic/pangalactic/test/utils4test.py 1.44 1.45 Log message: Small edit I missed. Index: PanGalactic/pangalactic/test/utils4test.py diff -u PanGalactic/pangalactic/test/utils4test.py:1.44 PanGalactic/pangalactic/test/utils4test.py:1.45 --- PanGalactic/pangalactic/test/utils4test.py:1.44 Mon Jul 16 11:46:11 2007 +++ PanGalactic/pangalactic/test/utils4test.py Wed Jul 18 00:14:14 2007 @@ -1,4 +1,4 @@ -# $Id: utils4test.py,v 1.44 2007/07/16 15:46:11 waterbug Exp $ +# $Id: utils4test.py,v 1.45 2007/07/18 04:14:14 waterbug Exp $ """ Utilities for testing. @@ -277,8 +277,7 @@ if versionable and not updateable: test_objects.append(pt2) pt3 = initTestObject('Part', registry, pt3_id, base_id=pt3_base_id, - id_ns='http://pangalactic.us/test/lib/', - version='working', iteration=0, + id_ns=id_ns, version='working', iteration=0, name=pt3_name, cm_authority='sandbox:H2G2', owner=fester) if versionable and not updateable: test_objects.append(pt3) From waterbug at step.nasa.gov Thu Jul 19 12:15:35 2007 From: waterbug at step.nasa.gov (waterbug CVS) Date: Thu Jul 19 12:15:37 2007 Subject: [pangalactic-commits] Begin converting _passwd -> _credentials ... Message-ID: <200707191615.l6JGFZIM004308@ned.gsfc.nasa.gov> Modified files: PanGalactic/NOTES 1.24 1.25 PanGalactic/pangalactic/repo/chronosynclastic.py 1.113 1.114 PanGalactic/pangalactic/repo/pgercred.py 1.18 1.19 Log message: Begin converting _passwd -> _credentials ... this will break lots of stuff! Index: PanGalactic/NOTES diff -u PanGalactic/NOTES:1.24 PanGalactic/NOTES:1.25 --- PanGalactic/NOTES:1.24 Thu Jul 12 12:41:58 2007 +++ PanGalactic/NOTES Thu Jul 19 12:15:32 2007 @@ -17,7 +17,14 @@ - CommonProperty: Properties from _schema become CommonProperty insts. (like Python properties on steriods), may dispatch messages and like that - - oid = id_ns + id + - oid = ':'.join([id_ns, id]) + + this has implications for userid's -- namely, the oid cannot be used as a + userid for http basic auth (because the ':' is not allowed in that + context). + + this is probably a blessing in disguise, because it forces better + normalization for the Person/Credentials relationship -- i.e., the _passwd + table becomes a _credentials table and the relationship between the + _person and _credentials tables is one-to-many. - id_ns is Namespace object (hmmm...) @@ -43,13 +50,13 @@ uri's, which have been committed to a repository). - when committed to a repo, objects will be assigned to the repo's sandbox - under user's id, which will be the following id namespace: + under user's oid, which will be the following id namespace: - "http://[repo addr]/vger/sandbox/[userid]/" + "http://[repo addr]/vger/sandbox/[user oid]/" or if part of a local project that has not yet been committed: - "http://[repo addr]/vger/sandbox/[userid]/[project id]/" + "http://[repo addr]/vger/sandbox/[user oid]/[project id]/" Once the project has been committed and has been assigned a global namespace, they would by default be registered within that namespace unless Index: PanGalactic/pangalactic/repo/pgercred.py diff -u PanGalactic/pangalactic/repo/pgercred.py:1.18 PanGalactic/pangalactic/repo/pgercred.py:1.19 --- PanGalactic/pangalactic/repo/pgercred.py:1.18 Fri Feb 9 17:33:07 2007 +++ PanGalactic/pangalactic/repo/pgercred.py Thu Jul 19 12:15:33 2007 @@ -1,9 +1,9 @@ -# $Id: pgercred.py,v 1.18 2007/02/09 22:33:07 waterbug Exp $ +# $Id: pgercred.py,v 1.19 2007/07/19 16:15:33 waterbug Exp $ """ Authentication and credential management for PGER. -@version: $Revision: 1.18 $ +@version: $Revision: 1.19 $ """ -__version__ = "$Revision: 1.18 $"[11:-2] +__version__ = "$Revision: 1.19 $"[11:-2] import sha @@ -164,7 +164,7 @@ Verify credentials, returning the username if successful. """ res = self.db.runQuery( - """SELECT * from _passwd where _oid = %s + """SELECT * from _credentials where _userid = %s and _password = %s""", (creds.username, sha.sha(creds.password).hexdigest())) Index: PanGalactic/pangalactic/repo/chronosynclastic.py diff -u PanGalactic/pangalactic/repo/chronosynclastic.py:1.113 PanGalactic/pangalactic/repo/chronosynclastic.py:1.114 --- PanGalactic/pangalactic/repo/chronosynclastic.py:1.113 Sun Jun 17 23:21:00 2007 +++ PanGalactic/pangalactic/repo/chronosynclastic.py Thu Jul 19 12:15:33 2007 @@ -1,11 +1,11 @@ -# $Id: chronosynclastic.py,v 1.113 2007/06/18 03:21:00 waterbug Exp $ +# $Id: chronosynclastic.py,v 1.114 2007/07/19 16:15:33 waterbug Exp $ """ An asynchronous, model-driven object-relational mapping and database interface -@version: $Revision: 1.113 $ +@version: $Revision: 1.114 $ """ -__version__ = "$Revision: 1.113 $"[11:-2] +__version__ = "$Revision: 1.114 $"[11:-2] import os import re @@ -141,7 +141,7 @@ for schema_name in invbaseorder: tname = self._tableNameForSchemaName(schema_name) dropcmds.append("DROP TABLE %s CASCADE;" % tname) - dropcmds.append("DROP TABLE _passwd CASCADE;") + dropcmds.append("DROP TABLE _credentials CASCADE;") dropallcmd = '\n'.join(dropcmds) return dropallcmd # return self.runOperation(dropallcmd) @@ -166,10 +166,10 @@ not in current_tables): print ' + creating table for', schema self.createTable(schema) - # special case: _passwd table - print ' + creating table: _passwd' - create_passwd_table = '\n'.join([ - " CREATE TABLE _passwd", + # special case: _credentials table + print ' + creating table: _credentials' + create_credentials_table = '\n'.join([ + " CREATE TABLE _credentials", " (", " _oid TEXT PRIMARY KEY,", " /* oid of Person who owns this password. */", @@ -179,7 +179,7 @@ " );"]) conn = psycopg2.connect(database=self.database) curs = conn.cursor() - curs.execute(create_passwd_table) + curs.execute(create_credentials_table) return conn.commit() def createTable(self, schema): @@ -337,7 +337,7 @@ """ logmsg = 'changing passwd for %s' % userid log.msg(logmsg, system='%s:Chronosynclastic' % requestor) - d = self.runQuery("""SELECT * FROM _passwd WHERE _oid = %s""", + d = self.runQuery("""SELECT * FROM _credentials WHERE _userid = %s""", (userid,)) return d.addCallbacks(lambda x: self._addPasswdRecIfNec(x, userid, newpasswd), @@ -345,20 +345,21 @@ def _addPasswdRecIfNec(self, passwdres, userid, newpasswd): """ - Add a record to the _passwd table for the current userid if necessary. + Add a record to the _credentials table for the current userid if + necessary. @param passwdrec: the output of a search for the user's oid in the - _passwd table + _credentials table """ if len(passwdres): - r = self.runOperation("""UPDATE _passwd + r = self.runOperation("""UPDATE _credentials SET _password = %s - WHERE _oid = %s + WHERE _userid = %s """, (newpasswd, userid)) logmsg = 'passwd change for %s succeeded.' % userid else: - r = self.runOperation("""INSERT INTO _passwd - (_oid, _password) VALUES + r = self.runOperation("""INSERT INTO _credentials + (_userid, _password) VALUES (%s, %s) """, (userid, newpasswd)) logmsg = 'passwd change for %s failed.' % userid From waterbug at step.nasa.gov Fri Jul 20 08:51:44 2007 From: waterbug at step.nasa.gov (waterbug CVS) Date: Fri Jul 20 08:51:45 2007 Subject: [pangalactic-commits] Fixes to _credentials. Message-ID: <200707201251.l6KCpiPf013352@ned.gsfc.nasa.gov> Modified files: PanGalactic/pangalactic/repo/chronosynclastic.py 1.114 1.115 PanGalactic/src/sql/insertRefData.sql 1.29 1.30 Log message: Fixes to _credentials. Index: PanGalactic/src/sql/insertRefData.sql diff -u PanGalactic/src/sql/insertRefData.sql:1.29 PanGalactic/src/sql/insertRefData.sql:1.30 --- PanGalactic/src/sql/insertRefData.sql:1.29 Fri Jul 13 23:55:58 2007 +++ PanGalactic/src/sql/insertRefData.sql Fri Jul 20 08:51:42 2007 @@ -1,6 +1,6 @@ /* PGER reference data initialization. */ -/* $Id: insertRefData.sql,v 1.29 2007/07/14 03:55:58 waterbug Exp $ */ +/* $Id: insertRefData.sql,v 1.30 2007/07/20 12:51:42 waterbug Exp $ */ /* This script sets up some reference data, including the default * identification contexts for PGEF objects, and is required before the @@ -38,11 +38,13 @@ INSERT INTO _passwd ( - _oid + _oid, + _userid ) VALUES ( 'pgefobjects:admin' + 'admin' ); END; Index: PanGalactic/pangalactic/repo/chronosynclastic.py diff -u PanGalactic/pangalactic/repo/chronosynclastic.py:1.114 PanGalactic/pangalactic/repo/chronosynclastic.py:1.115 --- PanGalactic/pangalactic/repo/chronosynclastic.py:1.114 Thu Jul 19 12:15:33 2007 +++ PanGalactic/pangalactic/repo/chronosynclastic.py Fri Jul 20 08:51:41 2007 @@ -1,11 +1,11 @@ -# $Id: chronosynclastic.py,v 1.114 2007/07/19 16:15:33 waterbug Exp $ +# $Id: chronosynclastic.py,v 1.115 2007/07/20 12:51:41 waterbug Exp $ """ An asynchronous, model-driven object-relational mapping and database interface -@version: $Revision: 1.114 $ +@version: $Revision: 1.115 $ """ -__version__ = "$Revision: 1.114 $"[11:-2] +__version__ = "$Revision: 1.115 $"[11:-2] import os import re @@ -172,7 +172,8 @@ " CREATE TABLE _credentials", " (", " _oid TEXT PRIMARY KEY,", - " /* oid of Person who owns this password. */", + " /* oid of Person who owns these credentials. */", + " _userid VARCHAR(40) UNIQUE,", " _password VARCHAR(40)", " /* Secure Hash Algorithm (SHA-1) digest of the user's", " * password. */", From waterbug at step.nasa.gov Fri Jul 20 10:56:45 2007 From: waterbug at step.nasa.gov (waterbug CVS) Date: Fri Jul 20 10:56:47 2007 Subject: [pangalactic-commits] More mods for new _credentials. Message-ID: <200707201456.l6KEujKo014728@ned.gsfc.nasa.gov> Modified files: PanGalactic/src/sql/admininit.py 1.6 1.7 PanGalactic/src/sql/insertRefData.sql 1.30 1.31 PanGalactic/src/sql/insertSandboxData.sql 1.1 1.2 PanGalactic/src/sql/insertTestData.sql 1.27 1.28 Log message: More mods for new _credentials. Index: PanGalactic/src/sql/insertRefData.sql diff -u PanGalactic/src/sql/insertRefData.sql:1.30 PanGalactic/src/sql/insertRefData.sql:1.31 --- PanGalactic/src/sql/insertRefData.sql:1.30 Fri Jul 20 08:51:42 2007 +++ PanGalactic/src/sql/insertRefData.sql Fri Jul 20 10:56:43 2007 @@ -1,6 +1,6 @@ /* PGER reference data initialization. */ -/* $Id: insertRefData.sql,v 1.30 2007/07/20 12:51:42 waterbug Exp $ */ +/* $Id: insertRefData.sql,v 1.31 2007/07/20 14:56:43 waterbug Exp $ */ /* This script sets up some reference data, including the default * identification contexts for PGEF objects, and is required before the @@ -36,14 +36,14 @@ '1' ); -INSERT INTO _passwd +INSERT INTO _credentials ( _oid, _userid ) VALUES ( - 'pgefobjects:admin' + 'pgefobjects:admin', 'admin' ); Index: PanGalactic/src/sql/admininit.py diff -u PanGalactic/src/sql/admininit.py:1.6 PanGalactic/src/sql/admininit.py:1.7 --- PanGalactic/src/sql/admininit.py:1.6 Tue Feb 21 10:12:53 2006 +++ PanGalactic/src/sql/admininit.py Fri Jul 20 10:56:43 2007 @@ -1,8 +1,8 @@ """Initialize admin credentials""" -# $Id: admininit.py,v 1.6 2006/02/21 15:12:53 waterbug Exp $ +# $Id: admininit.py,v 1.7 2007/07/20 14:56:43 waterbug Exp $ -__version__ = "$Revision: 1.6 $"[11:-2] +__version__ = "$Revision: 1.7 $"[11:-2] import psycopg2 import sha @@ -11,7 +11,7 @@ conn = psycopg2.connect(database='pgerdb') curs = conn.cursor() -curs.execute("""UPDATE _passwd SET _password = %s WHERE _oid = %s""", +curs.execute("""UPDATE _credentials SET _password = %s WHERE _oid = %s""", (adminpass, 'admin')) conn.commit() conn.close() Index: PanGalactic/src/sql/insertSandboxData.sql diff -u PanGalactic/src/sql/insertSandboxData.sql:1.1 PanGalactic/src/sql/insertSandboxData.sql:1.2 --- PanGalactic/src/sql/insertSandboxData.sql:1.1 Sun Jul 15 14:41:05 2007 +++ PanGalactic/src/sql/insertSandboxData.sql Fri Jul 20 10:56:43 2007 @@ -1,7 +1,7 @@ /* Test data initialization script. * */ -/* $Id: insertSandboxData.sql,v 1.1 2007/07/15 18:41:05 waterbug Exp $ */ +/* $Id: insertSandboxData.sql,v 1.2 2007/07/20 14:56:43 waterbug Exp $ */ /* TODO: Add the following 'Roles' and assign them ... 'Just Some Guy' @@ -118,13 +118,15 @@ '0' ); -INSERT INTO _passwd +INSERT INTO _credentials ( - _oid + _oid, + _userid ) VALUES ( - 'sandbox:zaphod.beeblebrox' + 'sandbox:zaphod.beeblebrox', + 'zaphod' ); INSERT INTO _person @@ -160,13 +162,15 @@ '0' ); -INSERT INTO _passwd +INSERT INTO _credentials ( - _oid + _oid, + _userid ) VALUES ( - 'sandbox:buckaroo.banzai' + 'sandbox:buckaroo.banzai', + 'banzai' ); INSERT INTO _person @@ -200,13 +204,15 @@ 'yoyofone' ); -INSERT INTO _passwd +INSERT INTO _credentials ( - _oid + _oid, + _userid ) VALUES ( - 'sandbox:john.bigboote' + 'sandbox:john.bigboote', + 'bigboote' ); INSERT INTO _person @@ -240,13 +246,15 @@ 'yoyofone' ); -INSERT INTO _passwd +INSERT INTO _credentials ( - _oid + _oid, + _userid ) VALUES ( - 'sandbox:john.smallberries' + 'sandbox:john.smallberries', + 'smallberries' ); INSERT INTO _person @@ -280,13 +288,15 @@ 'yoyofone' ); -INSERT INTO _passwd +INSERT INTO _credentials ( - _oid + _oid, + _userid ) VALUES ( - 'sandbox:john.whorfin' + 'sandbox:john.whorfin', + 'lizardo' ); END; Index: PanGalactic/src/sql/insertTestData.sql diff -u PanGalactic/src/sql/insertTestData.sql:1.27 PanGalactic/src/sql/insertTestData.sql:1.28 --- PanGalactic/src/sql/insertTestData.sql:1.27 Sun Jul 15 14:38:43 2007 +++ PanGalactic/src/sql/insertTestData.sql Fri Jul 20 10:56:43 2007 @@ -1,7 +1,7 @@ /* Test data initialization script. * */ -/* $Id: insertTestData.sql,v 1.27 2007/07/15 18:38:43 waterbug Exp $ */ +/* $Id: insertTestData.sql,v 1.28 2007/07/20 14:56:43 waterbug Exp $ */ /* TODO: Add the following 'Roles' and assign them ... 'Just Some Guy' @@ -76,13 +76,15 @@ '0' ); -INSERT INTO _passwd +INSERT INTO _credentials ( - _oid + _oid, + _userid ) VALUES ( - 'test:fester.bestertester' + 'test:fester.bestertester', + 'fester' ); END; From waterbug at step.nasa.gov Sat Jul 21 03:58:14 2007 From: waterbug at step.nasa.gov (waterbug CVS) Date: Sat Jul 21 03:58:16 2007 Subject: [pangalactic-commits] Small fix for test. Message-ID: <200707210758.l6L7wEvW021294@ned.gsfc.nasa.gov> Modified files: PanGalactic/pangalactic/test/test_pger_changePassword.py 1.2 1.3 Log message: Small fix for test. Index: PanGalactic/pangalactic/test/test_pger_changePassword.py diff -u PanGalactic/pangalactic/test/test_pger_changePassword.py:1.2 PanGalactic/pangalactic/test/test_pger_changePassword.py:1.3 --- PanGalactic/pangalactic/test/test_pger_changePassword.py:1.2 Mon Feb 12 19:02:47 2007 +++ PanGalactic/pangalactic/test/test_pger_changePassword.py Sat Jul 21 03:58:12 2007 @@ -1,4 +1,4 @@ -# $Id: test_pger_changePassword.py,v 1.2 2007/02/13 00:02:47 waterbug Exp $ +# $Id: test_pger_changePassword.py,v 1.3 2007/07/21 07:58:12 waterbug Exp $ """ Functional test for PGER.changePassword() @@ -16,7 +16,7 @@ print f reactor.stop() -d = PGER.changePassword('admin', 'zaphod@hog.univ', 'sekret') +d = PGER.changePassword('admin', 'zaphod', 'sekret') d.addCallbacks(success, failure) reactor.run() From waterbug at step.nasa.gov Sun Jul 22 14:26:42 2007 From: waterbug at step.nasa.gov (waterbug CVS) Date: Sun Jul 22 14:26:44 2007 Subject: [pangalactic-commits] Fixes for many little flakinesses ... Message-ID: <200707221826.l6MIQgYB008027@ned.gsfc.nasa.gov> Modified files: PanGalactic/pangalactic/node/cache.py 1.38 1.39 PanGalactic/pangalactic/node/pangalaxian.py 1.196 1.197 PanGalactic/pangalactic/node/uberorb.py 1.154 1.155 PanGalactic/pangalactic/node/gui/widgets/pgxnpanes.py 1.50 1.51 PanGalactic/pangalactic/node/gui/widgets/pgxntree.py 1.13 1.14 PanGalactic/src/sql/insertModels.sql 1.21 1.22 PanGalactic/src/sql/insertPartModels.sql 1.8 1.9 Log message: Fixes for many little flakinesses ... notably, some maddening test data typos/thinkos! 8P Index: PanGalactic/src/sql/insertPartModels.sql diff -u PanGalactic/src/sql/insertPartModels.sql:1.8 PanGalactic/src/sql/insertPartModels.sql:1.9 --- PanGalactic/src/sql/insertPartModels.sql:1.8 Fri Jul 13 23:55:58 2007 +++ PanGalactic/src/sql/insertPartModels.sql Sun Jul 22 14:26:40 2007 @@ -1,6 +1,6 @@ /* PGER Demo PartModel data inserts. */ -/* $Id: insertPartModels.sql,v 1.8 2007/07/14 03:55:58 waterbug Exp $ */ +/* $Id: insertPartModels.sql,v 1.9 2007/07/22 18:26:40 waterbug Exp $ */ BEGIN; SET CONSTRAINTS ALL DEFERRED; @@ -30,7 +30,7 @@ ( 'sandbox:PartModel.MMT-01.1-CAD.1', 'PartModel', -- __schema_name -'MMT-01.1-CAD.1', -- _id +'PartModel.MMT-01.1-CAD.1', -- _id 'sandbox', -- _id_ns '0', -- _security_mask 'Model of Twanger, Magic, Megawatt', -- _description @@ -73,7 +73,7 @@ ( 'sandbox:PartModel.BTA-20.1-CAD.1', 'PartModel', -- __schema_name -'BTA-20.1-CAD.1', -- _id +'PartModel.BTA-20.1-CAD.1', -- _id 'sandbox', -- _id_ns '0', -- _security_mask 'Preliminary Twanging Assembly', -- _description @@ -116,7 +116,7 @@ ( 'sandbox:PartModel.HM.200.1-CAD.1', 'PartModel', -- __schema_name -'HM.200-CAD.1', -- _id +'PartModel.HM.200-CAD.1', -- _id 'sandbox', -- _id_ns '0', -- _security_mask 'Mabob, Hoogie', -- _description @@ -159,7 +159,7 @@ ( 'sandbox:PartModel.IDrive.1-CAD.1', 'PartModel', -- __schema_name -'IDrive.1-CAD.1', -- _id +'PartModel.IDrive.1-CAD.1', -- _id 'sandbox', -- _id_ns '0', -- _security_mask 'Drive, Improbability', -- _description @@ -202,7 +202,7 @@ ( 'sandbox:PartModel.B57SMB.1-CAD.1', 'PartModel', -- __schema_name -'B57SMB.1-CAD.1', -- _id +'PartModel.B57SMB.1-CAD.1', -- _id 'sandbox', -- _id_ns '0', -- _security_mask 'Computer, Hyper-Quantum, Subfemto', -- _description @@ -245,7 +245,7 @@ ( 'sandbox:PartModel.FX-CAP.1-CAD.1', 'PartModel', -- __schema_name -'FX-CAP.1-CAD.1', -- _id +'PartModel.FX-CAP.1-CAD.1', -- _id 'sandbox', -- _id_ns '0', -- _security_mask 'Capacitor, Flux', -- _description @@ -288,7 +288,7 @@ ( 'sandbox:PartModel.HOG.1-CAD.1', 'PartModel', -- __schema_name -'HOG.1-CAD.1', -- _id +'PartModel.HOG.1-CAD.1', -- _id 'sandbox', -- _id_ns '0', -- _security_mask 'Heart of Gold Spacecraft', -- _description @@ -331,7 +331,7 @@ ( 'sandbox:PartModel.MF Series A.1-CAD.1', 'PartModel', -- __schema_name -'MF Series A.1-CAD.1', -- _id +'PartModel.MF Series A.1-CAD.1', -- _id 'sandbox', -- _id_ns '0', -- _security_mask 'Mr. Fusion A10K version 1 3D MCAD Model', -- _description @@ -374,7 +374,7 @@ ( 'sandbox:PartModel.OO-1.1-CAD.1', 'PartModel', -- __schema_name -'OO-1.1-CAD.1', -- _id +'PartModel.OO-1.1-CAD.1', -- _id 'sandbox', -- _id_ns '0', -- _security_mask 'Overthruster, Oscillation', -- _description @@ -417,7 +417,7 @@ ( 'sandbox:PartModel.OO-Def-1.1-CAD.1', 'PartModel', -- __schema_name -'OO-Def-1.1-CAD.1', -- _id +'PartModel.OO-Def-1.1-CAD.1', -- _id 'sandbox', -- _id_ns '0', -- _security_mask 'Overthruster, Oscillation', -- _description Index: PanGalactic/src/sql/insertModels.sql diff -u PanGalactic/src/sql/insertModels.sql:1.21 PanGalactic/src/sql/insertModels.sql:1.22 --- PanGalactic/src/sql/insertModels.sql:1.21 Fri Jul 13 23:55:58 2007 +++ PanGalactic/src/sql/insertModels.sql Sun Jul 22 14:26:40 2007 @@ -1,6 +1,6 @@ /* PGER Demo Model data inserts. */ -/* $Id: insertModels.sql,v 1.21 2007/07/14 03:55:58 waterbug Exp $ */ +/* $Id: insertModels.sql,v 1.22 2007/07/22 18:26:40 waterbug Exp $ */ BEGIN; SET CONSTRAINTS ALL DEFERRED; @@ -161,7 +161,7 @@ ( 'sandbox:HM.200.1-CAD.1', 'Model', -- __schema_name -'HM.200-CAD.1', -- _id +'HM.200.1-CAD.1', -- _id 'sandbox', -- _id_ns '0', -- _security_mask 'Mabob, Hoogie', -- _description Index: PanGalactic/pangalactic/node/uberorb.py diff -u PanGalactic/pangalactic/node/uberorb.py:1.154 PanGalactic/pangalactic/node/uberorb.py:1.155 --- PanGalactic/pangalactic/node/uberorb.py:1.154 Mon Jun 4 01:48:55 2007 +++ PanGalactic/pangalactic/node/uberorb.py Sun Jul 22 14:26:39 2007 @@ -1,11 +1,11 @@ -# $Id: uberorb.py,v 1.154 2007/06/04 05:48:55 waterbug Exp $ +# $Id: uberorb.py,v 1.155 2007/07/22 18:26:39 waterbug Exp $ # -*- test-case-name: pangalactic.test.test_uberorb -*- """ A PanGalaxian node's UberORB -@version: $Revision: 1.154 $ +@version: $Revision: 1.155 $ """ -__version__ = "$Revision: 1.154 $"[11:-2] +__version__ = "$Revision: 1.155 $"[11:-2] import logging import mimetypes @@ -130,18 +130,6 @@ # cache operations - def getDict(self, name): - """ - Get the {oid : obj} dictionary of cache objects that provide the named - Interface (this is a wrapper for cache.getDict). - """ - d = {} - if getattr(self, 'cache'): - d = self.cache.getDict(name) - else: - self.log.debug(' + no cache -- call orb.initCache() first') - return d - def saveToCache(self, objs): """ Save the specified objects to the cache. @@ -150,7 +138,7 @@ if getattr(self, 'cache'): self.cache.saveObjects(objs) else: - self.log.debug(' + no cache -- call orb.initCache() first') + self.log.debug(' + no cache! -- call orb.initCache() first') def deleteFromCache(self, objs): """ @@ -388,11 +376,9 @@ else: # pass self.log.debug(' none found.') - # else: - # objs = self.searchLocalObjects(cm_authority=context) else: self.log.debug(' * nothing found in %s.' % context) - return objs + return self.searchLocalObjects(cm_authority=context) def update(self, context): """ @@ -460,8 +446,8 @@ """ Marshall (re-member heh ;) a C{PgefObject} from an extract. If no local copy exists in the cache (i.e., one with the same oid), a new object is - created, saved to the cache, and returned; otherwise, the local object - is updated from the "remembered" one. + created and returned; otherwise, the local object is updated from the + "remembered" one. @param e: an extract @type e: C{dict} @@ -608,18 +594,22 @@ self.log.info(' + no objects retrieved -- not logged in.') return objs - def searchLocalObjects(self, **kw): + def searchLocalObjects(self, schema_names=None, **kw): """ Get objects from the cache by parameters. + @param schema_names: if not None, restricts the search to objects that + have the named schemas + @type schema_names: L{list} + @param kw: a dictionary of parameters to match object attributes - @type kw: C{dict} + @type kw: L{dict} @return: a list of objects - @rtype: C{list} + @rtype: L{list} """ if getattr(self, 'cache'): - return self.cache.searchLocalObjects(**kw) + return self.cache.searchLocalObjects(schema_names, **kw) else: return [] @@ -671,7 +661,7 @@ self.log.info(' parameters: %s' % str(params)) spec = spec or [] if spec: - self.log.info(' spec (retrieve data only): %s' % str(spec)) + self.log.info(' + spec (retrieve data only): %s' % str(spec)) # try: data = self.xmlrpc.search(schema_name, refs, subtypes, params, spec) # if attrs are specified, just return the datasets @@ -681,6 +671,8 @@ else: objs = [self.remember(e) for e in data] ret = objs + self.log.info(' + search found %s objects' % len(objs)) + self.log.info(' + saving to cache ...') self.saveToCache(objs) return ret # except: @@ -827,38 +819,12 @@ def getProjects(self): """ - Get a C{dict} of all Project objects in the cache mapped by oid. + Get a L{dict} of all Project objects in the cache mapped by oid. """ return self.cache.getDict('Project') projects = property(fget=getProjects, doc='projects') -# def getNamespaces(self, writable=True): -# """ -# Get the list of known namespaces. If writable is True, get only -# namespaces that are writable for the current user. If logged in, get -# them from the repository, save them locally, and return them as a list. -# If local, check whether there are any in cache. -# """ -# # TODO: some way to determine which namespaces the user has permission -# # to pollute. ;) -# self.log.info(' - getNamespaces') -# if state['repo'] and self.xmlrpc: -# self.log.info(' + logged in -- going to the server ...') -# params = {'owner' : 'admin'} -# nsexts = self.xmlrpc.getObjects('PmofNamespace', -# params=params) -# namespaces = [self.remember(e) for e in nsexts] -# if namespaces: -# self.saveToCache(namespaces) -# self.log.info('dispatching signal "updates received"') -# dispatcher.send(signal='updates received') -# else: -# self.log.info(' + in local mode -- using cached namespaces ...') -# namespaces = self.searchLocalObjects( -# _schema=self.interfaces['PmofNamespace']) -# return namespaces - def getNames(self, ns): """ Get the known names (C{id} Property values) for the specified namespace. @@ -918,7 +884,7 @@ self.log.debug(' + oid found in self.assy_maps') acus = self.assy_maps[oid] else: - for obj in self.getDict('Acu').values(): + for obj in self.cache.getDict('Acu').values(): if obj.parent == oid: acus.append(obj) elif getattr(obj.parent, 'oid', '') == oid: Index: PanGalactic/pangalactic/node/gui/widgets/pgxntree.py diff -u PanGalactic/pangalactic/node/gui/widgets/pgxntree.py:1.13 PanGalactic/pangalactic/node/gui/widgets/pgxntree.py:1.14 --- PanGalactic/pangalactic/node/gui/widgets/pgxntree.py:1.13 Sun May 13 20:41:29 2007 +++ PanGalactic/pangalactic/node/gui/widgets/pgxntree.py Sun Jul 22 14:26:39 2007 @@ -1,10 +1,10 @@ -# $Id: pgxntree.py,v 1.13 2007/05/14 00:41:29 waterbug Exp $ +# $Id: pgxntree.py,v 1.14 2007/07/22 18:26:39 waterbug Exp $ """ Base class for PanGalaxian's trees -@version: $Revision: 1.13 $ +@version: $Revision: 1.14 $ """ -__version__ = "$Revision: 1.13 $"[11:-2] +__version__ = "$Revision: 1.14 $"[11:-2] import wx @@ -91,9 +91,9 @@ acu_oids.append(acu_obj.oid) # print ' - acu_oids: ', acu_oids for acu_oid in acu_oids: - acu_obj = orb.getObject(acu_oid) + acu_obj = orb.getLocalObject(acu_oid) if acu_obj: - child = orb.getObject(acu_obj.child) + child = orb.getLocalObject(acu_obj.child) if child: treeid = self.AppendItem(rootnode, child.id) self.SetPyData(treeid, [acu_obj.oid, child.oid]) Index: PanGalactic/pangalactic/node/cache.py diff -u PanGalactic/pangalactic/node/cache.py:1.38 PanGalactic/pangalactic/node/cache.py:1.39 --- PanGalactic/pangalactic/node/cache.py:1.38 Fri May 18 01:11:15 2007 +++ PanGalactic/pangalactic/node/cache.py Sun Jul 22 14:26:39 2007 @@ -1,9 +1,9 @@ """ Local object cache manager (a layer over ZODB) -@version: $Revision: 1.38 $ +@version: $Revision: 1.39 $ """ -__version__ = "$Revision: 1.38 $"[11:-2] +__version__ = "$Revision: 1.39 $"[11:-2] # Python import logging, os, sys @@ -66,6 +66,13 @@ objs = property(getObjs, 'objs') + def getDict(self, name): + """ + Get the cache's dictionary of objects that have a _schema with the + specified __name__. + """ + return self.dbroot.get(name, {}) + # property: trash def getTrash(self): @@ -102,12 +109,12 @@ def saveObjects(self, objs): """ - Save some objects to the cache. Map the object's oid to the object - in the dictionary C{self.objs} (which includes *all* objects in the - cache). By default, also add the object to the dictionary + Save some objects to the cache. Map the object's oid to the object in + C{self.objs} (the dictionary that maps oids to objects in the cache). + By default, also add the object to the dictionary C{self.dbroot[schema]}, where C{schema} is the object's - _schema.__name__, and to any dictionaries whose schemas are parents - of the object's _schema. + _schema.__name__, and to any dictionaries whose schemas are parents of + the object's _schema. @param objs: objects to be saved @type objs: list (usually of instances of @@ -118,17 +125,19 @@ # last-modified dates. If the object to be saved has been modified more # recently than the cache copy, replace the cache copy; if both have # been modified, notify user of the conflict. + # TODO: track down weird bug that caused only one Model to be committed + # to the OidsLookup dictionary when a group of Models was saved. if type(objs) is not list: objs = [objs] self.log.debug(" + oids: %s" % str([o.oid for o in objs])) - for obj in objs: - self.objs[obj.oid] = obj - if hasattr(obj, '_schema'): - self.dbroot[obj._schema.__name__][obj.oid] = obj + for o in objs: + if hasattr(o, '_schema'): + self.objs[o.oid] = o + self.dbroot[o._schema.__name__][o.oid] = o # dictionaries of parents of the object's _schema for name in [x.__name__ for x in self.interfaces.values() - if x in allYourBase(obj._schema)]: - self.dbroot[name][obj.oid] = obj + if x in allYourBase(o._schema)]: + self.dbroot[name][o.oid] = o self.commit() def deleteObjects(self, objs): @@ -197,6 +206,9 @@ """ Return True for an object that matches all attr/values, False otherwise. + + @param obj: a C{PgefObject} instance to be tested + @type obj: L{pangalactic.meta.pgefobject.PgefObject} """ # stunningly inefficient ... but it works :) r = True @@ -207,32 +219,35 @@ break return r - def searchLocalObjects(self, **kw): + def searchLocalObjects(self, schema_names=None, **kw): """ Get objects that match the specified parameters (or all objects, if no parameters are specified) from the cache. + @param schema_names: if not None, restricts the search to objects that + have the named schemas + @type schema_names: L{list} + @param kw: a dictionary of parameters to match object attributes - @type kw: C{dict} + @type kw: L{dict} @return: a list of objects - @rtype: C{list} + @rtype: L{list} """ - self.log.debug(" - ObjectCache.searchLocalObjects") + self.log.debug(" - searchLocalObjects") self.log.debug(" + kw = %s" % str(kw)) + schema_names = schema_names or [] + if schema_names: + objs = set() + for name in schema_names: + objs |= set(self.getDict(name).values()) + else: + objs = set(self.objs.values()) if kw: - objs = [x for x in self.objs.values() if self._getFilter(x, **kw)] + res = [x for x in objs if self._getFilter(x, **kw)] else: - objs = self.objs.values() - return objs - - def getDict(self, name): - """ - Get the cache's dictionary of objects that implement the interface with - the specified name. - """ - # applications may only have some of the dicts that the cache has - return self.dbroot.get(name) + res = objs + return res # May revisit pack() later, but probably don't need it for now, and it is a # very expensive operation. @@ -245,58 +260,3 @@ # self.dbtrash.pack() # self.commit() - # FIXME: Domain-specific stuff (everything from here on) should be in one - # or more separate modules - - # strange special cases for Workflow stuff - - def GetWorkflows(self, attrlist = None): - self.log.debug(" - ObjectCache.getworkflows") - wf_dict = self.getDict(self.WFPROCESSINSTANCE) - objdict = {} - for wfid, wfobj in wf_dict.items(): - if wfobj.state != 'DELETE': - tmpobj = self.objs[wfobj.oid] - elif tmpobj.state == None: - tmpobj = self.objs[wfobj.oid] - if tmpobj: - objdict[wfid] = tmpobj - itemdict = dict(objdict) - for wfid, wfobj in itemdict.items(): - if wfobj._schema.__name__ == "WfProcessInstance": - self.log.debug(" + wfobj.name '%s'" % str(wfobj.name)) - if objdict.has_key(wfid): - if wfobj.state != 'DELETE': - tmpobj = self.objs[wfobj.oid] - objdict[wfid] = tmpobj - else: - del objdict[wfid] - else: - if wfobj.state != 'DELETE': - tmpobj = self.objs[wfobj.oid] - objdict[wfid] = tmpobj - self.log.debug(" + objdict: %s" % str(objdict)) - return objdict - - def saveWfProcessInstance(self, wflist, recurse=False): - self.log.debug(" - ObjectCache.SaveWfProcessInstance") - self.saveObjects(wflist) - for wfobj in wflist: - for entry in wfobj.history: - self.saveObjects(entry) - if recurse: - self.saveObjects(wfobj.activities.values()) - self.saveObjects(wfobj.transitions_dict.values()) - self.commit() - - def addWfProcessInstance(self, wflist, recurse=False): - #self.log.debug(" - ObjectCache.addWfProcessInstance") - self.saveObjects(wflist) - for wfobj in wflist: - for entry in wfobj.history: - self.saveObjects(entry) - if recurse: - self.saveObjects(wfobj.activities.values()) - self.saveObjects(wfobj.transitions_dict.values()) - self.commit() - Index: PanGalactic/pangalactic/node/gui/widgets/pgxnpanes.py diff -u PanGalactic/pangalactic/node/gui/widgets/pgxnpanes.py:1.50 PanGalactic/pangalactic/node/gui/widgets/pgxnpanes.py:1.51 --- PanGalactic/pangalactic/node/gui/widgets/pgxnpanes.py:1.50 Mon May 28 02:50:22 2007 +++ PanGalactic/pangalactic/node/gui/widgets/pgxnpanes.py Sun Jul 22 14:26:39 2007 @@ -1,9 +1,9 @@ """ The central widgets of the PanGalaxian main window. -@version: $Revision: 1.50 $ +@version: $Revision: 1.51 $ """ -__version__ = "$Revision: 1.50 $"[11:-2] +__version__ = "$Revision: 1.51 $"[11:-2] import logging @@ -160,7 +160,7 @@ self.trees[oid] = PanGalaxianTree(self, dragndrop=False) self.trees[oid].SetBackgroundColour('WHITE') self.AddPage(self.trees[oid], id) - self.trees[oid].loadTreeForObject(orb.getObject(oid)) + self.trees[oid].loadTreeForObject(orb.getLocalObject(oid)) self.pages[oid] = oid else: # TODO: figure out some rational policy for picking @@ -170,7 +170,7 @@ self.trees[oid] = PanGalaxianTree(self, dragndrop=False) self.trees[oid].SetBackgroundColour('WHITE') self.AddPage(self.trees[oid], id) - self.trees[oid].loadTreeForObject(orb.getObject(oid)) + self.trees[oid].loadTreeForObject(orb.getLocalObject(oid)) self.pages[oid] = oid self.SetSelection(0) Index: PanGalactic/pangalactic/node/pangalaxian.py diff -u PanGalactic/pangalactic/node/pangalaxian.py:1.196 PanGalactic/pangalactic/node/pangalaxian.py:1.197 --- PanGalactic/pangalactic/node/pangalaxian.py:1.196 Thu Jul 12 17:49:53 2007 +++ PanGalactic/pangalactic/node/pangalaxian.py Sun Jul 22 14:26:39 2007 @@ -2,16 +2,16 @@ # -*- coding: ANSI_X3.4-1968 -*- # generated by wxGlade 0.3.5.1 on Tue Feb 1 00:19:02 2005 -# $Id: pangalaxian.py,v 1.196 2007/07/12 21:49:53 waterbug Exp $ +# $Id: pangalaxian.py,v 1.197 2007/07/22 18:26:39 waterbug Exp $ """ Main application module for PanGalaxian, the PGEF GUI client. WE ARE THE PANGALAXIANS! :) -@version: $Revision: 1.196 $ +@version: $Revision: 1.197 $ """ -__version__ = "$Revision: 1.196 $"[11:-2] +__version__ = "$Revision: 1.197 $"[11:-2] # Python import logging @@ -1158,6 +1158,16 @@ kw['cm_authority'] = state.get('project') self.log.info(' + kw = %s' % str(kw)) objs = orb.searchLocalObjects(**kw) + if objs: + self.log.debug(' + objects:') + # for name in set([o._schema.__name__ for o in objs]): + for name in ['Model', 'Part', 'Document']: + self.log.debug(' %i %s' % (len([o for o in objs if + o._schema.__name__ == name]), + name)) + else: + self.log.debug(' + no objects found.') + self.log.debug(' ') self.gridbook.objs = objs self.treebook.onSetView() From waterbug at step.nasa.gov Sun Jul 22 19:05:59 2007 From: waterbug at step.nasa.gov (waterbug CVS) Date: Sun Jul 22 19:06:00 2007 Subject: [pangalactic-commits] Give PgefObjects full knowledge of their interfaces ... Message-ID: <200707222305.l6MN5xqB008182@ned.gsfc.nasa.gov> Modified files: PanGalactic/pangalactic/meta/pgefobject.py 1.22 1.23 PanGalactic/pangalactic/node/cache.py 1.39 1.40 PanGalactic/pangalactic/node/pangalaxian.py 1.197 1.198 Log message: Give PgefObjects full knowledge of their interfaces ... and determine which cache dictionaries they are added to using z.i.providedBy(). This provides the basis for more interface-driven stuff later. Index: PanGalactic/pangalactic/meta/pgefobject.py diff -u PanGalactic/pangalactic/meta/pgefobject.py:1.22 PanGalactic/pangalactic/meta/pgefobject.py:1.23 --- PanGalactic/pangalactic/meta/pgefobject.py:1.22 Thu Jul 12 17:49:52 2007 +++ PanGalactic/pangalactic/meta/pgefobject.py Sun Jul 22 19:05:57 2007 @@ -1,15 +1,18 @@ -# $Id: pgefobject.py,v 1.22 2007/07/12 21:49:52 waterbug Exp $ +# $Id: pgefobject.py,v 1.23 2007/07/22 23:05:57 waterbug Exp $ """ The Mother of all PanGalactic "domain objects". -@version: $Revision: 1.22 $ +@version: $Revision: 1.23 $ """ -__version__ = "$Revision: 1.22 $"[11:-2] +__version__ = "$Revision: 1.23 $"[11:-2] # Louie (messaging package) from louie import dispatcher +# Twisted +from twisted.python.reflect import allYourBase + # Zope Interface import zope.interface as zi @@ -56,7 +59,7 @@ characteristics, but that is its ultimate intent. """ - zi.implements(IPgefObject, IMofObject) + zi.implements(IPgefObject) def __init__(self, _schema, **kw): """ @@ -81,7 +84,8 @@ @type repo: L{str} """ self._schema = _schema - zi.directlyProvides(self, _schema) + ifaces = set([_schema]) | set(allYourBase(_schema)) + zi.directlyProvides(self, *ifaces) self.state = kw.get('state', '') self.editor = '' self.repo = '' Index: PanGalactic/pangalactic/node/cache.py diff -u PanGalactic/pangalactic/node/cache.py:1.39 PanGalactic/pangalactic/node/cache.py:1.40 --- PanGalactic/pangalactic/node/cache.py:1.39 Sun Jul 22 14:26:39 2007 +++ PanGalactic/pangalactic/node/cache.py Sun Jul 22 19:05:57 2007 @@ -1,9 +1,9 @@ """ Local object cache manager (a layer over ZODB) -@version: $Revision: 1.39 $ +@version: $Revision: 1.40 $ """ -__version__ = "$Revision: 1.39 $"[11:-2] +__version__ = "$Revision: 1.40 $"[11:-2] # Python import logging, os, sys @@ -13,6 +13,9 @@ from ZODB import FileStorage, DB import transaction +# Zope Interface +import zope.interface as zi + # Twisted from twisted.python.reflect import allYourBase @@ -88,15 +91,14 @@ def addInterfaces(self, ifaces): """ - For an C{Interface}, set up a root dictionary in the cache that - will contain C{PgefObject} instances whose _schema is that - C{Interface}. - - @param ifaces: a list of C{Interface} instances that will be supported - by the cache - @type ifaces: C{list} of L{zope.interface.interface.InterfaceClass} + For a L{zope.interface.Interface}, set up a root dictionary in the cache + that will contain objects whose _schema is that C{Interface}. + + @param ifaces: a list of L{zope.interface.Interface} instances that + will be supported by the cache + @type ifaces: C{list} of L{zope.interface.Interface} """ - self.log.debug(' - ObjectCache.addInterfaces') + self.log.debug(' - addInterfaces()') self.interfaces = getattr(self, 'interfaces', {}) for i in ifaces: self.log.debug(' + %s' % i.__name__) @@ -109,35 +111,31 @@ def saveObjects(self, objs): """ - Save some objects to the cache. Map the object's oid to the object in - C{self.objs} (the dictionary that maps oids to objects in the cache). - By default, also add the object to the dictionary - C{self.dbroot[schema]}, where C{schema} is the object's - _schema.__name__, and to any dictionaries whose schemas are parents of - the object's _schema. + Save objects to the cache and add them to C{self.objs} -- a dictionary + that maps oids to objects in the cache -- and also to all appropriate + C{self.dbroot[schema]}s -- dictionaries like C{self.objs} except + restricted to objects that provide the specified C{schema}. @param objs: objects to be saved - @type objs: list (usually of instances of - L{pangalactic.meta.pgefobject.PgefObject} + @type objs: L{list} containing instances that provide + L{pangalactic.meta.interfaces.IPgefObject} """ self.log.debug(" - saveObjects()") # TODO: 'merge' -- i.e., in case of oid collision, compare # last-modified dates. If the object to be saved has been modified more # recently than the cache copy, replace the cache copy; if both have # been modified, notify user of the conflict. - # TODO: track down weird bug that caused only one Model to be committed - # to the OidsLookup dictionary when a group of Models was saved. if type(objs) is not list: objs = [objs] - self.log.debug(" + oids: %s" % str([o.oid for o in objs])) + self.log.debug(" + saving objects with oids: %s" % str( + [o.oid for o in objs])) for o in objs: - if hasattr(o, '_schema'): - self.objs[o.oid] = o - self.dbroot[o._schema.__name__][o.oid] = o - # dictionaries of parents of the object's _schema - for name in [x.__name__ for x in self.interfaces.values() - if x in allYourBase(o._schema)]: - self.dbroot[name][o.oid] = o + self.objs[o.oid] = o + self.dbroot[o._schema.__name__][o.oid] = o + # add to the appropriate interface-specific dictionaries + for name in [x.__name__ for x in self.interfaces.values() + if x in list(zi.providedBy(o))]: + self.dbroot[name][o.oid] = o self.commit() def deleteObjects(self, objs): @@ -234,7 +232,7 @@ @return: a list of objects @rtype: L{list} """ - self.log.debug(" - searchLocalObjects") + self.log.debug(" - searchLocalObjects()") self.log.debug(" + kw = %s" % str(kw)) schema_names = schema_names or [] if schema_names: Index: PanGalactic/pangalactic/node/pangalaxian.py diff -u PanGalactic/pangalactic/node/pangalaxian.py:1.197 PanGalactic/pangalactic/node/pangalaxian.py:1.198 --- PanGalactic/pangalactic/node/pangalaxian.py:1.197 Sun Jul 22 14:26:39 2007 +++ PanGalactic/pangalactic/node/pangalaxian.py Sun Jul 22 19:05:57 2007 @@ -2,16 +2,16 @@ # -*- coding: ANSI_X3.4-1968 -*- # generated by wxGlade 0.3.5.1 on Tue Feb 1 00:19:02 2005 -# $Id: pangalaxian.py,v 1.197 2007/07/22 18:26:39 waterbug Exp $ +# $Id: pangalaxian.py,v 1.198 2007/07/22 23:05:57 waterbug Exp $ """ Main application module for PanGalaxian, the PGEF GUI client. WE ARE THE PANGALAXIANS! :) -@version: $Revision: 1.197 $ +@version: $Revision: 1.198 $ """ -__version__ = "$Revision: 1.197 $"[11:-2] +__version__ = "$Revision: 1.198 $"[11:-2] # Python import logging @@ -635,7 +635,7 @@ # part of the current PanGalaxian context is a namespace), the # projectwidget should show only the C{id} of each Project; otherwise, # it should show the C{id_ns : id} pair for each Project. - self.projectwidget.items = [(orb.projects[oid].id, oid) + self.projectwidget.items = [(oid, oid) for oid in prefs['projects']] if state['project'] not in prefs['projects']: state['project'] = 'Any' From waterbug at step.nasa.gov Sun Jul 22 20:41:14 2007 From: waterbug at step.nasa.gov (waterbug CVS) Date: Sun Jul 22 20:41:16 2007 Subject: [pangalactic-commits] Fix a test. Message-ID: <200707230041.l6N0fEtj008261@ned.gsfc.nasa.gov> Modified files: PanGalactic/pangalactic/test/test_pgefobject.py 1.5 1.6 Log message: Fix a test. Index: PanGalactic/pangalactic/test/test_pgefobject.py diff -u PanGalactic/pangalactic/test/test_pgefobject.py:1.5 PanGalactic/pangalactic/test/test_pgefobject.py:1.6 --- PanGalactic/pangalactic/test/test_pgefobject.py:1.5 Mon Jul 16 11:46:11 2007 +++ PanGalactic/pangalactic/test/test_pgefobject.py Sun Jul 22 20:41:12 2007 @@ -1,4 +1,4 @@ -# $Id: test_pgefobject.py,v 1.5 2007/07/16 15:46:11 waterbug Exp $ +# $Id: test_pgefobject.py,v 1.6 2007/07/23 00:41:12 waterbug Exp $ """ Unit tests for pangalactic.meta.pgefobject @@ -65,8 +65,7 @@ def test_01_PgefObjectImplementsInterfaces(self): """CASE: PgefObject implements required interfaces""" - value = (IPgefObject.implementedBy(PgefObject) and - IMofObject.implementedBy(PgefObject)) + value = (IPgefObject.implementedBy(PgefObject)) expected = True self.failUnlessEqual(expected, value) From waterbug at step.nasa.gov Mon Jul 23 03:45:49 2007 From: waterbug at step.nasa.gov (waterbug CVS) Date: Mon Jul 23 03:45:51 2007 Subject: [pangalactic-commits] Lose some worthless junk. Message-ID: <200707230745.l6N7jnW8009307@ned.gsfc.nasa.gov> Modified files: PanGalactic/pangalactic/meta/pgefobject.py 1.23 1.24 Log message: Lose some worthless junk. Index: PanGalactic/pangalactic/meta/pgefobject.py diff -u PanGalactic/pangalactic/meta/pgefobject.py:1.23 PanGalactic/pangalactic/meta/pgefobject.py:1.24 --- PanGalactic/pangalactic/meta/pgefobject.py:1.23 Sun Jul 22 19:05:57 2007 +++ PanGalactic/pangalactic/meta/pgefobject.py Mon Jul 23 03:45:47 2007 @@ -1,11 +1,11 @@ -# $Id: pgefobject.py,v 1.23 2007/07/22 23:05:57 waterbug Exp $ +# $Id: pgefobject.py,v 1.24 2007/07/23 07:45:47 waterbug Exp $ """ The Mother of all PanGalactic "domain objects". -@version: $Revision: 1.23 $ +@version: $Revision: 1.24 $ """ -__version__ = "$Revision: 1.23 $"[11:-2] +__version__ = "$Revision: 1.24 $"[11:-2] # Louie (messaging package) from louie import dispatcher @@ -70,7 +70,7 @@ L{PgefPropertySpec}), a L{PgefProperty} instance is created. If a keyword argument by that name is passed to the object's constructor, its value will be assigned. - @type _schema: L{Interface} + @type _schema: L{zi.Interface} @param state: backward compatibility (may go away). @type state: L{str} @@ -95,9 +95,8 @@ # significant interface (e.g., deriving Dublin Core attributes from PGEF # IDocument attributes). The form of such declarative mappings is TBD, # and may have a relationship to adaptation. - # TODO: this stuff should be part of some "type" apparatus in - # PgefPropertySpec -- Python datatype dependencies need to be controlled - # in one place. + # TODO: this stuff should use some "type" apparatus in PgefPropertySpec + # -- Python datatype dependencies need to be controlled in one place. for a in self._schema: val = kw.get(a) if not self._schema[a].functional: @@ -265,23 +264,6 @@ d['_schema_name'] = self._schema.__name__ return d - # IMofObject Interface ops - - def getMetaClass(self): - return self._schema - - def get(self, property): - """ - Get the value of an attribute. - """ - return getattr(self, property) - - def set(self, property, value): - """ - Set the value of an attribute. - """ - setattr(self, property, value) - @cook.when_type(PgefObject) def cookPgefObject(value): From waterbug at step.nasa.gov Mon Jul 23 15:40:10 2007 From: waterbug at step.nasa.gov (waterbug CVS) Date: Mon Jul 23 15:40:12 2007 Subject: [pangalactic-commits] Never say "always". Message-ID: <200707231940.l6NJeAtp017413@ned.gsfc.nasa.gov> Modified files: PanGalactic/pangalactic/utils/io/part21_preparse.py 1.6 1.7 Log message: Never say "always". Index: PanGalactic/pangalactic/utils/io/part21_preparse.py diff -u PanGalactic/pangalactic/utils/io/part21_preparse.py:1.6 PanGalactic/pangalactic/utils/io/part21_preparse.py:1.7 --- PanGalactic/pangalactic/utils/io/part21_preparse.py:1.6 Fri May 4 20:51:16 2007 +++ PanGalactic/pangalactic/utils/io/part21_preparse.py Mon Jul 23 15:40:08 2007 @@ -1,14 +1,14 @@ #!/usr/bin/env python -# $Id: part21_preparse.py,v 1.6 2007/05/05 00:51:16 waterbug Exp $ +# $Id: part21_preparse.py,v 1.7 2007/07/23 19:40:08 waterbug Exp $ """ A generic (no dependencies on the rest of PanGalactic) reader/writer for "Part 21 files" (ISO 10303-21, STEP "Clear Text Encoding", a serialization format). This module reads a STEP Part 21 data file into a set of Python dictionaries. -@version: $Revision: 1.6 $ +@version: $Revision: 1.7 $ """ -__version__ = "$Revision: 1.6 $"[11:-2] +__version__ = "$Revision: 1.7 $"[11:-2] import re, sys, string, time from optparse import OptionParser @@ -163,7 +163,6 @@ def readStepFile(f=None, perf=False, verbose=False, test=False): - # NOTE: test is always True for now ... """ (These docs are fiction at the moment ... ;) From waterbug at step.nasa.gov Mon Jul 23 23:25:23 2007 From: waterbug at step.nasa.gov (waterbug CVS) Date: Mon Jul 23 23:25:24 2007 Subject: [pangalactic-commits] Super-trivial comment modifications. Message-ID: <200707240325.l6O3PNJv020954@ned.gsfc.nasa.gov> Modified files: PanGalactic/pangalactic/meta/pgefobject.py 1.24 1.25 Log message: Super-trivial comment modifications. Index: PanGalactic/pangalactic/meta/pgefobject.py diff -u PanGalactic/pangalactic/meta/pgefobject.py:1.24 PanGalactic/pangalactic/meta/pgefobject.py:1.25 --- PanGalactic/pangalactic/meta/pgefobject.py:1.24 Mon Jul 23 03:45:47 2007 +++ PanGalactic/pangalactic/meta/pgefobject.py Mon Jul 23 23:25:22 2007 @@ -1,11 +1,11 @@ -# $Id: pgefobject.py,v 1.24 2007/07/23 07:45:47 waterbug Exp $ +# $Id: pgefobject.py,v 1.25 2007/07/24 03:25:22 waterbug Exp $ """ The Mother of all PanGalactic "domain objects". -@version: $Revision: 1.24 $ +@version: $Revision: 1.25 $ """ -__version__ = "$Revision: 1.24 $"[11:-2] +__version__ = "$Revision: 1.25 $"[11:-2] # Louie (messaging package) from louie import dispatcher @@ -18,7 +18,7 @@ # PanGalactic from pangalactic.meta.datatypes import cook -from pangalactic.meta.interfaces import IPgefObject, IMofObject +from pangalactic.meta.interfaces import IPgefObject from pangalactic.utils.toolbox import isAString from pangalactic.utils.datetimes import dtstamp, getDate @@ -27,9 +27,9 @@ """ L{PgefObject} is the Python class that represents "domain objects". - The C{BetaUnit} auxiliary class (a reference to "The Last Starfighter") is a - golem-like entity that takes the schemas and interfaces pertinent to any - I{domain object} and implements them. + The C{BetaUnit} auxiliary class (see "The Last Starfighter") is a golem-like + entity that takes the schemas and interfaces pertinent to any I{domain + object} and implements them. Here is a description of what a domain object is, from "The Wiki" U{http://www.c2.com/cgi/wiki}: @@ -100,7 +100,7 @@ for a in self._schema: val = kw.get(a) if not self._schema[a].functional: - # TODO: consider using set([]) instead of [] + # TODO: consider using set instead of list here setattr(self, a, val or []) else: if self._schema[a].property_type == 'object': From waterbug at step.nasa.gov Tue Jul 24 16:30:09 2007 From: waterbug at step.nasa.gov (waterbug CVS) Date: Tue Jul 24 16:30:11 2007 Subject: [pangalactic-commits] Begin using zope.schema in pgefproperty. Message-ID: <200707242030.l6OKU9Xw000759@ned.gsfc.nasa.gov> Modified files: PanGalactic/pangalactic/meta/pgefproperty.py 1.69 1.70 Log message: Begin using zope.schema in pgefproperty. Index: PanGalactic/pangalactic/meta/pgefproperty.py diff -u PanGalactic/pangalactic/meta/pgefproperty.py:1.69 PanGalactic/pangalactic/meta/pgefproperty.py:1.70 --- PanGalactic/pangalactic/meta/pgefproperty.py:1.69 Mon Jun 25 00:13:56 2007 +++ PanGalactic/pangalactic/meta/pgefproperty.py Tue Jul 24 16:30:07 2007 @@ -1,12 +1,13 @@ -# $Id: pgefproperty.py,v 1.69 2007/06/25 04:13:56 waterbug Exp $ +# $Id: pgefproperty.py,v 1.70 2007/07/24 20:30:07 waterbug Exp $ """ -PgefProperty is based on the CommonProperty recipe by Raymond Hettinger. +PgefProperty is based on FieldProperty and CommonProperty. -@version: $Revision: 1.69 $ +@version: $Revision: 1.70 $ """ -__version__ = "$Revision: 1.69 $"[11:-2] +__version__ = "$Revision: 1.70 $"[11:-2] +from zope.schema.fieldproperty import FieldProperty # TODO: add a new interface-oriented getDefault fn @@ -32,9 +33,10 @@ class PgefProperty(object): """ - PgefProperty is based on the CommonProperty recipe by Raymond Hettinger. - [Ref: Python Cookbook, 2nd Edition, recipe 20.5, "Using One Method As - Accessor for Multiple Attributes".] + PgefProperty is based on the ZopeSchema L{FieldProperty} and the + C{CommonProperty} recipe by Raymond Hettinger. [Ref: Python Cookbook, 2nd + Edition, recipe 20.5, "Using One Method As Accessor for Multiple + Attributes".] """ # TODO: # * message triggered by fset ('property x of obj y was set') @@ -43,7 +45,8 @@ # * lazy evaluation def __init__(self, name, fget=getattr, fset=setattr, fdel=delattr, doc=None): - # NOTE: this depends on addProperty adding the '__' attr + # NOTE: this depends on the '__' attr being added by the class that + # receives this PgefProperty self.internal_name = ''.join(['__', name]) self.fget = fget self.fset = fset From waterbug at step.nasa.gov Wed Jul 25 16:16:26 2007 From: waterbug at step.nasa.gov (waterbug CVS) Date: Wed Jul 25 16:16:28 2007 Subject: [pangalactic-commits] Doc updates. Message-ID: <200707252016.l6PKGQHX019380@ned.gsfc.nasa.gov> Modified files: PanGalactic/pangalactic/meta/pgefproperty.py 1.70 1.71 Log message: Doc updates. Index: PanGalactic/pangalactic/meta/pgefproperty.py diff -u PanGalactic/pangalactic/meta/pgefproperty.py:1.70 PanGalactic/pangalactic/meta/pgefproperty.py:1.71 --- PanGalactic/pangalactic/meta/pgefproperty.py:1.70 Tue Jul 24 16:30:07 2007 +++ PanGalactic/pangalactic/meta/pgefproperty.py Wed Jul 25 16:16:24 2007 @@ -1,19 +1,11 @@ -# $Id: pgefproperty.py,v 1.70 2007/07/24 20:30:07 waterbug Exp $ +# $Id: pgefproperty.py,v 1.71 2007/07/25 20:16:24 waterbug Exp $ """ -PgefProperty is based on FieldProperty and CommonProperty. +PgefProperty is based on CommonProperty and FieldProperty. -@version: $Revision: 1.70 $ +@version: $Revision: 1.71 $ """ -__version__ = "$Revision: 1.70 $"[11:-2] - -from zope.schema.fieldproperty import FieldProperty - - -# TODO: add a new interface-oriented getDefault fn -def getDefault(if_name, prop_id): - # get a default value for the PgefProperty with id prop_id - return '' +__version__ = "$Revision: 1.71 $"[11:-2] class Foo(object): @@ -33,10 +25,10 @@ class PgefProperty(object): """ - PgefProperty is based on the ZopeSchema L{FieldProperty} and the - C{CommonProperty} recipe by Raymond Hettinger. [Ref: Python Cookbook, 2nd - Edition, recipe 20.5, "Using One Method As Accessor for Multiple - Attributes".] + PgefProperty is based on the C{CommonProperty} recipe by Raymond Hettinger. + [Ref: Python Cookbook, 2nd Edition, recipe 20.5, "Using One Method As + Accessor for Multiple Attributes".] It also incorporates some ideas from + the ZopeSchema L{FieldProperty} class. """ # TODO: # * message triggered by fset ('property x of obj y was set')