changeset 586:8872c31d8f69

[add] Feature Request ID 2161471 : Added support for the Python indenter pindent. http://universalindent.sf.net/issue/2161471 git-svn-id: svn://svn.code.sf.net/p/universalindent/code/trunk@830 59b1889a-e5ac-428c-b0c7-476e01d41282
author thomas_-_s <thomas_-_s@59b1889a-e5ac-428c-b0c7-476e01d41282>
date Mon, 13 Oct 2008 15:53:14 +0000
parents c3f99e70cd57
children ef99b04070f2
files indenters/example.py indenters/uigui_pindent.ini
diffstat 2 files changed, 77 insertions(+), 0 deletions(-) [+]
line wrap: on
line diff
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/indenters/example.py	Mon Oct 13 15:53:14 2008 +0000
@@ -0,0 +1,23 @@
+#! /usr/bin/env python
+"Replace CRLF with LF in argument files.  Print names of changed files."
+
+import sys, os
+
+def main():
+    for filename in sys.argv[1:]:
+        if os.path.isdir(filename):
+            print filename, "Directory!"
+            continue
+        data = open(filename, "rb").read()
+        if '\0' in data:
+            print filename, "Binary!"
+            continue
+        newdata = data.replace("\r\n", "\n")
+        if newdata != data:
+            print filename
+            f = open(filename, "wb")
+            f.write(newdata)
+            f.close()
+
+if __name__ == '__main__':
+    main()
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/indenters/uigui_pindent.ini	Mon Oct 13 15:53:14 2008 +0000
@@ -0,0 +1,54 @@
+[header]
+categories=General options
+cfgFileParameterEnding=" "
+configFilename=
+fileTypes=*.py
+indenterFileName=pindent.py
+indenterName=PIndent (Python)
+inputFileName=indentinput
+inputFileParameter=
+manual=http://jsppp.sourceforge.net/
+outputFileName=indentinput
+outputFileParameter=none
+stringparaminquotes=false
+parameterOrder=pio
+showHelpParameter=
+stringparaminquotes=false
+useCfgFileParameter=
+version="from Python 2.5.1 package"
+
+[End directives]
+Category=0
+Description="<html>Complete takes a valid Python program as input and outputs a version augmented with block-closing comments (add #end directives).<br />Or Delete assumes its input is a Python program with block-closing comments and outputs a commentless version(delete #end directives).<br />Or Reformat assumes its input is a Python program with block-closing comments but with its indentation messed up, and outputs a properly indented version (use #end directives).</html>"
+Enabled=true
+EditorType=multiple
+Choices="-c|-d|-r"
+ChoicesReadable="Complete|Delete|Reformat"
+ValueDefault=0
+
+[Step size]
+Category=0
+Description="<html>Sets the indentation step size.</html>"
+Enabled=true
+EditorType=numeric
+CallName="-s "
+MinVal=0
+MaxVal=999
+ValueDefault=8
+
+[Tab size]
+Category=0
+Description="<html>Sets the number of spaces a tab character is worth.</html>"
+Enabled=true
+EditorType=numeric
+CallName="-t "
+MinVal=0
+MaxVal=999
+ValueDefault=8
+
+[Convert Tabs]
+Category=0
+Description="<html>Expand TABs into spaces.</html>"
+EditorType=boolean
+TrueFalse=-e|
+ValueDefault=0