Commit 0a86d1a6 authored by Marcel Rieger's avatar Marcel Rieger
Browse files

Use vispa.VERSION in setup.py and bin/vispa.

parent ee83f560
......@@ -10,12 +10,13 @@ import webbrowser
import cherrypy
import gtk
from vispa import RELEASE_VERSION
base = os.path.abspath(os.path.join(os.path.dirname(__file__), '..'))
if os.path.isdir(base):
sys.path.insert(0, base)
VERSION = '1.1'
logger = logging.getLogger(__name__)
......@@ -76,39 +77,30 @@ class Browser(object):
def parse_commandline():
parser = ArgumentParser()
parser.add_argument(
'-c',
'--config-dir',
dest='configdir',
default=os.path.expanduser(
'~/.vispa-%s/conf' %
VERSION),
help='Directory containing configuration files '
'(default: ~/.vispa-%s/conf)' %
VERSION)
parser.add_argument(
'-d',
'--data-dir',
dest='vardir',
default=os.path.expanduser(
'~/.vispa-%s/var' %
VERSION),
help='Directory containing server '
'data and cache files (default: ~/.vispa-%s/var)' %
VERSION)
parser.add_argument('-l', '--loglevel', dest='loglevel', default=None,
help='enable debug messages')
parser.add_argument('-p', '--port',
default=None,
help='which port the server shall listen on')
config_dir = "~/.vispa-%s/conf" % release_version
parser.add_argument("--config-dir", "-c", dest="configdir",
default=os.path.expanduser(config_dir),
help="Directory containing config files (default: %s)" % config_dir)
data_dir = "~/.vispa-%s/var" % release_version
parser.add_argument("--data-dir", "-d", dest="vardir"
default=os.path.expanduser(data_dir),
help="Directory containing data and cache files (default: %s)" % data_dir)
parser.add_argument("--loglevel", "-l", dest="loglevel", default=None,
help="Enable debug messages")
parser.add_argument("--port", "-p", default=None,
help="Which port the server shall listen on")
return parser.parse_args()
def setup_logging(args):
logging_conf = os.path.join(args.configdir, 'logging.ini')
logformat = '%(asctime)s - %(levelname)-6s - %(name)-s - %(message)s'
datefmt = '%Y-%m-%d %H:%M'
logging_conf = os.path.join(args.configdir, "logging.ini")
logformat = "%(asctime)s - %(levelname)-6s - %(name)-s - %(message)s"
datefmt = "%Y-%m-%d %H:%M"
loglevel = args.loglevel
if os.path.isfile(logging_conf):
......@@ -146,5 +138,5 @@ def run():
browser.show()
server.stop()
if __name__ == '__main__':
if __name__ == "__main__":
run()
#!/usr/bin/env python
# -*- coding: utf-8 -*-
from setuptools import setup
import os
from vispa import VERSION
ignore_extensions = [".py", ".pyc", ".pyo", ".orig"]
files = []
......@@ -24,7 +26,7 @@ for wroot, wdirs, wfiles in os.walk(versions_path):
setup(
name="vispa",
version="1.1.0",
version=VERSION,
description="VISPA - Integrated Development Environment for Physicists",
author="VISPA Project",
author_email="vispa@lists.rwth-aachen.de",
......
# -*- coding: utf-8 -*-
"""
Basic functionality for the VISPA platform
"""
......@@ -37,6 +38,9 @@ except:
logger = logging.getLogger(__name__)
VERSION = "1.1.0"
RELEASE_VERSION, _, BUGFIX_VERSION = VERSION.rpartition(".")
_datapath = 'data'
_configpath = 'conf'
_codepath = os.path.dirname(inspect.getfile(inspect.currentframe()))
......
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