Skip to content

Commit

Permalink
Add --version parameter, control version in version.py
Browse files Browse the repository at this point in the history
  • Loading branch information
hartwork committed Sep 28, 2013
1 parent a256c04 commit 0b20060
Show file tree
Hide file tree
Showing 3 changed files with 11 additions and 2 deletions.
3 changes: 2 additions & 1 deletion ansi2html/converter.py
Original file line number Diff line number Diff line change
Expand Up @@ -29,6 +29,7 @@
from ordereddict import OrderedDict

from ansi2html.style import get_styles
from ansi2html.version import VERSION_STR
import six
from six.moves import map
from six.moves import zip
Expand Down Expand Up @@ -374,7 +375,7 @@ def main():
$ task burndown | ansi2html > burndown.html
"""

parser = optparse.OptionParser(usage=main.__doc__)
parser = optparse.OptionParser(usage=main.__doc__, version="%%prog %s" % VERSION_STR)
parser.add_option(
"-p", "--partial", dest="partial",
default=False, action="store_true",
Expand Down
5 changes: 5 additions & 0 deletions ansi2html/version.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
VERSION = (0, 10, 0)
VERSION_STR = '.'.join([str(e) for e in VERSION])

if __name__ == '__main__':
print(VERSION_STR)
5 changes: 4 additions & 1 deletion setup.py
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,9 @@

import sys

sys.path.insert(0, '.')
from ansi2html.version import VERSION_STR

f = open('README.rst')
long_description = f.read().strip()
long_description = long_description.split('split here', 1)[1]
Expand All @@ -34,7 +37,7 @@

setup(
name='ansi2html',
version='0.10.0',
version=VERSION_STR,
description="Convert text with ANSI color codes to HTML",
long_description=long_description,
author='Ralph Bean',
Expand Down

0 comments on commit 0b20060

Please sign in to comment.