Commit d32426b0 authored by Lukas Jelonek's avatar Lukas Jelonek
Browse files

Add setup script. Move all resources to psot module

parent 346fe67e
#!/usr/bin/env python3
import os
import sys
sys.path.insert(0, os.path.abspath(os.path.join(os.path.dirname(__file__), '..')))
from psot.main import main
main()
import os
import yaml
import copy
import pkg_resources
def get_install_location():
"""Finds the location directory of the tool"""
......@@ -12,17 +13,20 @@ def get_install_location():
def get_script_location():
return os.path.join(get_install_location(),'bin')
def get_scripts_location():
return pkg_resources.resource_filename('psot', 'scripts')
def get_template_location():
return os.path.join(get_install_location(),'templates')
return pkg_resources.resource_filename('psot', 'templates')
def get_modules_location():
return os.path.join(get_install_location(),'modules')
return pkg_resources.resource_filename('psot', 'modules')
def get_profiles_location():
return os.path.join(get_install_location(),'profiles')
return pkg_resources.resource_filename('psot', 'profiles')
def get_config_file():
return os.path.join(get_install_location(), 'config.yaml')
return pkg_resources.resource_filename('psot', 'config.yaml')
def load_config_file():
config = {}
......@@ -42,6 +46,7 @@ def create_app_config():
config = {}
config['app_path'] = get_install_location()
config['bin_path'] = get_script_location()
config['script_path'] = get_scripts_location()
return config
def load_profiles():
......
......@@ -57,7 +57,7 @@ def generate_execution(config, args):
execution['use_cluster'] = args.use_cluster
execution['mode'] = 'live' if args.live else 'complete'
execution['bin_path'] = config['app']['bin_path']
execution['script_path'] = os.path.abspath(os.path.join(os.path.dirname(config['app']['bin_path']), 'scripts'))
execution['script_path'] = config['app']['script_path']
execution['psot_path'] = os.path.abspath(os.path.join(os.path.dirname(config['app']['bin_path']), 'psot'))
execution['fasta'] = os.path.abspath(args.fasta)
execution['output'] = os.path.abspath(args.output)
......
Supports Markdown
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