WIP for memoryManager

This commit is contained in:
Chrys 2017-10-30 20:42:18 +01:00
parent 8b29f366a7
commit dec4974fb0
3 changed files with 12 additions and 3 deletions

View File

@ -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',],
}

View File

@ -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

View File

@ -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()