Exemplo n.º 1
0
def change_epilog(self, **words):
    try:
        if not self.value_returned:
            r = self.blocks[self.remap_level].executing_remap
            self.set_errormsg(
                "the %s remap procedure %s did not return a value" %
                (r.name, r.remap_ngc if r.remap_ngc else r.remap_py))
            return INTERP_ERROR

        if self.return_value > 0.0:
            if self.return_value == 3:
                message = "No tool measurement ! Please take care of the entry in the tool table"
                lbvcanon.MESSAGE(message)
            return INTERP_OK
        else:
            if self.return_value == -1:
                message = "Searchvel <= 0, not permitted!, Please correct INI Settings."
            elif self.return_value == -2:
                message = "Probevel <= 0, not permitted!, Please correct INI Settings."
            elif self.return_value == -3:
                message = "Probe contact failiure !!"
            else:
                message = "M6 aborted (return code %.1f)" % (self.return_value)
            self.set_errormsg(message)
            return INTERP_ERROR

    except Exception, e:
        self.set_errormsg("M6/change_epilog: %s" % (e))
        return INTERP_ERROR
Exemplo n.º 2
0
def call_pydevd():
    """ trap into the pydevd debugger"""

    import os, sys

    pydevdir = '/home/mah/.eclipse/org.eclipse.platform_3.5.0_155965261/plugins/org.python.pydev.debug_2.0.0.2011040403/pysrc/'

    # the 'lbvtask' module is present only in the milltask instance, otherwise both the UI and
    # milltask would try to connect to the debug server.

    if os.path.isdir(pydevdir) and 'lbvtask' in sys.builtin_module_names:
        sys.path.append(pydevdir)
        sys.path.insert(0, pydevdir)
        try:
            import pydevd
            lbvcanon.MESSAGE(
                "pydevd imported, connecting to Eclipse debug server...")
            pydevd.settrace()
        except:
            lbvcanon.MESSAGE("no pydevd module found")
            pass
Exemplo n.º 3
0
def failingprolog(self, *args, **words):
    lbvcanon.MESSAGE("failingprolog returning INTERP_ERROR")
    self.set_errormsg("A failed Python prolog returning INTERP_ERROR")
    return interpreter.INTERP_ERROR
Exemplo n.º 4
0
from gscreen import preferences
throw_exceptions = 1

debug = False
if debug:
    pydevdir = '/home/lbvmesa/Aptana_Studio_3/plugins/org.python.pydev_2.7.0.2013032300/pysrc'

    # the 'lbvtask' module is present only in the milltask instance, otherwise both the UI and
    # milltask would try to connect to the debug server.

    if os.path.isdir(pydevdir) and 'lbvtask' in sys.builtin_module_names:
        sys.path.append(pydevdir)
        sys.path.insert(0, pydevdir)
        try:
            import pydevd
            lbvcanon.MESSAGE(
                "pydevd imported, connecting to Eclipse debug server...")
            pydevd.settrace()
        except:
            lbvcanon.MESSAGE("no pydevd module found")
            pass

# REMAP=M6  modalgroup=6 prolog=change_prolog ngc=change epilog=change_epilog
# exposed parameters:
#    #<tool_in_spindle>
#    #<selected_tool>
#    #<current_pocket>
#    #<selected_pocket>


def change_prolog(self, **words):
    try: