upload initial history
This commit is contained in:
parent
f56847797f
commit
ee7eb3a9c6
@ -34,7 +34,7 @@ class command():
|
|||||||
if self.env['screenData']['newNegativeDelta'] == '':
|
if self.env['screenData']['newNegativeDelta'] == '':
|
||||||
return
|
return
|
||||||
# too much for a single backspace...
|
# too much for a single backspace...
|
||||||
if len(self.env['screenData']['newNegativeDelta']) >= 5:
|
if len(self.env['screenData']['newNegativeDelta']) >= 2:
|
||||||
return
|
return
|
||||||
|
|
||||||
self.env['runtime']['outputManager'].presentText(self.env['screenData']['newNegativeDelta'], interrupt=True, ignorePunctuation=True, announceCapital=True)
|
self.env['runtime']['outputManager'].presentText(self.env['screenData']['newNegativeDelta'], interrupt=True, ignorePunctuation=True, announceCapital=True)
|
||||||
|
58
src/fenrir/commands/onInput/72000-history.py
Normal file
58
src/fenrir/commands/onInput/72000-history.py
Normal file
@ -0,0 +1,58 @@
|
|||||||
|
#!/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 ''
|
||||||
|
|
||||||
|
def run(self):
|
||||||
|
if self.env['runtime']['inputManager'].noKeyPressed():
|
||||||
|
return
|
||||||
|
if self.env['screenData']['newTTY'] != self.env['screenData']['oldTTY']:
|
||||||
|
return
|
||||||
|
if self.env['screenData']['newCursor']['y'] != self.env['screenData']['oldCursor']['y']:
|
||||||
|
return
|
||||||
|
if len(self.env['input']['currInput']) != 1:
|
||||||
|
return
|
||||||
|
if not self.env['input']['currInput'][0] in ['KEY_UP','KEY_DOWN']:
|
||||||
|
return
|
||||||
|
prevLine = self.env['screenData']['oldContentText'].split('\n')[self.env['screenData']['newCursor']['y']]
|
||||||
|
currLine = self.env['screenData']['newContentText'].split('\n')[self.env['screenData']['newCursor']['y']]
|
||||||
|
#if prevLine == currLine:
|
||||||
|
# return
|
||||||
|
if currLine.isspace():
|
||||||
|
self.env['runtime']['outputManager'].presentText("blank", soundIcon='EmptyLine', interrupt=True)
|
||||||
|
else:
|
||||||
|
currPrompt = currLine.find('$')
|
||||||
|
rootPrompt = currLine.find('#')
|
||||||
|
if currPrompt == 0:
|
||||||
|
if rootPrompt != 0:
|
||||||
|
currPrompt = rootPrompt
|
||||||
|
else:
|
||||||
|
announce = currLine
|
||||||
|
if currPrompt != 0:
|
||||||
|
remove_digits = str.maketrans('0123456789', ' ')
|
||||||
|
if prevLine[:currPrompt].translate(remove_digits) == currLine[:currPrompt].translate(remove_digits):
|
||||||
|
announce = currLine[currPrompt+1:]
|
||||||
|
else:
|
||||||
|
announce = currLine
|
||||||
|
print(announce)
|
||||||
|
if currLine.isspace():
|
||||||
|
self.env['runtime']['outputManager'].presentText("blank", soundIcon='EmptyLine', interrupt=True)
|
||||||
|
else:
|
||||||
|
self.env['runtime']['outputManager'].presentText(announce, interrupt=True)
|
||||||
|
self.env['commandsIgnore']['onScreenUpdate']['INCOMING_IGNORE'] = True
|
||||||
|
def setCallback(self, callback):
|
||||||
|
pass
|
||||||
|
|
@ -25,7 +25,7 @@ class command():
|
|||||||
|
|
||||||
# its a cursor movement (experimental) - maybe also check current shortcut string?
|
# its a cursor movement (experimental) - maybe also check current shortcut string?
|
||||||
if abs(self.env['screenData']['newCursor']['x'] - self.env['screenData']['oldCursor']['x']) >= 1:
|
if abs(self.env['screenData']['newCursor']['x'] - self.env['screenData']['oldCursor']['x']) >= 1:
|
||||||
if len(self.env['screenData']['newDelta']) <= 5:
|
if len(self.env['screenData']['newDelta']) <= 2:
|
||||||
return
|
return
|
||||||
|
|
||||||
self.env['runtime']['outputManager'].presentText(self.env['screenData']['newDelta'], interrupt=False)
|
self.env['runtime']['outputManager'].presentText(self.env['screenData']['newDelta'], interrupt=False)
|
||||||
|
@ -34,6 +34,7 @@ class commandManager():
|
|||||||
commandList = glob.glob(commandFolder+'*')
|
commandList = glob.glob(commandFolder+'*')
|
||||||
for command in commandList:
|
for command in commandList:
|
||||||
try:
|
try:
|
||||||
|
print(command)
|
||||||
fileName, fileExtension = os.path.splitext(command)
|
fileName, fileExtension = os.path.splitext(command)
|
||||||
fileName = fileName.split('/')[-1]
|
fileName = fileName.split('/')[-1]
|
||||||
if fileName in ['__init__','__pycache__']:
|
if fileName in ['__init__','__pycache__']:
|
||||||
@ -46,8 +47,8 @@ class commandManager():
|
|||||||
self.env['commandsIgnore'][section][fileName.upper()[fileName.upper().find('-')+1:]+'_IGNORE'] = False
|
self.env['commandsIgnore'][section][fileName.upper()[fileName.upper().find('-')+1:]+'_IGNORE'] = False
|
||||||
self.env['commands'][section][fileName.upper()].initialize(self.env)
|
self.env['commands'][section][fileName.upper()].initialize(self.env)
|
||||||
self.env['runtime']['debug'].writeDebugOut("Load command:" + section + "." + fileName.upper() ,debug.debugLevel.INFO)
|
self.env['runtime']['debug'].writeDebugOut("Load command:" + section + "." + fileName.upper() ,debug.debugLevel.INFO)
|
||||||
|
|
||||||
except Exception as e:
|
except Exception as e:
|
||||||
|
print(e)
|
||||||
self.env['runtime']['debug'].writeDebugOut("Loading command:" + command ,debug.debugLevel.ERROR)
|
self.env['runtime']['debug'].writeDebugOut("Loading command:" + command ,debug.debugLevel.ERROR)
|
||||||
self.env['runtime']['debug'].writeDebugOut(str(e),debug.debugLevel.ERROR)
|
self.env['runtime']['debug'].writeDebugOut(str(e),debug.debugLevel.ERROR)
|
||||||
continue
|
continue
|
||||||
|
40
src/fenrir/fenrir.egg-info/PKG-INFO
Normal file
40
src/fenrir/fenrir.egg-info/PKG-INFO
Normal file
@ -0,0 +1,40 @@
|
|||||||
|
Metadata-Version: 1.1
|
||||||
|
Name: fenrir
|
||||||
|
Version: 0.1a0
|
||||||
|
Summary: An TTY Screen Reader For Linux.
|
||||||
|
Home-page: https://github.com/chrys87/fenrir/
|
||||||
|
Author: Chrys and others
|
||||||
|
Author-email: chrys87@web.de
|
||||||
|
License: UNKNOWN
|
||||||
|
Description: # fenrir (Alfa)
|
||||||
|
An TTY screenreader for Linux.
|
||||||
|
Its an early alpha version. You can test it. It is not recommended for production use. If you want to help just let me know.
|
||||||
|
|
||||||
|
# requirements
|
||||||
|
- linux
|
||||||
|
- python3
|
||||||
|
- python-espeak
|
||||||
|
- python-evdev
|
||||||
|
- loaded uinput kernel module
|
||||||
|
Read permission to the following files:
|
||||||
|
/sys/devices/virtual/tty/tty0/active
|
||||||
|
/dev/vcsa[1-64]
|
||||||
|
ReadWrite permission
|
||||||
|
/dev/input
|
||||||
|
/dev/uinput
|
||||||
|
|
||||||
|
# optional
|
||||||
|
- sox [its used by default in the generic sound driver for playing sound-icons]
|
||||||
|
- speech-dispatcher, python3-speechd [to use the speech-dispatcher driver]
|
||||||
|
- brltty, python-brlapi [for using braille] # (not implemented yet)
|
||||||
|
- gstreamer [for soundicons via gstreamer] # not working yet
|
||||||
|
- python-pyenchant for spell check functionality
|
||||||
|
|
||||||
|
# installation
|
||||||
|
Currently there is no setupscript (sorry). But you can just run as root or setup needed permission
|
||||||
|
cd src/fenrir-package/
|
||||||
|
sudo ./fenrir.py
|
||||||
|
Settings are located in the config directory.
|
||||||
|
|
||||||
|
Platform: UNKNOWN
|
||||||
|
Classifier: Development Status :: 3 - Alpha
|
171
src/fenrir/fenrir.egg-info/SOURCES.txt
Normal file
171
src/fenrir/fenrir.egg-info/SOURCES.txt
Normal file
@ -0,0 +1,171 @@
|
|||||||
|
setup.py
|
||||||
|
src/fenrir/fenrir
|
||||||
|
src/fenrir/braille/__init__.py
|
||||||
|
src/fenrir/braille/braille.py
|
||||||
|
src/fenrir/commands/__init__.py
|
||||||
|
src/fenrir/commands/command_template.py
|
||||||
|
src/fenrir/commands/switchTrigger_template.py
|
||||||
|
src/fenrir/commands/commands/__init__.py
|
||||||
|
src/fenrir/commands/commands/add_word_to_spell_check.py
|
||||||
|
src/fenrir/commands/commands/bookmark_1.py
|
||||||
|
src/fenrir/commands/commands/bookmark_10.py
|
||||||
|
src/fenrir/commands/commands/bookmark_2.py
|
||||||
|
src/fenrir/commands/commands/bookmark_3.py
|
||||||
|
src/fenrir/commands/commands/bookmark_4.py
|
||||||
|
src/fenrir/commands/commands/bookmark_5.py
|
||||||
|
src/fenrir/commands/commands/bookmark_6.py
|
||||||
|
src/fenrir/commands/commands/bookmark_7.py
|
||||||
|
src/fenrir/commands/commands/bookmark_8.py
|
||||||
|
src/fenrir/commands/commands/bookmark_9.py
|
||||||
|
src/fenrir/commands/commands/clear_bookmark_1.py
|
||||||
|
src/fenrir/commands/commands/clear_bookmark_10.py
|
||||||
|
src/fenrir/commands/commands/clear_bookmark_2.py
|
||||||
|
src/fenrir/commands/commands/clear_bookmark_3.py
|
||||||
|
src/fenrir/commands/commands/clear_bookmark_4.py
|
||||||
|
src/fenrir/commands/commands/clear_bookmark_5.py
|
||||||
|
src/fenrir/commands/commands/clear_bookmark_6.py
|
||||||
|
src/fenrir/commands/commands/clear_bookmark_7.py
|
||||||
|
src/fenrir/commands/commands/clear_bookmark_8.py
|
||||||
|
src/fenrir/commands/commands/clear_bookmark_9.py
|
||||||
|
src/fenrir/commands/commands/clear_clipboard.py
|
||||||
|
src/fenrir/commands/commands/clear_window_application.py
|
||||||
|
src/fenrir/commands/commands/copy_marked_to_clipboard.py
|
||||||
|
src/fenrir/commands/commands/curr_char_phonetic.py
|
||||||
|
src/fenrir/commands/commands/curr_clipboard.py
|
||||||
|
src/fenrir/commands/commands/curr_screen.py
|
||||||
|
src/fenrir/commands/commands/curr_screen_after_cursor.py
|
||||||
|
src/fenrir/commands/commands/curr_screen_before_cursor.py
|
||||||
|
src/fenrir/commands/commands/curr_word_phonetic.py
|
||||||
|
src/fenrir/commands/commands/cursor_position.py
|
||||||
|
src/fenrir/commands/commands/date.py
|
||||||
|
src/fenrir/commands/commands/dec_sound_volume.py
|
||||||
|
src/fenrir/commands/commands/dec_speech_pitch.py
|
||||||
|
src/fenrir/commands/commands/dec_speech_rate.py
|
||||||
|
src/fenrir/commands/commands/dec_speech_volume.py
|
||||||
|
src/fenrir/commands/commands/exit_review.py
|
||||||
|
src/fenrir/commands/commands/first_clipboard.py
|
||||||
|
src/fenrir/commands/commands/forward_keypress.py
|
||||||
|
src/fenrir/commands/commands/inc_sound_volume.py
|
||||||
|
src/fenrir/commands/commands/inc_speech_pitch.py
|
||||||
|
src/fenrir/commands/commands/inc_speech_rate.py
|
||||||
|
src/fenrir/commands/commands/inc_speech_volume.py
|
||||||
|
src/fenrir/commands/commands/indent_curr_line.py
|
||||||
|
src/fenrir/commands/commands/last_clipboard.py
|
||||||
|
src/fenrir/commands/commands/last_incoming.py
|
||||||
|
src/fenrir/commands/commands/linux_paste_clipboard.py
|
||||||
|
src/fenrir/commands/commands/marked_text.py
|
||||||
|
src/fenrir/commands/commands/next_clipboard.py
|
||||||
|
src/fenrir/commands/commands/present_first_line.py
|
||||||
|
src/fenrir/commands/commands/present_last_line.py
|
||||||
|
src/fenrir/commands/commands/prev_clipboard.py
|
||||||
|
src/fenrir/commands/commands/quit_fenrir.py
|
||||||
|
src/fenrir/commands/commands/remove_marks.py
|
||||||
|
src/fenrir/commands/commands/remove_word_from_spell_check.py
|
||||||
|
src/fenrir/commands/commands/review_bottom.py
|
||||||
|
src/fenrir/commands/commands/review_curr_char.py
|
||||||
|
src/fenrir/commands/commands/review_curr_line.py
|
||||||
|
src/fenrir/commands/commands/review_curr_word.py
|
||||||
|
src/fenrir/commands/commands/review_down.py
|
||||||
|
src/fenrir/commands/commands/review_line_begin.py
|
||||||
|
src/fenrir/commands/commands/review_line_end.py
|
||||||
|
src/fenrir/commands/commands/review_line_first_char.py
|
||||||
|
src/fenrir/commands/commands/review_line_last_char.py
|
||||||
|
src/fenrir/commands/commands/review_next_char.py
|
||||||
|
src/fenrir/commands/commands/review_next_line.py
|
||||||
|
src/fenrir/commands/commands/review_next_word.py
|
||||||
|
src/fenrir/commands/commands/review_prev_char.py
|
||||||
|
src/fenrir/commands/commands/review_prev_line.py
|
||||||
|
src/fenrir/commands/commands/review_prev_word.py
|
||||||
|
src/fenrir/commands/commands/review_top.py
|
||||||
|
src/fenrir/commands/commands/review_up.py
|
||||||
|
src/fenrir/commands/commands/set_bookmark_1.py
|
||||||
|
src/fenrir/commands/commands/set_bookmark_10.py
|
||||||
|
src/fenrir/commands/commands/set_bookmark_2.py
|
||||||
|
src/fenrir/commands/commands/set_bookmark_3.py
|
||||||
|
src/fenrir/commands/commands/set_bookmark_4.py
|
||||||
|
src/fenrir/commands/commands/set_bookmark_5.py
|
||||||
|
src/fenrir/commands/commands/set_bookmark_6.py
|
||||||
|
src/fenrir/commands/commands/set_bookmark_7.py
|
||||||
|
src/fenrir/commands/commands/set_bookmark_8.py
|
||||||
|
src/fenrir/commands/commands/set_bookmark_9.py
|
||||||
|
src/fenrir/commands/commands/set_mark.py
|
||||||
|
src/fenrir/commands/commands/set_window_application.py
|
||||||
|
src/fenrir/commands/commands/shut_up.py
|
||||||
|
src/fenrir/commands/commands/spell_check.py
|
||||||
|
src/fenrir/commands/commands/time.py
|
||||||
|
src/fenrir/commands/commands/toggle_auto_read.py
|
||||||
|
src/fenrir/commands/commands/toggle_auto_spell_check.py
|
||||||
|
src/fenrir/commands/commands/toggle_braille.py
|
||||||
|
src/fenrir/commands/commands/toggle_output.py
|
||||||
|
src/fenrir/commands/commands/toggle_punctuation_level.py
|
||||||
|
src/fenrir/commands/commands/toggle_sound.py
|
||||||
|
src/fenrir/commands/commands/toggle_speech.py
|
||||||
|
src/fenrir/commands/commands/toggle_tutorial_mode.py
|
||||||
|
src/fenrir/commands/onApplicationChange/__init__.py
|
||||||
|
src/fenrir/commands/onApplicationChange/test.py
|
||||||
|
src/fenrir/commands/onInput/10000-shut_up.py
|
||||||
|
src/fenrir/commands/onInput/45000-present_char_if_cursor_change_horizontal.py
|
||||||
|
src/fenrir/commands/onInput/50000-char_echo.py
|
||||||
|
src/fenrir/commands/onInput/55000-present_line_if_cursor_change_vertical.py
|
||||||
|
src/fenrir/commands/onInput/60000-word_echo.py
|
||||||
|
src/fenrir/commands/onInput/62000-spell_check.py
|
||||||
|
src/fenrir/commands/onInput/65000-char_delete_echo.py
|
||||||
|
src/fenrir/commands/onInput/80000-capslock.py
|
||||||
|
src/fenrir/commands/onInput/80300-scrolllock.py
|
||||||
|
src/fenrir/commands/onInput/80500-numlock.py
|
||||||
|
src/fenrir/commands/onInput/__init__.py
|
||||||
|
src/fenrir/commands/onScreenChanged/10000-shut_up.py
|
||||||
|
src/fenrir/commands/onScreenChanged/80000-screen_change_announcement.py
|
||||||
|
src/fenrir/commands/onScreenChanged/85000-screen_chnage_reset_marks.py
|
||||||
|
src/fenrir/commands/onScreenChanged/85000-screen_chnage_reset_review.py
|
||||||
|
src/fenrir/commands/onScreenChanged/89000-screen_chnage_leve_review_mode.py
|
||||||
|
src/fenrir/commands/onScreenChanged/__init__.py
|
||||||
|
src/fenrir/commands/onScreenUpdate/70000-incoming.py
|
||||||
|
src/fenrir/commands/onScreenUpdate/75000-incoming_promote.py
|
||||||
|
src/fenrir/commands/onScreenUpdate/__init__.py
|
||||||
|
src/fenrir/commands/onSwitchApplicationProfile/__init__.py
|
||||||
|
src/fenrir/commands/onSwitchApplicationProfile/agetty.py
|
||||||
|
src/fenrir/commands/onSwitchApplicationProfile/bash.py
|
||||||
|
src/fenrir/commands/onSwitchApplicationProfile/default.py
|
||||||
|
src/fenrir/commands/onSwitchApplicationProfile/vim.py
|
||||||
|
src/fenrir/core/__init__.py
|
||||||
|
src/fenrir/core/applicationManager.py
|
||||||
|
src/fenrir/core/commandManager.py
|
||||||
|
src/fenrir/core/commands.py
|
||||||
|
src/fenrir/core/cursorManager.py
|
||||||
|
src/fenrir/core/debug.py
|
||||||
|
src/fenrir/core/environment.py
|
||||||
|
src/fenrir/core/generalInformation.py
|
||||||
|
src/fenrir/core/inputEvent.py
|
||||||
|
src/fenrir/core/inputManager.py
|
||||||
|
src/fenrir/core/outputManager.py
|
||||||
|
src/fenrir/core/punctuationManager.py
|
||||||
|
src/fenrir/core/runtime.py
|
||||||
|
src/fenrir/core/screenData.py
|
||||||
|
src/fenrir/core/screenManager.py
|
||||||
|
src/fenrir/core/settings.py
|
||||||
|
src/fenrir/core/settingsManager.py
|
||||||
|
src/fenrir/fenrir.egg-info/PKG-INFO
|
||||||
|
src/fenrir/fenrir.egg-info/SOURCES.txt
|
||||||
|
src/fenrir/fenrir.egg-info/dependency_links.txt
|
||||||
|
src/fenrir/fenrir.egg-info/not-zip-safe
|
||||||
|
src/fenrir/fenrir.egg-info/requires.txt
|
||||||
|
src/fenrir/fenrir.egg-info/top_level.txt
|
||||||
|
src/fenrir/inputDriver/__init__.py
|
||||||
|
src/fenrir/inputDriver/evdev.py
|
||||||
|
src/fenrir/screenDriver/__init__.py
|
||||||
|
src/fenrir/screenDriver/linux.py
|
||||||
|
src/fenrir/soundDriver/__init__.py
|
||||||
|
src/fenrir/soundDriver/generic.py
|
||||||
|
src/fenrir/soundDriver/gstreamer.py
|
||||||
|
src/fenrir/speechDriver/__init__.py
|
||||||
|
src/fenrir/speechDriver/espeak.py
|
||||||
|
src/fenrir/speechDriver/generic.py
|
||||||
|
src/fenrir/speechDriver/speechd.py
|
||||||
|
src/fenrir/utils/__init__.py
|
||||||
|
src/fenrir/utils/char_utils.py
|
||||||
|
src/fenrir/utils/fenrir-config.py
|
||||||
|
src/fenrir/utils/line_utils.py
|
||||||
|
src/fenrir/utils/mark_utils.py
|
||||||
|
src/fenrir/utils/review_utils.py
|
||||||
|
src/fenrir/utils/word_utils.py
|
1
src/fenrir/fenrir.egg-info/dependency_links.txt
Normal file
1
src/fenrir/fenrir.egg-info/dependency_links.txt
Normal file
@ -0,0 +1 @@
|
|||||||
|
|
1
src/fenrir/fenrir.egg-info/not-zip-safe
Normal file
1
src/fenrir/fenrir.egg-info/not-zip-safe
Normal file
@ -0,0 +1 @@
|
|||||||
|
|
3
src/fenrir/fenrir.egg-info/requires.txt
Normal file
3
src/fenrir/fenrir.egg-info/requires.txt
Normal file
@ -0,0 +1,3 @@
|
|||||||
|
evdev
|
||||||
|
sox
|
||||||
|
python-espeak
|
1
src/fenrir/fenrir.egg-info/top_level.txt
Normal file
1
src/fenrir/fenrir.egg-info/top_level.txt
Normal file
@ -0,0 +1 @@
|
|||||||
|
|
Loading…
Reference in New Issue
Block a user