Code running outside of Chandler, such as unit tests, now has to
include the following few lines:
# to make parcels/osaf/contentmodel/Query.py happy
Globals.repository = rep
# to make parcels/osaf/framework/notifications/schema/Event.py happy
from osaf.framework.notifications.NotificationManager import
NotificationManager
Globals.notificationManager = NotificationManager()
Over time I can see the code required to properly set up of Globals
getting bigger and bigger, and this code needs to be replicated outside
of Application.py and kept in sync (for example, in
chandler/repository/tests/RepositoryTestCase.py).
We could try to write our code to gracefully handle the condition where
Globals.repository and Globals.notificationManager, etc. aren't there.
However it's probably better to make it easier for code outside of
Application.py to set up Globals correctly (perhaps with some method in
Application.py the unit tests could call to do this). Shall I break
out these required lines into a method living somewhere outside of
Application.py (and modify Application.py to use this method too)?
~morgen