|
1
|
Reformat the clipboard text.
Sometimes you need to reformat a piece of text, which is newlined on every n-th column like e-mail or usenet post texts, so that each paragraph has one single newline characters. Use this code on win32. Make a shortcut icon on your desktop and assign a hotkey(from the properties window). Just select any area of text which you want to reformat and then press the hotkey. You can now paste the reformatted text anywhere you want to. This module is reusable where you want to replace some piece of text on the fly. For example, you can use this module along with Reindenter in Tools/Scripts/reindent.py to reformat a piece of python code with clipboard ; you might need to fake file objects with StringIO in this case, since the class accepts file objs and writes on file objs, too.
Tags: text
|
Add a comment
Sign in to comment

Download
Copy to clipboard
