contentGroupProvider.py (1042B)
1 #Embedded file name: C:\BuildAgent\work\20d73f1b24eed06e\eve\release\V24.01\eve\client\script\ui\shared\agencyNew\contentGroups\contentGroupProvider.py 2 import logging 3 from eve.client.script.ui.shared.agencyNew.contentGroups.homeContentGroup import HomeContentGroup 4 logger = logging.getLogger(__name__) 5 rootContentGroup = None 6 7 def GetRootContentGroup(): 8 global rootContentGroup 9 if not rootContentGroup: 10 rootContentGroup = HomeContentGroup() 11 return rootContentGroup 12 13 14 def GetContentGroup(contentGroupID, itemID = None): 15 contentGroup = GetRootContentGroup().GetContentGroup(contentGroupID, itemID) 16 if not contentGroup: 17 logger.warn('No Content Group found: contentGroupID=%s, itemID=%s - defaulting to home' % (contentGroupID, itemID)) 18 return GetRootContentGroup() 19 return contentGroup 20 21 22 def IsContentGroupValid(contentGroupID, itemID = None): 23 return bool(GetRootContentGroup().GetContentGroup(contentGroupID, itemID)) 24 25 26 def ResetData(): 27 global rootContentGroup 28 rootContentGroup = None