Merge branch 'master' into processing

This commit is contained in:
Chrys 2017-07-25 16:16:35 +02:00
commit 2608ce0dc6
10 changed files with 36 additions and 35 deletions

1
.gitignore vendored
View File

@ -2,3 +2,4 @@ __pycache__/
*\.pyc *\.pyc
fenrir.egg-info/ fenrir.egg-info/
dist/ dist/
build/

View File

@ -75,3 +75,7 @@ By default it uses:
- speech driver: speechdDriver - speech driver: speechdDriver
- braille driver: brlttyDriver (WIP) - braille driver: brlttyDriver (WIP)
- input driver: evdevDriver - input driver: evdevDriver
# Documentation
You can see all information in the wiki:
https://wiki.linux-a11y.org/doku.php?id=fenrir_user_manual&s[]=fenrir

View File

@ -3,6 +3,7 @@
import os import os
from setuptools import find_packages from setuptools import find_packages
from setuptools import setup from setuptools import setup
fenrirVersion = '1.5'
def read(fname): def read(fname):
return open(os.path.join(os.path.dirname(__file__), fname)).read() return open(os.path.join(os.path.dirname(__file__), fname)).read()
@ -10,13 +11,14 @@ setup(
# Application name: # Application name:
name="fenrir", name="fenrir",
# Version number (initial): # Version number (initial):
version="1.5a", version=fenrirVersion,
# description # description
description="An TTY Screen Reader For Linux.", description="An TTY Screen Reader For Linux.",
long_description=read('README.md'), long_description=read('README.md'),
keywords='screenreader a11y accessibility terminal console', keywords=['screenreader', 'a11y', 'accessibility', 'terminal', 'TTY', 'console'],
license="License :: OSI Approved :: GNU General Public License v3 or later (GPLv3+)", license="License :: OSI Approved :: GNU General Public License v3 or later (GPLv3+)",
url="https://github.com/chrys87/fenrir/", url="https://github.com/chrys87/fenrir/",
download_url = 'https://github.com/chrys87/fenrir/archive/' + fenrirVersion + '.tar.gz',
classifiers=[ classifiers=[
"Programming Language :: Python", "Programming Language :: Python",
"Development Status :: 5 - Production/Stable", "Development Status :: 5 - Production/Stable",
@ -41,7 +43,9 @@ setup(
install_requires=[ install_requires=[
"evdev", "evdev",
"sox", "sox",
'setuptools', "dbus-python",
"pyenchant",
"setuptools",
], ],
) )

View File

View File

View File

@ -4,8 +4,10 @@
# Fenrir TTY screen reader # Fenrir TTY screen reader
# By Chrys, Storm Dragon, and contributers. # By Chrys, Storm Dragon, and contributers.
import glob, os, time import glob, os, time, inspect
import fenrirVersion currentdir = os.path.dirname(os.path.abspath(inspect.getfile(inspect.currentframe())))
fenrirPath = os.path.dirname(currentdir)
from core import debug from core import debug
from utils import module_utils from utils import module_utils
@ -32,7 +34,7 @@ class commandManager():
def loadCommands(self, section='commands',commandPath=''): def loadCommands(self, section='commands',commandPath=''):
if commandPath =='': if commandPath =='':
commandPath = os.path.dirname(os.path.realpath(fenrirVersion.__file__))+ "/commands/" commandPath = fenrirPath+ "/commands/"
if not commandPath.endswith('/'): if not commandPath.endswith('/'):
commandPath += '/' commandPath += '/'
commandFolder = commandPath + section +"/" commandFolder = commandPath + section +"/"
@ -76,8 +78,8 @@ class commandManager():
if not scriptPath.endswith('/'): if not scriptPath.endswith('/'):
scriptPath += '/' scriptPath += '/'
if not os.path.exists(scriptPath): if not os.path.exists(scriptPath):
if os.path.exists(os.path.dirname(os.path.realpath(fenrirVersion.__file__)) +'/../../config/scripts/'): if os.path.exists(fenrirPath +'/../../config/scripts/'):
scriptPath = os.path.dirname(os.path.realpath(fenrirVersion.__file__)) +'/../../config/scripts/' scriptPath = fenrirPath +'/../../config/scripts/'
else: else:
self.env['runtime']['debug'].writeDebugOut("scriptpath not exists:" + scriptPath ,debug.debugLevel.WARNING) self.env['runtime']['debug'].writeDebugOut("scriptpath not exists:" + scriptPath ,debug.debugLevel.WARNING)
return return
@ -88,7 +90,7 @@ class commandManager():
self.env['runtime']['debug'].writeDebugOut("scriptpath not readable:" + scriptPath ,debug.debugLevel.ERROR) self.env['runtime']['debug'].writeDebugOut("scriptpath not readable:" + scriptPath ,debug.debugLevel.ERROR)
return return
commandList = glob.glob(scriptPath+'*') commandList = glob.glob(scriptPath+'*')
subCommand = os.path.dirname(os.path.realpath(fenrirVersion.__file__)) + '/commands/commands/subprocess.py' subCommand = fenrirPath + '/commands/commands/subprocess.py'
for command in commandList: for command in commandList:
invalid = False invalid = False
try: try:

View File

@ -5,10 +5,6 @@
# By Chrys, Storm Dragon, and contributers. # By Chrys, Storm Dragon, and contributers.
import os, sys, signal, time import os, sys, signal, time
import fenrirVersion
if not os.path.dirname(os.path.realpath(fenrirVersion.__file__)) in sys.path:
sys.path.append(os.path.dirname(os.path.realpath(fenrirVersion.__file__)))
from core import i18n from core import i18n
from core import settingsManager from core import settingsManager
@ -170,11 +166,3 @@ class fenrirManager():
self.environment['runtime'][currManager].shutdown() self.environment['runtime'][currManager].shutdown()
del self.environment['runtime'][currManager] del self.environment['runtime'][currManager]
self.environment = None self.environment = None
def main():
app = fenrir()
app.proceed()
del app
if __name__ == "__main__":
main()

View File

@ -4,8 +4,10 @@
# Fenrir TTY screen reader # Fenrir TTY screen reader
# By Chrys, Storm Dragon, and contributers. # By Chrys, Storm Dragon, and contributers.
import os import os, inspect
import fenrirVersion currentdir = os.path.dirname(os.path.abspath(inspect.getfile(inspect.currentframe())))
fenrirPath = os.path.dirname(currentdir)
from configparser import ConfigParser from configparser import ConfigParser
from core import eventManager from core import eventManager
from core import inputManager from core import inputManager
@ -30,7 +32,7 @@ class settingsManager():
self.env = environment self.env = environment
def shutdown(self): def shutdown(self):
pass pass
def loadShortcuts(self, kbConfigPath=os.path.dirname(os.path.realpath(fenrirVersion.__file__)) + '/../../config/keyboard/desktop.conf'): def loadShortcuts(self, kbConfigPath=fenrirPath + '/../../config/keyboard/desktop.conf'):
kbConfig = open(kbConfigPath,"r") kbConfig = open(kbConfigPath,"r")
while(True): while(True):
invalid = False invalid = False
@ -106,7 +108,7 @@ class settingsManager():
def isValidKey(self, key): def isValidKey(self, key):
return key in inputData.keyNames return key in inputData.keyNames
def loadDicts(self, dictConfigPath=os.path.dirname(os.path.realpath(fenrirVersion.__file__)) + '/../../config/punctuation/default.conf'): def loadDicts(self, dictConfigPath=fenrirPath + '/../../config/punctuation/default.conf'):
dictConfig = open(dictConfigPath,"r") dictConfig = open(dictConfigPath,"r")
currDictName = '' currDictName = ''
while(True): while(True):
@ -204,7 +206,7 @@ class settingsManager():
if self.env['runtime'][driverType] != None: if self.env['runtime'][driverType] != None:
self.env['runtime'][driverType].shutdown(self.env) self.env['runtime'][driverType].shutdown(self.env)
driver_mod = module_utils.importModule(driverName, driver_mod = module_utils.importModule(driverName,
os.path.dirname(os.path.realpath(fenrirVersion.__file__)) + "/" + driverType + '/' + driverName + '.py') fenrirPath + "/" + driverType + '/' + driverName + '.py')
self.env['runtime'][driverType] = driver_mod.driver() self.env['runtime'][driverType] = driver_mod.driver()
self.env['runtime'][driverType].initialize(self.env) self.env['runtime'][driverType].initialize(self.env)
self.env['runtime']['debug'].writeDebugOut('Loading Driver ' + driverType + ' (' + driverName +") OK",debug.debugLevel.INFO, onAnyLevel=True) self.env['runtime']['debug'].writeDebugOut('Loading Driver ' + driverType + ' (' + driverName +") OK",debug.debugLevel.INFO, onAnyLevel=True)
@ -257,8 +259,8 @@ class settingsManager():
environment['runtime']['debug'].initialize(environment) environment['runtime']['debug'].initialize(environment)
# get fenrir settings root # get fenrir settings root
if not os.path.exists(settingsRoot): if not os.path.exists(settingsRoot):
if os.path.exists(os.path.dirname(os.path.realpath(fenrirVersion.__file__)) +'/../../config/'): if os.path.exists(fenrirPath +'/../../config/'):
settingsRoot = os.path.dirname(os.path.realpath(fenrirVersion.__file__)) +'/../../config/' settingsRoot = fenrirPath +'/../../config/'
else: else:
return None return None
# get settings file # get settings file
@ -269,8 +271,8 @@ class settingsManager():
return None return None
# get sound themes root # get sound themes root
if not os.path.exists(soundRoot): if not os.path.exists(soundRoot):
if os.path.exists(os.path.dirname(os.path.realpath(fenrirVersion.__file__)) +'/../../config/sound/'): if os.path.exists(fenrirPath +' /../../config/sound/'):
soundRoot = os.path.dirname(os.path.realpath(fenrirVersion.__file__)) +'/../../config/sound/' soundRoot = fenrirPath + '/../../config/sound/'
environment['runtime']['settingsManager'] = self environment['runtime']['settingsManager'] = self
environment['runtime']['settingsManager'].initialize(environment) environment['runtime']['settingsManager'].initialize(environment)

View File

@ -4,11 +4,11 @@
# Fenrir TTY screen reader # Fenrir TTY screen reader
# By Chrys, Storm Dragon, and contributers. # By Chrys, Storm Dragon, and contributers.
import os, sys import os, sys, inspect
import fenrirVersion fenrirPath = os.path.dirname(os.path.abspath(inspect.getfile(inspect.currentframe())))
if not os.path.dirname(os.path.realpath(fenrirVersion.__file__)) in sys.path: if not fenrirPath in sys.path:
sys.path.append(os.path.dirname(os.path.realpath(fenrirVersion.__file__))) sys.path.append(fenrirPath)
from core import fenrirManager from core import fenrirManager