Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.
def min_sidebar(w, size, key):
from pudb.settings import save_config
weight = 1/5
CONFIG["sidebar_width"] = weight
save_config(CONFIG)
self.columns.column_types[1] = "weight", weight
self.columns._invalidate()
import urwid
import bdb
import gc
import os
import sys
from functools import partial
from types import TracebackType
from pudb.lowlevel import decode_lines
from pudb.settings import load_config, save_config
from pudb.py3compat import PY3, raw_input, execfile
CONFIG = load_config()
save_config(CONFIG)
HELP_HEADER = r"""
Key Assignments: Use Arrow Down/Up or Page Down/Up to scroll.
"""
HELP_MAIN = r"""
Keys:
Ctrl-p - edit preferences
n - step over ("next")
s - step into
c - continue
r/f - finish current function
t - run to cursor
e - show traceback [post-mortem or in exception state]
b - set/clear breakpoint
if len(weights) != len(self.rhs_col.item_types):
weights[index - 1] = weights[index + 1]
weights = weights[:-1]
while True:
for idx in range(len(weights)):
weights[idx] = min(max_weight, max(min_weight, weights[idx]))
adjust = 1.0 * (len(weights) - sum(weights)) / len(weights)
weights = [weight + adjust for weight in weights]
if adjust == 0.0:
break
for idx, name in enumerate(['variables', 'stack', 'breakpoints']):
CONFIG[name + '_weight'] = weights[idx]
self.rhs_col.item_types[idx] = "weight", weights[idx]
save_config(CONFIG)
self.rhs_col._invalidate()
"\nChanges in version 2011.2:\n\n"
"- Fix for post-mortem debugging (contributed by 'Sundance')\n"
"\nChanges in version 2011.1:\n\n"
"- Breakpoints saved between sessions\n"
"- A new 'dark vim' theme\n"
"(both contributed by Naveen Michaud-Agrawal)\n"
"\nChanges in version 0.93:\n\n"
"- Stored preferences (no more pesky IPython prompt!)\n"
"- Themes\n"
"- Line numbers (optional)\n"
% VERSION)
from pudb.settings import save_config
save_config(CONFIG)
self.run_edit_config()
try:
if toplevel is None:
toplevel = self.top
self.size = self.screen.get_cols_rows()
self.quit_event_loop = False
while not self.quit_event_loop:
canvas = toplevel.render(self.size, focus=True)
self.screen.draw_screen(self.size, canvas)
keys = self.screen.get_input()
for k in keys:
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
THE SOFTWARE.
"""
NUM_VERSION = (2019, 2)
VERSION = ".".join(str(nv) for nv in NUM_VERSION)
__version__ = VERSION
from pudb.py3compat import raw_input, PY3
from pudb.settings import load_config, save_config
CONFIG = load_config()
save_config(CONFIG)
class PudbShortcuts(object):
@property
def db(self):
import sys
dbg = _get_debugger()
import threading
if isinstance(threading.current_thread(), threading._MainThread):
set_interrupt_handler()
dbg.set_trace(sys._getframe().f_back)
@property
def go(self):
import sys
def run_edit_config(self):
from pudb.settings import edit_config, save_config
edit_config(self, CONFIG)
save_config(CONFIG)
def grow_sidebar(w, size, key):
from pudb.settings import save_config
_, weight = self.columns.column_types[1]
if weight < 5:
weight *= 1.25
CONFIG["sidebar_width"] = weight
save_config(CONFIG)
self.columns.column_types[1] = "weight", weight
self.columns._invalidate()
def max_sidebar(w, size, key):
from pudb.settings import save_config
weight = 5
CONFIG["sidebar_width"] = weight
save_config(CONFIG)
self.columns.column_types[1] = "weight", weight
self.columns._invalidate()
"- New theme 'midnight' (submitted by Aaron Meurer)\n"
"- Support for IPython 0.11 (submitted by Chris Farrow)\n"
"- Suport for custom stringifiers (submitted by Aaron Meurer)\n"
"\nNew features in version 2011.2:\n\n"
"- Fix for post-mortem debugging (submitted by 'Sundance')\n"
"\nNew features in version 2011.1:\n\n"
"- Breakpoints saved between sessions\n"
"- A new 'dark vim' theme\n"
"(both contributed by Naveen Michaud-Agrawal)\n"
"\nNew features in version 0.93:\n\n"
"- Stored preferences (no more pesky IPython prompt!)\n"
"- Themes\n"
"- Line numbers (optional)\n"
% VERSION)
from pudb.settings import save_config
save_config(CONFIG)
self.run_edit_config()
try:
if toplevel is None:
toplevel = self.top
self.size = self.screen.get_cols_rows()
self.quit_event_loop = False
while not self.quit_event_loop:
canvas = toplevel.render(self.size, focus=True)
self.screen.draw_screen(self.size, canvas)
keys = self.screen.get_input()
keys = self.double_press_input_filter(keys, None)
def run_edit_config(self):
from pudb.settings import edit_config, save_config
edit_config(self, CONFIG)
save_config(CONFIG)