Commit 78d90258 authored by Lukas Jelonek's avatar Lukas Jelonek
Browse files

Moved helper scripts to own directory. Use absolute paths for scripts.

parent 67704550
...@@ -66,8 +66,8 @@ class Repository: ...@@ -66,8 +66,8 @@ class Repository:
module['analysis']['parameters'] = {} module['analysis']['parameters'] = {}
if module['converter']['parameters'] is None: if module['converter']['parameters'] is None:
module['converter']['parameters'] = {} module['converter']['parameters'] = {}
module['analysis']['script'] = os.path.join(self.get_scripts_location(), module['analysis']['script']) module['analysis']['script'] = os.path.abspath(os.path.join(self.get_scripts_location(), module['analysis']['script']))
module['converter']['script'] = os.path.join(self.get_scripts_location(), module['converter']['script']) module['converter']['script'] = os.path.abspath(os.path.join(self.get_scripts_location(), module['converter']['script']))
return modules return modules
def normalize_profiles(self, profiles): def normalize_profiles(self, profiles):
...@@ -120,6 +120,7 @@ class Config: ...@@ -120,6 +120,7 @@ class Config:
config['app']['script_path'] = repo.get_scripts_location() config['app']['script_path'] = repo.get_scripts_location()
config['install_path'] = pkg_resources.resource_filename('psot', '') config['install_path'] = pkg_resources.resource_filename('psot', '')
config['helpers_path'] = pkg_resources.resource_filename('psot', 'helpers')
config['repository_paths'] = self.repo_paths config['repository_paths'] = self.repo_paths
return config return config
...@@ -127,10 +128,14 @@ def load_config(repositories=None): ...@@ -127,10 +128,14 @@ def load_config(repositories=None):
# always use the installed repository as the first repo # always use the installed repository as the first repo
all_repositories = [pkg_resources.resource_filename('psot', '')] all_repositories = [pkg_resources.resource_filename('psot', '')]
# check for repositories via environment variable # check for repositories via environment variable
if 'PSOT_REPOSITORIES' in os.environ: if 'PSOT_REPOSITORIES' in os.environ:
variable = os.environ['PSOT_REPOSITORIES'] variable = os.environ['PSOT_REPOSITORIES']
env_repos = variable.split(':') env_repos = variable.split(':')
# convert all paths to absolute paths
env_repos = [os.path.abspath(x) for x in env_repos]
os.environ['PSOT_REPOSITORIES'] = ":".join(env_repos)
all_repositories.extend(env_repos) all_repositories.extend(env_repos)
if repositories: if repositories:
......
...@@ -64,9 +64,9 @@ def generate_execution(config, args): ...@@ -64,9 +64,9 @@ def generate_execution(config, args):
execution['use_cluster'] = args.use_cluster execution['use_cluster'] = args.use_cluster
execution['fetch_informations'] = args.fetch_informations execution['fetch_informations'] = args.fetch_informations
execution['mode'] = 'live' if args.live else 'complete' execution['mode'] = 'live' if args.live else 'complete'
execution['script_path'] = config['app']['script_path']
execution['fasta'] = os.path.abspath(args.fasta) execution['fasta'] = os.path.abspath(args.fasta)
execution['output'] = os.path.abspath(args.output) execution['output'] = os.path.abspath(args.output)
execution['install_path'] = config['install_path']
if args.execution_dir: if args.execution_dir:
execution['directory'] = os.path.abspath(args.execution_dir) execution['directory'] = os.path.abspath(args.execution_dir)
else: else:
......
...@@ -166,7 +166,7 @@ def setup_execution_directory(execution): ...@@ -166,7 +166,7 @@ def setup_execution_directory(execution):
script_file.write(nextflow_script) script_file.write(nextflow_script)
if not os.path.exists(directory + '/bin'): if not os.path.exists(directory + '/bin'):
os.symlink(execution['script_path'], directory + '/bin') os.symlink(os.path.join(execution['install_path'], 'helpers'), directory + '/bin')
#if not os.path.exists(directory + '/psot'): #if not os.path.exists(directory + '/psot'):
# os.symlink(execution['psot_path'], directory + '/psot') # os.symlink(execution['psot_path'], directory + '/psot')
......
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