This repository was archived by the owner on Jul 16, 2024. It is now read-only.
File tree Expand file tree Collapse file tree 1 file changed +10
-5
lines changed
Expand file tree Collapse file tree 1 file changed +10
-5
lines changed Original file line number Diff line number Diff line change 99class GreaseContainer (object ):
1010 """Inversion of Control Container for objects in GREASE"""
1111
12- __logger = Logging ()
13- __mongo = Mongo (__logger .getConfig ())
14-
1512
1613 def __init__ (self , * args , ** kwargs ):
1714 if args or kwargs :
1815 self .getLogger ().warning (
1916 "Passing instances of Logger to the IOC is deprecated. Please just use getLogger()." , verbose = True
2017 )
18+ self .__logger = None
19+ self .__mongo = None
2120
2221 def getLogger (self ):
2322 """Get the logging instance
@@ -27,7 +26,10 @@ def getLogger(self):
2726
2827 """
2928
30- return GreaseContainer .__logger
29+ if not isinstance (self .__logger , Logging ):
30+ self .__logger = Logging ()
31+
32+ return self .__logger
3133
3234 def getNotification (self ):
3335 """Get the notifications instance
@@ -46,7 +48,10 @@ def getMongo(self):
4648
4749 """
4850
49- return GreaseContainer .__mongo
51+ if not isinstance (self .__mongo , Mongo ):
52+ self .__mongo = Mongo (self .getLogger ().getConfig ())
53+
54+ return self .__mongo
5055
5156 def getCollection (self , collectionName ):
5257 """Get a collection object from MongoDB
You can’t perform that action at this time.
0 commit comments