def load_locustfile(path):
 (directory, locustfile) = os.path.split(path)
 added_to_path = False
 index = None
 if (directory not in sys.path):
  sys.path.insert(0, directory)
  added_to_path = True
 else:
  i = sys.path.index(directory)
  if (i != 0):
   index = i
   sys.path.insert(0, directory)
   del sys.path[(i + 1)]
 imported = __import__(os.path.splitext(locustfile)[0])
 if added_to_path:
  del sys.path[0]
 if (index is not None):
  sys.path.insert((index + 1), directory)
  del sys.path[0]
 locusts = dict(filter(is_locust, vars(imported).items()))
 return (imported.__doc__, locusts)

def load_locustfile ( path ) : ( directory , locustfile ) = os . path . split ( path ) added_to_path = False index = None if ( directory not in sys . path ) : sys . path . insert ( 0 , directory ) added_to_path = True else : i = sys . path . index ( directory ) if ( i != 0 ) : index = i sys . path . insert ( 0 , directory ) del sys . path [ ( i + 1 ) ] imported = __import__ ( os . path . splitext ( locustfile ) [ 0 ] ) if added_to_path : del sys . path [ 0 ] if ( index is not None ) : sys . path . insert ( ( index + 1 ) , directory ) del sys . path [ 0 ] locusts = dict ( filter ( is_locust , vars ( imported ) . items ( ) ) ) return ( imported . __doc__ , locusts )
import given locustfile path and return .