Ejemplo n.º 1
0
    def errorprint(self, *args):
        text = " ".join(map(lambda x: str(x), args))
        self.errorEditor.append(text)
        text = self.errorEditor.toPlainText()

        error_file = jarvis.get_filename(jarvis.ERROR_FILE)
        self.atomic_write(error_file, text + "\n")
Ejemplo n.º 2
0
    def debugprint(self, *args):
        text = " ".join(map(lambda x: str(x), args))
        self.debugEditor.append(text)
        text = self.debugEditor.toPlainText()

        debug_file = jarvis.get_filename(jarvis.DEBUG_FILE)
        self.atomic_write(debug_file, text + "\n")
Ejemplo n.º 3
0
    def debugprint(self, *args):
        text = " ".join(map(lambda x: str(x), args))
        self.debugEditor.append(text)
        text = self.debugEditor.toPlainText()

        debug_file = jarvis.get_filename(jarvis.DEBUG_FILE)
        self.atomic_write(debug_file, text + "\n")
Ejemplo n.º 4
0
    def errorprint(self, *args):
        text = " ".join(map(lambda x: str(x), args))
        self.errorEditor.append(text)
        text = self.errorEditor.toPlainText()

        error_file = jarvis.get_filename(jarvis.ERROR_FILE)
        self.atomic_write(error_file, text + "\n")
Ejemplo n.º 5
0
def main():
    test_filename_function = arg[0]
    test_filename_function_path = jarvis.get_filename(jarvis.TEST_FILENAME_FUNCTION)

    f = open(test_filename_function_path, "w")
    f.write(test_filename_function)
    f.close()
def main():
    test_filename_function = arg[0]
    test_filename_function_path = jarvis.get_filename(
        jarvis.TEST_FILENAME_FUNCTION)

    f = open(test_filename_function_path, "w")
    f.write(test_filename_function)
    f.close()
Ejemplo n.º 7
0
def external_inspect_vars(file_name, line_number):
    filename = jarvis.get_filename(jarvis.INSPECT_VAR_QUERY)
    f = open(filename, "w")
    query = "%s %s" % (line_number, file_name)
    f.write(query)
    f.close()
    start = time.time()
    elapsed = 0
    while elapsed < MAX_INSPECT_ELAPSED:
        try:
            filename = jarvis.get_filename(jarvis.INSPECT_VAR_QUERY_RESPONSE)
            r = open(filename).read()
            if r.split("\n")[0] == query:
                return r
        except IOError:
            pass

        elapsed = time.time() - start
Ejemplo n.º 8
0
 def buildAudioTmpFile(self, data, skip):
     import wavehelper
     if isinstance(data, basestring):
         data = wavehelper.WaveReader(data)
     if hasattr(data, "read"):
         outputFileName = jarvis.get_filename("audiotmpfile.wav")
         ws = wavehelper.WaveSink(data, outputFileName, self.loopTime, skip = skip)
         ws.run()
         return outputFileName
Ejemplo n.º 9
0
def external_inspect_vars(file_name, line_number):
    filename = jarvis.get_filename(jarvis.INSPECT_VAR_QUERY)
    f = open(filename, "w")
    query = "%s %s" % (line_number, file_name)
    f.write(query)
    f.close()
    start = time.time()
    elapsed = 0
    while elapsed < MAX_INSPECT_ELAPSED:
        try:
            filename = jarvis.get_filename(jarvis.INSPECT_VAR_QUERY_RESPONSE)
            r = open(filename).read()
            if r.split("\n")[0] == query:
                return r
        except IOError:
            pass

        elapsed = time.time() - start
