[Commits] (morgen) Removing all references to application.Globals.parcelManager

commits at osafoundation.org commits at osafoundation.org
Thu Feb 3 23:41:14 PST 2005


Commit by: morgen
Modified files:
chandler/application/Application.py 1.296 1.297
chandler/application/Globals.py 1.25 1.26
chandler/application/Parcel.py 1.43 1.44
chandler/application/dialogs/AccountPreferences.py 1.25 1.26
chandler/application/dialogs/PublishCollection.py 1.11 1.12
chandler/application/tests/ParcelLoaderTestCase.py 1.8 1.9
chandler/distrib/docgen/Util.py 1.5 1.6
chandler/parcels/osaf/framework/sharing/tests/TestFileSystemSharing.py 1.5 1.6
chandler/parcels/osaf/framework/sharing/tests/TestImportICalendar.py 1.7 1.8
chandler/parcels/osaf/views/main/Main.py 1.118 1.119
chandler/repository/tests/PreloadedRepositoryUtils.py 1.7 1.8
chandler/repository/tests/RepositoryTestCase.py 1.24 1.25
chandler/tools/s.py 1.7 1.8

Log message:
Removing all references to application.Globals.parcelManager



ViewCVS links:
http://cvs.osafoundation.org/index.cgi/chandler/application/Application.py.diff?r1=text&tr1=1.296&r2=text&tr2=1.297
http://cvs.osafoundation.org/index.cgi/chandler/application/Globals.py.diff?r1=text&tr1=1.25&r2=text&tr2=1.26
http://cvs.osafoundation.org/index.cgi/chandler/application/Parcel.py.diff?r1=text&tr1=1.43&r2=text&tr2=1.44
http://cvs.osafoundation.org/index.cgi/chandler/application/dialogs/AccountPreferences.py.diff?r1=text&tr1=1.25&r2=text&tr2=1.26
http://cvs.osafoundation.org/index.cgi/chandler/application/dialogs/PublishCollection.py.diff?r1=text&tr1=1.11&r2=text&tr2=1.12
http://cvs.osafoundation.org/index.cgi/chandler/application/tests/ParcelLoaderTestCase.py.diff?r1=text&tr1=1.8&r2=text&tr2=1.9
http://cvs.osafoundation.org/index.cgi/chandler/distrib/docgen/Util.py.diff?r1=text&tr1=1.5&r2=text&tr2=1.6
http://cvs.osafoundation.org/index.cgi/chandler/parcels/osaf/framework/sharing/tests/TestFileSystemSharing.py.diff?r1=text&tr1=1.5&r2=text&tr2=1.6
http://cvs.osafoundation.org/index.cgi/chandler/parcels/osaf/framework/sharing/tests/TestImportICalendar.py.diff?r1=text&tr1=1.7&r2=text&tr2=1.8
http://cvs.osafoundation.org/index.cgi/chandler/parcels/osaf/views/main/Main.py.diff?r1=text&tr1=1.118&r2=text&tr2=1.119
http://cvs.osafoundation.org/index.cgi/chandler/repository/tests/PreloadedRepositoryUtils.py.diff?r1=text&tr1=1.7&r2=text&tr2=1.8
http://cvs.osafoundation.org/index.cgi/chandler/repository/tests/RepositoryTestCase.py.diff?r1=text&tr1=1.24&r2=text&tr2=1.25
http://cvs.osafoundation.org/index.cgi/chandler/tools/s.py.diff?r1=text&tr1=1.7&r2=text&tr2=1.8

Index: chandler/distrib/docgen/Util.py
diff -u chandler/distrib/docgen/Util.py:1.5 chandler/distrib/docgen/Util.py:1.6
--- chandler/distrib/docgen/Util.py:1.5	Tue Feb  1 11:05:59 2005
+++ chandler/distrib/docgen/Util.py	Thu Feb  3 23:41:06 2005
@@ -10,6 +10,7 @@
 
 import os, sys
 import application.Globals as Globals
+import application.Parcel
 
 # - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
 
@@ -81,9 +82,8 @@
             sys.path.insert (2, debugParcelDir)
             parcelSearchPath.append( debugParcelDir )
 
