feisty meow concerns codebase
2.140
|
Public Member Functions | |
def | __init__ (self, argv) |
def | print_instructions (self) |
def | validate_and_consume_command_line (self) |
def | read_file_data (self, filename) |
def | write_file_data (self, filename) |
def | is_alphanumeric (self, check_char) |
def | replace_within_string (self, fix_string) |
def | emit_normal_accumulator (self) |
def | emit_comment_accumulator (self) |
def | process_file_data (self) |
def | replace_all_occurrences (self) |
A simple replacement tool that honors some C/C++ syntax when replacing. This will take a particular phrase given by the user and find it in a set of documents. That phrase will be replaced when it appears completely, and is not in a C or C++ style comment (// or /* ... */). It also must be clear of any other alphanumeric pollution, and only be surrounded by white space or operation characters.
Definition at line 3 of file phrase_replacer.py.
def phrase_replacer.phrase_replacer.__init__ | ( | self, | |
argv | |||
) |
Initializes the class with a set of arguments to work with. The arguments need to be in the form described by print_instructions().
Definition at line 13 of file phrase_replacer.py.
def phrase_replacer.phrase_replacer.emit_comment_accumulator | ( | self | ) |
emits the piled up text for comments found in the code.
Definition at line 141 of file phrase_replacer.py.
References fix_project_references.fix_project_references.comment_accumulator, phrase_replacer.phrase_replacer.comment_accumulator, fix_project_references.fix_project_references.processed_buffer, and phrase_replacer.phrase_replacer.processed_buffer.
def phrase_replacer.phrase_replacer.emit_normal_accumulator | ( | self | ) |
handle emission of a chunk of normal code (without comments).
Definition at line 133 of file phrase_replacer.py.
def phrase_replacer.phrase_replacer.is_alphanumeric | ( | self, | |
check_char | |||
) |
given a character, this returns true if it's between a-z, A-Z or 0-9.
Definition at line 94 of file phrase_replacer.py.
Referenced by fix_project_references.fix_project_references.replace_within_string(), and phrase_replacer.phrase_replacer.replace_within_string().
def phrase_replacer.phrase_replacer.print_instructions | ( | self | ) |
Shows the instructions for using this class.
Definition at line 25 of file phrase_replacer.py.
References fix_project_references.fix_project_references.arguments, and phrase_replacer.phrase_replacer.arguments.
Referenced by fix_project_references.fix_project_references.replace_all_occurrences(), and phrase_replacer.phrase_replacer.replace_all_occurrences().
def phrase_replacer.phrase_replacer.process_file_data | ( | self | ) |
iterates through the stored version of the file and replaces the phrase.
Definition at line 146 of file phrase_replacer.py.
Referenced by fix_project_references.fix_project_references.replace_all_occurrences(), and phrase_replacer.phrase_replacer.replace_all_occurrences().
def phrase_replacer.phrase_replacer.read_file_data | ( | self, | |
filename | |||
) |
loads the file into our memory buffer for processing.
Definition at line 59 of file phrase_replacer.py.
References open.
Referenced by fix_project_references.fix_project_references.extract_dependencies(), fix_project_references.fix_project_references.extract_xml_tag_from_file(), fix_project_references.fix_project_references.find_all_project_references(), fix_project_references.fix_project_references.find_asset_created(), fix_project_references.fix_project_references.replace_all_occurrences(), and phrase_replacer.phrase_replacer.replace_all_occurrences().
def phrase_replacer.phrase_replacer.replace_all_occurrences | ( | self | ) |
Orchestrates the process of replacing the phrases.
Definition at line 215 of file phrase_replacer.py.
References filesystem::directory.files(), fix_project_references.fix_project_references.files, phrase_replacer.phrase_replacer.files, bundle_creator.print_instructions(), unpacker_stub.print_instructions(), application_example.print_instructions(), ini_editor.print_instructions(), splitter_app.print_instructions(), find_missing.print_instructions(), transporter.print_instructions(), marks_maker_javascript.print_instructions(), link_parser.print_instructions(), marks_checker.print_instructions(), marks_maker.print_instructions(), marks_sorter.print_instructions(), fix_project_references.fix_project_references.print_instructions(), phrase_replacer.phrase_replacer.print_instructions(), fix_project_references.fix_project_references.process_file_data(), phrase_replacer.phrase_replacer.process_file_data(), fix_project_references.fix_project_references.read_file_data(), phrase_replacer.phrase_replacer.read_file_data(), fix_project_references.fix_project_references.validate_and_consume_command_line(), phrase_replacer.phrase_replacer.validate_and_consume_command_line(), fix_project_references.fix_project_references.write_file_data(), and phrase_replacer.phrase_replacer.write_file_data().
def phrase_replacer.phrase_replacer.replace_within_string | ( | self, | |
fix_string | |||
) |
given a string to fix, this replaces all appropriate locations of the phrase.
Definition at line 106 of file phrase_replacer.py.
References textual::parser_bits.is_alphanumeric(), fix_project_references.fix_project_references.is_alphanumeric(), phrase_replacer.phrase_replacer.is_alphanumeric(), fix_project_references.fix_project_references.phrase_to_replace, phrase_replacer.phrase_replacer.phrase_to_replace, fix_project_references.fix_project_references.replacement_bit, and phrase_replacer.phrase_replacer.replacement_bit.
def phrase_replacer.phrase_replacer.validate_and_consume_command_line | ( | self | ) |
Performs command line argument handling.
Definition at line 45 of file phrase_replacer.py.
References fix_project_references.fix_project_references.arguments, and phrase_replacer.phrase_replacer.arguments.
Referenced by fix_project_references.fix_project_references.replace_all_occurrences(), and phrase_replacer.phrase_replacer.replace_all_occurrences().
def phrase_replacer.phrase_replacer.write_file_data | ( | self, | |
filename | |||
) |
takes the processed buffer and sends it back out to the filename.
Definition at line 76 of file phrase_replacer.py.
References open, fix_project_references.fix_project_references.processed_buffer, and phrase_replacer.phrase_replacer.processed_buffer.
Referenced by fix_project_references.fix_project_references.replace_all_occurrences(), and phrase_replacer.phrase_replacer.replace_all_occurrences().
phrase_replacer.phrase_replacer.arguments |
Definition at line 18 of file phrase_replacer.py.
Referenced by fix_project_references.fix_project_references.print_instructions(), phrase_replacer.phrase_replacer.print_instructions(), fix_project_references.fix_project_references.unit_test(), fix_project_references.fix_project_references.validate_and_consume_command_line(), and phrase_replacer.phrase_replacer.validate_and_consume_command_line().
phrase_replacer.phrase_replacer.comment_accumulator |
Definition at line 144 of file phrase_replacer.py.
Referenced by phrase_replacer.phrase_replacer.emit_comment_accumulator().
phrase_replacer.phrase_replacer.EATING_MULTILINE_COMMENT |
Definition at line 23 of file phrase_replacer.py.
phrase_replacer.phrase_replacer.EATING_NORMAL_TEXT |
Definition at line 21 of file phrase_replacer.py.
phrase_replacer.phrase_replacer.EATING_ONELINE_COMMENT |
Definition at line 22 of file phrase_replacer.py.
phrase_replacer.phrase_replacer.file_lines |
Definition at line 73 of file phrase_replacer.py.
Referenced by fix_project_references.fix_project_references.extract_dependencies(), fix_project_references.fix_project_references.extract_xml_tag_from_file(), fix_project_references.fix_project_references.find_all_project_references(), and fix_project_references.fix_project_references.find_asset_created().
phrase_replacer.phrase_replacer.files |
Definition at line 56 of file phrase_replacer.py.
Referenced by fix_project_references.fix_project_references.replace_all_occurrences(), and phrase_replacer.phrase_replacer.replace_all_occurrences().
phrase_replacer.phrase_replacer.normal_accumulator |
Definition at line 136 of file phrase_replacer.py.
phrase_replacer.phrase_replacer.phrase_to_replace |
Definition at line 53 of file phrase_replacer.py.
Referenced by fix_project_references.fix_project_references.replace_within_string(), and phrase_replacer.phrase_replacer.replace_within_string().
phrase_replacer.phrase_replacer.processed_buffer |
Definition at line 150 of file phrase_replacer.py.
Referenced by phrase_replacer.phrase_replacer.emit_comment_accumulator(), fix_project_references.fix_project_references.write_file_data(), and phrase_replacer.phrase_replacer.write_file_data().
phrase_replacer.phrase_replacer.replacement_bit |
Definition at line 54 of file phrase_replacer.py.
Referenced by fix_project_references.fix_project_references.replace_within_string(), and phrase_replacer.phrase_replacer.replace_within_string().
phrase_replacer.phrase_replacer.state |
Definition at line 148 of file phrase_replacer.py.