lpschedule-generator

libreplanet schedule generator - ricketyspace.net/lpschedule-generator
git clone git://git.ricketyspace.net/lpschedule-generator.git
Log | Files | Refs

commit 5299189a7e02df8250d677fa69d3d16e1e09351c
parent 863b7855743e6f9eba5d5f80804a2b939ca4c138
Author: rsiddharth <rsd@gnu.org>
Date:   Sat,  5 Mar 2016 21:47:46 -0500

fixed setup.py

 - version info is loaded from _version.py

 - to read the README.rst (for long_description), we now use a function
   defined in setup.py instead of using `lps_gen.read_file` function.

Diffstat:
_version.py | 21+++++++++++++++++++++
lps_gen.py | 3++-
setup.py | 15++++++++++++---
3 files changed, 35 insertions(+), 4 deletions(-)

diff --git a/_version.py b/_version.py @@ -0,0 +1,21 @@ +# -*- coding: utf-8 -*- +# +# Copyright (C) 2015 lpschedule-generator contributors. See CONTRIBUTORS. +# +# This file is part of lpschedule-generator. +# +# lpschedule-generator is free software: you can redistribute it +# and/or modify it under the terms of the GNU General Public License +# as published by the Free Software Foundation, either version 3 of +# the License, or (at your option) any later version. +# +# lpschedule-generator is distributed in the hope that it will be useful, but +# WITHOUT ANY WARRANTY; without even the implied warranty of +# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU +# General Public License for more details. +# +# You should have received a copy of the GNU General Public License +# along with lpschedule-generator (see COPYING). If not, see +# <http://www.gnu.org/licenses/>. + +__version__ = '0.3.2.dev' diff --git a/lps_gen.py b/lps_gen.py @@ -31,7 +31,8 @@ from jinja2.exceptions import TemplateNotFound from mistune import Renderer, Markdown from unidecode import unidecode -__version__ = '0.3.1' +from _version import __version__ + # unicode magic reload(sys) diff --git a/setup.py b/setup.py @@ -19,16 +19,25 @@ # along with lpschedule-generator (see COPYING). If not, see # <http://www.gnu.org/licenses/>. -import lps_gen +import _version from setuptools import setup, find_packages +def readf(filename): + content = '' + try: + with open(filename, 'rb') as f: + for line in f: + content = content + line + except IOError: + print "Error: unable to open %s" % filename + return content config = { 'name': 'lpschedule-generator', 'description': 'LibrePlanet schedule generator', - 'long_description': lps_gen.read_file('README.rst'), - 'version': lps_gen.__version__, + 'long_description': readf('README.rst'), + 'version': _version.__version__, 'platforms': 'GNU/Linux', 'license': 'GNU General Public License version 3 or later', 'url': 'https://notabug.org/rsd/lpschedule-generator/',