Skip to content

Instantly share code, notes, and snippets.

View Elizaveta239's full-sized avatar

Elizaveta Shashkova Elizaveta239

View GitHub Profile
'''
This module provides utilities to get the absolute filenames so that we can be sure that:
- The case of a file will match the actual file in the filesystem (otherwise breakpoints won't be hit).
- Providing means for the user to make path conversions when doing a remote debugging session in
one machine and debugging in another.
To do that, the PATHS_FROM_ECLIPSE_TO_PYTHON constant must be filled with the appropriate paths.
@note:
in this context, the server is where your python process is running
def bar():
a = 1
b1 = 1 if a > 1 else 2 if a > 0 else 3 if a > 4 else 23 if a > 1 else 2 if a > 0 else 3 if a > 4 else 23 if a > 1 else 2 if a > 0 else 3 if a > 4 else 23 if a > 1 else 2 if a > 0 else 3 if a > 4 else 23 if a > 1 else 2 if a > 0 else 3 if a > 4 else 23 if a > 1 else 2 if a > 0 else 3 if a > 4 else 23 if a > 1 else 2 if a > 0 else 3 if a > 4 else 23 if a > 1 else 2 if a > 0 else 3 if a > 4 else 23 if a > 1 else 2 if a > 0 else 3 if a > 4 else 23 if a > 1 else 2 if a > 0 else 3 if a > 4 else 23
b2 = 1 if a > 1 else 2 if a > 0 else 3 if a > 4 else 23 if a > 1 else 2 if a > 0 else 3 if a > 4 else 23 if a > 1 else 2 if a > 0 else 3 if a > 4 else 23 if a > 1 else 2 if a > 0 else 3 if a > 4 else 23 if a > 1 else 2 if a > 0 else 3 if a > 4 else 23 if a > 1 else 2 if a > 0 else 3 if a > 4 else 23 if a > 1 else 2 if a > 0 else 3 if a > 4 else 23 if a > 1 else 2 if a > 0 else 3 if a > 4 else 23 if a > 1 else 2 if a > 0 else 3 if a > 4 else 23 if a > 1 else 2 if a > 0 else 3 if a > 4 else 2
if not skip_file:
try:
threadingCurrentThread()
except:
skip_file = True
cdef extern from *:
ctypedef void freefunc(void *)
ctypedef void PyObject
ctypedef struct PyCodeObject:
int co_argcount; # arguments, except *args */
int co_kwonlyargcount; # keyword only arguments */
int co_nlocals; # local variables */
int co_stacksize; # entries needed for evaluation stack */
int co_flags; # CO_..., see below */
int co_firstlineno; # first source line number */
import dis
import inspect
def trace():
print("hello!")
def insert_code(code_to_modify, lines_to_insert, before_line):
lines = inspect.getsourcelines(code_to_modify)[0]
line_for_break = lines[before_line]
import sys
class Debugger(object):
def __init__(self):
breakpoints = {}
def call_trace(self):
frame = sys._getframe(1)
print(frame.f_code.co_filename, frame.f_lineno, frame.f_locals)
# License: EPL
import os
import sys
import traceback
try:
xrange
except:
xrange = range
"""Stack tracer for multi-threaded applications.
Usage:
import stacktracer
stacktracer.start_trace("trace.html",interval=5,auto=True) # Set auto flag to always update file!
....
stacktracer.stop_trace()
taken from the http://code.activestate.com/recipes/577334-how-to-debug-deadlocked-multi-threaded-programs/
def str_to_args_windows(args):
# see http:#msdn.microsoft.com/en-us/library/a1y7w461.aspx
result = []
DEFAULT = 0
ARG = 1
IN_DOUBLE_QUOTE = 2
state = DEFAULT
backslashes = 0
<html>
<title>Test 2</title>
<body>
Hello {{ name }}!
{% macro fun() %}
{% set res = 9 %}
{{ res }}
{% endmacro %}