WIP memoryManager

This commit is contained in:
chrys 2017-11-03 16:43:34 +01:00
parent 7b24468501
commit 784ea2464b
2 changed files with 4 additions and 5 deletions

View File

@ -28,7 +28,7 @@ class command():
self.env['runtime']['outputManager'].presentText(_('First clipboard '), interrupt=True) self.env['runtime']['outputManager'].presentText(_('First clipboard '), interrupt=True)
if isLast: if isLast:
self.env['runtime']['outputManager'].presentText(_('Last clipboard '), interrupt=True) self.env['runtime']['outputManager'].presentText(_('Last clipboard '), interrupt=True)
print(isLast,isFirst)
speechInterrupt = not(isLast or isFirst) speechInterrupt = not(isLast or isFirst)
self.env['runtime']['outputManager'].presentText(clipboard, interrupt = speechInterrupt) self.env['runtime']['outputManager'].presentText(clipboard, interrupt = speechInterrupt)

View File

@ -16,7 +16,6 @@ class memoryManager():
pass pass
def listStorageValid(self,name, checkIndex = False): def listStorageValid(self,name, checkIndex = False):
try: try:
print(self.listStorage[name]['index'], self.listStorage[name]['list'])
if checkIndex: if checkIndex:
index = self.listStorage[name]['index'] index = self.listStorage[name]['index']
if index == -1: if index == -1:
@ -42,7 +41,7 @@ class memoryManager():
def isLastIndex(self, name): def isLastIndex(self, name):
if not self.listStorageValid(name): if not self.listStorageValid(name):
return False return False
return self.listStorage[name]['index'] == len(self.listStorage[name]['list']) return self.listStorage[name]['index'] == len(self.listStorage[name]['list']) - 1
def isFirstIndex(self, name): def isFirstIndex(self, name):
if not self.listStorageValid(name): if not self.listStorageValid(name):
return False return False
@ -81,14 +80,14 @@ class memoryManager():
if self.isIndexListEmpty(name): if self.isIndexListEmpty(name):
self.listStorage[name]['index'] = -1 self.listStorage[name]['index'] = -1
return 0 return 0
return len(self.listStorage[name]['index']) return len(self.listStorage[name])
def setLastIndex(self, name): def setLastIndex(self, name):
if not self.listStorageValid(name): if not self.listStorageValid(name):
return False return False
if self.isIndexListEmpty(name): if self.isIndexListEmpty(name):
self.listStorage[name]['index'] = -1 self.listStorage[name]['index'] = -1
return False return False
self.listStorage[name]['index'] = self.listStorage[name]['list'] -1 self.listStorage[name]['index'] = len(self.listStorage[name]['list']) -1
return True return True
def clearCurrentIndexList(self, name): def clearCurrentIndexList(self, name):
if not self.listStorageValid(name): if not self.listStorageValid(name):