desc stringlengths 3 26.7k | decl stringlengths 11 7.89k | bodies stringlengths 8 553k |
|---|---|---|
'Drag the word before point past the word after point, moving
point past that word as well. If the insertion point is at the end
of the line, this transposes the last two words on the line.'
| def transpose_words(self, e):
| self.l_buffer.transpose_words()
|
'Uppercase the current (or following) word. With a negative
argument, uppercase the previous word, but do not move the cursor.'
| def upcase_word(self, e):
| self.l_buffer.upcase_word()
|
'Lowercase the current (or following) word. With a negative
argument, lowercase the previous word, but do not move the cursor.'
| def downcase_word(self, e):
| self.l_buffer.downcase_word()
|
'Capitalize the current (or following) word. With a negative
argument, capitalize the previous word, but do not move the cursor.'
| def capitalize_word(self, e):
| self.l_buffer.capitalize_word()
|
'Toggle overwrite mode. With an explicit positive numeric
argument, switches to overwrite mode. With an explicit non-positive
numeric argument, switches to insert mode. This command affects only
emacs mode; vi mode does overwrite differently. Each call to
readline() starts in insert mode. In overwrite mode, characters
... | def overwrite_mode(self, e):
| pass
|
'Kill the text from point to the end of the line.'
| def kill_line(self, e):
| self.l_buffer.kill_line()
|
'Kill backward to the beginning of the line.'
| def backward_kill_line(self, e):
| self.l_buffer.backward_kill_line()
|
'Kill backward from the cursor to the beginning of the current line.'
| def unix_line_discard(self, e):
| self.l_buffer.unix_line_discard()
|
'Kill all characters on the current line, no matter where point
is. By default, this is unbound.'
| def kill_whole_line(self, e):
| self.l_buffer.kill_whole_line()
|
'Kill from point to the end of the current word, or if between
words, to the end of the next word. Word boundaries are the same as
forward-word.'
| def kill_word(self, e):
| self.l_buffer.kill_word()
|
'Kill the word behind point. Word boundaries are the same as
backward-word.'
| def backward_kill_word(self, e):
| self.l_buffer.backward_kill_word()
|
'Kill the word behind point, using white space as a word
boundary. The killed text is saved on the kill-ring.'
| def unix_word_rubout(self, e):
| self.l_buffer.unix_word_rubout()
|
'Delete all spaces and tabs around point. By default, this is unbound.'
| def delete_horizontal_space(self, e):
| pass
|
'Kill the text in the current region. By default, this command is unbound.'
| def kill_region(self, e):
| pass
|
'Copy the text in the region to the kill buffer, so it can be
yanked right away. By default, this command is unbound.'
| def copy_region_as_kill(self, e):
| pass
|
'Copy the text in the region to the windows clipboard.'
| def copy_region_to_clipboard(self, e):
| if self.enable_win32_clipboard:
mark = min(self.l_buffer.mark, len(self.l_buffer.line_buffer))
cursor = min(self.l_buffer.point, len(self.l_buffer.line_buffer))
if (self.l_buffer.mark == (-1)):
return
begin = min(cursor, mark)
end = max(cursor, mark)
tocli... |
'Copy the word before point to the kill buffer. The word
boundaries are the same as backward-word. By default, this command
is unbound.'
| def copy_backward_word(self, e):
| pass
|
'Copy the word following point to the kill buffer. The word
boundaries are the same as forward-word. By default, this command is
unbound.'
| def copy_forward_word(self, e):
| pass
|
'Paste windows clipboard'
| def paste(self, e):
| if self.enable_win32_clipboard:
txt = clipboard.get_clipboard_text_and_convert(False)
self.insert_text(txt)
|
'Paste windows clipboard'
| def paste_mulitline_code(self, e):
| reg = re.compile('\r?\n')
if self.enable_win32_clipboard:
txt = clipboard.get_clipboard_text_and_convert(False)
t = reg.split(txt)
t = [row for row in t if (row.strip() != '')]
if (t != ['']):
self.insert_text(t[0])
self.add_history(self.l_buffer.copy())
... |
'Paste windows clipboard. If enable_ipython_paste_list_of_lists is
True then try to convert tabseparated data to repr of list of lists or
repr of array'
| def ipython_paste(self, e):
| if self.enable_win32_clipboard:
txt = clipboard.get_clipboard_text_and_convert(self.enable_ipython_paste_list_of_lists)
if self.enable_ipython_paste_for_paths:
if ((len(txt) < 300) and (' DCTB ' not in txt) and ('\n' not in txt)):
txt = txt.replace('\\', '/').replace(' ... |
'Yank the top of the kill ring into the buffer at point.'
| def yank(self, e):
| pass
|
'Rotate the kill-ring, and yank the new top. You can only do this
if the prior command is yank or yank-pop.'
| def yank_pop(self, e):
| pass
|
'Add this digit to the argument already accumulating, or start a
new argument. M-- starts a negative argument.'
| def digit_argument(self, e):
| pass
|
'This is another way to specify an argument. If this command is
followed by one or more digits, optionally with a leading minus
sign, those digits define the argument. If the command is followed
by digits, executing universal-argument again ends the numeric
argument, but is otherwise ignored. As a special case, if this... | def universal_argument(self, e):
| pass
|
'Deletes the character under the cursor if not at the beginning or
end of the line (like delete-char). If at the end of the line,
behaves identically to possible-completions. This command is unbound
by default.'
| def delete_char_or_list(self, e):
| pass
|
'Begin saving the characters typed into the current keyboard macro.'
| def start_kbd_macro(self, e):
| pass
|
'Stop saving the characters typed into the current keyboard macro
and save the definition.'
| def end_kbd_macro(self, e):
| pass
|
'Re-execute the last keyboard macro defined, by making the
characters in the macro appear as if typed at the keyboard.'
| def call_last_kbd_macro(self, e):
| pass
|
'Read in the contents of the inputrc file, and incorporate any
bindings or variable assignments found there.'
| def re_read_init_file(self, e):
| pass
|
'Abort the current editing command and ring the terminals bell
(subject to the setting of bell-style).'
| def abort(self, e):
| self._bell()
|
'If the metafied character x is lowercase, run the command that is
bound to the corresponding uppercase character.'
| def do_uppercase_version(self, e):
| pass
|
'Metafy the next character typed. This is for keyboards without a
meta key. Typing ESC f is equivalent to typing M-f.'
| def prefix_meta(self, e):
| self.next_meta = True
|
'Incremental undo, separately remembered for each line.'
| def undo(self, e):
| self.l_buffer.pop_undo()
|
'Undo all changes made to this line. This is like executing the
undo command enough times to get back to the beginning.'
| def revert_line(self, e):
| pass
|
'Perform tilde expansion on the current word.'
| def tilde_expand(self, e):
| pass
|
'Set the mark to the point. If a numeric argument is supplied, the
mark is set to that position.'
| def set_mark(self, e):
| self.l_buffer.set_mark()
|
'Swap the point with the mark. The current cursor position is set
to the saved position, and the old cursor position is saved as the
mark.'
| def exchange_point_and_mark(self, e):
| pass
|
'A character is read and point is moved to the next occurrence of
that character. A negative count searches for previous occurrences.'
| def character_search(self, e):
| pass
|
'A character is read and point is moved to the previous occurrence
of that character. A negative count searches for subsequent
occurrences.'
| def character_search_backward(self, e):
| pass
|
'Without a numeric argument, the value of the comment-begin
variable is inserted at the beginning of the current line. If a
numeric argument is supplied, this command acts as a toggle: if the
characters at the beginning of the line do not match the value of
comment-begin, the value is inserted, otherwise the characters... | def insert_comment(self, e):
| pass
|
'Print all of the functions and their key bindings to the Readline
output stream. If a numeric argument is supplied, the output is
formatted in such a way that it can be made part of an inputrc
file. This command is unbound by default.'
| def dump_functions(self, e):
| pass
|
'Print all of the settable variables and their values to the
Readline output stream. If a numeric argument is supplied, the
output is formatted in such a way that it can be made part of an
inputrc file. This command is unbound by default.'
| def dump_variables(self, e):
| pass
|
'Print all of the Readline key sequences bound to macros and the
strings they output. If a numeric argument is supplied, the output
is formatted in such a way that it can be made part of an inputrc
file. This command is unbound by default.'
| def dump_macros(self, e):
| pass
|
'When in vi command mode, this causes a switch to emacs editing
mode.'
| def init_editing_mode(self, e):
| self._bind_exit_key('Control-d')
self._bind_exit_key('Control-z')
self._bind_key('Shift-space', self.self_insert)
self._bind_key('Control-space', self.self_insert)
self._bind_key('Return', self.accept_line)
self._bind_key('Left', self.backward_char)
self._bind_key('Control-b', self.backward_... |
'Try to act like GNU readline.'
| def readline(self, prompt=''):
| if self.first_prompt:
self.first_prompt = False
if self.startup_hook:
try:
self.startup_hook()
except:
print 'startup hook failed'
traceback.print_exc()
c = self.console
self.l_buffer.reset_line()
self.prompt =... |
'Initialize vi editingmode'
| def init_editing_mode(self, e):
| self.show_all_if_ambiguous = 'on'
self.key_dispatch = {}
self.__vi_insert_mode = None
self._vi_command = None
self._vi_command_edit = None
self._vi_key_find_char = None
self._vi_key_find_direction = True
self._vi_yank_buffer = None
self._vi_multiplier1 = ''
self._vi_multiplier2 =... |
'find matching <([{}])>'
| def key_percent(self, char):
| self.motion = self.motion_matching
self.delete_right = 1
self.state = _VI_MOTION
self.apply()
|
'Helper function for forceful termination of the plugin executable,
primarily used for testing'
| def killPlugin(self):
| for p in self.procs:
p.kill()
self.procs = []
|
'Rewrite the inconfig, substituting variables'
| def write_interpreted_xml_file(self, inConfFile, globalvars={}):
| tmpFile = open(inConfFile, 'w')
configdata = self.getMarshalledInConfig()
configlines = configdata.split('\n')
newlines = []
for line in configlines:
newlines.append(util.variable_replace(line, globalvars))
newconfig = '\n'.join(newlines)
tmpFile.write(newconfig)
tmpFile.close()
... |
'Return the following boolean flags:
newconsole - the plugin should execute in a new console
waitmode - Execution should wait for the plugin to finish
executing'
| def get_runflags(self, mode, interactive, scripted):
| if interactive:
if (not mode):
mode = self.getConsoleMode()
else:
mode = util.CONSOLE_REUSE
if (mode == util.CONSOLE_REUSE):
newconsole = False
else:
newconsole = True
waitmode = True
if (interactive and (not scripted) and newconsole):
waitmode... |
'Mark the parent item as used'
| def mark_used(self):
| self.set_mark('USED')
|
'Mark the parent item'
| def set_mark(self, value):
| self.item.set_status(value)
|
'Get the label for this info'
| def get_label(self):
| return self.label
|
'Add a parameter with value'
| def set(self, var, val):
| self.params[var] = val
|
'Get a parameter value'
| def get(self, var):
| try:
return self.params[var]
except KeyError:
raise exception.CmdErr, ('%s does not exist' % var)
|
'Get a list of all parameter var,vals'
| def get_paramlist(self):
| return self.params.items()
|
'The short view of what\'s going on'
| def __str__(self):
| return ('%s (%s)' % (self.name, self.status))
|
'All information about the SessionItem'
| def __repr__(self):
| string = ('[%d] %s (%s)\n' % (self.id, self.name, self.status))
string += (' Description : %s\n' % self.description)
string += (' Contract : %s\n' % str(self.contract))
string += (' History : %s\n' % str(sel... |
'Get the item name'
| def get_name(self):
| return self.name
|
'Return session directories'
| def get_dirs(self):
| return self.sess.get_dirs()
|
'Get the item status'
| def get_status(self):
| reason = ''
if self.is_failed():
try:
for p in self.contract.get_paramlist():
if (p.name.lower() == 'returncode'):
reason = (' : ' + p.value.value)
break
except:
pass
return (self.status + reason)
|
'Set the status of the item'
| def set_status(self, status):
| if (status.upper() in ('RUNNING', 'FAIL', 'READY', 'USED')):
self.status = status.upper()
else:
raise exception.CmdErr, ('%s invalid status' % status)
|
'Get the name of the session'
| def get_name(self):
| return self.name
|
'Set session directories'
| def set_dirs(self, base_dir, log_dir):
| self.base_dir = os.path.normpath(base_dir)
self.log_dir = os.path.normpath(log_dir)
|
'Return session directories'
| def get_dirs(self):
| return (self.base_dir, self.log_dir)
|
'Add a new item to the session'
| def add_item(self, name, description):
| id = len(self.items)
self.items.append(SessionItem(name, id, description, self))
return self.items[(-1)]
|
'Get an item by index from the session'
| def get_item(self, index):
| try:
return self.items[index]
except IndexError:
raise exception.CmdErr, ('Bad index %d' % index)
|
'Get all of the items in the session'
| def get_itemlist(self):
| return [util.Param(item.get_name(), item) for item in self.items]
|
'Get a contract by index from the session'
| def get_contract(self, index):
| item = self.get_item(index)
if item.contract:
return item.contract
else:
raise exception.CmdErr, 'Contract not available'
|
'@brief Initialize the Fuzzbunch object
@param configfile The main Fuzzbunch configuration file (an XML file)
@param base_dir
@param log_dir Location for Fuzzbunch log files
@param stdin
@param stdout
@param stderr'
| def __init__(self, configfile, base_dir, log_dir, stdin=None, stdout=None, stderr=None):
| self.configvars = {}
self.readconfig(configfile)
enablecolor = eval(self.configvars['globals']['Color'])
FbCmd.__init__(self, stdin=stdin, stdout=stdout, stderr=stderr, enablecolor=enablecolor)
self.defaultcontext.print_info = self.print_info
self.preconfig()
self.fbglobalvars = util.iDict()... |
'Intercept user cmd line to global replacement'
| def precmd(self, line):
| newline = util.variable_replace(line, self.fbglobalvars)
return FbCmd.precmd(self, newline)
|
'Retrieve the current log directory'
| def get_logdir(self):
| (base_dir, log_dir) = self.session.get_dirs()
return log_dir
|
'Retrieve the current base directory'
| def get_basedir(self):
| (base_dir, log_dir) = self.session.get_dirs()
return base_dir
|
'Set the current log directory and create a new log file'
| def set_logdir(self, log_dir=None):
| if (not log_dir):
log_dir = os.path.normpath(self.default_logdir)
base_dir = self.get_basedir()
self.session.set_dirs(base_dir, log_dir)
logname = ('fuzzbunch-%s.log' % util.formattime())
self.io.setlogfile(os.path.join(log_dir, logname))
|
'Return stats in the form of tuple(count, type)'
| def getstats(self):
| return [(len(list(m.get_plugins())), m.get_type()) for m in self.get_manager_list()]
|
'Set the Fuzzbunch banner (seen when starting fuzzbunch)'
| def setbanner(self):
| (self.banner, font) = figlet.newbanner(self.fontdir, self.bannerstr)
|
'Print the currently configured banner'
| def printbanner(self):
| banner = {'banner': self.banner, 'version': self.version, 'stats': self.getstats()}
self.io.print_banner(banner)
|
'Print the startup banner'
| def do_banner(self, line):
| line = line.strip().split()
if line:
savedbanner = self.bannerstr
self.bannerstr = ' '.join(line)
self.setbanner()
self.printbanner()
if line:
self.bannerstr = savedbanner
|
'Parse the Fuzzbunch.xml file to setup the Fuzzbunch initial environment'
| def readconfig(self, file):
| try:
import xml.dom.minidom
xmlDoc = xml.dom.minidom.parse(file)
config = edfmeta.get_elements(xmlDoc, 'config')[0]
redir = edfmeta.get_elements(config, 'redirection')[0]
runmode = edfmeta.get_elements(config, 'runmode')[0]
banner = edfmeta.get_elements(config, 'banne... |
'Register a manager with Fuzzbunch. Initially these are PluginManager objects'
| def register_manager(self, type, typeConstructor):
| if (type in self.pluginmanagers):
raise exception.CmdErr, ("'%s' already registered" % type)
self.pluginmanagers[type] = typeConstructor(type, self)
return self.pluginmanagers[type]
|
'Quit fuzzbunch'
| def do_quit(self, arg):
| try:
opencontracts = [item.name for item in self.session.get_itemlist() if item.value.has_opencontract()]
if opencontracts:
self.io.print_opensessions({'sessions': opencontracts})
line = self.io.get_input('Really quit [n] ? ')
if (line.lower() not in (... |
'Print information about the current context'
| def do_info(self, *ignore):
| self.getcontext().print_info()
|
'Leave the current context back to the default'
| def do_back(self, *ignore):
| self.setcontext(None)
self.setprompt()
|
'Alias for back'
| def do_exit(self, arg):
| return self.do_back(arg)
|
'Command completion routine for autorun'
| def complete_autorun(self, text, line, arglist, state, begidx, endidx):
| if (state == 1):
return [item for item in ('on', 'off') if item.lower().startswith(text.lower())]
return ['']
|
'Set autorun mode'
| def do_autorun(self, input):
| (argc, argv) = util.parseinput(input, 1)
if (argc == 0):
self.io.print_autoruncmds(self.autorun, self.autorunvars)
elif (argv[0].lower() in ('on', 'enabled', 'yes')):
self.autorun = True
self.io.print_msg('Autorun is ON')
elif (argv[0].lower() in ('off', 'disabled', 'no')):... |
'Command completion routine for enter.'
| def complete_enter(self, text, line, arglist, state, begidx, endidx):
| if (state == 1):
return [item for item in self.get_manager_types() if item.upper().startswith(text.upper())]
return ['']
|
'Enter the context of a plugin'
| def do_enter(self, input):
| (argc, argv) = util.parseinput(input, 1)
if (argc == 0):
self.io.print_module_types({'modules': self.get_active_plugin_names()})
else:
manager = self.get_manager(argv[0])
if (manager is None):
raise exception.CmdErr, ('No plugin type for %s' % argv[0])
... |
'Command completion routine for use.'
| def complete_use(self, text, line, arglist, state, begidx, endidx):
| typeList = self.get_manager_types()
if (state == 1):
pluginlist = []
for manager in self.get_manager_list():
pluginlist += manager.get_plugin_names()
return [item for item in sorted(pluginlist) if item.upper().startswith(text.upper())]
else:
return []
|
'Activate a plugin for use and enter context'
| def do_use(self, input):
| (argc, argv) = util.parseinput(input, 2)
if (argc == 0):
for manager in self.get_manager_list():
plugins = [(plugin.getName(), plugin.getVersion()) for plugin in manager.get_plugins()]
args = {'module': manager.get_name(), 'plugins': plugins}
self.io.print_module_list... |
'Command completion routine for show.'
| def complete_show(self, text, line, arglist, state, begidx, endidx):
| typeList = self.get_manager_types()
if (state == 1):
return [item for item in sorted(typeList) if item.upper().startswith(text.upper())]
elif (state == 2):
if (arglist[1] not in typeList):
return ['']
else:
pluginList = self.get_manager(arglist[1]).get_plugin_... |
'Show plugin info'
| def do_show(self, input):
| (argc, argv) = util.parseinput(input, 2)
if (argc == 0):
self.io.print_module_types({'modules': self.get_active_plugin_names()})
elif (argc == 1):
plugins = [(plugin.getName(), plugin.getVersion()) for plugin in self.get_manager(argv[0]).get_plugins()]
args = {'module': argv[0], 'plu... |
'Command completion for session command.'
| def complete_session(self, text, line, arglist, state, begidx, endidx):
| itemList = [str(i) for (i, item) in enumerate(sorted(self.session.get_itemlist()))]
if (state == 1):
return [i for i in itemList if i.startswith(text)]
return ['']
|
'Show session items'
| def do_session(self, input):
| (argc, argv) = util.parseinput(input, 1)
if (argc == 0):
items = [(item.value.get_longname(), item.value.get_status()) for item in self.session.get_itemlist()]
self.io.print_session_items({'items': items})
else:
try:
index = int(argv[0])
except ValueError:
... |
'Command completion for mark command.'
| def complete_mark(self, text, line, arglist, state, begidx, endidx):
| itemList = [str(i) for (i, item) in enumerate(sorted(self.session.get_itemlist()))]
if (state == 1):
return [i for i in itemList if i.startswith(text)]
elif (state == 2):
if (arglist[1] not in itemList):
return ['']
else:
markingList = ['READY', 'RUNNING', 'FA... |
'Mark a session item'
| def do_mark(self, input):
| (argc, argv) = util.parseinput(input, 2)
if (argc == 0):
return self.do_session(input)
elif (argc == 1):
return self.help_mark()
elif (argc == 2):
try:
index = int(argv[0])
value = argv[1]
except (IndexError, ValueError):
raise exceptio... |
'Command completion routine for redirect'
| def complete_redirect(self, text, line, arglist, state, begidx, endidx):
| if (state == 1):
return [item for item in ('on', 'off') if item.lower().startswith(text.lower())]
return ['']
|
'Configure redirection'
| def do_redirect(self, input):
| (argc, argv) = util.parseinput(input, 2)
self.io.newline()
if (argc == 0):
if self.redirection.is_active():
self.io.print_success('Redirection ON')
else:
self.io.print_warning('Redirection OFF')
elif (argc == 1):
if (argv[0].lower() in ('off', 'no'))... |
'Set a global variable'
| @util.charconvert
def do_setg(self, input):
| readonly_globals = ['logdir', 'tmpdir']
(argc, argv) = util.parseinput(input, 2)
if (argc in (0, 1)):
args = {'title': 'Global Variables', 'vars': self.fbglobalvars.items()}
self.io.print_set_names(args)
elif (argc > 1):
inputList = input.strip().split()
value = ' '... |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.