more attribute work

This commit is contained in:
chrys 2017-08-13 23:13:05 +02:00
parent da0ffbc3c8
commit 0c34c2e871
2 changed files with 26 additions and 1 deletions

View File

@ -0,0 +1,25 @@
#!/bin/python
# -*- coding: utf-8 -*-
# Fenrir TTY screen reader
# By Chrys, Storm Dragon, and contributers.
from core import debug
class command():
def __init__(self):
pass
def initialize(self, environment):
self.env = environment
def shutdown(self):
pass
def getDescription(self):
return 'No description found'
def run(self):
cursorPos = self.env['runtime']['cursorManager'].getReviewOrTextCursor()
attributes = self.env['screen']['newContentAttrib'][cursorPos['x']][cursorPos['y']]
attributeFormatString = self.env['runtime']['settingsManager'].getSetting('general', 'attributeFormatString')
attributeFormatString = self.env['runtime']['screenManager'].formatAttributes(attributeFormatString)
self.env['runtime']['outputManager'].presentText(attributeFormatString, soundIcon='', interrupt=True)
def setCallback(self, callback):
pass

View File

@ -35,7 +35,7 @@ class screenManager():
# or len(self.env['screen']['newDelta']) > 6:
# self.env['runtime']['screenDriver'].getCurrApplication()
self.env['screen']['lastScreenUpdate'] = time.time()
def formatAttributes(self, x, y,attribute, attributeFormatString = None):
def formatAttributes(self, attribute, attributeFormatString = None):
if not attributeFormatString:
attributeFormatString = self.env['runtime']['settingsManager'].getSetting('general', 'attributeFormatString')
if not attributeFormatString: