summaryrefslogtreecommitdiff
path: root/configs/sim/axis/remap/iocontrol-removed/python/task.py
blob: 4a632edf69eb934b39e18b0eb88c1170e97c4fd9 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
import sys
import hal
import emccanon
import interpreter

try:
    import emctask
    import customtask
except ImportError,e:
    print "failed on import emctask,customtask",e
    pass

try:
    import cPickle as pickle
except ImportError:
    import pickle

def starttask():
    global pytask
    try:
        import emc
    except ImportError:
        import linuxcnc as emc  # ini only

    ini = emc.ini(emctask.ini_filename())
    t = ini.find("PYTHON", "PYTHON_TASK")
    if int(t) if t else 0:
        pytask = customtask.CustomTask()

if 'emctask' in sys.builtin_module_names:
    starttask()