Ejemplo n.º 10
0
    def trace_query_check(self):
        if self.tracer == None:
            return

        filename = jarvis.get_filename(jarvis.INSPECT_VAR_QUERY)

        # Check date of trace file, not to redo work for nothing
        if not os.path.exists(filename):
            return

        filedate = os.path.getmtime(filename)
        if hasattr(self,
                   "trace_file_date") and filedate == self.trace_file_date:
            return

        try:
            query_string = open(filename).read()
            query = query_string.split()
            line = query[0]
            file = query[1]
        except:
            return None

        if not self.tracer.istracing(file):
            self.trace_file_white_list[file] = True
            # Force a new run !!
            self.force_run = True
            return

        ret = self.tracer.inspect(file, int(line))
        if ret == None:
            self.trace_query_check_write(query_string,
                                         "Function was not executed")
            return

        # The check was successful, so we can set the date
        self.trace_file_date = filedate

        new_ret = []
        for time, d in ret:
            new_ret += [[time, {}]]
            for k, v in d.iteritems():
                new_ret[-1][1][k] = [v[0], str(v[1])]
        ret = new_ret

        self.trace_query_check_write(query_string, str(ret))
Ejemplo n.º 11
0
    def trace_query_check(self):
        if self.tracer == None:
            return

        filename = jarvis.get_filename(jarvis.INSPECT_VAR_QUERY)

        # Check date of trace file, not to redo work for nothing
        if not os.path.exists(filename):
            return

        filedate = os.path.getmtime(filename)
        if hasattr(self, "trace_file_date") and filedate == self.trace_file_date:
            return

        try:
            query_string = open(filename).read()
            query = query_string.split()
            line = query[0]
            file = query[1]
        except:
            return None

        if not self.tracer.istracing(file):
            self.trace_file_white_list[file] = True
            # Force a new run !!
            self.force_run = True
            return

        ret = self.tracer.inspect(file, int(line))
        if ret == None:
            self.trace_query_check_write(query_string, "Function was not executed")
            return

        # The check was successful, so we can set the date
        self.trace_file_date = filedate

        new_ret = []
        for time,d in ret:
            new_ret += [[time, {}]]
            for k,v in d.iteritems():
                new_ret[-1][1][k] = [v[0], str(v[1])]
        ret = new_ret

        self.trace_query_check_write(query_string, str(ret))
Ejemplo n.º 12
0
from Pymacs import lisp
import jarvis

try:
    test_filename_function = open(jarvis.get_filename(jarvis.TEST_FILENAME_FUNCTION)).read()
except:
    test_filename_function = None

if test_filename_function not in [None, ""]:
    lisp.set_frame_size(lisp.selected_frame(), 164, 62)

    lisp.compile("jarvis --filename_function " + test_filename_function)
else:
    lisp.compile("jarvis")


Ejemplo n.º 13
0
 def trace_query_check_write(self, query_string, content):
     filename = jarvis.get_filename(jarvis.INSPECT_VAR_QUERY_RESPONSE)
     f = open(filename, "w")
     f.write(query_string + "\n")
     f.write(content + "\n")
     f.close()
Ejemplo n.º 14
0
 def trace_query_check_write(self, query_string, content):
     filename = jarvis.get_filename(jarvis.INSPECT_VAR_QUERY_RESPONSE)
     f = open(filename, "w")
     f.write(query_string + "\n")
     f.write(content + "\n")
     f.close()
Ejemplo n.º 15
0
from Pymacs import lisp
import jarvis

errorpath = jarvis.get_filename(jarvis.ERROR_FILE)
f = open(errorpath).read()

finalfilename = None
finalline = None

for l in f.split("\n"):
    if "File \"" in l:
        parts = l.split()
        filename = parts[1][1:-2]
        line = parts[3].strip(",")
        finalfilename = filename
        finalline = line

if finalfilename != None and finalline != None:
    lisp.find_file(finalfilename)
    lisp.goto_line(int(finalline))
Ejemplo n.º 16
0
if 'arg' in globals():
    from Pymacs import lisp
    import jarvis

    debug_file = jarvis.get_filename(jarvis.DEBUG_FILE)

    # Sample code : break on whitespace
    lisp.insert(open(debug_file).read())