-    from application.Parcel import Manager
-    manager = Manager.getManager(repository.view, path=parcelSearchPath)
-    manager.loadParcels()
+    application.Parcel.Manager.get(repository.view,
+                                   path=parcelSearchPath).loadParcels()
 
 def setup(directory, destroy=False):
     """

Index: chandler/application/Globals.py
diff -u chandler/application/Globals.py:1.25 chandler/application/Globals.py:1.26
--- chandler/application/Globals.py:1.25	Mon Jan 31 12:17:39 2005
+++ chandler/application/Globals.py	Thu Feb  3 23:41:05 2005
@@ -1,5 +1,5 @@
-__version__ = "$Revision: 1.25 $"
-__date__ = "$Date: 2005/01/31 20:17:39 $"
+__version__ = "$Revision: 1.26 $"
+__date__ = "$Date: 2005/02/04 07:41:05 $"
 __copyright__ = "Copyright (c) 2003-2004 Open Source Applications Foundation"
 __license__ = "http://osafoundation.org/Chandler_0.1_license_terms.htm"
 
@@ -14,7 +14,6 @@
 
 
 chandlerDirectory = None      # Directory containing chandler executable
-parcelManager = None          # parcelManager
 wxApplication = None          # The application object. Use wx.GetApp() as the prefered
                               # way to get the application object when possible.
 mainViewRoot = None           # The main View

Index: chandler/parcels/osaf/views/main/Main.py
diff -u chandler/parcels/osaf/views/main/Main.py:1.118 chandler/parcels/osaf/views/main/Main.py:1.119
--- chandler/parcels/osaf/views/main/Main.py:1.118	Thu Feb  3 18:21:42 2005
+++ chandler/parcels/osaf/views/main/Main.py	Thu Feb  3 23:41:07 2005
@@ -1,5 +1,5 @@
-__version__ = "$Revision: 1.118 $"
-__date__ = "$Date: 2005/02/04 02:21:42 $"
+__version__ = "$Revision: 1.119 $"
+__date__ = "$Date: 2005/02/04 07:41:07 $"
 __copyright__ = "Copyright (c) 2004 Open Source Applications Foundation"
 __license__ = "http://osafoundation.org/Chandler_0.1_license_terms.htm"
 
@@ -13,7 +13,7 @@
 import osaf.contentmodel.mail.Mail as Mail
 import osaf.mail.imap
 from application.SplashScreen import SplashScreen
-from application.Parcel import Manager as ParcelManager
+import application.Parcel
 import osaf.contentmodel.mail.Mail as Mail
 import osaf.contentmodel.contacts.Contacts as Contacts
 import osaf.contentmodel.tests.GenerateItems as GenerateItems
@@ -442,7 +442,7 @@
         theApp = wx.GetApp()
         theApp.UnRenderMainView ()
 
-        ParcelManager.getManager(self.itsView).loadParcels()
+        application.Parcel.Manager.get(self.itsView).loadParcels()
 
         theApp.LoadMainViewRoot (delete=True)
         theApp.RenderMainView ()

Index: chandler/application/dialogs/PublishCollection.py
diff -u chandler/application/dialogs/PublishCollection.py:1.11 chandler/application/dialogs/PublishCollection.py:1.12
--- chandler/application/dialogs/PublishCollection.py:1.11	Thu Jan 27 13:01:20 2005
+++ chandler/application/dialogs/PublishCollection.py	Thu Feb  3 23:41:05 2005
@@ -2,7 +2,6 @@
 import wx
 import wx.xrc
 import application.Globals
-from application.Globals import parcelManager as pm
 import osaf.mail.message
 import osaf.mail.sharing
 import application.dialogs.Util

Index: chandler/application/tests/ParcelLoaderTestCase.py
diff -u chandler/application/tests/ParcelLoaderTestCase.py:1.8 chandler/application/tests/ParcelLoaderTestCase.py:1.9
--- chandler/application/tests/ParcelLoaderTestCase.py:1.8	Thu Jan 27 13:01:23 2005
+++ chandler/application/tests/ParcelLoaderTestCase.py	Thu Feb  3 23:41:05 2005
@@ -2,8 +2,8 @@
 A helper class which sets up and tears down a repository and anything else
 that a parcel loader unit test might need
 """
-__revision__  = "$Revision: 1.8 $"
-__date__      = "$Date: 2005/01/27 21:01:23 $"
+__revision__  = "$Revision: 1.9 $"
+__date__      = "$Date: 2005/02/04 07:41:05 $"
 __copyright__ = "Copyright (c) 2003-2004 Open Source Applications Foundation"
 __license__   = "http://osafoundation.org/Chandler_0.1_license_terms.htm"
 
@@ -12,7 +12,6 @@
 import repository.tests.RepositoryTestCase as RepositoryTestCase
 
 import application
