Selaa lähdekoodia

Merge pull request #4 from jodal/mixed-cleanup

Mixed cleanup
9and3r 10 vuotta sitten
vanhempi
commit
fd3102dc9b
7 muutettua tiedostoa jossa 66 lisäystä ja 36 poistoa
  1. 2 1
      .gitignore
  2. 4 0
      MANIFEST.in
  3. 47 28
      README.rst
  4. 1 1
      mopidy_touchscreen/__init__.py
  5. 3 3
      setup.py
  6. BIN
      setuptools-5.4.2.zip
  7. 9 3
      tox.ini

+ 2 - 1
.gitignore

@@ -3,8 +3,9 @@
 *.swp
 *.swp
 *~
 *~
 .coverage
 .coverage
+.idea/
 .tox/
 .tox/
 MANIFEST
 MANIFEST
 build/
 build/
 dist/
 dist/
-.idea/
+xunit-*.xml

+ 4 - 0
MANIFEST.in

@@ -5,5 +5,9 @@ include MANIFEST.in
 include README.rst
 include README.rst
 include mopidy_touchscreen/ext.conf
 include mopidy_touchscreen/ext.conf
 include mopidy_touchscreen/icomoon.ttf
 include mopidy_touchscreen/icomoon.ttf
+include tox.ini
 
 
 recursive-include tests *.py
 recursive-include tests *.py
+
+prune docs
+prune mopidy_touchscreen/fonts

+ 47 - 28
README.rst

@@ -1,6 +1,6 @@
-****************************
+******************
 Mopidy-Touchscreen
 Mopidy-Touchscreen
-****************************
+******************
 
 
 .. image:: https://img.shields.io/pypi/v/Mopidy-Touchscreen.svg?style=flat
 .. image:: https://img.shields.io/pypi/v/Mopidy-Touchscreen.svg?style=flat
     :target: https://pypi.python.org/pypi/Mopidy-Touchscreen/
     :target: https://pypi.python.org/pypi/Mopidy-Touchscreen/
@@ -10,7 +10,7 @@ Mopidy-Touchscreen
     :target: https://pypi.python.org/pypi/Mopidy-Touchscreen/
     :target: https://pypi.python.org/pypi/Mopidy-Touchscreen/
     :alt: Number of PyPI downloads
     :alt: Number of PyPI downloads
 
 
-.. image:: https://img.shields.io/travis/9and3r/mopidy-touchscreen/master.png?style=flat
+.. image:: https://img.shields.io/travis/9and3r/mopidy-touchscreen/master.svg?style=flat
     :target: https://travis-ci.org/9and3r/mopidy-touchscreen
     :target: https://travis-ci.org/9and3r/mopidy-touchscreen
     :alt: Travis CI build status
     :alt: Travis CI build status
 
 
@@ -18,10 +18,12 @@ Mopidy-Touchscreen
    :target: https://coveralls.io/r/9and3r/mopidy-touchscreen?branch=master
    :target: https://coveralls.io/r/9and3r/mopidy-touchscreen?branch=master
    :alt: Test coverage
    :alt: Test coverage
 
 
-Extension for displaying track info and controlling Mopidy from a touch screen using `PyGame <http://www.pygame.org/>`_/SDL.
+Extension for displaying track info and controlling Mopidy from a touch screen
+using `PyGame <http://www.pygame.org/>`_/SDL.
 
 
 Cover images are downloaded from `last.fm <http://www.last.fm/api>`_
 Cover images are downloaded from `last.fm <http://www.last.fm/api>`_
 
 
+
 Dependencies
 Dependencies
 ============
 ============
 
 
@@ -29,6 +31,7 @@ Dependencies
 - ``Pykka`` >= 1.1
 - ``Pykka`` >= 1.1
 - ``pygame``
 - ``pygame``
 
 
+
 Installation
 Installation
 ============
 ============
 
 
