Merge pull request #4 from jodal/mixed-cleanup

Mixed cleanup
This commit is contained in:
9and3r
2015-03-24 12:32:56 +01:00
7 changed files with 66 additions and 36 deletions

3
.gitignore vendored
View File

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

View File

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

View File

@@ -1,6 +1,6 @@
****************************
******************
Mopidy-Touchscreen
****************************
******************
.. image:: https://img.shields.io/pypi/v/Mopidy-Touchscreen.svg?style=flat
:target: https://pypi.python.org/pypi/Mopidy-Touchscreen/
@@ -10,7 +10,7 @@ Mopidy-Touchscreen
:target: https://pypi.python.org/pypi/Mopidy-Touchscreen/
: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
:alt: Travis CI build status
@@ -18,10 +18,12 @@ Mopidy-Touchscreen
:target: https://coveralls.io/r/9and3r/mopidy-touchscreen?branch=master
: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>`_
Dependencies
============
@@ -29,6 +31,7 @@ Dependencies
- ``Pykka`` >= 1.1
- ``pygame``
Installation
============
@@ -55,13 +58,24 @@ Mopidy-Touchscreen to your Mopidy configuration file::
cache_dir = $XDG_CACHE_DIR/mopidy/touchscreen
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``
@@ -84,30 +98,31 @@ Add to the config the next variables::
sdl_fbdev = /dev/fb1
sdl_mousdrv = TSLIB
sdl_mousedev = event0
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::
os.environ["SDL_FBDEV"] = "/dev/fb1"
os.environ["SDL_MOUSEDRV"] = "TSLIB"
os.environ["SDL_MOUSEDEV"] = "event0"
Run mopidy with root privileges
Run Mopidy with root privileges
```````````````````````````````
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``
Do not forget that this is a workaround and that mopidy will run with root privileges.
Help
====
You can use `mopidy discuss <https://discuss.mopidy.com/>`_
or send an email to `9and3r@gmail.com <mailto:9and3r@gmail.com>`_
Features
========
@@ -132,16 +147,19 @@ Planned
* Use keyboard or GPIO buttons instead of touchscreen
Screenshots
===========
.. image:: http://i60.tinypic.com/qqsait.jpg
Video
=====
`Example video running the extension <https://www.youtube.com/watch?v=KuYoIb8Q2LI>`_
Project resources
=================
@@ -153,25 +171,26 @@ Project resources
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
- UI changes
- Smoth text scrolling
- 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
v0.2.0
----------------------------------------
v0.2.0 (2014-08-02)
-------------------
- First working version
v0.1.0 (UNRELEASED)
----------------------------------------
- Initial release.

View File

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

View File

@@ -6,9 +6,9 @@ from setuptools import find_packages, setup
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(

Binary file not shown.

12
tox.ini
View File

@@ -4,12 +4,18 @@ envlist = py27, flake8
[testenv]
sitepackages = true
deps =
coverage
mock
nose
mopidy==dev
pytest
pytest-cov
pytest-xdist
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]
deps =