mirror of https://gitee.com/bigwinds/arangodb
Merge branch 'devel' of github.com:triAGENS/ArangoDB into devel
This commit is contained in:
commit
439b05a361
|
@ -75,7 +75,7 @@ logfiles:
|
|||
|
||||
|
||||
<!-- arangod/Wal/LogfileManager.h -->
|
||||
@startDocuBlock WalLogfileFilesize
|
||||
@startDocuBlock WalLogfileSize
|
||||
|
||||
|
||||
<!-- arangod/Wal/LogfileManager.h -->
|
||||
|
|
|
@ -4,201 +4,201 @@ import inspect
|
|||
|
||||
|
||||
def file_content(filepath):
|
||||
""" Fetches and formats file's content to perform the required operation.
|
||||
"""
|
||||
""" Fetches and formats file's content to perform the required operation.
|
||||
"""
|
||||
|
||||
infile = open(filepath, 'r')
|
||||
filelines = tuple(infile)
|
||||
infile.close()
|
||||
infile = open(filepath, 'r')
|
||||
filelines = tuple(infile)
|
||||
infile.close()
|
||||
|
||||
comment_indexes = []
|
||||
comments = []
|
||||
comment_indexes = []
|
||||
comments = []
|
||||
|
||||
for line in enumerate(filelines):
|
||||
if "@startDocuBlock" in line[1]:
|
||||
_start = line[0]
|
||||
if "@endDocuBlock" in line[1]:
|
||||
_end = line[0] + 1
|
||||
comment_indexes.append([_start, _end])
|
||||
for line in enumerate(filelines):
|
||||
if "@startDocuBlock" in line[1]:
|
||||
_start = line[0]
|
||||
if "@endDocuBlock" in line[1]:
|
||||
_end = line[0] + 1
|
||||
comment_indexes.append([_start, _end])
|
||||
|
||||
for index in comment_indexes:
|
||||
comments.append(filelines[index[0]: index[1]])
|
||||
for index in comment_indexes:
|
||||
comments.append(filelines[index[0]: index[1]])
|
||||
|
||||
return comments
|
||||
return comments
|
||||
|
||||
|
||||
def example_content(filepath, fh, tag):
|
||||
""" Fetches an example file and inserts it using code
|
||||
"""
|
||||
""" Fetches an example file and inserts it using code
|
||||
"""
|
||||
|
||||
arangosh = False
|
||||
curl = False
|
||||
first = True
|
||||
lastline = None
|
||||
long = ""
|
||||
longLines = 0
|
||||
short = ""
|
||||
shortLines = 0
|
||||
shortable = False
|
||||
showdots = True
|
||||
arangosh = False
|
||||
curl = False
|
||||
first = True
|
||||
lastline = None
|
||||
long = ""
|
||||
longLines = 0
|
||||
short = ""
|
||||
shortLines = 0
|
||||
shortable = False
|
||||
showdots = True
|
||||
|
||||
CURL_STATE_CMD = 1
|
||||
CURL_STATE_HEADER = 2
|
||||
CURL_STATE_BODY = 3
|
||||
CURL_STATE_CMD = 1
|
||||
CURL_STATE_HEADER = 2
|
||||
CURL_STATE_BODY = 3
|
||||
|
||||
# read in the context, split into long and short
|
||||
infile = open(filepath, 'r')
|
||||
# read in the context, split into long and short
|
||||
infile = open(filepath, 'r')
|
||||
|
||||
for line in infile:
|
||||
if first:
|
||||
arangosh = line.startswith("arangosh>")
|
||||
curl = line.startswith("shell> curl")
|
||||
first = False
|
||||
for line in infile:
|
||||
if first:
|
||||
arangosh = line.startswith("arangosh>")
|
||||
curl = line.startswith("shell> curl")
|
||||
first = False
|
||||
|
||||
if arangosh:
|
||||
if line.startswith("arangosh>") or line.startswith("........>"):
|
||||
if lastline != None:
|
||||
# short = short + lastline
|
||||
# shortLines = shortLines + 1
|
||||
lastline = None
|
||||
if arangosh:
|
||||
if line.startswith("arangosh>") or line.startswith("........>"):
|
||||
if lastline != None:
|
||||
# short = short + lastline
|
||||
# shortLines = shortLines + 1
|
||||
lastline = None
|
||||
|
||||
short = short + line
|
||||
shortLines = shortLines + 1
|
||||
showdots = True
|
||||
else:
|
||||
if showdots:
|
||||
if lastline == None:
|
||||
# lastline = line
|
||||
shortable = True
|
||||
showdots = False
|
||||
lastline = None
|
||||
else:
|
||||
# short = short + "~~~hidden~~~\n"
|
||||
# shortLines = shortLines + 1
|
||||
shortable = True
|
||||
showdots = False
|
||||
lastline = None
|
||||
|
||||
if curl:
|
||||
if line.startswith("shell> curl"):
|
||||
curlState = CURL_STATE_CMD
|
||||
elif curlState == CURL_STATE_CMD and line.startswith("HTTP/1.1 "):
|
||||
curlState = CURL_STATE_HEADER
|
||||
elif curlState == CURL_STATE_HEADER and line.startswith("{"):
|
||||
curlState = CURL_STATE_BODY
|
||||
|
||||
if curlState == CURL_STATE_CMD or curlState == CURL_STATE_HEADER:
|
||||
short = short + line
|
||||
shortLines = shortLines + 1
|
||||
else:
|
||||
shortable = True
|
||||
|
||||
long = long + line
|
||||
longLines = longLines + 1
|
||||
|
||||
if lastline != None:
|
||||
short = short + lastline
|
||||
short = short + line
|
||||
shortLines = shortLines + 1
|
||||
showdots = True
|
||||
else:
|
||||
if showdots:
|
||||
if lastline == None:
|
||||
# lastline = line
|
||||
shortable = True
|
||||
showdots = False
|
||||
lastline = None
|
||||
else:
|
||||
# short = short + "~~~hidden~~~\n"
|
||||
# shortLines = shortLines + 1
|
||||
shortable = True
|
||||
showdots = False
|
||||
lastline = None
|
||||
|
||||
infile.close()
|
||||
if curl:
|
||||
if line.startswith("shell> curl"):
|
||||
curlState = CURL_STATE_CMD
|
||||
elif curlState == CURL_STATE_CMD and line.startswith("HTTP/1.1 "):
|
||||
curlState = CURL_STATE_HEADER
|
||||
elif curlState == CURL_STATE_HEADER and line.startswith("{"):
|
||||
curlState = CURL_STATE_BODY
|
||||
|
||||
if longLines - shortLines < 5:
|
||||
shortable = False
|
||||
if curlState == CURL_STATE_CMD or curlState == CURL_STATE_HEADER:
|
||||
short = short + line
|
||||
shortLines = shortLines + 1
|
||||
else:
|
||||
shortable = True
|
||||
|
||||
# write example
|
||||
fh.write("\n")
|
||||
fh.write("<div id=\"%s_container\">\n" % tag)
|
||||
long = long + line
|
||||
longLines = longLines + 1
|
||||
|
||||
longTag = "%s_long" % tag
|
||||
shortTag = "%s_short" % tag
|
||||
if lastline != None:
|
||||
short = short + lastline
|
||||
shortLines = shortLines + 1
|
||||
|
||||
longToggle = "$('#%s').hide(); $('#%s').show();" % (longTag, shortTag)
|
||||
shortToggle = "$('#%s').hide(); $('#%s').show();" % (shortTag, longTag)
|
||||
infile.close()
|
||||
|
||||
if shortable:
|
||||
fh.write("<div id=\"%s\" onclick=\"%s\" style=\"Display: none;\">\n" % (longTag, longToggle))
|
||||
else:
|
||||
fh.write("<div id=\"%s\">\n" % longTag)
|
||||
if longLines - shortLines < 5:
|
||||
shortable = False
|
||||
|
||||
# write example
|
||||
fh.write("\n")
|
||||
fh.write("<div id=\"%s_container\">\n" % tag)
|
||||
|
||||
longTag = "%s_long" % tag
|
||||
shortTag = "%s_short" % tag
|
||||
|
||||
longToggle = "$('#%s').hide(); $('#%s').show();" % (longTag, shortTag)
|
||||
shortToggle = "$('#%s').hide(); $('#%s').show();" % (shortTag, longTag)
|
||||
|
||||
if shortable:
|
||||
fh.write("<div id=\"%s\" onclick=\"%s\" style=\"Display: none;\">\n" % (longTag, longToggle))
|
||||
else:
|
||||
fh.write("<div id=\"%s\">\n" % longTag)
|
||||
|
||||
fh.write("<pre>\n")
|
||||
fh.write("```\n")
|
||||
fh.write("%s" % long)
|
||||
fh.write("```\n")
|
||||
fh.write("</pre>\n")
|
||||
fh.write("</div>\n")
|
||||
|
||||
if shortable:
|
||||
fh.write("<div id=\"%s\" onclick=\"%s\">\n" % (shortTag, shortToggle))
|
||||
fh.write("<pre>\n")
|
||||
fh.write("```\n")
|
||||
fh.write("%s" % long)
|
||||
fh.write("%s" % short)
|
||||
fh.write("```\n")
|
||||
fh.write("</pre>\n")
|
||||
fh.write("</div>\n")
|
||||
|
||||
if shortable:
|
||||
fh.write("<div id=\"%s\" onclick=\"%s\">\n" % (shortTag, shortToggle))
|
||||
fh.write("<pre>\n")
|
||||
fh.write("```\n")
|
||||
fh.write("%s" % short)
|
||||
fh.write("```\n")
|
||||
|
||||
if arangosh:
|
||||
fh.write("</pre><div class=\"example_show_button\">show execution results</div>\n")
|
||||
elif curl:
|
||||
fh.write("</pre><div class=\"example_show_button\">show response body</div>\n")
|
||||
else:
|
||||
fh.write("</pre><div class=\"example_show_button\">show</div>\n")
|
||||
|
||||
fh.write("</div>\n")
|
||||
|
||||
if arangosh:
|
||||
fh.write("</pre><div class=\"example_show_button\">show execution results</div>\n")
|
||||
elif curl:
|
||||
fh.write("</pre><div class=\"example_show_button\">show response body</div>\n")
|
||||
else:
|
||||
fh.write("</pre><div class=\"example_show_button\">show</div>\n")
|
||||
|
||||
fh.write("</div>\n")
|
||||
fh.write("\n")
|
||||
|
||||
fh.write("</div>\n")
|
||||
fh.write("\n")
|
||||
|
||||
|
||||
def fetch_comments(dirpath):
|
||||
""" Fetches comments from files and writes to a file in required format.
|
||||
"""
|
||||
""" Fetches comments from files and writes to a file in required format.
|
||||
"""
|
||||
|
||||
comments_filename = "allComments.txt"
|
||||
fh = open(comments_filename, "a")
|
||||
shouldIgnoreLine = False;
|
||||
comments_filename = "allComments.txt"
|
||||
fh = open(comments_filename, "a")
|
||||
shouldIgnoreLine = False;
|
||||
|
||||
for root, directories, files in os.walk(dirpath):
|
||||
for filename in files:
|
||||
filepath = os.path.join(root, filename)
|
||||
file_comments = file_content(filepath)
|
||||
for comment in file_comments:
|
||||
fh.write("\n<!-- filename: %s -->\n" % filename)
|
||||
for _com in comment:
|
||||
_text = re.sub(r"//(/)+\s*\n", "<br />", _com)
|
||||
_text = re.sub(r"///+(\s+\s+)([-\*\d])", r" \2", _text)
|
||||
_text = re.sub(r"///\s*", "", _text)
|
||||
_text = _text.strip("\n")
|
||||
if _text:
|
||||
if not shouldIgnoreLine:
|
||||
if ("@startDocuBlock" in _text) or \
|
||||
("@endDocuBlock" in _text):
|
||||
fh.write("%s\n\n" % _text)
|
||||
elif ("@EXAMPLE_ARANGOSH_OUTPUT" in _text or \
|
||||
"@EXAMPLE_ARANGOSH_RUN" in _text):
|
||||
shouldIgnoreLine = True
|
||||
_filename = re.search("{(.*)}", _text).group(1)
|
||||
dirpath = os.path.abspath(os.path.join(os.path.dirname( __file__ ), os.pardir, "Examples", _filename + ".generated"))
|
||||
if os.path.isfile(dirpath):
|
||||
example_content(dirpath, fh, _filename)
|
||||
else:
|
||||
print "Could not find code for " + _filename
|
||||
else:
|
||||
fh.write("%s\n" % _text)
|
||||
elif ("@END_EXAMPLE_ARANGOSH_OUTPUT" in _text or \
|
||||
"@END_EXAMPLE_ARANGOSH_RUN" in _text):
|
||||
shouldIgnoreLine = False
|
||||
|
||||
fh.close()
|
||||
for root, directories, files in os.walk(dirpath):
|
||||
for filename in files:
|
||||
if filename.endswith((".cpp", ".h", ".js")):
|
||||
filepath = os.path.join(root, filename)
|
||||
file_comments = file_content(filepath)
|
||||
for comment in file_comments:
|
||||
fh.write("\n<!-- filename: %s -->\n" % filename)
|
||||
for _com in comment:
|
||||
_text = re.sub(r"//(/)+\s*\n", "<br />", _com)
|
||||
_text = re.sub(r"///+(\s+\s+)([-\*\d])", r" \2", _text)
|
||||
_text = re.sub(r"///\s*", "", _text)
|
||||
_text = _text.strip("\n")
|
||||
if _text:
|
||||
if not shouldIgnoreLine:
|
||||
if ("@startDocuBlock" in _text) or \
|
||||
("@endDocuBlock" in _text):
|
||||
fh.write("%s\n\n" % _text)
|
||||
elif ("@EXAMPLE_ARANGOSH_OUTPUT" in _text or \
|
||||
"@EXAMPLE_ARANGOSH_RUN" in _text):
|
||||
shouldIgnoreLine = True
|
||||
_filename = re.search("{(.*)}", _text).group(1)
|
||||
dirpath = os.path.abspath(os.path.join(os.path.dirname( __file__ ), os.pardir, "Examples", _filename + ".generated"))
|
||||
if os.path.isfile(dirpath):
|
||||
example_content(dirpath, fh, _filename)
|
||||
else:
|
||||
print "Could not find code for " + _filename
|
||||
else:
|
||||
fh.write("%s\n" % _text)
|
||||
elif ("@END_EXAMPLE_ARANGOSH_OUTPUT" in _text or \
|
||||
"@END_EXAMPLE_ARANGOSH_RUN" in _text):
|
||||
shouldIgnoreLine = False
|
||||
fh.close()
|
||||
|
||||
|
||||
if __name__ == "__main__":
|
||||
open("allComments.txt", "w").close()
|
||||
path = ["arangod/cluster","arangod/RestHandler","arangod/V8Server","arangod/RestServer","arangod/Wal",
|
||||
"lib/Admin","lib/HttpServer","lib/V8","lib/ApplicationServer","lib/Scheduler","lib/Rest","lib/BasicsC",
|
||||
"js/actions","js/client","js/apps/databases","js/apps/system/cerberus","js/apps/system/gharial","js/common","js/server"]
|
||||
for i in path:
|
||||
dirpath = os.path.abspath(os.path.join(os.path.dirname( __file__ ), os.pardir,"ArangoDB/../../"+i))
|
||||
fetch_comments(dirpath)
|
||||
print dirpath
|
||||
|
||||
|
||||
os.path.abspath(os.path.join(os.path.dirname( __file__ ), '..', 'templates'))
|
||||
open("allComments.txt", "w").close()
|
||||
path = ["arangod/cluster","arangod/RestHandler","arangod/V8Server","arangod/RestServer","arangod/Wal",
|
||||
"lib/Admin","lib/HttpServer","lib/V8","lib/ApplicationServer","lib/Scheduler","lib/Rest","lib/BasicsC",
|
||||
"js/actions","js/client","js/apps/databases","js/apps/system/cerberus","js/apps/system/gharial","js/common","js/server"]
|
||||
for i in path:
|
||||
dirpath = os.path.abspath(os.path.join(os.path.dirname( __file__ ), os.pardir,"ArangoDB/../../"+i))
|
||||
print "Reading" + i
|
||||
fetch_comments(dirpath)
|
||||
|
||||
|
||||
os.path.abspath(os.path.join(os.path.dirname( __file__ ), '..', 'templates'))
|
||||
|
||||
|
|
1
README
1
README
|
@ -5,6 +5,7 @@ documents, graphs, and key-values. Build high performance applications using a
|
|||
convenient SQL-like query language or JavaScript/Ruby extensions. Use ACID
|
||||
transaction if you require them. Scale horizontally and vertically with a few
|
||||
mouse clicks.
|
||||
|
||||
Key features include:
|
||||
|
||||
* Schema-free schemata let you combine the space efficiency of MySQL with the
|
||||
|
|
|
@ -540,7 +540,7 @@ SHELL_SERVER_AHUACATL = @top_srcdir@/js/server/tests/ahuacatl-ranges.js \
|
|||
@top_srcdir@/js/server/tests/ahuacatl-general-graph.js \
|
||||
@top_srcdir@/js/server/tests/ahuacatl-graph.js \
|
||||
@top_srcdir@/js/server/tests/ahuacatl-edges.js \
|
||||
@top_srcdir@/js/server/tests/ahuacatl-modify.js \
|
||||
@top_srcdir@/js/server/tests/ahuacatl-modify-noncluster.js \
|
||||
@top_srcdir@/js/server/tests/ahuacatl-refaccess-variable.js \
|
||||
@top_srcdir@/js/server/tests/ahuacatl-refaccess-attribute.js \
|
||||
@top_srcdir@/js/server/tests/ahuacatl-queries-simple.js \
|
||||
|
|
File diff suppressed because it is too large
Load Diff
Loading…
Reference in New Issue