added setup.py
This commit is contained in:
@@ -28,8 +28,8 @@ from multiprocessing import Process
|
|||||||
|
|
||||||
import nose
|
import nose
|
||||||
|
|
||||||
from LedD import controller, VERSION
|
from ledd import controller, VERSION
|
||||||
from LedD.decorators import add_action
|
from ledd.decorators import add_action
|
||||||
|
|
||||||
|
|
||||||
class Daemon:
|
class Daemon:
|
||||||
@@ -98,7 +98,7 @@ class Daemon:
|
|||||||
os.remove("ledd.sqlite")
|
os.remove("ledd.sqlite")
|
||||||
self.sqldb = sqlite3.connect(self.config.get(self.databaseSection, 'name', fallback='ledd.sqlite'))
|
self.sqldb = sqlite3.connect(self.config.get(self.databaseSection, 'name', fallback='ledd.sqlite'))
|
||||||
self.sqldb.row_factory = sqlite3.Row
|
self.sqldb.row_factory = sqlite3.Row
|
||||||
with open("LedD/sql/ledd.sql", "r") as sqlfile:
|
with open("ledd/sql/ledd.sql", "r") as sqlfile:
|
||||||
c = self.sqldb.cursor()
|
c = self.sqldb.cursor()
|
||||||
c.executescript(sqlfile.read())
|
c.executescript(sqlfile.read())
|
||||||
c.close()
|
c.close()
|
30
setup.py
Normal file
30
setup.py
Normal file
@@ -0,0 +1,30 @@
|
|||||||
|
# LEDD Project
|
||||||
|
# Copyright (C) 2015 LEDD Team
|
||||||
|
#
|
||||||
|
# This program is free software: you can redistribute it and/or modify
|
||||||
|
# it under the terms of the GNU General Public License as published by
|
||||||
|
# the Free Software Foundation, either version 3 of the License, or
|
||||||
|
# (at your option) any later version.
|
||||||
|
#
|
||||||
|
# This program is distributed in the hope that it will be useful,
|
||||||
|
# but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||||
|
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||||
|
# GNU General Public License for more details.
|
||||||
|
#
|
||||||
|
# You should have received a copy of the GNU General Public License
|
||||||
|
# along with this program. If not, see <http://www.gnu.org/licenses/>.
|
||||||
|
|
||||||
|
from setuptools import setup
|
||||||
|
|
||||||
|
setup(name='LedD',
|
||||||
|
version='0.1',
|
||||||
|
description='Providing control for led stripes.',
|
||||||
|
url='https://github.com/LED-Freaks/LedD',
|
||||||
|
author='IdleGandalf, Lauch',
|
||||||
|
author_email='539@idlegandalf.com',
|
||||||
|
license='GPLv3',
|
||||||
|
packages=['ledd'],
|
||||||
|
install_requires=[
|
||||||
|
'nose', 'colour',
|
||||||
|
],
|
||||||
|
zip_safe=False)
|
18
start.py
18
start.py
@@ -14,6 +14,8 @@
|
|||||||
# You should have received a copy of the GNU General Public License
|
# You should have received a copy of the GNU General Public License
|
||||||
# along with this program. If not, see <http://www.gnu.org/licenses/>.
|
# along with this program. If not, see <http://www.gnu.org/licenses/>.
|
||||||
|
|
||||||
|
import logging
|
||||||
|
|
||||||
from pkgutil import iter_modules
|
from pkgutil import iter_modules
|
||||||
|
|
||||||
if "smbus" not in (name for loader, name, ispkg in iter_modules()):
|
if "smbus" not in (name for loader, name, ispkg in iter_modules()):
|
||||||
@@ -32,11 +34,21 @@ if "smbus" not in (name for loader, name, ispkg in iter_modules()):
|
|||||||
def read_word_data(self, cmd):
|
def read_word_data(self, cmd):
|
||||||
return self.channels[(cmd - 8) / 4]
|
return self.channels[(cmd - 8) / 4]
|
||||||
|
|
||||||
|
|
||||||
import sys
|
import sys
|
||||||
|
|
||||||
sys.modules['smbus'] = SMBus
|
sys.modules['smbus'] = SMBus
|
||||||
import LedD.daemon
|
import ledd.daemon
|
||||||
|
|
||||||
if __name__ == "__main__":
|
if __name__ == "__main__":
|
||||||
daemon = LedD.daemon.Daemon()
|
log = logging.getLogger("")
|
||||||
|
formatter = logging.Formatter("%(asctime)s %(levelname)s " +
|
||||||
|
"[%(module)s:%(lineno)d] %(message)s")
|
||||||
|
# setup console logging
|
||||||
|
log.setLevel(logging.DEBUG)
|
||||||
|
ch = logging.StreamHandler()
|
||||||
|
ch.setLevel(logging.DEBUG)
|
||||||
|
|
||||||
|
ch.setFormatter(formatter)
|
||||||
|
log.addHandler(ch)
|
||||||
|
|
||||||
|
daemon = ledd.daemon.Daemon()
|
||||||
|
Reference in New Issue
Block a user