Author: steve.ebersole(a)jboss.com
Date: 2007-07-03 13:06:22 -0400 (Tue, 03 Jul 2007)
New Revision: 12684
Added:
core/tags/JBOSS_EAP_3_2_4_SP1_CP01/indent.py
Removed:
tags/JBOSS_EAP_3_2_4_SP1_CP01/Hibernate3/indent.py
Log:
migrating core/tags/JBOSS_EAP_3_2_4_SP1_CP01 tag to new layout
Copied: core/tags/JBOSS_EAP_3_2_4_SP1_CP01/indent.py (from rev 12683,
tags/JBOSS_EAP_3_2_4_SP1_CP01/Hibernate3/indent.py)
===================================================================
--- core/tags/JBOSS_EAP_3_2_4_SP1_CP01/indent.py (rev 0)
+++ core/tags/JBOSS_EAP_3_2_4_SP1_CP01/indent.py 2007-07-03 17:06:22 UTC (rev 12684)
@@ -0,0 +1,45 @@
+import re
+import sys
+sys.argv.pop(0)
+for fname in sys.argv:
+ file = open(fname)
+ inlines = file.read().split('\n')
+ file.close()
+ out= []
+ tabcount = 0
+ extratab=0
+ for ln in inlines:
+ code = ln.lstrip('\t ').rstrip('\t ')
+ clen = len(code)
+ javadoc = clen > 0 and code[0]=='*'
+ if javadoc:
+ code = ' ' + code
+ else:
+ begincb = clen > 0 and ( code[0]=='}' or code[0]==')' )
+ tabcount -= begincb
+
+ extratab = extratab or ( len(code)>0 and code[0]=='.' )
+
+ tabs = '\t' * (tabcount + extratab)
+
+ extratab = clen>0 and ( code[clen-1]==':' or code[clen-1]=='?' )
+
+ if clen>5 and code[0:6] == '} else':
+ code = '}\n' + tabs + 'else' + code[6:]
+ if clen>6 and code[0:7] == '} catch':
+ code = '}\n' + tabs + 'catch' + code[7:]
+
+ out.append( tabs + code + '\n' )
+
+ if not javadoc:
+ uncommented = code.split('//')[0].rstrip()
+ clen = len(uncommented)
+ endob = clen > 0 and ( code[clen-1]=='{' or code[clen-1]=='(' )
+ tabcount += endob
+
+ file = open( fname, 'w' )
+ for ln in out:
+ file.write(ln)
+ file.close()
+
+
Deleted: tags/JBOSS_EAP_3_2_4_SP1_CP01/Hibernate3/indent.py
===================================================================
--- tags/JBOSS_EAP_3_2_4_SP1_CP01/Hibernate3/indent.py 2007-07-03 17:05:32 UTC (rev
12683)
+++ tags/JBOSS_EAP_3_2_4_SP1_CP01/Hibernate3/indent.py 2007-07-03 17:06:22 UTC (rev
12684)
@@ -1,45 +0,0 @@
-import re
-import sys
-sys.argv.pop(0)
-for fname in sys.argv:
- file = open(fname)
- inlines = file.read().split('\n')
- file.close()
- out= []
- tabcount = 0
- extratab=0
- for ln in inlines:
- code = ln.lstrip('\t ').rstrip('\t ')
- clen = len(code)
- javadoc = clen > 0 and code[0]=='*'
- if javadoc:
- code = ' ' + code
- else:
- begincb = clen > 0 and ( code[0]=='}' or code[0]==')' )
- tabcount -= begincb
-
- extratab = extratab or ( len(code)>0 and code[0]=='.' )
-
- tabs = '\t' * (tabcount + extratab)
-
- extratab = clen>0 and ( code[clen-1]==':' or code[clen-1]=='?' )
-
- if clen>5 and code[0:6] == '} else':
- code = '}\n' + tabs + 'else' + code[6:]
- if clen>6 and code[0:7] == '} catch':
- code = '}\n' + tabs + 'catch' + code[7:]
-
- out.append( tabs + code + '\n' )
-
- if not javadoc:
- uncommented = code.split('//')[0].rstrip()
- clen = len(uncommented)
- endob = clen > 0 and ( code[clen-1]=='{' or code[clen-1]=='(' )
- tabcount += endob
-
- file = open( fname, 'w' )
- for ln in out:
- file.write(ln)
- file.close()
-
-
Show replies by date