Permalink
Browse files

XPUBLIC updater script

  • Loading branch information...
1 parent 7ab9489 commit 031ca70f2ea0134a65fe4e2e2e9d7d1c88d3ef75 @holtwick committed Feb 23, 2012
Showing with 38 additions and 0 deletions.
  1. +38 −0 xpublicmove.py
View
@@ -0,0 +1,38 @@
+"""
+Transforms:
+
+XPUBLIC
+- (void)bla {
+
+Into:
+
+- (XPUBLIC void)bla {
+
+For Xcode 4.3 compatibility
+"""
+
+import glob
+import re
+
+rx = re.compile("\-\s*\(")
+files = (
+ # Add you implementation files here
+ # glob.glob("/Users/SOMEUSER/work/SOMETPATH/*.m")
+ )
+
+for name in files:
+ print name
+ next = 0
+ lines = []
+ for line in open(name, "r").readlines():
+ if line.startswith("XPUBLIC"):
+ next = 1
+ continue
+ # print line
+ if next and line.startswith("-"):
+ line = rx.sub("- (XPUBLIC ", line)
+ print " ", line,
+ lines += line.rstrip() + '\n'
+ next = 0;
+
+ open(name, "w").writelines(lines)

0 comments on commit 031ca70

Please sign in to comment.