I am calling a matlab function which is in my file called test.py
*
test.py*
from mlabwrap import mlab
SINGLE_FILE_TO_CHECK="D:\study\python\Deceptive\Deceptive\ToCheck"
def DetectFile():
    fullpath =SINGLE_FILE_TO_CHECK + "\\" + "OUTPUT.txt"
    y=mlab.detectfiles(fullpath)
    return y

#Function to be called
print DetectFile()

I want to call this function from my controller method eg:

@expose(template='deceptive.templates.edit')
    def validate(self,pagename,data):
        message="Changes Saved"
        page=Page.byPagename(pagename)
        page.data=data

        y=ttest.DetectFile())


I get an exception when I call this from the controller

500 Internal error

The server encountered an unexpected condition which prevented it from
fulfilling the request.

Page handler: <bound method Root.validate of
<deceptive.controllers.Root object at 0x01C75F50>>
Traceback (most recent call last):
  File 
"c:\python25\lib\site-packages\cherrypy-2.3.0-py2.5.egg\cherrypy\_cphttptools.py",
line 121, in _run
    self.main()
  File 
"c:\python25\lib\site-packages\cherrypy-2.3.0-py2.5.egg\cherrypy\_cphttptools.py",
line 264, in main
    body = page_handler(*virtual_path, **self.params)
  File "<string>", line 3, in validate
  File 
"c:\python25\lib\site-packages\TurboGears-1.0.4.3-py2.5.egg\turbogears\controllers.py",
line 363, in expose
    *args, **kw)
  File "<string>", line 5, in run_with_transaction
  File 
"c:\python25\lib\site-packages\TurboGears-1.0.4.3-py2.5.egg\turbogears\database.py",
line 356, in so_rwt
    retval = func(*args, **kw)
  File "<string>", line 5, in _expose
  File 
"c:\python25\lib\site-packages\TurboGears-1.0.4.3-py2.5.egg\turbogears\controllers.py",
line 378, in <lambda>
    mapping, fragment, args, kw)))
  File 
"c:\python25\lib\site-packages\TurboGears-1.0.4.3-py2.5.egg\turbogears\controllers.py",
line 405, in _execute_func
    output = errorhandling.try_call(func, *args, **kw)
  File 
"c:\python25\lib\site-packages\TurboGears-1.0.4.3-py2.5.egg\turbogears\errorhandling.py",
line 72, in try_call
    return func(self, *args, **kw)
  File "D:\study\python\Deceptive1.0\Deceptive\deceptive\controllers.py",
line 101, in validate
    test.DetectFile()
  File "D:\study\python\Deceptive1.0\Deceptive\deceptive\test.py",
line 5, in DetectFile
    y=mlab.detectfiles(fullpath)
  File "C:\Python25\lib\site-packages\mlabwrap.py", line 580, in __getattr__
    typ = self._do("exist('%s')" % name)
  File "C:\Python25\lib\site-packages\mlabwrap.py", line 477, in _do
    mlabraw.eval(self._session,  "cd('%s');" % os.getcwd().replace("'", "''"))
error: Unable to evaluate string in MATLAB(TM) workspace


Has anyone out there been using matlab or are there some limitations on how
many functions you can call from the controller.

--~--~---------~--~----~------------~-------~--~----~
You received this message because you are subscribed to the Google Groups 
"TurboGears" group.
To post to this group, send email to [email protected]
To unsubscribe from this group, send email to [EMAIL PROTECTED]
For more options, visit this group at 
http://groups.google.com/group/turbogears?hl=en
-~----------~----~----~----~------~----~------~--~---

Reply via email to