]> kaliko git repositories - mpd-sima.git/commitdiff
Packaging refactoring
authorkaliko <efrim@azylum.org>
Wed, 8 Jan 2014 19:29:12 +0000 (20:29 +0100)
committerkaliko <efrim@azylum.org>
Wed, 8 Jan 2014 19:31:46 +0000 (20:31 +0100)
mpd-sima [new file with mode: 0644]
setup.py
sima/__init__.py
sima/core.py
sima/info.py [new file with mode: 0644]
sima/launch.py [moved from launch with 88% similarity, mode: 0644]

diff --git a/mpd-sima b/mpd-sima
new file mode 100644 (file)
index 0000000..e6157a2
--- /dev/null
+++ b/mpd-sima
@@ -0,0 +1,10 @@
+#!/usr/bin/env python3
+# -*- coding: utf-8 -*-
+
+# Script starts here
+from sima.launch import main
+main()
+
+# VIM MODLINE
+# vim: ai ts=4 sw=4 sts=4 expandtab
+
index 2768347e7feb5cdd9a7dbb2b00931ffdbb5e20b4..eb8501c9f69886f6f6fc1698ac703816b55bc3fe 100755 (executable)
--- a/setup.py
+++ b/setup.py
@@ -3,23 +3,12 @@
 
 import glob
 
-from setuptools import setup
-#from distutils.core import setup
+from setuptools import setup, find_packages  # >= 2.0.2
 from os import listdir
 from os.path import isfile, isdir
 
-from sima.core import __version__ as VERSION
-
-DESCRIPTION = """
-sima is a Python application meant to feed your MPD playlist with tracks
-from artists similar to your currently playing track, provided that these
-artists are found in MPD library. Similar artists are fetched from last.fm.
-
-sima can queue track, top track or whole album for similar artists.
-
-This client allows you to never run out of music when your playlist
-queue is getting short.
-"""
+from sima.info import __version__ as VERSION, __author__ as AUTHOR
+from sima.info import __doc__ as DESCRIPTION, __email__ as EMAIL
 
 data_files = [
     #('share/man/man1', ['data/mpd-sima.1', 'data/simadb_cli.1',]),
@@ -44,22 +33,19 @@ setup(name='sima',
       download_url='http://codingteam.net/project/sima/download',
       url='http://codingteam.net/project/sima',
       description='Automagically add titles to MPD playlist',
-      author='Jack Kaliko',
-      author_email='Jack Kaliko <kaliko@azylum.org>',
+      author=AUTHOR,
+      author_email= EMAIL,
       license='GPLv3',
       keywords='MPD',
       long_description=DESCRIPTION,
       classifiers=classifiers,
-      install_requires=['distribute', 'python-musicpd'],
-      packages=['sima','sima.lib', 'sima.utils',
-                'sima.plugins.core',
-                'sima.plugins.internal',
-                'sima.plugins.contrib'],
+      install_requires=['python-musicpd'],
+      packages=find_packages(),
       include_package_data=True,
       data_files=data_files,
-      scripts=['launch'],
+      #scripts=['mpd-sima'],
       entry_points={
-          'console_scripts': ['sima = launch:mainc',]
+          'console_scripts': ['mpd-sima = sima.launch:main',]
           },
 )
 
index bd387be9e61a1cb4dfa968f1d760a159e809a759..f78f6343e7bd53c0f18cdfba0f1b165e9da84c1c 100644 (file)
@@ -1,6 +1,4 @@
 # -*- coding: utf-8 -*-
 
-
 # VIM MODLINE
 # vim: ai ts=4 sw=4 sts=4 expandtab
-
index bf098bbb58ececa7d2442e0927d1009a7ef08e8b..adbefa2218a3016fcf553f238cc75e5730be0479 100644 (file)
@@ -2,10 +2,6 @@
 """Core Object dealing with plugins and player client
 """
 
-__version__ = '0.12.0pr1'
-__author__ = 'kaliko jack'
-__url__ = 'git://git.kaliko.me/sima.git'
-
 import sys
 import time
 
diff --git a/sima/info.py b/sima/info.py
new file mode 100644 (file)
index 0000000..3b6d369
--- /dev/null
@@ -0,0 +1,22 @@
+# -*- coding: utf-8 -*-
+"""
+sima is a Python application meant to feed your MPD playlist with tracks
+from artists similar to your currently playing track, provided that these
+artists are found in MPD library. Similar artists are fetched from last.fm.
+
+sima can queue track, top track or whole album for similar artists.
+
+This client allows you to never run out of music when your playlist
+queue is getting short.
+"""
+
+
+__version__ = '0.12.0pr2'
+__author__ = 'kaliko jack'
+__email__ = 'kaliko@azylum.org'
+__url__ = 'git://git.kaliko.me/sima.git'
+
+
+# VIM MODLINE
+# vim: ai ts=4 sw=4 sts=4 expandtab
+
old mode 100755 (executable)
new mode 100644 (file)
similarity index 88%
rename from launch
rename to sima/launch.py
index 9d12fda..dbd1525
--- a/launch
@@ -1,4 +1,3 @@
-#!/usr/bin/env python3
 # -*- coding: utf-8 -*-
 """Sima
 """
@@ -15,15 +14,15 @@ from os.path import isfile
 ##
 
 # local import
-from sima import core
-from sima.lib.logger import set_logger
-from sima.lib.simadb import SimaDB
-from sima.utils.config import ConfMan
-from sima.utils.startopt import StartOpt
-from sima.utils.utils import exception_log, SigHup
+from . import core, info
+from .lib.logger import set_logger
+from .lib.simadb import SimaDB
+from .utils.config import ConfMan
+from .utils.startopt import StartOpt
+from .utils.utils import exception_log, SigHup
  # core plugins
-from sima.plugins.core.history import History
-from sima.plugins.core.mpdoptions import MpdOptions
+from .plugins.core.history import History
+from .plugins.core.mpdoptions import MpdOptions
 ##
 
 
@@ -99,7 +98,6 @@ def start(sopt, restart=False):
             logger.info('Daemonize process...')
             sima.start()
 
-    logger.error('starting')
     try:
         sima.foreground()
     except KeyboardInterrupt:
@@ -122,10 +120,10 @@ def run(sopt, restart=False):
 
 # Script starts here
 def main():
-    info = dict({'version': core.__version__,
+    nfo = dict({'version': info.__version__,
                  'prog': 'sima'})
     # StartOpt gathers options from command line call (in StartOpt().options)
-    sopt = StartOpt(info)
+    sopt = StartOpt(nfo)
     run(sopt)