Editing Clipboard Transformations

Jump to navigation Jump to search

Warning: You are not logged in. Your IP address will be publicly visible if you make any edits. If you log in or create an account, your edits will be attributed to your username, along with other benefits.

The edit can be undone. Please check the comparison below to verify that this is what you want to do, and then save the changes below to finish undoing the edit.

Latest revision Your text
Line 25: Line 25:
 
Most transformations ( and perhaps all in the future ) do some general processing:
 
Most transformations ( and perhaps all in the future ) do some general processing:
  
* Break the text into multiple lines using a variety of markers ( see Python splitlines ), -- this is really a search and replace where we replace with \n
+
* Break the text into multiple lines using a variety of markers ( see Python splitlines ),  
 
* Delete trailing spaces on each line  
 
* Delete trailing spaces on each line  
* Joins lines back using a standard line marker ( cmd_processor.line_join ) by default the newline character \n   -- is this search and replace \n to nothing ( or to space )
+
* Joins lines back using a standard line marker ( cmd_processor.line_join ) by default the newline character \n
 
* White space is used in the same sense as Python.  In includes spaces, tabs \n \r and other characters.
 
* White space is used in the same sense as Python.  In includes spaces, tabs \n \r and other characters.
 
== Transformation Types ==
 
 
Ways of organizing transformations that may be used in some GUI versions, this is a new feature in progress
 
 
=== Search and Replace ===
 
* Search and replace ( some fixed one adjustable )
 
* do we want a join lines adjustable ??
 
* Advanced search and replace, almost search and replace but....
 
=== Line Operations ===
 
* Line operations, do something to lines, some work on pairs of lines
 
Add *>url
 
Add *>shell
 
 
=== Pair Line Operations ===
 
 
 
=== Table of Transfromations ===
 
 
{| class="wikitable"
 
|-valign="top"
 
|What
 
|Does What
 
|Search/Replace
 
|Line Op
 
|Pair Line Op
 
|Command Op
 
|Wiki
 
<!-------------------------------->
 
|-valign="top"
 
|Add *>url
 
|Adds text "*>url" to each line.
 
|X
 
|
 
|
 
|X
 
|
 
<!-------------------------------->
 
|-valign="top"
 
|Add *>shell
 
|Adds text "*>shell" to each line.
 
|X
 
|
 
|
 
|X
 
|
 
<!-------------------------------->
 
|-valign="top"
 
|Alt Line Sort 0
 
|Sorts line pairs using 0 line as key
 
|
 
|
 
|X
 
|
 
|
 
<!-------------------------------->
 
|-valign="top"
 
|CAP
 
|upper case all
 
|X*
 
|
 
|
 
|
 
|
 
<!-------------------------------->
 
|-valign="top"
 
|lower
 
|lower case all
 
|X*
 
|
 
|
 
|
 
|
 
<!-------------------------------->
 
|-valign="top"
 
|Less WS
 
|All white space to single space
 
|X*
 
|
 
|
 
|
 
|
 
<!-------------------------------->
 
|-valign="top"
 
|Line Num
 
|Number the lines
 
|
 
|
 
|X
 
|
 
|
 
<!-------------------------------->
 
|-valign="top"
 
|No Blank Lines
 
|
 
|X
 
|
 
|
 
|
 
|
 
<!-------------------------------->
 
|-valign="top"
 
|No Trail Space
 
|
 
|X
 
|
 
|
 
|
 
|
 
<!-------------------------------->
 
|-valign="top"
 
|No WS
 
|X*
 
|
 
|
 
|
 
|
 
|
 
<!-------------------------------->
 
|-valign="top"
 
|Add *new
 
|
 
|
 
|
 
|
 
|
 
|
 
<!-------------------------------->
 
|-valign="top"
 
|Add *new
 
|
 
|
 
|
 
|
 
|
 
|
 
<!-------------------------------->
 
|-valign="top"
 
|Add *new
 
|
 
|
 
|
 
|
 
|
 
|
 
<!-------------------------------->
 
<!--------------------------------
 
<!--------------------------------
 
<!-------------------------------->
 
|}
 
 
=== Application View ===
 
* Text Edit
 
* Wiki work
 
* Command building
 
 
 
 
 
 
  
 
= Individual Transformations =
 
