Merge branch 'master' into processing

This commit is contained in:
Chrys 2017-07-25 17:56:33 +02:00
commit 7edebc2962
5 changed files with 37 additions and 9 deletions

View File

@ -1,9 +1,34 @@
#!/bin/python #!/bin/python
#https://python-packaging.readthedocs.io/en/latest/minimal.html #https://python-packaging.readthedocs.io/en/latest/minimal.html
import os import os, glob
from setuptools import find_packages from setuptools import find_packages
from setuptools import setup from setuptools import setup
fenrirVersion = '1.5' fenrirVersion = '1.5'
data_files = []
directories = glob.glob('config/*')
for directory in directories:
files = glob.glob(directory+'/*')
destDir = ''
if 'config/punctuation' in directory :
destDir = '/etc/fenrir/punctuation'
elif 'config/keyboard' in directory:
destDir = '/etc/fenrir/keyboard'
elif 'config/settings' in directory:
destDir = '/etc/fenrir/settings'
elif 'config/scripts' in directory:
destDir = '/usr/share/fenrir/scripts'
elif 'config/sound' in directory:
if "default-wav" in directory:
destDir = '/usr/share/sounds/fenrir/default-wav'
elif "default" in directory:
destDir = '/usr/share/sounds/fenrir/default'
elif "template" in directory:
destDir = '/usr/share/sounds/fenrir/template'
if destDir != '':
data_files.append((destDir, files))
data_files.append(('/usr/lib/systemd/system/', 'autostart/systemd/fenrir.service'))
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()
@ -39,12 +64,15 @@ setup(
include_package_data=True, include_package_data=True,
zip_safe=False, zip_safe=False,
data_files=data_files,
# Dependent packages (distributions) # Dependent packages (distributions)
install_requires=[ install_requires=[
"evdev", "evdev",
"sox", "sox",
"dbus-python", "dbus-python",
"pyenchant", "pyenchant",
"pyudev",
"setuptools", "setuptools",
], ],

View File

@ -5,7 +5,7 @@
# By Chrys, Storm Dragon, and contributers. # By Chrys, Storm Dragon, and contributers.
import glob, os, time, inspect import glob, os, time, inspect
currentdir = os.path.dirname(os.path.abspath(inspect.getfile(inspect.currentframe()))) currentdir = os.path.dirname(os.path.realpath(os.path.abspath(inspect.getfile(inspect.currentframe()))))
fenrirPath = os.path.dirname(currentdir) fenrirPath = os.path.dirname(currentdir)
from core import debug from core import debug

View File

@ -5,7 +5,7 @@
# By Chrys, Storm Dragon, and contributers. # By Chrys, Storm Dragon, and contributers.
import os, inspect import os, inspect
currentdir = os.path.dirname(os.path.abspath(inspect.getfile(inspect.currentframe()))) currentdir = os.path.dirname(os.path.realpath(os.path.abspath(inspect.getfile(inspect.currentframe()))))
fenrirPath = os.path.dirname(currentdir) fenrirPath = os.path.dirname(currentdir)
from configparser import ConfigParser from configparser import ConfigParser

View File

@ -5,7 +5,7 @@
# By Chrys, Storm Dragon, and contributers. # By Chrys, Storm Dragon, and contributers.
import os, sys, inspect import os, sys, inspect
fenrirPath = os.path.dirname(os.path.abspath(inspect.getfile(inspect.currentframe()))) fenrirPath = os.path.dirname(os.path.realpath(os.path.abspath(inspect.getfile(inspect.currentframe()))))
if not fenrirPath in sys.path: if not fenrirPath in sys.path:
sys.path.append(fenrirPath) sys.path.append(fenrirPath)

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.realpath(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
from daemonize import Daemonize from daemonize import Daemonize
@ -23,6 +23,6 @@ def main():
if __name__ == "__main__": if __name__ == "__main__":
# for debug in foreground # for debug in foreground
#daemon = Daemonize(app="fenrir-daemon", pid=pidFile, action=main, foreground=True,chdir=os.path.dirname(os.path.realpath(fenrirVersion.__file__))) #daemon = Daemonize(app="fenrir-daemon", pid=pidFile, action=main, foreground=True,chdir=os.path.dirname(os.path.realpath(fenrirVersion.__file__)))
daemon = Daemonize(app="fenrir-daemon", pid=pidFile, action=main, chdir=os.path.dirname(os.path.realpath(fenrirVersion.__file__))) daemon = Daemonize(app="fenrir-daemon", pid=pidFile, action=main, chdir=fenrirPath)
daemon.start() daemon.start()