]> kaliko git repositories - mpd-sima.git/blobdiff - sima/launch.py
Add missing daemon option in bash completion
[mpd-sima.git] / sima / launch.py
index 24802bf043701648a3635a88db79eec2eda0e9b4..e1bd7449143a852d0eae500a2e18553b39e2d702 100644 (file)
@@ -1,4 +1,22 @@
 # -*- coding: utf-8 -*-
+# Copyright (c) 2013, 2014 Jack Kaliko <kaliko@azylum.org>
+#
+#  This file is part of sima
+#
+#  sima 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.
+#
+#  sima 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 sima.  If not, see <http://www.gnu.org/licenses/>.
+#
+#
 """Sima
 """
 
@@ -40,7 +58,8 @@ def load_plugins(sima, source):
         try:
             mod_obj = __import__(module, fromlist=[plugin])
         except ImportError as err:
-            logger.error('Failed to load plugin\'s module: {0} ({1})'.format(module, err))
+            logger.error('Failed to load plugin\'s module: ' +
+                         '{0} ({1})'.format(module, err))
             sima.shutdown()
             sys.exit(1)
         try:
@@ -49,7 +68,8 @@ def load_plugins(sima, source):
             logger.error('Failed to load plugin {0} ({1})'.format(plugin, err))
             sima.shutdown()
             sys.exit(1)
-        logger.info('Loading {0} plugin: {name} ({doc})'.format(source, **plugin_obj.info()))
+        logger.info('Loading {0} plugin: {name} ({doc})'.format(
+                             source, **plugin_obj.info()))
         sima.register_plugin(plugin_obj)
 
 
@@ -115,13 +135,14 @@ def run(sopt, restart=False):
     # pylint: disable=broad-except
     try:
         start(sopt, restart)
-    except SigHup as err:  # SigHup inherit from Exception
+    except SigHup:  # SigHup inherit from Exception
         run(sopt, True)
     except Exception:  # Unhandled exception
         exception_log()
 
 # Script starts here
 def main():
+    """Entry point"""
     nfo = dict({'version': info.__version__,
                  'prog': 'sima'})
     # StartOpt gathers options from command line call (in StartOpt().options)