From d64aef6447c5d13a40ea1eea650a7b9a9e3e3b18 Mon Sep 17 00:00:00 2001 From: Giovanni Harting Date: Thu, 27 Aug 2015 21:36:48 +0200 Subject: [PATCH] added setup.py --- {LedD => ledd}/__init__.py | 2 +- {LedD => ledd}/controller.py | 0 {LedD => ledd}/daemon.py | 6 +++--- {LedD => ledd}/decorators.py | 2 +- {LedD => ledd}/effects/__init__.py | 0 {LedD => ledd}/effects/baseeffect.py | 0 {LedD => ledd}/sql/ledd.sql | 0 {LedD => ledd}/tests.py | 0 setup.py | 30 ++++++++++++++++++++++++++++ start.py | 18 ++++++++++++++--- 10 files changed, 50 insertions(+), 8 deletions(-) rename {LedD => ledd}/__init__.py (97%) rename {LedD => ledd}/controller.py (100%) rename {LedD => ledd}/daemon.py (98%) rename {LedD => ledd}/decorators.py (98%) rename {LedD => ledd}/effects/__init__.py (100%) rename {LedD => ledd}/effects/baseeffect.py (100%) rename {LedD => ledd}/sql/ledd.sql (100%) rename {LedD => ledd}/tests.py (100%) create mode 100644 setup.py diff --git a/LedD/__init__.py b/ledd/__init__.py similarity index 97% rename from LedD/__init__.py rename to ledd/__init__.py index 911294b..8738588 100644 --- a/LedD/__init__.py +++ b/ledd/__init__.py @@ -14,4 +14,4 @@ # You should have received a copy of the GNU General Public License # along with this program. If not, see . -VERSION = "0.1" \ No newline at end of file +VERSION = "0.1" diff --git a/LedD/controller.py b/ledd/controller.py similarity index 100% rename from LedD/controller.py rename to ledd/controller.py diff --git a/LedD/daemon.py b/ledd/daemon.py similarity index 98% rename from LedD/daemon.py rename to ledd/daemon.py index ed4d8a1..bd9a485 100644 --- a/LedD/daemon.py +++ b/ledd/daemon.py @@ -28,8 +28,8 @@ from multiprocessing import Process import nose -from LedD import controller, VERSION -from LedD.decorators import add_action +from ledd import controller, VERSION +from ledd.decorators import add_action class Daemon: @@ -98,7 +98,7 @@ class Daemon: os.remove("ledd.sqlite") self.sqldb = sqlite3.connect(self.config.get(self.databaseSection, 'name', fallback='ledd.sqlite')) 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.executescript(sqlfile.read()) c.close() diff --git a/LedD/decorators.py b/ledd/decorators.py similarity index 98% rename from LedD/decorators.py rename to ledd/decorators.py index bbc2cbb..7f13fe9 100644 --- a/LedD/decorators.py +++ b/ledd/decorators.py @@ -30,4 +30,4 @@ def add_action(actiondict): return wrapped_f - return wrap \ No newline at end of file + return wrap diff --git a/LedD/effects/__init__.py b/ledd/effects/__init__.py similarity index 100% rename from LedD/effects/__init__.py rename to ledd/effects/__init__.py diff --git a/LedD/effects/baseeffect.py b/ledd/effects/baseeffect.py similarity index 100% rename from LedD/effects/baseeffect.py rename to ledd/effects/baseeffect.py diff --git a/LedD/sql/ledd.sql b/ledd/sql/ledd.sql similarity index 100% rename from LedD/sql/ledd.sql rename to ledd/sql/ledd.sql diff --git a/LedD/tests.py b/ledd/tests.py similarity index 100% rename from LedD/tests.py rename to ledd/tests.py diff --git a/setup.py b/setup.py new file mode 100644 index 0000000..0f5c239 --- /dev/null +++ b/setup.py @@ -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 . + +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) diff --git a/start.py b/start.py index bd0af26..bca150a 100644 --- a/start.py +++ b/start.py @@ -14,6 +14,8 @@ # You should have received a copy of the GNU General Public License # along with this program. If not, see . +import logging + from pkgutil import 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): return self.channels[(cmd - 8) / 4] - import sys sys.modules['smbus'] = SMBus -import LedD.daemon +import ledd.daemon 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()