@@ -55,13 +58,24 @@ Mopidy-Touchscreen to your Mopidy configuration file::
     cache_dir = $XDG_CACHE_DIR/mopidy/touchscreen
     cache_dir = $XDG_CACHE_DIR/mopidy/touchscreen
 
 
 The following configuration values are available:
 The following configuration values are available:
-    
-- ``touchscreen/enabled``: If the Touchscreen extension should be enabled or not.
-- ``touchscreen/screen_width``: The width of the resolution you want to use in pixels.
-- ``touchscreen/screen_height``: The width of the resolution you want to use in pixels.
-- ``touchscreen/cursor``: If the mouse cursor should be shown. (If you use a touchscreen it should be false)
-- ``touchscreen/fullscreen``: If you want to be shown as a window or in fullscreen.
-- ``touchscreen/screen_width``: The folder to be used as cache. Defaults to ``$XDG_CACHE_DIR/mopidy/touchscreen``, which usually means
+
+- ``touchscreen/enabled``: If the Touchscreen extension should be enabled or
+  not.
+
+- ``touchscreen/screen_width``: The width of the resolution you want to use in
+  pixels.
+
+- ``touchscreen/screen_height``: The width of the resolution you want to use in
+  pixels.
+
+- ``touchscreen/cursor``: If the mouse cursor should be shown. (If you use a
+  touchscreen it should be false)
+
+- ``touchscreen/fullscreen``: If you want to be shown as a window or in
+  fullscreen.
+
+- ``touchscreen/screen_width``: The folder to be used as cache. Defaults to
+  ``$XDG_CACHE_DIR/mopidy/touchscreen``, which usually means
   ``~/.cache/mopidy/touchscreen``
   ``~/.cache/mopidy/touchscreen``
 
 
 
 
@@ -84,30 +98,31 @@ Add to the config the next variables::
     sdl_fbdev = /dev/fb1
     sdl_fbdev = /dev/fb1
     sdl_mousdrv = TSLIB
     sdl_mousdrv = TSLIB
     sdl_mousedev = event0
     sdl_mousedev = event0
-    
+
 This is just an example. It may work but each LCD Shield seems to have its own configuration. 
 This is just an example. It may work but each LCD Shield seems to have its own configuration. 
 To find your values find an example of using pygame with your LCD Shield and it should be something like this in the code::
 To find your values find an example of using pygame with your LCD Shield and it should be something like this in the code::
 
 
     os.environ["SDL_FBDEV"] = "/dev/fb1"
     os.environ["SDL_FBDEV"] = "/dev/fb1"
     os.environ["SDL_MOUSEDRV"] = "TSLIB"
     os.environ["SDL_MOUSEDRV"] = "TSLIB"
     os.environ["SDL_MOUSEDEV"] = "event0"
     os.environ["SDL_MOUSEDEV"] = "event0"
-    
-Run mopidy with root privileges
+
+Run Mopidy with root privileges
 ```````````````````````````````
 ```````````````````````````````
-    
+
 You can use ``sudo mopidy``.
 You can use ``sudo mopidy``.
 
 
 In case you are using musicbox edit ``/etc/init.d/mopidy`` file. Change ``DAEMON_USER=mopidy`` to ``DAEMON_USER=root``
 In case you are using musicbox edit ``/etc/init.d/mopidy`` file. Change ``DAEMON_USER=mopidy`` to ``DAEMON_USER=root``
 
 
 Do not forget that this is a workaround and that mopidy will run with root privileges.
 Do not forget that this is a workaround and that mopidy will run with root privileges.
-    
-    
+
+
 Help
 Help
 ====
 ====
 
 
 You can use `mopidy discuss <https://discuss.mopidy.com/>`_
 You can use `mopidy discuss <https://discuss.mopidy.com/>`_
 or send an email to `9and3r@gmail.com <mailto:9and3r@gmail.com>`_
 or send an email to `9and3r@gmail.com <mailto:9and3r@gmail.com>`_
 
 
