From 50b54e6db6c82caac05f99a99f5fe02dbd41e96d Mon Sep 17 00:00:00 2001 From: tkl Date: Thu, 16 Feb 2017 07:44:56 +0000 Subject: [PATCH] setup: rearrange constants --- setup.py | 72 ++++++++++++++++++++++++++++---------------------------- 1 file changed, 36 insertions(+), 36 deletions(-) diff --git a/setup.py b/setup.py index 2cb4be2..4d448f4 100644 --- a/setup.py +++ b/setup.py @@ -1,36 +1,36 @@ -#!/usr/bin/env python -''' -Created on Feb 15, 2017 - -Type 'python setup.py sdist' to create the distribution, -type 'python setup.py install' to install the distribution. - -@author: tkl -''' -from distutils.core import setup -import shutil -import os -import stat -import sys - -DAEMON_START_SCRIPT_SRC = 'mqtt_logger.service' -DAEMON_START_SCRIPT_DST = '/lib/systemd/system/mqtt_logger.service' -PKG_NAME = 'mqtt_logger' -PKG_VERSION = '0.1.0' -PKG_AUTHOR = 'tkl' -PKG_AUTHOR_EMAIL = 'tkl@blackfinn.de' -PKG_URL = 'files.blackfinn.de/python/' + PKG_NAME + '.py/' + PKG_NAME + '-' + \ - PKG_VERSION + '.tar.gz' -PKG_PACKAGES = [PKG_NAME] -PKG_SCRIPTS = [DAEMON_START_SCRIPT_SRC] - -if sys.argv[1] == 'install': - shutil.copyfile(DAEMON_START_SCRIPT_SRC, DAEMON_START_SCRIPT_DST) - os.chmod(DAEMON_START_SCRIPT_DST, stat.S_IRUSR | stat.S_IWUSR | \ - stat.S_IRGRP | stat.S_IROTH) - setup(name=PKG_NAME, version=PKG_VERSION, author=PKG_AUTHOR, - author_email=PKG_AUTHOR_EMAIL, url=PKG_URL, packages=PKG_PACKAGES) -elif sys.argv[1] == 'sdist': - setup(name=PKG_NAME, version=PKG_VERSION, author=PKG_AUTHOR, - author_email=PKG_AUTHOR_EMAIL, url=PKG_URL, packages=PKG_PACKAGES, - scripts=PKG_SCRIPTS) +#!/usr/bin/env python +''' +Created on Feb 15, 2017 + +Type 'python setup.py sdist' to create the distribution, +type 'python setup.py install' to install the distribution. + +@author: tkl +''' +from distutils.core import setup +import shutil +import os +import stat +import sys + +PKG_NAME = 'mqtt_logger' +PKG_VERSION = '0.1.0' +DAEMON_START_SCRIPT_SRC = PKG_NAME + '.service' +DAEMON_START_SCRIPT_DST = '/lib/systemd/system/' + DAEMON_START_SCRIPT_SRC +PKG_AUTHOR = 'tkl' +PKG_AUTHOR_EMAIL = 'tkl@blackfinn.de' +PKG_URL = 'files.blackfinn.de/python/' + PKG_NAME + '.py/' + PKG_NAME + '-' + \ + PKG_VERSION + '.tar.gz' +PKG_PACKAGES = [PKG_NAME] +PKG_SCRIPTS = [DAEMON_START_SCRIPT_SRC] + +if sys.argv[1] == 'install': + shutil.copyfile(DAEMON_START_SCRIPT_SRC, DAEMON_START_SCRIPT_DST) + os.chmod(DAEMON_START_SCRIPT_DST, stat.S_IRUSR | stat.S_IWUSR | \ + stat.S_IRGRP | stat.S_IROTH) + setup(name=PKG_NAME, version=PKG_VERSION, author=PKG_AUTHOR, + author_email=PKG_AUTHOR_EMAIL, url=PKG_URL, packages=PKG_PACKAGES) +elif sys.argv[1] == 'sdist': + setup(name=PKG_NAME, version=PKG_VERSION, author=PKG_AUTHOR, + author_email=PKG_AUTHOR_EMAIL, url=PKG_URL, packages=PKG_PACKAGES, + scripts=PKG_SCRIPTS)