Commit 82400cb80b97e70c11f8acdf6cc6d842c29cbd7f

Authored by Etienne Pallier
1 parent 1fb6bca0
Exists in dev

simplification import Agent dans A_Scheduler

src/core/pyros_django/majordome/agent/A_Basic.py
@@ -14,13 +14,17 @@ import os @@ -14,13 +14,17 @@ import os
14 14
15 ###sys.path.append("../../../..") 15 ###sys.path.append("../../../..")
16 16
  17 +# pwd = PYROS/
17 pwd = os.environ['PROJECT_ROOT_PATH'] 18 pwd = os.environ['PROJECT_ROOT_PATH']
18 if pwd not in sys.path: 19 if pwd not in sys.path:
19 sys.path.append(pwd) 20 sys.path.append(pwd)
20 21
  22 +# Add paths PYROS/src and PYROS/src/core/pyros_django
21 short_paths = ['src', 'src/core/pyros_django'] 23 short_paths = ['src', 'src/core/pyros_django']
22 for short_path in short_paths: 24 for short_path in short_paths:
23 path = os.path.join(pwd, short_path) 25 path = os.path.join(pwd, short_path)
  26 + # ou plutot ?
  27 + #path = os.path.abspath(os.path.join(pwd, short_path))
24 if path not in sys.path: 28 if path not in sys.path:
25 sys.path.insert(0, path) 29 sys.path.insert(0, path)
26 30
src/core/pyros_django/scheduling/A_Scheduler.py
@@ -29,6 +29,7 @@ import argparse @@ -29,6 +29,7 @@ import argparse
29 import os 29 import os
30 import pickle 30 import pickle
31 import socket 31 import socket
  32 +
32 pwd = os.environ['PROJECT_ROOT_PATH'] 33 pwd = os.environ['PROJECT_ROOT_PATH']
33 if pwd not in sys.path: 34 if pwd not in sys.path:
34 sys.path.append(pwd) 35 sys.path.append(pwd)
@@ -39,7 +40,8 @@ for short_path in short_paths: @@ -39,7 +40,8 @@ for short_path in short_paths:
39 if path not in sys.path: 40 if path not in sys.path:
40 sys.path.insert(0, path) 41 sys.path.insert(0, path)
41 42
42 -from src.core.pyros_django.majordome.agent.Agent import Agent, build_agent, log, parse_args 43 +#from src.core.pyros_django.majordome.agent.Agent import Agent, build_agent, log, parse_args
  44 +from majordome.agent.Agent import Agent, build_agent, log, parse_args
43 from seq_submit.models import Sequence 45 from seq_submit.models import Sequence
44 from user_mgmt.models import Period, ScientificProgram, SP_Period 46 from user_mgmt.models import Period, ScientificProgram, SP_Period
45 from scheduling.models import PredictiveSchedule, EffectiveSchedule 47 from scheduling.models import PredictiveSchedule, EffectiveSchedule