-import application.Globals as Globals
 
 class ParcelLoaderTestCase(RepositoryTestCase.RepositoryTestCase):
 
@@ -23,7 +22,3 @@
         self.testdir = os.path.join(self.rootdir, 'application', 'tests')
 
         super(ParcelLoaderTestCase, self)._openRepository(self)
-
-        view = self.rep.view
-        Globals.parcelManager = application.Parcel.Manager.getManager(view)
-

Index: chandler/application/Application.py
diff -u chandler/application/Application.py:1.296 chandler/application/Application.py:1.297
--- chandler/application/Application.py:1.296	Tue Feb  1 15:11:12 2005
+++ chandler/application/Application.py	Thu Feb  3 23:41:04 2005
@@ -1,5 +1,5 @@
-__version__ = "$Revision: 1.296 $"
-__date__ = "$Date: 2005/02/01 23:11:12 $"
+__version__ = "$Revision: 1.297 $"
+__date__ = "$Date: 2005/02/04 07:41:04 $"
 __copyright__ = "Copyright (c) 2003-2004 Open Source Applications Foundation"
 __license__ = "http://osafoundation.org/Chandler_0.1_license_terms.htm"
 
@@ -227,10 +227,8 @@
         if debugParcelDir:
             parcelSearchPath.append( debugParcelDir )
 
-        application.Globals.parcelManager = \
-         application.Parcel.Manager.getManager(self.UIRepositoryView,
-                                               path=parcelSearchPath)
-        application.Globals.parcelManager.loadParcels()
+        application.Parcel.Manager.get(self.UIRepositoryView,
+                                       path=parcelSearchPath).loadParcels()
 
         EVT_MAIN_THREAD_CALLBACK(self, self.OnMainThreadCallbackEvent)
         self.Bind(wx.EVT_IDLE, self.OnIdle)
