提交 de15c44f 编写于 作者: A Alexey Milovidov

Added a patch from Civil for Python 3 compatibility [#CLICKHOUSE-3]

上级 0fe2984d
...@@ -20,12 +20,12 @@ import re ...@@ -20,12 +20,12 @@ import re
import os import os
if len(sys.argv) < 2: if len(sys.argv) < 2:
print "Usage: concatenate.py language_dir" print("Usage: concatenate.py language_dir")
print "Example: concatenate.py ru" print("Example: concatenate.py ru")
sys.exit(1) sys.exit(1)
if not os.path.exists(sys.argv[1]): if not os.path.exists(sys.argv[1]):
print "Pass language_dir correctly. For example, 'ru'." print("Pass language_dir correctly. For example, 'ru'.")
sys.exit(2) sys.exit(2)
# Configuration # Configuration
...@@ -43,8 +43,8 @@ for l in cfg_file: ...@@ -43,8 +43,8 @@ for l in cfg_file:
path = (l[l.index(':') + 1:]).strip(" '\n") path = (l[l.index(':') + 1:]).strip(" '\n")
files_to_concatenate.append(path) files_to_concatenate.append(path)
print str(len(files_to_concatenate)) + " files will be concatenated into single md-file.\nFiles:" print(str(len(files_to_concatenate)) + " files will be concatenated into single md-file.\nFiles:")
print files_to_concatenate print(files_to_concatenate)
# 2. Concatenate all of the files in the list # 2. Concatenate all of the files in the list
...@@ -68,7 +68,7 @@ for path in files_to_concatenate: ...@@ -68,7 +68,7 @@ for path in files_to_concatenate:
if sharp_pos > -1: if sharp_pos > -1:
return '[' + text + '](' + link[sharp_pos:] + ')' return '[' + text + '](' + link[sharp_pos:] + ')'
else: else:
print 'ERROR: Link [' + text + '](' + link + ') in file ' + path + ' has no anchor. Please provide it.' print('ERROR: Link [' + text + '](' + link + ') in file ' + path + ' has no anchor. Please provide it.')
# return '['+text+'](#'+link.replace('/','-')+')' # return '['+text+'](#'+link.replace('/','-')+')'
for l in file: for l in file:
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册