= Individual Transformations =
  
 
+
The GUI names should match those below, but use a bit of caution.
 
 
The GUI names should match those below, but use a bit of caution.  The order here is more or less alpha, not the order in the GUI.
 
  
 
== Add *>url ==
 
== Add *>url ==
* What: Prefixes all lines with a url with "*>url"
+
* What: Prefixs all lines with a url with "*>url"
 
* Why: to save url's in command format for later use with '''<*cmd>''' button
 
* Why: to save url's in command format for later use with '''<*cmd>''' button
 
* Lines with a url have *>url pre-pended to the line.  This is the command indicator for the *cmd button to go to a given url.
 
* Lines with a url have *>url pre-pended to the line.  This is the command indicator for the *cmd button to go to a given url.
Line 203: Line 41:
  
 
== Add *>shell ==
 
== Add *>shell ==
* What: Prefixes all lines with *>shell ( or just lines with file names, need to check )
+
* What:
* Why: Make it easy to store ( single line ) shell commands in files.
+
* Why:  
  
 
== Alt Line Sort 0 ==
 
== Alt Line Sort 0 ==
Line 218: Line 56:
 
* Why:  Mostly to show off, this is actually not very useful for me.
 
* Why:  Mostly to show off, this is actually not very useful for me.
  
== xxx ==
+
== Line Num ==
 
* What:
 
* What:
* Why:
+
* Why:  
 +
 
 +
== No Blank Lines ==
 +
 
 +
 
 +
== No Trail Space ==
 +
 
 +
* What: Remove all trailing white space.
 +
* Why: Trailing white space is just a waste of space and may slow down code editing.
 +
 
  
 
== lower ==
 
== lower ==
Line 241: Line 88:
 
* What: Put sequential numbers in front of each non-blank lines
 
* What: Put sequential numbers in front of each non-blank lines
 
* Why: Sometimes nice to have you lines numbered.
 
* Why: Sometimes nice to have you lines numbered.
== No Blank Lines ==
 
What:  Delete all blank lines.
 
Why:  Often blank lines are filler you just want to get rid of.
 
 
== No Trail Space ==
 
 
* What: Remove all trailing white space.
 
* Why: Trailing white space is just a waste of space and may slow down code editing.
 
  
 
== No WS ==
 
== No WS ==
  
 
* What: Remove all white space.
 
* What: Remove all white space.
* Why: White space, for example can be a pain in the neck.  May have a transform that converts to underscores for a similar reason.
+
* Why:
  
 
== Tab > Space ==
 
== Tab > Space ==
  
* What: Remove all tab characters changing them to spaces.
+
* What: Rempve all tab characters changing them to spaces.
 
* Why: Python programmers tend to prefer spaces over tabs.  A mix of them can be confusing when editiong, and can cause Python programs that look correct to fail.
 
* Why: Python programmers tend to prefer spaces over tabs.  A mix of them can be confusing when editiong, and can cause Python programs that look correct to fail.
  
  
== still to do scratch  ==
 
 
off unformatted  Less WS indent *lines  comma, sep  delete dup  undent  alt line sort / sage delte /  url to wiki / wiki file upload
 
 
== xxx ==
 
* What: 
 
* Why: 
 
* Lines 
 
* Lines
 
  
 
= Customization =
 
= Customization =
Line 287: Line 117:
 
The return is a tuple
 
The return is a tuple
  
* First a Boolean, it indicates the success of the operation.  This seems to be almost always True, as transformations "cannot fail".  I had some other ideas for this at one time.
+
* First a Boolean, it indicates the success of the operation
* Second a string a comment on the operation.  Will be displayed in the message area of the GUI.
+
* Second a string a comment on the operation
* Third a string, the transformed text.  Will place in the clipboard and displayed int the GUI below the comment.
+
* Third a string, the transformed text.
  
 
To learn more about the transforms read the code, then write yours following the conventions in this one.
 
To learn more about the transforms read the code, then write yours following the conventions in this one.

Please note that all contributions to OpenCircuits may be edited, altered, or removed by other contributors. If you do not want your writing to be edited mercilessly, then do not submit it here.
You are also promising us that you wrote this yourself, or copied it from a public domain or similar free resource (see OpenCircuits:Copyrights for details). Do not submit copyrighted work without permission!

Cancel Editing help (opens in new window)