jonnor / CuraServer

3d-printing slicing server based on Cura, HTTP API
24 stars 2 forks source link

global name '_' is not defined #3

Closed city8208 closed 5 years ago

city8208 commented 5 years ago

Hi,I use the Code and install Cura by alephobjects. And it success to slice. But when its response and something error.

112.104.132.194 - - [2019-01-05 11:39:11] "GET / HTTP/1.1" 304 66 0.002120 Listening for engine communications on 49674 Traceback (most recent call last): File "/usr/local/lib/python2.7/dist-packages/bottle.py", line 862, in _handle return route.call(args) File "/usr/local/lib/python2.7/dist-packages/bottle.py", line 1740, in wrapper rv = callback(a, ka) File "/var/www/html/3dplus/CuraServer/curaserver/server.py", line 125, in slice ret = slicer.slice(stlpath) File "/var/www/html/3dplus/CuraServer/curaserver/server.py", line 51, in slice r = self._slice(stl) File "/var/www/html/3dplus/CuraServer/curaserver/server.py", line 86, in slice 'filamentUse': result.getFilamentAmount(), File "/usr/share/cura/Cura/util/sliceEngine.py", line 107, in getFilamentAmount return ('%0.2f meter %0.0f gram') % (float(self._filamentMM[e]) / 1000.0, self.getFilamentWeight(e) 1000.0) NameError: global name ' _ ' is not defined

What happened?

jonnor commented 5 years ago

This is a problem inside Cura, not in this project. Closing issue. But it looks like _ is some translation function, perhaps gettext.

city8208 commented 5 years ago

But When I disable this line and this thing resule success

ret = { 'gcode': result.getGCode(), 'polygons': result._polygons /////Disable This, 'filamentUse': result.getFilamentAmount(), /////Disable This 'printTime': result.getPrintTime(), /////Disable This } Is anything change by Cura LulzBot version?