+
 Features
 Features
 ========
 ========
 
 
@@ -132,16 +147,19 @@ Planned
 
 
 * Use keyboard or GPIO buttons instead of touchscreen
 * Use keyboard or GPIO buttons instead of touchscreen
 
 
+
 Screenshots
 Screenshots
 ===========
 ===========
 
 
 .. image:: http://i60.tinypic.com/qqsait.jpg
 .. image:: http://i60.tinypic.com/qqsait.jpg
 
 
+
 Video
 Video
 =====
 =====
 
 
 `Example video running the extension <https://www.youtube.com/watch?v=KuYoIb8Q2LI>`_
 `Example video running the extension <https://www.youtube.com/watch?v=KuYoIb8Q2LI>`_
 
 
+
 Project resources
 Project resources
 =================
 =================
 
 
@@ -153,25 +171,26 @@ Project resources
 Changelog
 Changelog
 =========
 =========
 
 
-v0.3.2
-----------------------------------------
+v0.4.0 (UNRELEASED)
+-------------------
+
+- Require Mopidy v1.0
+- Update to work with changed core playback API in Mopidy 1.0
+
+v0.3.2 (2015-01-09)
+-------------------
 
 
 - Bug Fixes
 - Bug Fixes
 - UI changes
 - UI changes
 - Smoth text scrolling
 - Smoth text scrolling
 - Search albums, artist or songs (Not fully implemented. Basic functionality)
 - Search albums, artist or songs (Not fully implemented. Basic functionality)
 
 
-v0.2.1
-----------------------------------------
+v0.2.1 (2014-08-02)
+-------------------
 
 
 - Font will be included on installation
 - Font will be included on installation
 
 
-v0.2.0
-----------------------------------------
+v0.2.0 (2014-08-02)
+-------------------
 
 
 - First working version
 - First working version
-
-v0.1.0 (UNRELEASED)
-----------------------------------------
-
-- Initial release.

+ 1 - 1
mopidy_touchscreen/__init__.py

@@ -7,7 +7,7 @@ from mopidy import config, ext
 from .touch_screen import TouchScreen
 from .touch_screen import TouchScreen
 
 
 
 
-__version__ = '0.3.2'
+__version__ = '0.4.0'
 
 
 
 
 class Extension(ext.Extension):
 class Extension(ext.Extension):

+ 3 - 3
setup.py

@@ -6,9 +6,9 @@ from setuptools import find_packages, setup
 
 
 
 
 def get_version(filename):
 def get_version(filename):
-    content = open(filename).read()
-    metadata = dict(re.findall("__([a-z]+)__ = '([^']+)'", content))
-    return metadata['version']
+    with open(filename) as fh:
+        metadata = dict(re.findall("__([a-z]+)__ = '([^']+)'", fh.read()))
+        return metadata['version']
 
 
 
 
 setup(
 setup(

BIN
setuptools-5.4.2.zip


+ 9 - 3
tox.ini

@@ -4,12 +4,18 @@ envlist = py27, flake8
 [testenv]
 [testenv]
 sitepackages = true
 sitepackages = true
 deps =
 deps =
-    coverage
     mock
     mock
-    nose
     mopidy==dev
     mopidy==dev
+    pytest
+    pytest-cov
+    pytest-xdist
 install_command = pip install --allow-unverified=mopidy --pre {opts} {packages}
 install_command = pip install --allow-unverified=mopidy --pre {opts} {packages}
-commands = nosetests -v --with-xunit --xunit-file=xunit-{envname}.xml --with-coverage --cover-package=mopidy_touchscreen
+commands =
+    py.test \
+        --basetemp={envtmpdir} \
+        --junit-xml=xunit-{envname}.xml \
+        --cov=mopidy_touchpanel --cov-report=term-missing \
+        {posargs}
 
 
 [testenv:flake8]
 [testenv:flake8]
 deps =
 deps =