cnc-club / linuxcnc-features

LinuxCNC Features
55 stars 21 forks source link

features.ngc not found #2

Open jegb opened 10 years ago

jegb commented 10 years ago

I get this error:

Traceback (most recent call last):
  File "features.py", line 904, in refresh
    f = open(PROGRAM_PREFIX + "/features.ngc","w")
IOError: [Errno 13] Permission denied: '/features.ngc'

this relates to the fix you commented on the forum:

try : 
   inifile = linuxcnc.ini(ini)
   SUBROUTINES_PATH = inifile.find('RS274NGC', 'SUBROUTINE_PATH') or ""
   PROGRAM_PREFIX = inifile.find('DISPLAY', 'PROGRAM_PREFIX') or ""
except : 
   print _("Warning! Problem while loading ini file!")

I managed to avoid this by hardcoding both PROGRAM_PREFIX, but SUBROUTINE_PATH still gives a later error:

Traceback (most recent call last):
  File "features.py", line 906, in refresh
    f.write(self.to_gcode())
  File "features.py", line 888, in to_gcode
    g,d =  self.refresh_recursive(iter)
  File "features.py", line 865, in refresh_recursive
    gcode_def += f.get_definitions()
  File "features.py", line 257, in get_definitions
    s = self.process(self.attr["definitions"])
  File "features.py", line 324, in process
    s = re.sub(r"(?i)(<eval>(.*?)</eval>)", eval_callback, s)
  File "/usr/lib/python2.6/re.py", line 151, in sub
    return _compile(pattern, 0).sub(repl, string, count)
  File "features.py", line 287, in eval_callback
    return str( eval(m.group(2), {"self":self}) )
  File "<string>", line 1, in <module>
  File "features.py", line 274, in include_once
    return self.include(src)
  File "features.py", line 265, in include
    f = open(search_path(SUBROUTINES_PATH,src))
TypeError: coercing to Unicode: need string or buffer, NoneType found
cnc-club commented 10 years ago

Are you using Features as stand alone app or not? Verify that PROGRAM_PREFIX and SUBROUTINE_PATH are defined in your LinuxCNC ini file.

jegb commented 10 years ago

I am using in both ways, as vcp and stand alone. I changed the paths in ini file to make sure they point to the linuxcnc-features base dir and subroutines subdir.

PROGRAM_PREFIX = /home/cnc-virtual/linuxcnc/linuxcnc-features
SUBROUTINE_PATH= /home/cnc-virtual/linuxcnc/linuxcnc-features/subroutines

What I have found on the embedded case: -adding features does not work (via +), the dialog does no exit on double clicking on the feature. -the shortcuts work though. -there is not the problem of the features.ngc access denied, axis can open it and write on it. -Axis does not refresh the graphical window, but only the code area is visible, for example by adding one of those hexagons on the panel tree.

On the stand alone panel: -Error of the access, but works if I run it as sudo.

features.py:1077: DeprecationWarning: integer argument expected, got float
  self.timeout = gobject.timeout_add(self.autorefresh_timeout.get_value()*1000, self.autorefresh_call)
Traceback (most recent call last):
  File "features.py", line 1063, in autorefresh_call
    self.refresh()
  File "features.py", line 909, in refresh
    f = open(PROGRAM_PREFIX + "/features.ngc","w")
IOError: [Errno 13] Permission denied: '/features.ngc'

-Then in this case also noticed that parenting is not possible, but adding features is possible from the dialog window.

Shift_L
Traceback (most recent call last):
  File "features.py", line 724, in unindent
    while parent != xml and not (parent.tag=="param" and parent.get("type") == "items") and parent is not None :
AttributeError: 'NoneType' object has no attribute 'tag'

-axis does not refresh (as it does not load features.ngc)

Let me know how can I help sorting this, the software is really promising. Currently using HeeksCAD/CNC.