@@ -582,7 +580,6 @@
         import wx.py
         rootObjects = {
          "globals" : application.Globals,
-         "parcelManager" : application.Globals.parcelManager,
          "parcelsRoot" : self.UIRepositoryView.findPath("//parcels"),
          "repository" : self.UIRepositoryView.repository,
          "wxApplication" : self,

Index: chandler/parcels/osaf/framework/sharing/tests/TestFileSystemSharing.py
diff -u chandler/parcels/osaf/framework/sharing/tests/TestFileSystemSharing.py:1.5 chandler/parcels/osaf/framework/sharing/tests/TestFileSystemSharing.py:1.6
--- chandler/parcels/osaf/framework/sharing/tests/TestFileSystemSharing.py:1.5	Thu Jan 27 13:02:00 2005
+++ chandler/parcels/osaf/framework/sharing/tests/TestFileSystemSharing.py	Thu Feb  3 23:41:06 2005
@@ -1,8 +1,8 @@
 """
 A helper class which sets up and tears down dual RamDB repositories
 """
-__revision__  = "$Revision: 1.5 $"
-__date__      = "$Date: 2005/01/27 21:02:00 $"
+__revision__  = "$Revision: 1.6 $"
+__date__      = "$Date: 2005/02/04 07:41:06 $"
 __copyright__ = "Copyright (c) 2003-2004 Open Source Applications Foundation"
 __license__   = "http://osafoundation.org/Chandler_0.1_license_terms.htm"
 
@@ -54,8 +54,8 @@
         self.mgrs = []
         for i in xrange(2):
             self.repos.append(self._initRamDB(packs))
-            self.mgrs.append(Parcel.Manager.getManager(self.repos[i].view,
-                                                       path=parcelpath))
+            self.mgrs.append(Parcel.Manager.get(self.repos[i].view,
+                                                path=parcelpath))
             self.mgrs[i].loadParcels(namespaces)
             # create a sandbox root
             Item.Item("sandbox", self.repos[i], None)

Index: chandler/repository/tests/RepositoryTestCase.py
diff -u chandler/repository/tests/RepositoryTestCase.py:1.24 chandler/repository/tests/RepositoryTestCase.py:1.25
--- chandler/repository/tests/RepositoryTestCase.py:1.24	Thu Jan 27 13:02:11 2005
+++ chandler/repository/tests/RepositoryTestCase.py	Thu Feb  3 23:41:09 2005
@@ -1,8 +1,8 @@
 """
 A base class for repository testing
 """
-__revision__  = "$Revision: 1.24 $"
-__date__      = "$Date: 2005/01/27 21:02:11 $"
+__revision__  = "$Revision: 1.25 $"
+__date__      = "$Date: 2005/02/04 07:41:09 $"
 __copyright__ = "Copyright (c) 2003-2004 Open Source Applications Foundation"
 __license__   = "http://osafoundation.org/Chandler_0.1_license_terms.htm"
 
@@ -57,7 +57,7 @@
             self.rep.commit()
 
         self.manager = \
-         ParcelManager.getManager(self.rep.view, \
+         ParcelManager.get(self.rep.view, \
          path=[os.path.join(self.rootdir, 'parcels')])
 
     def setUp(self, ramdb=True):
@@ -86,7 +86,7 @@
             self.rep.open()
 
         self.manager = \
-         ParcelManager.getManager(self.rep.view, \
+         ParcelManager.get(self.rep.view, \
          path=[os.path.join(self.rootdir, 'parcels')])
 
     def _find(self, path):

Index: chandler/repository/tests/PreloadedRepositoryUtils.py
diff -u chandler/repository/tests/PreloadedRepositoryUtils.py:1.7 chandler/repository/tests/PreloadedRepositoryUtils.py:1.8
--- chandler/repository/tests/PreloadedRepositoryUtils.py:1.7	Thu Jan 27 13:02:11 2005
+++ chandler/repository/tests/PreloadedRepositoryUtils.py	Thu Feb  3 23:41:09 2005
@@ -1,8 +1,8 @@
 """
 Utilities for working with preloaded repository
 """
-__revision__  = "$Revision: 1.7 $"
-__date__      = "$Date: 2005/01/27 21:02:11 $"
+__revision__  = "$Revision: 1.8 $"
+__date__      = "$Date: 2005/02/04 07:41:09 $"
 __copyright__ = "Copyright (c) 2003-2004 Open Source Applications Foundation"
 __license__   = "http://osafoundation.org/Chandler_0.1_license_terms.htm"
 
@@ -34,7 +34,7 @@
         rep.loadPack(schemaPack)
 
     if parcels:
-        manager = application.Parcel.Manager.getManager(rep.view, \
+        manager = application.Parcel.Manager.get(rep.view, \
          path=[os.path.join(rootdir, 'chandler', 'parcels')])
         manager.loadParcels()
 

Index: chandler/application/dialogs/AccountPreferences.py
diff -u chandler/application/dialogs/AccountPreferences.py:1.25 chandler/application/dialogs/AccountPreferences.py:1.26
--- chandler/application/dialogs/AccountPreferences.py:1.25	Thu Feb  3 14:50:09 2005
+++ chandler/application/dialogs/AccountPreferences.py	Thu Feb  3 23:41:05 2005
@@ -6,6 +6,7 @@
 import osaf.contentmodel.mail.Mail as Mail
 import application.dialogs.Util
 import osaf.framework.sharing.WebDAV as WebDAV
+import application.Parcel
 
 # Used to lookup the mail model parcel:
 MAIL_MODEL = "http://osafoundation.org/parcels/osaf/contentmodel/mail"
@@ -240,9 +241,10 @@
         self.view.refresh()
 
         accountIndex = 0 # which account to select first
-        imapAccountKind = application.Globals.parcelManager.lookup(MAIL_MODEL, "IMAPAccount")
-        smtpAccountKind = application.Globals.parcelManager.lookup(MAIL_MODEL, "SMTPAccount")
-        webDavAccountKind = application.Globals.parcelManager.lookup(SHARING_MODEL, "WebDAVAccount")
+        pm = application.Parcel.Manager.get(self.view)
+        imapAccountKind = pm.lookup(MAIL_MODEL, "IMAPAccount")
+        smtpAccountKind = pm.lookup(MAIL_MODEL, "SMTPAccount")
+        webDavAccountKind = pm.lookup(SHARING_MODEL, "WebDAVAccount")
 
         accounts = []
 

Index: chandler/application/Parcel.py
diff -u chandler/application/Parcel.py:1.43 chandler/application/Parcel.py:1.44
--- chandler/application/Parcel.py:1.43	Thu Jan 27 13:01:13 2005
+++ chandler/application/Parcel.py	Thu Feb  3 23:41:05 2005
@@ -33,17 +33,17 @@
     the repository and providing a namespace --> item mapping function.
 
     To use the parcel manager, retrieve an instance of it by using the class
-    method getManager()::
+    method get()::
 
         import application
-        mgr = application.Parcel.Manager.getManager(view, path=parcelSearchPath)
+        mgr = application.Parcel.Manager.get(view, path=parcelSearchPath)
         mgr.loadParcels()
 
     if "path" is not passed in, it will use
     os.path.join(Globals.chandlerDirectory, "parcels").
     """
 
-    def getManager(cls, view, path=None):
+    def get(cls, view, path=None):
         """
         Class method for getting an instance of the parcel manager.
 
@@ -79,7 +79,7 @@
 
         return manager
 
-    getManager = classmethod(getManager)
+    get = classmethod(get)
 
     def __init__(self, name, parent, kind):
         super(Manager, self).__init__(name, parent, kind)
@@ -1752,7 +1752,7 @@
     rep = __prepareRepo()
 
     parcelPath = [os.path.join(Globals.chandlerDirectory, "parcels")]
-    manager = Manager.getManager(rep.view, path=parcelPath)
+    manager = Manager.get(rep.view, path=parcelPath)
     manager.loadParcels()
 
     if False:

Index: chandler/parcels/osaf/framework/sharing/tests/TestImportICalendar.py
diff -u chandler/parcels/osaf/framework/sharing/tests/TestImportICalendar.py:1.7 chandler/parcels/osaf/framework/sharing/tests/TestImportICalendar.py:1.8
--- chandler/parcels/osaf/framework/sharing/tests/TestImportICalendar.py:1.7	Thu Jan 27 13:02:00 2005
+++ chandler/parcels/osaf/framework/sharing/tests/TestImportICalendar.py	Thu Feb  3 23:41:06 2005
@@ -1,8 +1,8 @@
 """
 A helper class which sets up and tears down dual RamDB repositories
 """
-__revision__  = "$Revision: 1.7 $"
-__date__      = "$Date: 2005/01/27 21:02:00 $"
+__revision__  = "$Revision: 1.8 $"
+__date__      = "$Date: 2005/02/04 07:41:06 $"
 __copyright__ = "Copyright (c) 2003-2004 Open Source Applications Foundation"
 __license__   = "http://osafoundation.org/Chandler_0.1_license_terms.htm"
 
@@ -46,8 +46,8 @@
         ]
 
         self.repo = self._initRamDB(packs)
-        self.manager = Parcel.Manager.getManager(self.repo.view,
-                                                 path=parcelpath)
+        self.manager = Parcel.Manager.get(self.repo.view,
+                                          path=parcelpath)
         self.manager.loadParcels(namespaces)
         # create a sandbox root
         Item.Item("sandbox", self.repo, None)

Index: chandler/tools/s.py
diff -u chandler/tools/s.py:1.7 chandler/tools/s.py:1.8
--- chandler/tools/s.py:1.7	Thu Jan 27 13:02:12 2005
+++ chandler/tools/s.py	Thu Feb  3 23:41:09 2005
@@ -83,7 +83,7 @@
     handler.setFormatter(formatter)
     logging.getLogger().addHandler(handler)
 
-def initParcels():
+def initParcels(rep):
     """
     Load all parcels under the 'parcels' directory
     """
@@ -105,9 +105,8 @@
             sys.path.insert (2, debugParcelDir)
             parcelSearchPath.append( debugParcelDir )
 
-    from application.Parcel import Manager
-    manager = Manager.getManager(path=parcelSearchPath)
-    manager.loadParcels()
+    application.Parcel.Manager.get(rep.view,
+                                   path=parcelSearchPath).loadParcels()
 
 def setup(directory, destroy=False):
     """
@@ -122,8 +121,8 @@
 
     Globals.chandlerDirectory = directory
     initLogger(os.path.join(directory, 'chandler.log'))
-    initRepository(os.path.join(directory, '__repository__'), destroy)
-    initParcels()
+    rep = initRepository(os.path.join(directory, '__repository__'), destroy)
+    initParcels(rep)
     return rep
 
 # - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
@@ -133,7 +132,7 @@
 
 
 # Bind some useful variables:
-pm = application.Parcel.Manager.getManager()
+pm = application.Parcel.Manager.get(r.view)
 Kind = r.findPath("//Schema/Core/Kind")
 Item = r.findPath("//Schema/Core/Item")
 parcels = r.findPath("//parcels")
@@ -149,9 +148,9 @@
 
 def lp(uri=None):
     if uri is None:
-        application.Parcel.Manager.getManager().loadParcels()
+        application.Parcel.Manager.get(r.view).loadParcels()
     else:
-        application.Parcel.Manager.getManager().loadParcels([uri])
+        application.Parcel.Manager.get(r.view).loadParcels([uri])
 
 def start():
     global twistedmgr



More information about the Commits mailing list