Merge remote-tracking branch 'cappuccino/master'

This commit is contained in:
Didier Korthoudt committed 2018-09-16 10:55:10 +02:00
commit 97209846ad
2 files changed
+13 -5

No files matched your search

@@ -5,6 +5,9 @@
# $1 Cappuccino documentation directory
Encoding.default_external = 'UTF-8'
ACCESSOR_GET_TEMPLATE = <<EOS
/*!
Synthesized accessor method.
@@ -39,7 +42,7 @@ DUMMY_IVAR = " id __doxygen__;"
def makeHeaderFileFrom(fileName)
# Grab the entire file (text)
sourceFile = File.new(fileName, "r")
sourceFile = File.new(fileName, "r", :encoding => 'UTF-8')
source = sourceFile.read
sourceFile.close()
@@ -51,7 +54,7 @@ def makeHeaderFileFrom(fileName)
source.gsub!(/^\s*(@implementation \s*\w+(?:\s*:\s*\w+)?)\n(\s*[^{])/, "\\1\n{\n#{DUMMY_IVAR}\n}\n\\2")
source.gsub!(/^\s*(@implementation \s*\w+(?:\s*:\s*\w+)?)\n\s*\{\s*\}/, "\\1\n{\n#{DUMMY_IVAR}\n}")
sourceFile = File.new(fileName, "w")
sourceFile = File.new(fileName, "w", :encoding => 'UTF-8')
# Remove @accessor declarations from ivars before writing the source file
sourceFile.write(source.gsub(/(\s*\w+\s+\w+)\s+@accessors(\(.+?\))?;/m, "\\1;"))
+8 -3
View File
@@ -28,10 +28,15 @@ transforms = [
html = glob.glob(os.path.join(sys.argv[1], "*.html"))
for count, filename in enumerate(html):
f = open(filename, "r+")
text = f.read()
try:
# For some reason we get some UTF errors in the output HTML. Ignoring them should be fine.
f = open(filename, "r+", encoding='UTF-8', errors='ignore')
text = f.read()
except:
print("Failed to read %s." % filename)
raise
i = 0
while i < len(transforms):
text = transforms[i].sub(transforms[i + 1], text)
i += 2