def install_neuroconstruct():
    try:
        
        install_root = os.environ['HOME']

        with working_dir(install_root):
                print(co(['git', 'clone', 'https://github.com/NeuralEnsemble/neuroConstruct.git']))
                
        path = os.path.join(install_root,'neuroConstruct')
        
        with working_dir(path):
            print(co(['./updatenC.sh']))
            print(co(['./nC.sh', '-make']))
            m = 'Successfully installed neuroConstruct...'
        
        
    except Exception as e:
        m = 'ERROR installing neuroConstruct: ' + str(e)
    finally:
        inform(m)
 def is_installed(version):
     
     inform('Checking whether neuroConstruct is installed', indent=2)
     ret = True
     try:
         with working_dir(PyneuroConstructEngine.get_nC_environment()['NC_HOME']):
             print(co(['./nC.sh','-v']))
     except Exception as err:
         inform("Couldn't execute neuroConstruct:", err, indent=1)
         ret = False
     return ret
 def is_installed(version):
     nChome = PyneuroConstructEngine.get_nC_environment()['NC_HOME']
     inform('Checking whether neuroConstruct is installed (in %s)'%nChome, indent=2, verbosity=2)
     ret = True
     try:
         with working_dir(nChome):
             r = co(['./nC.sh','-v'], verbosity=1)
             ret = 'v%s'%r.split('neuroConstruct, version: ')[-1].split()[0]
     except Exception as err:
         inform("Couldn't execute neuroConstruct:", err, indent=1)
         ret = False
     return ret
 def is_installed(version):
     
     inform('Checking whether neuroConstruct is installed', indent=2, verbosity=2)
     ret = True
     try:
         with working_dir(PyneuroConstructEngine.get_nC_environment()['NC_HOME']):
             r = co(['./nC.sh','-v'], verbosity=1)
             ret = 'v%s'%r.split()[-1]
     except Exception as err:
         inform("Couldn't execute neuroConstruct:", err, indent=1)
         ret = False
     return ret
 def run(self):
     
     try:
         inform("Running file %s with Py_neuroConstruct" % trim_path(self.modelpath), indent=1)
         
         nC_sh = os.path.join(PyneuroConstructEngine.get_nC_environment()['NC_HOME'], 'nC.sh')
         self.stdout = co([nC_sh, '-python', self.modelpath, '-nogui'],
                                       cwd=os.path.dirname(self.modelpath))
         self.returncode = 0
     except Exception as err:
         inform("Error with running Py_neuroConstruct:", err, indent=1)
         self.returncode = -1
         self.stdout = "???"
 def run(self):
     
     try:
         inform("Running file %s with Py_neuroConstruct" % trim_path(self.modelpath), indent=1)
         
         nC_sh = os.path.join(PyneuroConstructEngine.get_nC_environment()['NC_HOME'], 'nC.sh')
         self.stdout = co([nC_sh, '-python', self.modelpath, '-nogui'],
                                       cwd=os.path.dirname(self.modelpath))
         self.returncode = 0
     except Exception as err:
         inform("Error with running Py_neuroConstruct:", err, indent=1)
         self.returncode = -1
         self.stdout = "???"
def install_neuroconstruct():
    try:

        install_root = os.environ['HOME']

        with working_dir(install_root):
            print(
                co([
                    'git', 'clone',
                    'https://github.com/NeuralEnsemble/neuroConstruct.git'
                ]))

        path = os.path.join(install_root, 'neuroConstruct')

        with working_dir(path):
            print(co(['./updatenC.sh']))
            print(co(['./nC.sh', '-make']))
            m = 'Successfully installed neuroConstruct...'

    except Exception as e:
        m = 'ERROR installing neuroConstruct: ' + str(e)
    finally:
        inform(m)
 def run(self):
     try:
         inform("Running file %s with %s" %
                (trim_path(self.modelpath), self.name),
                indent=1)
         self.stdout = co([
             'pynml' if os.name != 'nt' else 'pynml.bat', self.modelpath,
             '-nogui'
         ],
                          cwd=os.path.dirname(self.modelpath))
         self.returncode = 0
     except sp.CalledProcessError as err:
         self.returncode = err.returncode
         self.stdout = err.output
         raise EngineExecutionError