Commit fb8544e0 authored by Matt Traudt's avatar Matt Traudt Committed by Matt Traudt
Browse files

Rename SBWS_VERSION to __version__

parent e5ed6d34
......@@ -16,7 +16,7 @@ import os
def find_version():
with open(os.path.join("..", "..", "sbws", "__init__.py")) as fp:
for line in fp:
if "SBWS_VERSION" in line.strip():
if "__version__" in line.strip():
version = line.split("=", 1)[1].strip().strip("'")
return version
......
import os
SBWS_VERSION = '0.1.0'
__version__ = '0.1.0'
RESULT_VERSION = 1
WIRE_VERSION = 1
SPEC_VERSION = '1.1.0'
......
......@@ -4,7 +4,7 @@
import time
import logging
from sbws import SBWS_VERSION, SPEC_VERSION
from sbws import __version__, SPEC_VERSION
log = logging.getLogger(__name__)
......@@ -21,7 +21,7 @@ class V3BwHeader(object):
:param str software_version: the version of the software
"""
def __init__(self, timestamp=None, version=SPEC_VERSION, software='sbws',
software_version=SBWS_VERSION):
software_version=__version__):
self.timestamp = timestamp or int(time.time())
self.version = version
self.software = software
......
......@@ -5,7 +5,7 @@ import sbws.core.init
import sbws.core.pwgen
import sbws.core.server
import sbws.core.stats
from sbws import SBWS_VERSION
from sbws import __version__
from argparse import ArgumentParser, ArgumentDefaultsHelpFormatter
import os
......@@ -20,7 +20,7 @@ def create_parser():
p = ArgumentParser(formatter_class=ArgumentDefaultsHelpFormatter)
p.add_argument(
'--version', action='version', help='sbws version',
version='%(prog)s {}'.format(SBWS_VERSION))
version='%(prog)s {}'.format(__version__))
p.add_argument('--log-level',
choices=['DEBUG', 'INFO', 'WARNING', 'ERROR', 'CRITICAL'],
help='Override the sbws log level')
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment