more attribute work
This commit is contained in:
parent
da0ffbc3c8
commit
0c34c2e871
25
src/fenrir/commands/commands/attribute_cursor.py
Normal file
25
src/fenrir/commands/commands/attribute_cursor.py
Normal 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
|
@ -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:
|
||||
|
Loading…
Reference in New Issue
Block a user