.. link: .. description: .. tags: .. date: 2013/08/18 00:00:00 .. title: NINJA-IDE .. slug: find_in_files .. class:: alert alert-info pull-top .. contents:: *Module:* `find_in_files.py `_ API ======================================================================================== No description. *Imports:* ------------ - `os `_ - `re `_ - `ninja_ide.gui.ide.IDE `_ - `PyQt4.QtGui.QAbstractItemView `_ - `PyQt4.QtGui.QCheckBox `_ - `PyQt4.QtGui.QComboBox `_ - `PyQt4.QtGui.QDialog `_ - `PyQt4.QtCore.QDir `_ - `PyQt4.QtCore.QFile `_ - `PyQt4.QtGui.QFileDialog `_ - `PyQt4.QtGui.QGridLayout `_ - `PyQt4.QtGui.QGroupBox `_ - `PyQt4.QtGui.QHBoxLayout `_ - `PyQt4.QtGui.QHeaderView `_ - `PyQt4.QtGui.QIcon `_ - `PyQt4.QtGui.QLabel `_ - `PyQt4.QtGui.QLineEdit `_ - `PyQt4.QtGui.QMessageBox `_ - `PyQt4.QtGui.QPushButton `_ - `PyQt4.QtGui.QRadioButton `_ - `PyQt4.QtCore.QRegExp `_ - `PyQt4.QtGui.QSizePolicy `_ - `PyQt4.QtGui.QSpacerItem `_ - `PyQt4.QtCore.QTextStream `_ - `PyQt4.QtCore.QThread `_ - `PyQt4.QtGui.QTreeWidget `_ - `PyQt4.QtGui.QTreeWidgetItem `_ - `PyQt4.QtGui.QVBoxLayout `_ - `PyQt4.QtGui.QWidget `_ - `PyQt4.QtCore.Qt `_ - `PyQt4.QtCore.SIGNAL `_ - `__future__.absolute_import `_ - `ninja_ide.core.file_handling.file_manager `_ - `ninja_ide.resources `_ - `__future__.unicode_literals `_ *Class:* `FindInFilesRootItem(QTreeWidgetItem) `_ --------------------------------------------------------------------------------------------------------------------------------------------------- .. code:: python class FindInFilesRootItem(QTreeWidgetItem): No description. *Attributes* ~~~~~~~~~~~~~~ - `dir_name_root [at ln:164] `_ *Function:* `__init__(parent, names, dir_name_root) [at ln:162] `_ ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ .. code:: python def __init__(parent, names, dir_name_root): No description. ---- *Class:* `FindInFilesDialog(QDialog) `_ ----------------------------------------------------------------------------------------------------------------------------------------- .. code:: python class FindInFilesDialog(QDialog): No description. *Attributes* ~~~~~~~~~~~~~~ - `_find_thread [at ln:171] `_ - `cancel_button [at ln:201] `_ - `case_checkbox [at ln:189] `_ - `check_replace [at ln:188] `_ - `dir_combo [at ln:180] `_ - `dir_name_root [at ln:350] `_ - `filters_line_edit [at ln:185] `_ - `find_button [at ln:199] `_ - `open_button [at ln:183] `_ - `pattern_line_edit [at ln:177] `_ - `phrase_radio [at ln:193] `_ - `recursive_checkbox [at ln:191] `_ - `replace_line [at ln:186] `_ - `result_widget [at ln:203] `_ - `type_checkbox [at ln:190] `_ - `user_home [at ln:179] `_ - `words_radio [at ln:196] `_ *Function:* `__init__(result_widget, parent) [at ln:169] `_ ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ .. code:: python def __init__(result_widget, parent): No description. ---- *Function:* `_change_radio_enabled(val) [at ln:272] `_ ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ .. code:: python def _change_radio_enabled(val): No description. ---- *Function:* `_find_in_files() [at ln:321] `_ ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ .. code:: python def _find_in_files(): No description. ---- *Function:* `_find_thread_finished() [at ln:294] `_ ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ .. code:: python def _find_thread_finished(): No description. ---- *Function:* `_found_match(result) [at ln:310] `_ ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ .. code:: python def _found_match(result): No description. ---- *Function:* `_kill_thread() [at ln:316] `_ ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ .. code:: python def _kill_thread(): No description. ---- *Function:* `_replace_activated() [at ln:263] `_ ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ .. code:: python def _replace_activated(): No description. ---- *Function:* `_select_dir() [at ln:298] `_ ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ .. code:: python def _select_dir(): No description. ---- *Function:* `_words_radio_pressed(value) [at ln:267] `_ ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ .. code:: python def _words_radio_pressed(value): No description. ---- *Function:* `reject() [at ln:288] `_ ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ .. code:: python def reject(): No description. ---- *Function:* `show(actual_project=None, actual=None) [at ln:277] `_ ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ .. code:: python def show(actual_project=None, actual=None): No description. ---- *Class:* `FindInFilesWidget(QWidget) `_ ----------------------------------------------------------------------------------------------------------------------------------------- .. code:: python class FindInFilesWidget(QWidget): No description. *Attributes* ~~~~~~~~~~~~~~ - `_clear_button [at ln:364] `_ - `_error_label [at ln:367] `_ - `_explorer_container [at ln:360] `_ - `_find_widget [at ln:366] `_ - `_main_container [at ln:359] `_ - `_open_find_button [at ln:362] `_ - `_replace_button [at ln:365] `_ - `_result_widget [at ln:361] `_ - `_stop_button [at ln:363] `_ - `lbl_replace [at ln:373] `_ - `replace_edit [at ln:375] `_ - `replace_widget [at ln:370] `_ *Function:* `__init__(parent) [at ln:357] `_ ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ .. code:: python def __init__(parent): No description. ---- *Function:* `_clear_results() [at ln:438] `_ ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ .. code:: python def _clear_results(): No description. ---- *Function:* `_find_finished() [at ln:416] `_ ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ .. code:: python def _find_finished(): No description. ---- *Function:* `_find_started() [at ln:434] `_ ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ .. code:: python def _find_started(): No description. ---- *Function:* `_find_stop() [at ln:431] `_ ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ .. code:: python def _find_stop(): No description. ---- *Function:* `_go_to(item, val) [at ln:441] `_ ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ .. code:: python def _go_to(item, val): No description. ---- *Function:* `_replace_results() [at ln:474] `_ ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ .. code:: python def _replace_results(): No description. ---- *Function:* `find_occurrences(word) [at ln:461] `_ ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ .. code:: python def find_occurrences(word): No description. ---- *Function:* `open() [at ln:452] `_ ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ .. code:: python def open(): No description. ---- *Class:* `FindInFilesResult(QTreeWidget) `_ --------------------------------------------------------------------------------------------------------------------------------------------- .. code:: python class FindInFilesResult(QTreeWidget): No description. *Function:* `__init__() [at ln:142] `_ ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ .. code:: python def __init__(): No description. ---- *Function:* `update_result(dir_name_root, file_name, items) [at ln:151] `_ ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ .. code:: python def update_result(dir_name_root, file_name, items): No description. ---- *Class:* `FindInFilesThread(QThread) `_ ---------------------------------------------------------------------------------------------------------------------------------------- .. code:: python class FindInFilesThread(QThread): | Emit the signal | found\_pattern(PyQt\_PyObject) *Attributes* ~~~~~~~~~~~~~~ - `_cancel [at ln:137] `_ - `by_phrase [at ln:72] `_ - `filters [at ln:73] `_ - `queue [at ln:74] `_ - `recursive [at ln:70] `_ - `root_dir [at ln:76] `_ - `search_pattern [at ln:71] `_ *Function:* `_grep_file(file_path, file_name) [at ln:103] `_ ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ .. code:: python def _grep_file(file_path, file_name): No description. ---- *Function:* `cancel() [at ln:136] `_ ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ .. code:: python def cancel(): No description. ---- *Function:* `find_in_files(dir_name, filters, reg_exp, recursive, by_phrase) [at ln:68] `_ ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ .. code:: python def find_in_files(dir_name, filters, reg_exp, recursive, by_phrase): No description. ---- *Function:* `run() [at ln:80] `_ ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ .. code:: python def run(): No description.