diff --git a/src/fenrir/core/generalData.py b/src/fenrir/core/generalData.py index a33035e4..98404ccf 100644 --- a/src/fenrir/core/generalData.py +++ b/src/fenrir/core/generalData.py @@ -11,8 +11,8 @@ generalData = { 'tutorialMode': False, 'currUser':'', 'prevUser':'', -'managerList':['processManager','punctuationManager','cursorManager','applicationManager','commandManager' - ,'screenManager','inputManager','outputManager','helpManager','eventManager','debug'], +'managerList':['processManager', 'punctuationManager', 'cursorManager', 'applicationManager', 'commandManager' + , 'screenManager', 'inputManager','outputManager', 'helpManager', 'memoryManager', 'eventManager', 'debug'], 'commandFolderList':['commands','onInput', 'onCursorChange', 'onScreenUpdate','onScreenChanged','onHeartBeat', 'onPlugInputDevice' ,'onApplicationChange','onSwitchApplicationProfile','help',], } diff --git a/src/fenrir/core/memoryManager.py b/src/fenrir/core/memoryManager.py index 0c2af5e3..5fc6a0e2 100644 --- a/src/fenrir/core/memoryManager.py +++ b/src/fenrir/core/memoryManager.py @@ -7,15 +7,21 @@ import time from core import debug -class inputManager(): +class memoryManager(): def __init__(self): self.listStorage = {} def initialize(self, environment): self.env = environment + def shutdown(self): + pass def addValueToFirstIndex(self, name, value): pass def addIndexList(self, name, maxLength = None, currList = [], currIndex = 0): self.listStorage[name] = {'list': currList, 'index': currIndex, 'maxLength': maxLength} + def isLastIndex(self, name): + return self.listStorage[name]['index'] == len(self.listStorage[name]['list']): + def isFirstIndex(self, name): + return self.listStorage[name]['index'] == 0: def getNextIndex(self, name): if self.isIndexListEmpty(name): self.listStorage[name]['index'] = -1 diff --git a/src/fenrir/core/settingsManager.py b/src/fenrir/core/settingsManager.py index 39f86095..9b89f267 100644 --- a/src/fenrir/core/settingsManager.py +++ b/src/fenrir/core/settingsManager.py @@ -10,6 +10,7 @@ fenrirPath = os.path.dirname(currentdir) from configparser import ConfigParser from core import debugManager +from core import memoryManager from core import processManager from core import eventManager from core import inputManager @@ -323,6 +324,8 @@ class settingsManager(): if fenrirManager: environment['runtime']['fenrirManager'] = fenrirManager + environment['runtime']['memoryManager'] = memoryManager.memoryManager() + environment['runtime']['memoryManager'].initialize(environment) environment['runtime']['eventManager'] = eventManager.eventManager() environment['runtime']['eventManager'].initialize(environment) environment['runtime']['processManager'] = processManager.processManager()