From 38a2ec0e79ee9e000306202588acf33734a1c139 Mon Sep 17 00:00:00 2001 From: opacam Date: Sun, 5 Aug 2018 13:29:05 +0200 Subject: [PATCH] Move Cohen project to new name Cohen3 In order to avoid conflicts with the original project (in case that the author decides to support python 3), the init scripts and project name has benn moved from Cohen to Cohen3. Also sets new project links for github and pypi and bumped the version number to 0.8.0. --- .travis.yml | 8 +- CHANGELOG.rst | 10 ++ LICENCE | 1 + README.rst | 40 +++--- bin/{cohen => cohen3} | 4 +- coherence/__init__.py | 6 +- docs/cli.rst | 14 +- docs/conf.py | 14 +- docs/ext_github.py | 4 - docs/index.rst | 30 +++-- ...hen-initscript.sh => cohen3-initscript.sh} | 18 +-- ...cohen.conf.example => cohen3.conf.example} | 0 setup.py | 124 ++++++++++-------- 13 files changed, 147 insertions(+), 126 deletions(-) rename bin/{cohen => cohen3} (98%) rename misc/{cohen-initscript.sh => cohen3-initscript.sh} (65%) rename misc/{cohen.conf.example => cohen3.conf.example} (100%) diff --git a/.travis.yml b/.travis.yml index 5844ce9b..c8ff8b87 100644 --- a/.travis.yml +++ b/.travis.yml @@ -1,14 +1,14 @@ language: python python: -- '2.7' +- '3.5' install: - pip install . script: nosetests deploy: provider: pypi - user: unintended + user: opacam password: - secure: gQZE3O5sSfpn5t4lMHaaW+HEXDP/xqHMzIbN9lbJMwnmqNZuZIO4gZTWwlqY0XIWeMZLnmRr+pqNy2vQUuoaU1TWVeymGx4rnWEKGvg7V94kIbJOWiFu6Ag43fTkCBB90V/ZkZ8UK9E2aZw7kCNizhVSJO096VJdQ7ryVfTrZZQ= + secure: on: tags: true - repo: unintended/Cohen + repo: opacam/Cohen3 diff --git a/CHANGELOG.rst b/CHANGELOG.rst index 1444f0a0..c1a96b66 100644 --- a/CHANGELOG.rst +++ b/CHANGELOG.rst @@ -1,3 +1,13 @@ +0.8.0 - Moves to python 3 +------------------------------ + +General: + - Renames project from Cohen to Cohen3 + - Migrates source code to python version 3 + - Reformat, Cleanup and some PEP8 fixes + - Twisted >= 18.7.0 is now required + - Louie-latest is now required (instead of Louie) + 0.7.3 - Fixes and improvements ------------------------------ diff --git a/LICENCE b/LICENCE index 8f46fc05..40e65b40 100644 --- a/LICENCE +++ b/LICENCE @@ -1,3 +1,4 @@ +Copyright (c) <2018> Copyright (c) <2015> Copyright (c) <2006> diff --git a/README.rst b/README.rst index 5ae3711b..09348a0e 100644 --- a/README.rst +++ b/README.rst @@ -1,37 +1,37 @@ -Cohen -===== +Cohen3 +====== Simple DLNA/UPnP Media Server -.. image:: http://img.shields.io/pypi/v/Cohen.svg?style=flat-square - :target: https://pypi.python.org/pypi/Cohen +.. image:: http://img.shields.io/pypi/v/Cohen3.svg?style=flat-square + :target: https://pypi.python.org/pypi/Cohen3 -.. image:: http://img.shields.io/pypi/dm/Cohen.svg?style=flat-square - :target: https://pypi.python.org/pypi/Cohen +.. image:: http://img.shields.io/pypi/dm/Cohen3.svg?style=flat-square + :target: https://pypi.python.org/pypi/Cohen3 -.. image:: http://img.shields.io/travis/unintended/Cohen.svg?style=flat-square - :target: http://travis-ci.org/unintended/Cohen +.. image:: http://img.shields.io/travis/opacam/Cohen3.svg?style=flat-square + :target: http://travis-ci.org/opacam/Cohen3 Overview -------- -Cohen is a DLNA/UPnP Media Server written in Python (v2), +Cohen3 is a DLNA/UPnP Media Server written in Python (v3), providing several UPnP MediaServers and MediaRenderers to make simple publishing and streaming different types of media content to your network. -Cohen is actually a highly simplified and refreshed version of +Cohen3 is actually a highly simplified and refreshed version of `Coherence Framework `_ project by `Frank Scholz `_ which looks like no longer supported. -- Documentation: https://cohen.readthedocs.org/ -- GitHub: https://github.com/unintended/Cohen -- Issue tracker: https://github.com/unintended/Cohen/issues -- PyPI: https://pypi.python.org/pypi/cohen +- Documentation: https://cohen3.readthedocs.org/ +- GitHub: https://github.com/opacam/Cohen3 +- Issue tracker: https://github.com/opacam/Cohen3/issues +- PyPI: https://pypi.python.org/pypi/cohen3 - Free software: MIT licence Features -------- -Cohen is known to work with various clients +Cohen3 is known to work with various clients - Sony Playstation 3/4 - XBox360/One - Denon AV Receivers @@ -49,13 +49,13 @@ And provides a lot of backends to fulfil your media streaming needs Installation from source ------------------------ After downloading and extracting the archive or having done a git -clone, move into the freshly created 'Cohen' folder and install +clone, move into the freshly created 'Cohen3' folder and install the files with:: $ sudo python ./setup.py install This will copy the Python module files into your local Python package -folder and the cohen executable to ``/usr/local/bin/cohen``. +folder and the cohen executable to ``/usr/local/bin/cohen3``. Quickstart @@ -63,19 +63,19 @@ Quickstart To just export some files on your hard-disk fire up Cohen with an UPnP MediaServer with a file-system backend enabled:: - $ cohen --plugin=backend:FSStore,content:/path/to/your/media/files + $ cohen3 --plugin=backend:FSStore,content:/path/to/your/media/files You can also configure cohen via a config file. Feel free to check our example ``misc/cohen.conf.example``. The config file can be placed anywhere, cohen looks by default for ``$HOME/.cohen``, but you can pass the path via the commandline option '-c' to it too:: - $ cohen -c /path/to/config/file + $ cohen3 -c /path/to/config/file Contributing ------------ -Report bugs at https://github.com/unintended/Cohen/issues +Report bugs at https://github.com/opacam/Cohen3/issues Feel free to fetch the repo and send your pull requests! diff --git a/bin/cohen b/bin/cohen3 similarity index 98% rename from bin/cohen rename to bin/cohen3 index 39af8f10..81c70657 100755 --- a/bin/cohen +++ b/bin/cohen3 @@ -8,7 +8,7 @@ """ Cohen is a framework to host DLNA/UPnP devices For more information about it and its available backends - point your browser to: https://cohen.readthedocs.org/ + point your browser to: https://cohen3.readthedocs.org/ """ import errno import sys @@ -49,7 +49,7 @@ def get_config_file(): if config_dir == '~': config_dir = os.getcwd() - return os.path.join(config_dir, '.cohen') + return os.path.join(config_dir, '.cohen3') def __opt_option(option, opt, value, parser): diff --git a/coherence/__init__.py b/coherence/__init__.py index 5a4b4bc1..3d6e1988 100644 --- a/coherence/__init__.py +++ b/coherence/__init__.py @@ -1,10 +1,10 @@ import platform -__version_info__ = (0, 7, 3) +__version_info__ = (0, 8, 0) __version__ = '.'.join(map(str, __version_info__)) -__url__ = 'https://github.com/unintended/Cohen' -__service_name__ = 'Cohen' +__url__ = 'https://github.com/opacam/Cohen3' +__service_name__ = 'Cohen3' SERVER_ID = ','.join([platform.system(), platform.release(), diff --git a/docs/cli.rst b/docs/cli.rst index 568609d9..8c196642 100644 --- a/docs/cli.rst +++ b/docs/cli.rst @@ -6,12 +6,12 @@ Command-Line Interface SYNOPSIS -------- -``cohen`` [--plugin= [ , : ] ...] +``cohen3`` [--plugin= [ , : ] ...] DESCRIPTION ----------- -Cohen is a Python DLNA/UPnP Media Server made to broadcast digital media content over your network. +Cohen3 is a Python DLNA/UPnP Media Server made to broadcast digital media content over your network. The core of Cohen provides a (hopefully complete) implementation of: @@ -42,11 +42,11 @@ OPTIONS EXAMPLES -------- -:cohen --plugin=backend\:FSStore,name\:MyCoherence: +:cohen3 --plugin=backend\:FSStore,name\:MyCoherence: Start cohen activating the `FSStore` backend. -:cohen --plugin=backend\:MediaStore,medialocation\:$HOME/Music/,mediadb\:/tmp/media.db: - Start cohen activating the `MediaStore` backend with media +:cohen3 --plugin=backend\:MediaStore,medialocation\:$HOME/Music/,mediadb\:/tmp/media.db: + Start cohen3 activating the `MediaStore` backend with media located in `$HOME/Music` and the media metadata store in `/tmp/media.db`. @@ -62,7 +62,7 @@ LastFMStore, AxisCamStore, YouTubeStore, TEDStore, IRadioStore, TwitchStore FILES ----- -:$HOME/.cohen: default config file +:$HOME/.cohen3: default config file ENVIRONMENT VARIABLES --------------------- @@ -74,4 +74,4 @@ ENVIRONMENT VARIABLES SEE ALSO -------- -Project Homepage https://github.com/unintended/Cohen +Project Homepage https://github.com/opacam/Cohen3 diff --git a/docs/conf.py b/docs/conf.py index 51fb8d8b..b7411614 100644 --- a/docs/conf.py +++ b/docs/conf.py @@ -1,6 +1,6 @@ # -*- coding: utf-8 -*- # -# Cohen documentation build configuration file, created by +# Cohen3 documentation build configuration file, created by # sphinx-quickstart on Fri May 1 23:29:12 2015. # # This file is execfile()d with the current directory set to its @@ -54,9 +54,9 @@ master_doc = 'index' # General information about the project. -project = u'Cohen' -copyright = u'2015, unintended' -author = u'unintended' +project = 'Cohen3' +copyright = '2018, opacam' +author = 'opacam' # The version info for the project you're documenting, acts as replacement for # |version| and |release|, also used in various other places throughout the @@ -111,7 +111,7 @@ # If true, `todo` and `todoList` produce output, else they produce nothing. todo_include_todos = True -github_project = 'unintended/Cohen' +github_project = 'opacam/Cohen3' # -- Options for HTML output ---------------------------------------------- @@ -219,14 +219,14 @@ #html_search_scorer = 'scorer.js' # Output file base name for HTML help builder. -htmlhelp_basename = 'Cohendoc' +htmlhelp_basename = 'Cohen3doc' # -- Options for manual page output --------------------------------------- # One entry per manual page. List of tuples # (source start file, name, description, authors, manual section). man_pages = [ - ('cli', 'Cohen', u'DLNA/UPnP Media Server', [author, "Frank Scholz"], 1) + ('cli', 'Cohen3', 'DLNA/UPnP Media Server', [author, "unintended", "Frank Scholz"], 1) ] # If true, show URL addresses after external links. diff --git a/docs/ext_github.py b/docs/ext_github.py index 1c2583e1..eeca5804 100644 --- a/docs/ext_github.py +++ b/docs/ext_github.py @@ -5,7 +5,6 @@ """ import re -import sys from docutils import nodes from docutils.transforms import Transform @@ -13,9 +12,6 @@ GITHUB_ISSUE_URL = "https://github.com/{0}/issues/{1}" GITHUB_USER_URL = "https://github.com/{1}" -if sys.version_info[0] == 2: - str = unicode - class GithubReferences(Transform): default_priority = 999 diff --git a/docs/index.rst b/docs/index.rst index 112adf2f..108e7474 100644 --- a/docs/index.rst +++ b/docs/index.rst @@ -1,17 +1,23 @@ Overview -------- -Cohen is a DLNA/UPnP Media Server written in Python, -providing several UPnP MediaServers and MediaRenderers -to make simple publishing and streaming different types of media content to your network. +Cohen3 is a DLNA/UPnP Media Server written in Python 3, providing several +UPnP MediaServers and MediaRenderers to make simple publishing and streaming +different types of media content to your network. + +If you need the python 2 version you should take a look into the original project: +`Cohen Framework `_ project managed by +the github user `unintended `_ + +Cohen/Cohen3 are actually a highly simplified and refreshed versions of +`Coherence Framework `_ +project by `Frank Scholz `_ which looks like +no longer supported. -Cohen is actually a highly simplified and refreshed version of -`Coherence Framework `_ project by `Frank Scholz `_ -which looks like no longer supported. - Latest release: |version| (:ref:`changelog`) -- GitHub: https://github.com/unintended/Cohen -- Issue tracker: https://github.com/unintended/Cohen/issues -- PyPI: https://pypi.python.org/pypi/cohen +- GitHub: https://github.com/opacam/Cohen3 +- Issue tracker: https://github.com/opacam/Cohen3/issues +- PyPI: https://pypi.python.org/pypi/cohen3 - Free software: MIT licence @@ -36,14 +42,14 @@ Quickstart To just export some files on your hard-disk fire up Cohen with an UPnP MediaServer with a file-system backend enabled:: - $ cohen --plugin=backend:FSStore,content:/path/to/your/media/files + $ cohen3 --plugin=backend:FSStore,content:/path/to/your/media/files You can also configure cohen via a config file. Feel free to check our example ``misc/cohen.conf.example``. The config file can be placed anywhere, cohen looks by default for -``$HOME/.cohen``, but you can pass the path via the commandline option +``$HOME/.cohen3``, but you can pass the path via the commandline option '-c' to it too:: - $ cohen -c /path/to/config/file + $ cohen3 -c /path/to/config/file Table of Contents diff --git a/misc/cohen-initscript.sh b/misc/cohen3-initscript.sh similarity index 65% rename from misc/cohen-initscript.sh rename to misc/cohen3-initscript.sh index 1deaed3e..fac63b80 100755 --- a/misc/cohen-initscript.sh +++ b/misc/cohen3-initscript.sh @@ -1,22 +1,22 @@ #!/bin/sh ### BEGIN INIT INFO -# Provides: cohen +# Provides: cohen3 # Required-Start: $all # Required-Stop: $all # Default-Start: 2 3 4 5 # Default-Stop: 0 1 6 -# Short-Description: Starts or stops the cohen mediaserver daemon +# Short-Description: Starts or stops the cohen3 mediaserver daemon # Description: Put a long description of the service here ### END INIT INFO -NAME=cohen -DAEMON=/usr/local/bin/$NAME -CONFIG=/usr/local/etc/cohen.conf -LOGFILE=/var/log/cohen.log +NAME=cohen3 +DAEMON=/usr/local/bin/${NAME} +CONFIG=/usr/local/etc/${NAME}.conf +LOGFILE=/var/log/${NAME}.log USER=nobody DAEMON_OPTS="" -PIDFILE=/var/run/$NAME.pid +PIDFILE=/var/run/${NAME}.pid STOP_TIMEOUT=30 # Add any command line options for daemon here @@ -27,13 +27,13 @@ STOP_TIMEOUT=30 do_start () { log_daemon_msg "Starting $NAME daemon" - start-stop-daemon --start --background --pidfile $PIDFILE --make-pidfile --user $USER --chuid $USER --startas $DAEMON -- -c $CONFIG -l $LOGFILE $DAEMON_OPTS + start-stop-daemon --start --background --pidfile ${PIDFILE} --make-pidfile --user ${USER} --chuid ${USER} --startas ${DAEMON} -- -c ${CONFIG} -l ${LOGFILE} ${DAEMON_OPTS} log_end_msg $? } do_stop () { log_daemon_msg "Stopping $NAME daemon" - start-stop-daemon --stop --pidfile $PIDFILE --retry $STOP_TIMEOUT + start-stop-daemon --stop --pidfile ${PIDFILE} --retry ${STOP_TIMEOUT} log_end_msg $? } diff --git a/misc/cohen.conf.example b/misc/cohen3.conf.example similarity index 100% rename from misc/cohen.conf.example rename to misc/cohen3.conf.example diff --git a/setup.py b/setup.py index fb78f387..8b6ef518 100644 --- a/setup.py +++ b/setup.py @@ -1,94 +1,102 @@ # -*- coding: utf-8 -*- import sys + from setuptools import setup, find_packages + from coherence import __version__ +if sys.version_info[:3] < (3, 5, 0): + raise NotImplemented('Python 3.5+ required, bye-bye') + packages = find_packages() DOCPAGES = ( - ('manpage', 'docs/man/cohen.rst', 'docs/man/cohen.1'), + ('manpage', 'docs/man/cohen3.rst', 'docs/man/cohen3.1'), ) deps = [ - 'ConfigObj >= 4.3', - 'Twisted >= 14.0', - 'zope.interface', - 'louie', - 'livestreamer', - 'lxml', - 'python-dateutil', - 'pyopenssl' + 'ConfigObj >= 4.3', + 'Twisted >= 18.7', + 'zope.interface', + 'louie-latest', + 'livestreamer', + 'lxml', + 'python-dateutil', + 'pyopenssl' ] if sys.platform in ('win32', 'sunos5'): - deps.append('Netifaces >= 0.4') + deps.append('Netifaces >= 0.4') entry_points = """ - [coherence.plugins.backend.media_server] - AmpacheStore = coherence.backends.ampache_storage:AmpacheStore - AppleTrailersStore = coherence.backends.appletrailers_storage:AppleTrailersStore - AudioCDStore = coherence.backends.audiocd_storage:AudioCDStore - AxisCamStore = coherence.backends.axiscam_storage:AxisCamStore - BansheeStore = coherence.backends.banshee_storage:BansheeStore - BBCStore = coherence.backends.bbc_storage:BBCStore - BuzztardStore = coherence.backends.buzztard_control:BuzztardStore - DVBDStore = coherence.backends.dvbd_storage:DVBDStore - ElisaMediaStore = coherence.backends.elisa_storage:ElisaMediaStore - FeedStore = coherence.backends.feed_storage:FeedStore - FlickrStore = coherence.backends.flickr_storage:FlickrStore - FSStore = coherence.backends.fs_storage:FSStore - Gallery2Store = coherence.backends.gallery2_storage:Gallery2Store - IRadioStore = coherence.backends.iradio_storage:IRadioStore - ITVStore = coherence.backends.itv_storage:ITVStore - LastFMStore = coherence.backends.lastfm_storage:LastFMStore - LolcatsStore = coherence.backends.lolcats_storage:LolcatsStore - MediaStore = coherence.backends.mediadb_storage:MediaStore - MiroGuideStore = coherence.backends.miroguide_storage:MiroGuideStore - PicasaStore = coherence.backends.picasa_storage:PicasaStore - PlaylistStore = coherence.backends.playlist_storage:PlaylistStore - RadiotimeStore = coherence.backends.radiotime_storage:RadiotimeStore - SWR3Store = coherence.backends.swr3_storage:SWR3Store - TEDStore = coherence.backends.ted_storage:TEDStore - TestStore = coherence.backends.test_storage:TestStore - TrackerStore = coherence.backends.tracker_storage:TrackerStore - TwitchStore = coherence.backends.twitch_storage:TwitchStore - YamjStore = coherence.backends.yamj_storage:YamjStore - YouTubeStore = coherence.backends.youtube_storage:YouTubeStore - - [coherence.plugins.backend.media_renderer] - BuzztardPlayer = coherence.backends.buzztard_control:BuzztardPlayer - ElisaPlayer = coherence.backends.elisa_renderer:ElisaPlayer - GStreamerPlayer = coherence.backends.gstreamer_renderer:GStreamerPlayer + [coherence.plugins.backend.media_server] + AmpacheStore = coherence.backends.ampache_storage:AmpacheStore + AppleTrailersStore = coherence.backends.appletrailers_storage:AppleTrailersStore + AudioCDStore = coherence.backends.audiocd_storage:AudioCDStore + AxisCamStore = coherence.backends.axiscam_storage:AxisCamStore + BansheeStore = coherence.backends.banshee_storage:BansheeStore + BBCStore = coherence.backends.bbc_storage:BBCStore + BuzztardStore = coherence.backends.buzztard_control:BuzztardStore + DVBDStore = coherence.backends.dvbd_storage:DVBDStore + ElisaMediaStore = coherence.backends.elisa_storage:ElisaMediaStore + FeedStore = coherence.backends.feed_storage:FeedStore + FlickrStore = coherence.backends.flickr_storage:FlickrStore + FSStore = coherence.backends.fs_storage:FSStore + Gallery2Store = coherence.backends.gallery2_storage:Gallery2Store + IRadioStore = coherence.backends.iradio_storage:IRadioStore + ITVStore = coherence.backends.itv_storage:ITVStore + LastFMStore = coherence.backends.lastfm_storage:LastFMStore + LolcatsStore = coherence.backends.lolcats_storage:LolcatsStore + MediaStore = coherence.backends.mediadb_storage:MediaStore + MiroGuideStore = coherence.backends.miroguide_storage:MiroGuideStore + PicasaStore = coherence.backends.picasa_storage:PicasaStore + PlaylistStore = coherence.backends.playlist_storage:PlaylistStore + RadiotimeStore = coherence.backends.radiotime_storage:RadiotimeStore + SWR3Store = coherence.backends.swr3_storage:SWR3Store + TEDStore = coherence.backends.ted_storage:TEDStore + TestStore = coherence.backends.test_storage:TestStore + TrackerStore = coherence.backends.tracker_storage:TrackerStore + TwitchStore = coherence.backends.twitch_storage:TwitchStore + YamjStore = coherence.backends.yamj_storage:YamjStore + YouTubeStore = coherence.backends.youtube_storage:YouTubeStore + + [coherence.plugins.backend.media_renderer] + BuzztardPlayer = coherence.backends.buzztard_control:BuzztardPlayer + ElisaPlayer = coherence.backends.elisa_renderer:ElisaPlayer + GStreamerPlayer = coherence.backends.gstreamer_renderer:GStreamerPlayer """ -setup(name='Cohen', +setup(name='Cohen3', version=__version__, - description="Cohen - DLNA/UPnP Media Server", - long_description="Cohen is a DLNA/UPnP Media Server written in Python, " - "providing several UPnP MediaServers and MediaRenderers" - "to make simple publishing and streaming different types of media content to your network.", - author='unintended', - author_email='unintended.github@gmail.com', + description="Cohen3 - DLNA/UPnP Media Server", + long_description="Cohen3 is a DLNA/UPnP Media Server rewritten in Python3" + " from the Python2 version Cohen (original project" + " was coherence-project), providing several " + "UPnP MediaServers and MediaRenderers to make simple " + "publishing and streaming different types of media " + "content to your network.", + author='opacam', + author_email='canellestudi@gmail.com', license='MIT', packages=packages, - scripts=['bin/cohen'], - url='https://github.com/unintended/Cohen', + scripts=['bin/cohen3'], + url='https://github.com/opacam/Cohen3', keywords=['UPnP', 'DLNA', 'multimedia', 'gstreamer'], classifiers=['Development Status :: 5 - Production/Stable', 'Environment :: Console', 'Environment :: Web Environment', 'License :: OSI Approved :: MIT License', 'Operating System :: OS Independent', - 'Programming Language :: Python :: 2', - 'Programming Language :: Python :: 2.7', + 'Programming Language :: Python :: 3', + 'Programming Language :: Python :: 3.5', 'Topic :: Internet :: WWW/HTTP', 'Topic :: Multimedia :: Sound/Audio', 'Topic :: Multimedia :: Video', 'Topic :: Utilities', ], package_data={ - 'coherence': ['upnp/core/xml-service-descriptions/*.xml'], - 'misc': ['device-icons/*.png'], + 'coherence': ['upnp/core/xml-service-descriptions/*.xml'], + 'misc': ['device-icons/*.png'], }, install_requires=deps, entry_points=entry_points