Advertisement
LAIR82

Python

Sep 16th, 2015
152
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 1.31 KB | None | 0 0
  1. 4. Upgrading an existing configuration for remapping
  2.  
  3. The minimal prerequisites for using REMAP statements are as follows:
  4.  
  5. the Python plugin must be activated by specifying a [PYTHON]TOPLEVEL=<path-to-toplevel-script> in the ini file.
  6.  
  7. the toplevel script needs to import the remap module, which can be initially empty, but the import needs to be in place.
  8.  
  9. The Python interpreter needs to find the remap.py module above, so the path to the directory where your Python modules live needs to be added with [PYTHON]APPEND=<path-to-your-local-Python-directory>
  10.  
  11. Recommended: import the stdglue handlers in the remap module. In this case Python also needs to find stdglue.py - we just copy it from the distribution so you can make local changes as needed. Depending on your installation the path to stdglue.py might vary.
  12.  
  13. Assuming your configuration lives under /home/user/xxx and the ini file is /home/user/xxx/xxx.ini, execute the following commands.
  14.  
  15. cd /home/user/xxx
  16. mkdir python
  17. cd python
  18. cp /home/cinci15cc/linuxcnc-dev/nc_files/remap_lib/python-stdglue/stdglue.py .
  19.  
  20. echo 'from stdglue import *' >remap.py
  21. echo 'import remap' >toplevel.py
  22.  
  23. Now edit /home/user/xxx/xxx.ini and add the following:
  24.  
  25. [PYTHON]
  26. TOPLEVEL=/home/user/xxx/python/toplevel.py
  27. PATH_APPEND=/home/user/xxx/python
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement