Changeset 329

Show
Ignore:
Timestamp:
06/04/08 19:43:25 (5 years ago)
Author:
apdavison
Message:

The addition of a path argument to load_mechanisms() (see r328) was flawed, since the function would only use the first path it was given, and subsequent calls would be ignored.

Files:
1 modified

Legend:

Unmodified
Added
Removed
  • trunk/src/neuron/__init__.py

    r328 r329  
    3232running       = False 
    3333initialised   = False 
    34 nrn_dll_loaded = False 
     34nrn_dll_loaded = [] 
    3535 
    3636# ============================================================================== 
     
    122122def load_mechanisms(path=pyNN_path[0]): 
    123123    global nrn_dll_loaded 
    124     if not nrn_dll_loaded: 
     124    if path not in nrn_dll_loaded: 
    125125        arch_list = [platform.machine(), 'i686', 'x86_64', 'powerpc'] 
    126126        # in case NEURON is assuming a different architecture to Python, we try multiple possibilities 
     
    129129            if os.path.exists(lib_path): 
    130130                h.nrn_load_dll(lib_path) 
    131                 nrn_dll_loaded = True 
     131                nrn_dll_loaded.append(path) 
    132132                return 
    133133        raise Exception("NEURON mechanisms not found in %s." % os.path.join(path, 'hoc'))