[Commits] (morgen) Sharing framework handles mixins;
moved tools.timing to util.timing
commits at osafoundation.org
commits at osafoundation.org
Wed Apr 27 13:21:27 PDT 2005
Commit by: morgen
Modified files:
chandler/Chandler.py 1.68 1.69
chandler/application/Application.py 1.323 1.324
chandler/application/Parcel.py 1.56 1.57
chandler/application/tests/TestAllParcels.py 1.5 1.6
chandler/application/tests/TestParcelPerf.py 1.2 1.3
chandler/distrib/linux/manifest.debug.linux 1.41 1.42
chandler/distrib/linux/manifest.linux 1.60 1.61
chandler/distrib/osx/manifest.debug.osx 1.33 1.34
chandler/distrib/osx/manifest.osx 1.47 1.48
chandler/distrib/win/manifest.debug.win 1.38 1.39
chandler/distrib/win/manifest.win 1.48 1.49
chandler/parcels/osaf/contentmodel/ContentModel.py 1.56 1.57
chandler/parcels/osaf/framework/blocks/DocumentTypes.py 1.7 1.8
chandler/parcels/osaf/framework/blocks/parcel.xml 1.163 1.164
chandler/parcels/osaf/framework/blocks/calendar/parcel.xml 1.16 1.17
chandler/parcels/osaf/framework/sharing/Sharing.py 1.93 1.94
chandler/parcels/osaf/framework/sharing/SubscribeDialog.py 1.1 1.2
chandler/repository/query/Query.py 1.41 1.42
chandler/repository/query/tests/TestSimpleQueries.py 1.25 1.26
chandler/repository/tests/TestDelete.py 1.4 1.5
chandler/repository/tests/TestRepository.py 1.12 1.13
chandler/repository/tests/TestRepositoryBasic.py 1.11 1.12
chandler/util/.cvsignore None 1.1
chandler/util/__init__.py None 1.1
chandler/util/timing.py None 1.1
Log message:
Sharing framework handles mixins; moved tools.timing to util.timing
ViewCVS links:
http://cvs.osafoundation.org/index.cgi/chandler/Chandler.py.diff?r1=text&tr1=1.68&r2=text&tr2=1.69
http://cvs.osafoundation.org/index.cgi/chandler/application/Application.py.diff?r1=text&tr1=1.323&r2=text&tr2=1.324
http://cvs.osafoundation.org/index.cgi/chandler/application/Parcel.py.diff?r1=text&tr1=1.56&r2=text&tr2=1.57
http://cvs.osafoundation.org/index.cgi/chandler/application/tests/TestAllParcels.py.diff?r1=text&tr1=1.5&r2=text&tr2=1.6
http://cvs.osafoundation.org/index.cgi/chandler/application/tests/TestParcelPerf.py.diff?r1=text&tr1=1.2&r2=text&tr2=1.3
http://cvs.osafoundation.org/index.cgi/chandler/distrib/linux/manifest.debug.linux.diff?r1=text&tr1=1.41&r2=text&tr2=1.42
http://cvs.osafoundation.org/index.cgi/chandler/distrib/linux/manifest.linux.diff?r1=text&tr1=1.60&r2=text&tr2=1.61
http://cvs.osafoundation.org/index.cgi/chandler/distrib/osx/manifest.debug.osx.diff?r1=text&tr1=1.33&r2=text&tr2=1.34
http://cvs.osafoundation.org/index.cgi/chandler/distrib/osx/manifest.osx.diff?r1=text&tr1=1.47&r2=text&tr2=1.48
http://cvs.osafoundation.org/index.cgi/chandler/distrib/win/manifest.debug.win.diff?r1=text&tr1=1.38&r2=text&tr2=1.39
http://cvs.osafoundation.org/index.cgi/chandler/distrib/win/manifest.win.diff?r1=text&tr1=1.48&r2=text&tr2=1.49
http://cvs.osafoundation.org/index.cgi/chandler/parcels/osaf/contentmodel/ContentModel.py.diff?r1=text&tr1=1.56&r2=text&tr2=1.57
http://cvs.osafoundation.org/index.cgi/chandler/parcels/osaf/framework/blocks/DocumentTypes.py.diff?r1=text&tr1=1.7&r2=text&tr2=1.8
http://cvs.osafoundation.org/index.cgi/chandler/parcels/osaf/framework/blocks/parcel.xml.diff?r1=text&tr1=1.163&r2=text&tr2=1.164
http://cvs.osafoundation.org/index.cgi/chandler/parcels/osaf/framework/blocks/calendar/parcel.xml.diff?r1=text&tr1=1.16&r2=text&tr2=1.17
http://cvs.osafoundation.org/index.cgi/chandler/parcels/osaf/framework/sharing/Sharing.py.diff?r1=text&tr1=1.93&r2=text&tr2=1.94
http://cvs.osafoundation.org/index.cgi/chandler/parcels/osaf/framework/sharing/SubscribeDialog.py.diff?r1=text&tr1=1.1&r2=text&tr2=1.2
http://cvs.osafoundation.org/index.cgi/chandler/repository/query/Query.py.diff?r1=text&tr1=1.41&r2=text&tr2=1.42
http://cvs.osafoundation.org/index.cgi/chandler/repository/query/tests/TestSimpleQueries.py.diff?r1=text&tr1=1.25&r2=text&tr2=1.26
http://cvs.osafoundation.org/index.cgi/chandler/repository/tests/TestDelete.py.diff?r1=text&tr1=1.4&r2=text&tr2=1.5
http://cvs.osafoundation.org/index.cgi/chandler/repository/tests/TestRepository.py.diff?r1=text&tr1=1.12&r2=text&tr2=1.13
http://cvs.osafoundation.org/index.cgi/chandler/repository/tests/TestRepositoryBasic.py.diff?r1=text&tr1=1.11&r2=text&tr2=1.12
http://cvs.osafoundation.org/index.cgi/chandler/util/.cvsignore?rev=1.1&content-type=text/vnd.viewcvs-markup
http://cvs.osafoundation.org/index.cgi/chandler/util/__init__.py?rev=1.1&content-type=text/vnd.viewcvs-markup
http://cvs.osafoundation.org/index.cgi/chandler/util/timing.py?rev=1.1&content-type=text/vnd.viewcvs-markup
Index: chandler/distrib/osx/manifest.osx
diff -u chandler/distrib/osx/manifest.osx:1.47 chandler/distrib/osx/manifest.osx:1.48
--- chandler/distrib/osx/manifest.osx:1.47 Tue Mar 29 11:12:46 2005
+++ chandler/distrib/osx/manifest.osx Wed Apr 27 13:21:17 2005
@@ -56,7 +56,7 @@
exclude=CVS,*.pyo,*.pyc
parcels
exclude=CVS,tests,*.pyo,*.pyc
-tools
+util
glob=*
repository
Index: chandler/distrib/win/manifest.win
diff -u chandler/distrib/win/manifest.win:1.48 chandler/distrib/win/manifest.win:1.49
--- chandler/distrib/win/manifest.win:1.48 Wed Apr 6 21:00:24 2005
+++ chandler/distrib/win/manifest.win Wed Apr 27 13:21:17 2005
@@ -47,7 +47,7 @@
exclude=CVS,*.pyo,*.pyc
parcels
exclude=CVS,tests,*.pyo,*.pyc
-tools
+util
glob=*
repository
Index: chandler/application/Parcel.py
diff -u chandler/application/Parcel.py:1.56 chandler/application/Parcel.py:1.57
--- chandler/application/Parcel.py:1.56 Mon Apr 25 14:54:45 2005
+++ chandler/application/Parcel.py Wed Apr 27 13:21:15 2005
@@ -25,7 +25,7 @@
#@@@Temporary testing tool written by Morgen -- DJA
timing = False
-if timing: import tools.timing
+if timing: import util.timing
class Manager(Item):
"""
@@ -266,7 +266,7 @@
Also check files for XML correctness (mismatched tags, etc).
"""
#@@@Temporary testing tool written by Morgen -- DJA
- if timing: tools.timing.begin("Scan XML for namespaces")
+ if timing: util.timing.begin("Scan XML for namespaces")
class MappingHandler(xml.sax.ContentHandler):
""" A SAX2 handler for parsing namespace information """
@@ -391,7 +391,7 @@
raise
#@@@Temporary testing tool written by Morgen -- DJA
- if timing: tools.timing.end("Scan XML for namespaces")
+ if timing: util.timing.end("Scan XML for namespaces")
def __walkParcels(self, rootParcel):
"""
@@ -560,7 +560,7 @@
globalDepth = 0
#@@@Temporary testing tool written by Morgen -- DJA
- if timing: tools.timing.begin("Load parcels")
+ if timing: util.timing.begin("Load parcels")
try:
self.resetState()
@@ -624,7 +624,7 @@
raise
#@@@Temporary testing tool written by Morgen -- DJA
- if timing: tools.timing.end("Load parcels")
+ if timing: util.timing.end("Load parcels")
def handleKind(self, handler, kind):
"""
@@ -1370,7 +1370,7 @@
"""
#@@@Temporary testing tool written by Morgen -- DJA
- if timing: tools.timing.begin("Creating items")
+ if timing: util.timing.begin("Creating items")
try:
if className:
@@ -1385,7 +1385,7 @@
raise
#@@@Temporary testing tool written by Morgen -- DJA
- if timing: tools.timing.end("Creating items")
+ if timing: util.timing.end("Creating items")
if item is None:
explanation = "Item not created"
@@ -1419,7 +1419,7 @@
self.saveState(line=line, file=file)
#@@@Temporary testing tool written by Morgen -- DJA
- if timing: tools.timing.begin("Attribute assignments")
+ if timing: util.timing.begin("Attribute assignments")
if assignment["assignType"] == self._DELAYED_REFERENCE:
@@ -1604,7 +1604,7 @@
raise ParcelException(explanation)
#@@@Temporary testing tool written by Morgen -- DJA
- if timing: tools.timing.end("Attribute assignments")
+ if timing: util.timing.end("Attribute assignments")
# Remove any assignments still remaining in the old value set, since
# we didn't see them in the new XML
Index: chandler/parcels/osaf/contentmodel/ContentModel.py
diff -u chandler/parcels/osaf/contentmodel/ContentModel.py:1.56 chandler/parcels/osaf/contentmodel/ContentModel.py:1.57
--- chandler/parcels/osaf/contentmodel/ContentModel.py:1.56 Fri Mar 18 09:21:37 2005
+++ chandler/parcels/osaf/contentmodel/ContentModel.py Wed Apr 27 13:21:18 2005
@@ -1,8 +1,8 @@
""" Classes used for contentmodel parcel and kinds.
"""
-__revision__ = "$Revision: 1.56 $"
-__date__ = "$Date: 2005/03/18 17:21:37 $"
+__revision__ = "$Revision: 1.57 $"
+__date__ = "$Date: 2005/04/27 20:21:18 $"
__copyright__ = "Copyright (c) 2003-2005 Open Source Applications Foundation"
__license__ = "http://osafoundation.org/Chandler_0.1_license_terms.htm"
@@ -14,7 +14,6 @@
import repository.item.Query as Query
import mx.DateTime as DateTime
import logging
-import tools.timing
import application.Globals as Globals
Index: chandler/repository/tests/TestRepositoryBasic.py
diff -u chandler/repository/tests/TestRepositoryBasic.py:1.11 chandler/repository/tests/TestRepositoryBasic.py:1.12
--- chandler/repository/tests/TestRepositoryBasic.py:1.11 Fri Feb 4 12:35:54 2005
+++ chandler/repository/tests/TestRepositoryBasic.py Wed Apr 27 13:21:23 2005
@@ -2,8 +2,8 @@
Basic Unit tests for Chandler repository
"""
-__revision__ = "$Revision: 1.11 $"
-__date__ = "$Date: 2005/02/04 20:35:54 $"
+__revision__ = "$Revision: 1.12 $"
+__date__ = "$Date: 2005/04/27 20:21:23 $"
__copyright__ = "Copyright (c) 2003-2004 Open Source Applications Foundation"
__license__ = "http://osafoundation.org/Chandler_0.1_license_terms.htm"
@@ -12,7 +12,7 @@
from bsddb.db import DBNoSuchFileError
from repository.persistence.RepositoryError import RepositoryOpenDeniedError
from repository.persistence.DBRepository import DBRepository
-import tools.timing
+import util.timing
class BasicRepositoryTest(unittest.TestCase):
""" Very basic repository tests """
@@ -38,11 +38,11 @@
def testCreate(self):
""" Create a repository and make sure it is open """
- tools.timing.reset()
- tools.timing.begin("repository.TestRepositoryBasic.testCreate")
+ util.timing.reset()
+ util.timing.begin("repository.TestRepositoryBasic.testCreate")
self.rep.create()
- tools.timing.end("repository.TestRepositoryBasic.testCreate")
- tools.timing.results(verbose=False)
+ util.timing.end("repository.TestRepositoryBasic.testCreate")
+ util.timing.results(verbose=False)
self.assert_(self.rep.check())
self.assert_(self.rep.isOpen())
@@ -61,11 +61,11 @@
self.assert_(self.rep.check())
schemaPack = os.path.join(self.rootdir, 'repository',
'packs', 'schema.pack')
- tools.timing.reset()
- tools.timing.begin("repository.TestRepositoryBasic.testLoadPack")
+ util.timing.reset()
+ util.timing.begin("repository.TestRepositoryBasic.testLoadPack")
self.rep.loadPack(schemaPack)
- tools.timing.end("repository.TestRepositoryBasic.testLoadPack")
- tools.timing.results(verbose=False)
+ util.timing.end("repository.TestRepositoryBasic.testLoadPack")
+ util.timing.results(verbose=False)
self.assert_(self.rep.check())
def tearDown(self):
Index: chandler/parcels/osaf/framework/blocks/parcel.xml
diff -u chandler/parcels/osaf/framework/blocks/parcel.xml:1.163 chandler/parcels/osaf/framework/blocks/parcel.xml:1.164
--- chandler/parcels/osaf/framework/blocks/parcel.xml:1.163 Mon Apr 25 13:49:21 2005
+++ chandler/parcels/osaf/framework/blocks/parcel.xml Wed Apr 27 13:21:19 2005
@@ -1,7 +1,7 @@
<?xml version="1.0" encoding="iso-8859-1"?>
-<!-- $Revision: 1.163 $ -->
-<!-- $Date: 2005/04/25 20:49:21 $ -->
+<!-- $Revision: 1.164 $ -->
+<!-- $Date: 2005/04/27 20:21:19 $ -->
<!-- Copyright (c) 2003-2005 Open Source Applications Foundation -->
<!-- License: http://osafoundation.org/Chandler_0.1_license_terms.htm -->
@@ -174,6 +174,17 @@
<attributes itemref="docSchema:foregroundColor"/>
<attributes itemref="docSchema:backgroundColor"/>
+ <Cloud itsName="SharingCloud">
+ <Endpoint itsName="foregroundColor">
+ <attribute value="foregroundColor"/>
+ </Endpoint>
+ <endpoints alias="foregroundColor" itemref="docSchema:ColorStyle/SharingCloud/foregroundColor"/>
+ <Endpoint itsName="backgroundColor">
+ <attribute value="backgroundColor"/>
+ </Endpoint>
+ <endpoints alias="backgroundColor" itemref="docSchema:ColorStyle/SharingCloud/backgroundColor"/>
+ </Cloud>
+ <clouds alias="sharing" itemref="docSchema:ColorStyle/SharingCloud"/>
</Kind>
<Attribute itsName="foregroundColor">
Index: chandler/repository/query/tests/TestSimpleQueries.py
diff -u chandler/repository/query/tests/TestSimpleQueries.py:1.25 chandler/repository/query/tests/TestSimpleQueries.py:1.26
--- chandler/repository/query/tests/TestSimpleQueries.py:1.25 Fri Feb 18 16:28:13 2005
+++ chandler/repository/query/tests/TestSimpleQueries.py Wed Apr 27 13:21:22 2005
@@ -1,12 +1,12 @@
-__revision__ = "$Revision: 1.25 $"
-__date__ = "$Date: 2005/02/19 00:28:13 $"
+__revision__ = "$Revision: 1.26 $"
+__date__ = "$Date: 2005/04/27 20:21:22 $"
__copyright__ = "Copyright (c) 2004, 2005 Open Source Applications Foundation"
__license__ = "http://osafoundation.org/Chandler_0.1_license_terms.htm"
import os, unittest
import repository.query.tests.QueryTestCase as QueryTestCase
-import tools.timing
+import util.timing
class TestSimpleQueries(QueryTestCase.QueryTestCase):
@@ -29,12 +29,12 @@
def testKindQuery(self):
""" Test a simulation of kindQuery """
- tools.timing.reset()
- tools.timing.begin("repository.query.tests.TestSimpleQueries.testKindQuery")
+ util.timing.reset()
+ util.timing.begin("repository.query.tests.TestSimpleQueries.testKindQuery")
results = self._compileQuery('testKindQuery','for i in "//Schema/Core/Kind" where True')
self._checkQuery(lambda i: False, results)
- tools.timing.end("repository.query.tests.TestSimpleQueries.testKindQuery")
- tools.timing.results(verbose=False)
+ util.timing.end("repository.query.tests.TestSimpleQueries.testKindQuery")
+ util.timing.results(verbose=False)
def testFunctionKindQuery(self):
""" Test calling a function in the query predicate """
Index: chandler/application/Application.py
diff -u chandler/application/Application.py:1.323 chandler/application/Application.py:1.324
--- chandler/application/Application.py:1.323 Mon Apr 25 11:57:34 2005
+++ chandler/application/Application.py Wed Apr 27 13:21:15 2005
@@ -1,5 +1,5 @@
-__version__ = "$Revision: 1.323 $"
-__date__ = "$Date: 2005/04/25 18:57:34 $"
+__version__ = "$Revision: 1.324 $"
+__date__ = "$Date: 2005/04/27 20:21:15 $"
__copyright__ = "Copyright (c) 2003-2005 Open Source Applications Foundation"
__license__ = "http://osafoundation.org/Chandler_0.1_license_terms.htm"
@@ -20,7 +20,7 @@
logger.setLevel(logging.INFO)
#@@@Temporary testing tool written by Morgen -- DJA
-import tools.timing
+import util.timing
# Increment this constant whenever you change the schema:
SCHEMA_VERSION = "10"
@@ -128,7 +128,7 @@
PARCEL_IMPORT = 'parcels'
def OnInit(self):
- tools.timing.begin("wxApplication OnInit") #@@@Temporary testing tool written by Morgen -- DJA
+ util.timing.begin("wxApplication OnInit") #@@@Temporary testing tool written by Morgen -- DJA
"""
Main application initialization.
"""
@@ -346,7 +346,7 @@
Globals.wakeupCaller = WakeupCaller(self.UIRepositoryView.repository)
Globals.wakeupCaller.startup()
- tools.timing.end("wxApplication OnInit") #@@@Temporary testing tool written by Morgen -- DJA
+ util.timing.end("wxApplication OnInit") #@@@Temporary testing tool written by Morgen -- DJA
return True #indicates we succeeded with initialization
Index: chandler/parcels/osaf/framework/sharing/SubscribeDialog.py
diff -u chandler/parcels/osaf/framework/sharing/SubscribeDialog.py:1.1 chandler/parcels/osaf/framework/sharing/SubscribeDialog.py:1.2
--- chandler/parcels/osaf/framework/sharing/SubscribeDialog.py:1.1 Mon Apr 25 17:28:09 2005
+++ chandler/parcels/osaf/framework/sharing/SubscribeDialog.py Wed Apr 27 13:21:21 2005
@@ -93,6 +93,7 @@
share.delete()
except Sharing.SharingError, err:
self.__showStatus("Sharing Error:\n%s" % err.message)
+ self.__showStatus("Exception:\n%s" % traceback.format_exc(10))
share.conduit.delete()
share.format.delete()
share.delete()
Index: chandler/repository/tests/TestDelete.py
diff -u chandler/repository/tests/TestDelete.py:1.4 chandler/repository/tests/TestDelete.py:1.5
--- chandler/repository/tests/TestDelete.py:1.4 Fri Feb 4 12:35:54 2005
+++ chandler/repository/tests/TestDelete.py Wed Apr 27 13:21:23 2005
@@ -2,8 +2,8 @@
Test deletion of items
"""
-__revision__ = "$Revision: 1.4 $"
-__date__ = "$Date: 2005/02/04 20:35:54 $"
+__revision__ = "$Revision: 1.5 $"
+__date__ = "$Date: 2005/04/27 20:21:23 $"
__copyright__ = "Copyright (c) 2003-2004 Open Source Applications Foundation"
__license__ = "http://osafoundation.org/Chandler_0.1_license_terms.htm"
@@ -11,7 +11,7 @@
from repository.tests.RepositoryTestCase import RepositoryTestCase
from repository.util.Path import Path
-import tools.timing
+import util.timing
class TestDelete(RepositoryTestCase):
@@ -28,15 +28,15 @@
def testDeleteItemsInCollection(self):
- tools.timing.reset()
+ util.timing.reset()
self._reopenRepository()
k = self.rep.findPath('//CineGuide/KHepburn')
- tools.timing.reset()
+ util.timing.reset()
for m in k.movies:
- tools.timing.begin("repository.tests.TestDelete.testDeleteItemsInCollection")
+ util.timing.begin("repository.tests.TestDelete.testDeleteItemsInCollection")
m.delete()
- tools.timing.end("repository.tests.TestDelete.testDeleteItemsInCollection")
+ util.timing.end("repository.tests.TestDelete.testDeleteItemsInCollection")
self.assert_(len(k.movies) == 0)
self.assert_(self.rep.check())
@@ -44,22 +44,22 @@
self._reopenRepository()
self.assert_(self.rep.check())
- tools.timing.results(verbose=False)
+ util.timing.results(verbose=False)
def testCloudDelete(self):
- tools.timing.reset()
+ util.timing.reset()
k = self.rep.findPath('//CineGuide/KHepburn')
- tools.timing.begin("repository.tests.TestDelete.testCloudDelete")
+ util.timing.begin("repository.tests.TestDelete.testCloudDelete")
k.delete(cloudAlias='remote')
- tools.timing.end("repository.tests.TestDelete.testCloudDelete")
+ util.timing.end("repository.tests.TestDelete.testCloudDelete")
self.rep.commit()
self.rep.check()
self._reopenRepository()
self.rep.check()
- tools.timing.results(verbose=False)
+ util.timing.results(verbose=False)
if __name__ == "__main__":
Index: chandler/distrib/linux/manifest.debug.linux
diff -u chandler/distrib/linux/manifest.debug.linux:1.41 chandler/distrib/linux/manifest.debug.linux:1.42
--- chandler/distrib/linux/manifest.debug.linux:1.41 Mon Jan 17 23:09:42 2005
+++ chandler/distrib/linux/manifest.debug.linux Wed Apr 27 13:21:16 2005
@@ -87,7 +87,7 @@
glob=*.py,*.png,*.xrc,*.daml,*.gif,*.xml,*.txt,*.bmp,*.jpg,*.html,*.pack
application
parcels
-tools
+util
glob=*
repository
Index: chandler/application/tests/TestAllParcels.py
diff -u chandler/application/tests/TestAllParcels.py:1.5 chandler/application/tests/TestAllParcels.py:1.6
--- chandler/application/tests/TestAllParcels.py:1.5 Wed Dec 29 19:47:36 2004
+++ chandler/application/tests/TestAllParcels.py Wed Apr 27 13:21:16 2005
@@ -1,15 +1,15 @@
"""
Loads all parcels
"""
-__revision__ = "$Revision: 1.5 $"
-__date__ = "$Date: 2004/12/30 03:47:36 $"
+__revision__ = "$Revision: 1.6 $"
+__date__ = "$Date: 2005/04/27 20:21:16 $"
__copyright__ = "Copyright (c) 2003-2004 Open Source Applications Foundation"
__license__ = "http://osafoundation.org/Chandler_0.1_license_terms.htm"
import ParcelLoaderTestCase, os, sys, unittest
import application
-import tools.timing
+import util.timing
class AllParcelsTestCase(ParcelLoaderTestCase.ParcelLoaderTestCase):
@@ -18,12 +18,12 @@
"""
Test to ensure all parcels load
"""
- tools.timing.begin("application.TestAllParcels")
+ util.timing.begin("application.TestAllParcels")
self.loadParcels()
- tools.timing.end("application.TestAllParcels")
- tools.timing.results(verbose=False)
+ util.timing.end("application.TestAllParcels")
+ util.timing.results(verbose=False)
self.assert_( self.rep.check(), "Repository check failed -- see chandler.log" )
Index: chandler/Chandler.py
diff -u chandler/Chandler.py:1.68 chandler/Chandler.py:1.69
--- chandler/Chandler.py:1.68 Fri Mar 18 11:32:25 2005
+++ chandler/Chandler.py Wed Apr 27 13:21:15 2005
@@ -1,5 +1,5 @@
-__version__ = "$Revision: 1.68 $"
-__date__ = "$Date: 2005/03/18 19:32:25 $"
+__version__ = "$Revision: 1.69 $"
+__date__ = "$Date: 2005/04/27 20:21:15 $"
__copyright__ = "Copyright (c) 2003-2005 Open Source Applications Foundation"
__license__ = "http://osafoundation.org/Chandler_0.1_license_terms.htm"
@@ -212,9 +212,9 @@
raise
#@@@Temporary testing tool written by Morgen -- DJA
- # import tools.timing
+ # import util.timing
# print "\nTiming results:\n"
- # tools.timing.results()
+ # util.timing.results()
if __name__=="__main__":
main()
Index: chandler/parcels/osaf/framework/blocks/DocumentTypes.py
diff -u chandler/parcels/osaf/framework/blocks/DocumentTypes.py:1.7 chandler/parcels/osaf/framework/blocks/DocumentTypes.py:1.8
--- chandler/parcels/osaf/framework/blocks/DocumentTypes.py:1.7 Tue Apr 19 11:26:17 2005
+++ chandler/parcels/osaf/framework/blocks/DocumentTypes.py Wed Apr 27 13:21:19 2005
@@ -60,7 +60,7 @@
def __repr__(self):
return "(%sr, %sg, %sb, %sa)" % (self.red, self.green, self.blue, self.alpha)
-
+
class ColorStruct(CoreTypes.Struct):
def makeValue(Struct, data):
@@ -71,3 +71,8 @@
setattr (color, 'blue', int(blue))
setattr (color, 'alpha', int(alpha))
return color
+
+ def makeString(self, value):
+ return "%d,%d,%d,%d" % (int(value.red), int(value.green),
+ int(value.blue), int(value.alpha))
+
\ No newline at end of file
Index: chandler/parcels/osaf/framework/sharing/Sharing.py
diff -u chandler/parcels/osaf/framework/sharing/Sharing.py:1.93 chandler/parcels/osaf/framework/sharing/Sharing.py:1.94
--- chandler/parcels/osaf/framework/sharing/Sharing.py:1.93 Mon Apr 25 17:28:09 2005
+++ chandler/parcels/osaf/framework/sharing/Sharing.py Wed Apr 27 13:21:21 2005
@@ -1,5 +1,5 @@
-Allowed = "$Revision: 1.93 $"
-__date__ = "$Date: 2005/04/26 00:28:09 $"
+Allowed = "$Revision: 1.94 $"
+__date__ = "$Date: 2005/04/27 20:21:21 $"
__copyright__ = "Copyright (c) 2004 Open Source Applications Foundation"
__license__ = "http://osafoundation.org/Chandler_0.1_license_terms.htm"
@@ -17,6 +17,7 @@
from repository.item.Query import KindQuery
from repository.util.Lob import Lob
from repository.item.Item import Item
+from repository.schema.Types import Type
import repository.query.Query as Query
import repository
import logging
@@ -852,7 +853,7 @@
try:
item = self.share.format.importProcess(text, item=into)
except Exception, e:
- raise TransformationFailed(message=str(e))
+ raise TransformationFailed(message="%s:%s" % (str(e), text))
return (item, etag)
@@ -1077,8 +1078,17 @@
attributes = self.__collectAttributes(item)
result = indent * depth
+
+ if item.itsKind.isMixin():
+ kindsList = []
+ for kind in item.itsKind.superKinds:
+ kindsList.append(str(kind.itsPath))
+ kinds = ",".join(kindsList)
+ else:
+ kinds = str(item.itsKind.itsPath)
+
result += "<%s kind='%s' uuid='%s'>\n" % (item.itsKind.itsName,
- item.itsKind.itsPath,
+ kinds,
item.itsUUID)
depth += 1
@@ -1093,6 +1103,7 @@
otherName = item.itsKind.getOtherName(attrName, None, item, None)
cardinality = item.getAttributeAspect(attrName, 'cardinality')
+ type = item.getAttributeAspect(attrName, 'type')
if otherName: # it's a bidiref
result += "\n"
@@ -1125,14 +1136,19 @@
# For 0.6, we should handle encoding properly.
uStr = value.getReader().read()
value = uStr.encode('ascii', 'replace')
- result += "<![CDATA[" + str(value) + "]]>"
+
+ if isinstance(value, Item):
+ result += "\n"
+ result += self.exportProcess(value, depth+1)
+ else:
+ result += "<![CDATA[" + type.makeString(value) + "]]>"
elif cardinality == 'list':
depth += 1
result += "\n"
for value in item.getAttributeValue(attrName):
result += indent * depth
- result += "<value>%s</value>\n" % value
+ result += "<value>%s</value>\n" % type.makeString(value)
depth -= 1
result += indent * depth
@@ -1151,6 +1167,7 @@
def __collectAttributes(self, item):
attributes = {}
+ skip = {}
for cloud in item.itsKind.getClouds(self.cloudAlias):
for (alias, endpoint, inCloud) in cloud.iterEndpoints(self.cloudAlias):
# @@@MOR for now, don't support endpoint attribute 'chains'
@@ -1158,8 +1175,14 @@
# An includePolicy of 'none' is how we override an inherited
# endpoint
- if endpoint.includePolicy != 'none':
- attributes[attrName] = endpoint
+ if endpoint.includePolicy == 'none':
+ skip[attrName] = 1
+
+ attributes[attrName] = endpoint
+
+ for attrName in skip.iterkeys():
+ del attributes[attrName]
+
return attributes
@@ -1197,28 +1220,37 @@
def __importNode(self, node, item=None):
kind = None
- kindPath = None
+ kinds = []
kindNode = node.hasProp('kind')
if kindNode:
- kindPath = kindNode.content
- kind = self.itsView.findPath(kindNode.content)
-
- if kind is None:
- # No kind provided, or we don't have that kind in repository
- if kindPath:
- logger.info("No kind found for %s" % kindPath)
- else:
- logger.info("Can't import an item without a kind provided")
+ kindPathList = kindNode.content.split(",")
+ for kindPath in kindPathList:
+ kind = self.itsView.findPath(kindPath)
+ if kind is not None:
+ kinds.append(kind)
+ else:
+ logger.info("No kinds provided")
return None
+ if len(kinds) == 0:
+ # we don't have any of the kinds provided
+ logger.info("No kinds found locally for %s" % kindPathList)
+ return None
+ elif len(kinds) == 1:
+ kind = kinds[0]
+ else: # time to mixin
+ kind = kinds[0].mixin(kinds[1:])
if item is None:
uuidNode = node.hasProp('uuid')
if uuidNode:
- uuid = UUID(uuidNode.content)
- item = self.itsView.findUUID(uuid)
+ try:
+ uuid = UUID(uuidNode.content)
+ item = self.itsView.findUUID(uuid)
+ except Exception, e:
+ print e
else:
uuid = None
@@ -1250,7 +1282,9 @@
cardinality = item.getAttributeAspect(attrName, 'cardinality')
type = item.getAttributeAspect(attrName, 'type')
- if otherName: # it's a bidiref
+ # @@@MOR What's the right way to tell if this is a single ref -- checking type for non-type items is a kludge:
+
+ if otherName or (isinstance(type, Item) and not isinstance(type, Type)): # it's a ref
if cardinality == 'single':
valueNode = attrNode.children
@@ -1274,7 +1308,7 @@
elif cardinality == 'dict':
pass
- else: # it's a literal (could be SingleRef though)
+ else: # it's a literal
if cardinality == 'single':
value = type.makeValue(attrNode.content)
Index: chandler/repository/tests/TestRepository.py
diff -u chandler/repository/tests/TestRepository.py:1.12 chandler/repository/tests/TestRepository.py:1.13
--- chandler/repository/tests/TestRepository.py:1.12 Fri Feb 4 12:35:54 2005
+++ chandler/repository/tests/TestRepository.py Wed Apr 27 13:21:23 2005
@@ -2,8 +2,8 @@
Basic Unit tests for Chandler repository
"""
-__revision__ = "$Revision: 1.12 $"
-__date__ = "$Date: 2005/02/04 20:35:54 $"
+__revision__ = "$Revision: 1.13 $"
+__date__ = "$Date: 2005/04/27 20:21:23 $"
__copyright__ = "Copyright (c) 2003-2004 Open Source Applications Foundation"
__license__ = "http://osafoundation.org/Chandler_0.1_license_terms.htm"
@@ -11,7 +11,7 @@
from repository.util.Path import Path
from bsddb.db import DBNoSuchFileError
-import tools.timing
+import util.timing
class RepositoryTest(RepositoryTestCase.RepositoryTestCase):
""" Very basic repository tests """
@@ -58,11 +58,11 @@
def testFind(self):
""" Make sure we can run find """
- tools.timing.reset()
- tools.timing.begin("repository.tests.TestRepository.testFind")
+ util.timing.reset()
+ util.timing.begin("repository.tests.TestRepository.testFind")
kind = self.rep.findPath('//Schema/Core/Kind')
- tools.timing.end("repository.tests.TestRepository.testFind")
- tools.timing.results(verbose=False)
+ util.timing.end("repository.tests.TestRepository.testFind")
+ util.timing.results(verbose=False)
self.assert_(kind is not None)
#TODO should check UUID
Index: chandler/distrib/linux/manifest.linux
diff -u chandler/distrib/linux/manifest.linux:1.60 chandler/distrib/linux/manifest.linux:1.61
--- chandler/distrib/linux/manifest.linux:1.60 Mon Jan 17 23:09:42 2005
+++ chandler/distrib/linux/manifest.linux Wed Apr 27 13:21:16 2005
@@ -91,7 +91,7 @@
exclude=CVS,*.pyo,*.pyc
parcels
exclude=CVS,tests,*.pyo,*.pyc
-tools
+util
glob=*
repository
Index: chandler/application/tests/TestParcelPerf.py
diff -u chandler/application/tests/TestParcelPerf.py:1.2 chandler/application/tests/TestParcelPerf.py:1.3
--- chandler/application/tests/TestParcelPerf.py:1.2 Fri Feb 18 16:28:11 2005
+++ chandler/application/tests/TestParcelPerf.py Wed Apr 27 13:21:16 2005
@@ -1,53 +1,53 @@
-__revision__ = "$Revision: 1.2 $"
-__date__ = "$Date: 2005/02/19 00:28:11 $"
+__revision__ = "$Revision: 1.3 $"
+__date__ = "$Date: 2005/04/27 20:21:16 $"
__copyright__ = "Copyright (c) 2005 Open Source Applications Foundation"
__license__ = "http://osafoundation.org/Chandler_0.1_license_terms.htm"
import os, unittest
import repository.tests.RepositoryTestCase as RepositoryTestCase
import osaf.contentmodel.tests.GenerateItems as GenerateItems
-import tools.timing
+import util.timing
class TestParcelPerf(RepositoryTestCase.RepositoryTestCase):
def testLoadGenerateCommitContacts(self):
""" Test loading, generating, and commiting contacts """
- tools.timing.reset()
- tools.timing.begin("application.tests.testParcelPerf.testContacts-load")
+ util.timing.reset()
+ util.timing.begin("application.tests.testParcelPerf.testContacts-load")
self.loadParcels(
['http://osafoundation.org/parcels/osaf/contentmodel/contacts']
)
- tools.timing.end("application.tests.testParcelPerf.testContacts-load")
+ util.timing.end("application.tests.testParcelPerf.testContacts-load")
view = self.rep.view
- tools.timing.begin("application.tests.testParcelPerf.testContacts-generate")
+ util.timing.begin("application.tests.testParcelPerf.testContacts-generate")
GenerateItems.GenerateItems(view, 100, GenerateItems.GenerateContact)
- tools.timing.end("application.tests.testParcelPerf.testContacts-generate")
+ util.timing.end("application.tests.testParcelPerf.testContacts-generate")
- tools.timing.begin("application.tests.testParcelPerf.testContacts-commit")
+ util.timing.begin("application.tests.testParcelPerf.testContacts-commit")
view.commit()
- tools.timing.end("application.tests.testParcelPerf.testContacts-commit")
- tools.timing.results(verbose=False)
+ util.timing.end("application.tests.testParcelPerf.testContacts-commit")
+ util.timing.results(verbose=False)
def testCalendarEvents(self):
""" Test loading, generating, and commiting calendar event """
- tools.timing.reset()
- tools.timing.begin("application.tests.testParcelPerf.testCalendarEvents-load")
+ util.timing.reset()
+ util.timing.begin("application.tests.testParcelPerf.testCalendarEvents-load")
self.loadParcels(
['http://osafoundation.org/parcels/osaf/contentmodel/calendar']
)
- tools.timing.end("application.tests.testParcelPerf.testCalendarEvents-load")
+ util.timing.end("application.tests.testParcelPerf.testCalendarEvents-load")
view = self.rep.view
- tools.timing.begin("application.tests.testParcelPerf.testCalendarEvents-generate")
+ util.timing.begin("application.tests.testParcelPerf.testCalendarEvents-generate")
GenerateItems.GenerateItems(view, 100, GenerateItems.GenerateCalendarEvent)
- tools.timing.end("application.tests.testParcelPerf.testCalendarEvents-generate")
+ util.timing.end("application.tests.testParcelPerf.testCalendarEvents-generate")
- tools.timing.begin("application.tests.testParcelPerf.testCalendarEvents-commit")
+ util.timing.begin("application.tests.testParcelPerf.testCalendarEvents-commit")
view.commit()
- tools.timing.end("application.tests.testParcelPerf.testCalendarEvents-commit")
- tools.timing.results(verbose=False)
+ util.timing.end("application.tests.testParcelPerf.testCalendarEvents-commit")
+ util.timing.results(verbose=False)
@@ -64,11 +64,11 @@
##TODO SHOULD NOT RUN IN RAMDB
self._reopenRepository()
- tools.timing.reset()
- tools.timing.begin("repository.tests.TestLoadAll")
+ util.timing.reset()
+ util.timing.begin("repository.tests.TestLoadAll")
count = load(self.rep.view)
- tools.timing.end("repository.tests.TestLoadAll")
- tools.timing.results(verbose=False)
+ util.timing.end("repository.tests.TestLoadAll")
+ util.timing.results(verbose=False)
if __name__ == "__main__":
unittest.main()
Index: chandler/distrib/win/manifest.debug.win
diff -u chandler/distrib/win/manifest.debug.win:1.38 chandler/distrib/win/manifest.debug.win:1.39
--- chandler/distrib/win/manifest.debug.win:1.38 Wed Apr 6 21:00:24 2005
+++ chandler/distrib/win/manifest.debug.win Wed Apr 27 13:21:17 2005
@@ -46,7 +46,7 @@
glob=*.py,*.png,*.xrc,*.daml,*.gif,*.xml,*.txt,*.bmp,*.jpg,*.html,*.pack
application
parcels
-tools
+util
glob=*
repository
Index: chandler/distrib/osx/manifest.debug.osx
diff -u chandler/distrib/osx/manifest.debug.osx:1.33 chandler/distrib/osx/manifest.debug.osx:1.34
--- chandler/distrib/osx/manifest.debug.osx:1.33 Tue Mar 29 11:12:46 2005
+++ chandler/distrib/osx/manifest.debug.osx Wed Apr 27 13:21:17 2005
@@ -53,7 +53,7 @@
glob=*.py,*.png,*.xrc,*.daml,*.gif,*.xml,*.txt,*.bmp,*.jpg,*.html,*.pack
application
parcels
-tools
+util
glob=*
repository
locale
Index: chandler/parcels/osaf/framework/blocks/calendar/parcel.xml
diff -u chandler/parcels/osaf/framework/blocks/calendar/parcel.xml:1.16 chandler/parcels/osaf/framework/blocks/calendar/parcel.xml:1.17
--- chandler/parcels/osaf/framework/blocks/calendar/parcel.xml:1.16 Tue Apr 26 11:25:38 2005
+++ chandler/parcels/osaf/framework/blocks/calendar/parcel.xml Wed Apr 27 13:21:19 2005
@@ -1,7 +1,7 @@
<?xml version="1.0" encoding="iso-8859-1"?>
-<!-- $Revision: 1.16 $ -->
-<!-- $Date: 2005/04/26 18:25:38 $-->
+<!-- $Revision: 1.17 $ -->
+<!-- $Date: 2005/04/27 20:21:19 $-->
<!-- Copyright (c) 2003-2004 Open Source Applications Foundation -->
<!-- License: http://osafoundation.org/Chandler_0.1_license_terms.htm -->
@@ -57,6 +57,13 @@
<Attribute itsName="calendarColor">
<type itemref="blocks:ColorStyle"/>
</Attribute>
+ <Cloud itsName="SharingCloud">
+ <Endpoint itsName="calendarColor">
+ <attribute value="calendarColor"/>
+ </Endpoint>
+ <endpoints alias="calendarColor" itemref="doc:CalendarData/SharingCloud/calendarColor"/>
+ </Cloud>
+ <clouds alias="sharing" itemref="doc:CalendarData/SharingCloud"/>
</Kind>
</Parcel>
Index: chandler/repository/query/Query.py
diff -u chandler/repository/query/Query.py:1.41 chandler/repository/query/Query.py:1.42
--- chandler/repository/query/Query.py:1.41 Tue Apr 12 18:19:17 2005
+++ chandler/repository/query/Query.py Wed Apr 27 13:21:21 2005
@@ -1,12 +1,11 @@
-__revision__ = "$Revision: 1.41 $"
-__date__ = "$Date: 2005/04/13 01:19:17 $"
+__revision__ = "$Revision: 1.42 $"
+__date__ = "$Date: 2005/04/27 20:21:21 $"
__copyright__ = "Copyright (c) 2004, 2005 Open Source Applications Foundation"
__license__ = "http://osafoundation.org/Chandler_0.1_license_terms.htm"
import QueryParser
import repository.item.Item as Item
-import tools.timing
import sets
import mx.DateTime.ISO
from chandlerdb.util.uuid import UUID
More information about the Commits
mailing list