Skip to content
This repository has been archived by the owner on Jan 8, 2020. It is now read-only.

Commit

Permalink
Merge branch 'hotfix-bad-search-logic'
Browse files Browse the repository at this point in the history
  • Loading branch information
waxlamp committed Jan 16, 2015
2 parents a49f29f + 08d01f7 commit baff6e2
Show file tree
Hide file tree
Showing 6 changed files with 23 additions and 26 deletions.
2 changes: 1 addition & 1 deletion js/src/core.js
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@ window.tangelo = {};

// Tangelo version number.
tangelo.version = function () {
var version = "0.8.0";
var version = "0.8.1";
return version;
};

Expand Down
2 changes: 1 addition & 1 deletion js/tests/tangelo-version.js
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@ QUnit.module("Tangelo version");
(function () {
"use strict";

var version = "0.8.0";
var version = "0.8.1";

QUnit.test("Tangelo version is correct", function (assert) {
var myVersion = tangelo.version();
Expand Down
2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
{
"version": "0.8.0",
"version": "0.8.1",
"engines": {
"node": ">= 0.10.0"
},
Expand Down
2 changes: 1 addition & 1 deletion tangelo/plugin/tangelo/web/version.py
Original file line number Diff line number Diff line change
Expand Up @@ -3,5 +3,5 @@

def run():
tangelo.content_type("text/plain")
version = "0.8.0"
version = "0.8.1"
return version
2 changes: 1 addition & 1 deletion tangelo/setup.py
Original file line number Diff line number Diff line change
Expand Up @@ -33,7 +33,7 @@ def copy_with_dir(files, base):

# Create the package.
distutils.core.setup(name="tangelo",
version="0.8.0",
version="0.8.1",
author="Kitware, Inc.",
author_email="tangelo-users@public.kitware.com",
url="http://kitware.github.io/tangelo",
Expand Down
39 changes: 18 additions & 21 deletions tangelo/tangelo/__main__.py
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@
import tangelo.util
import tangelo.websocket

tangelo_version = "0.8.0"
tangelo_version = "0.8.1"


class Config(object):
Expand Down Expand Up @@ -84,6 +84,14 @@ def shutdown(signum, frame):
tangelo.log_success("TANGELO", "Be seeing you.")


def get_invocation_dir():
invocation_dir = os.path.join(os.path.dirname(__file__), "..", "..", "..")
if platform.system() == "Windows":
return os.path.abspath(invocation_dir)
else:
return os.path.abspath(os.path.join(invocation_dir, ".."))


def main():
p = argparse.ArgumentParser(description="Start a Tangelo server.")
p.add_argument("-c", "--config", type=str, default=None, metavar="FILE", help="specifies configuration file to use")
Expand Down Expand Up @@ -125,7 +133,7 @@ def main():

# Figure out where this is being called from - that will be useful for a
# couple of purposes.
invocation_dir = os.path.abspath(os.path.dirname(os.path.abspath(__file__)) + "/..")
invocation_dir = get_invocation_dir()

# Before extracting the other arguments, compute a configuration dictionary.
# If --no-config was specified, this will be the empty dictionary;
Expand Down Expand Up @@ -236,15 +244,10 @@ def main():
if root:
root = tangelo.util.expandpath(root)
else:
default_paths = map(tangelo.util.expandpath, [sys.prefix + "/share/tangelo/web",
invocation_dir + "/share/tangelo/web",
"/usr/local/share/tangelo/web"])
tangelo.log_info("TANGELO", "Looking for default web content path")
for path in default_paths:
tangelo.log_info("TANGELO", "Trying %s" % (path))
if os.path.exists(path):
root = path
break
root = tangelo.util.expandpath(invocation_dir + "/share/tangelo/web")
tangelo.log_info("TANGELO", "Looking for default web content path in %s" % (root))
if not os.path.exists(root):
root = None

# TODO(choudhury): by default, should we simply serve from the current
# directory? This is how SimpleHTTPServer works, for example.
Expand All @@ -256,16 +259,10 @@ def main():

# Compute a default plugin configuration if it was not supplied.
if args.plugin_config is None:
plugin_cfg_file = None
default_paths = map(tangelo.util.expandpath, [sys.prefix + "/share/tangelo/plugin/plugin.conf",
invocation_dir + "/share/tangelo/plugin/plugin.conf",
"/usr/local/share/tangelo/plugin/plugin.conf"])
tangelo.log_info("TANGELO", "Looking for default plugin configuration file")
for path in default_paths:
tangelo.log_info("TANGELO", "Trying %s" % (path))
if os.path.exists(path):
plugin_cfg_file = path
break
plugin_cfg_file = tangelo.util.expandpath(invocation_dir + "/share/tangelo/plugin/plugin.conf")
tangelo.log_info("TANGELO", "Looking for default plugin configuration file in %s" % (plugin_cfg_file))
if not os.path.exists(plugin_cfg_file):
plugin_cfg_file = None
else:
plugin_cfg_file = tangelo.util.expandpath(args.plugin_config)

Expand Down

0 comments on commit baff6e2

Please sign in to comment.