Skip to content

Commit

Permalink
Merge pull request #2287 from nyalldawson/json
Browse files Browse the repository at this point in the history
Convert expression context help to json format
  • Loading branch information
m-kuhn committed Sep 9, 2015
2 parents ac97a0b + 10170f4 commit 55e2c7f
Show file tree
Hide file tree
Showing 277 changed files with 1,087 additions and 1,861 deletions.
12 changes: 0 additions & 12 deletions resources/function_help/$area

This file was deleted.

13 changes: 0 additions & 13 deletions resources/function_help/$atlasfeature

This file was deleted.

14 changes: 0 additions & 14 deletions resources/function_help/$atlasfeatureid

This file was deleted.

15 changes: 0 additions & 15 deletions resources/function_help/$atlasgeometry

This file was deleted.

19 changes: 15 additions & 4 deletions resources/function_help/CMakeLists.txt
Original file line number Diff line number Diff line change
@@ -1,6 +1,5 @@
FILE(GLOB HELP_FILES *)

LIST(REMOVE_ITEM HELP_FILES ${CMAKE_CURRENT_SOURCE_DIR}/CMakeLists.txt)
FILE(GLOB HELP_FILES text/*)
FILE(GLOB JSON_HELP_FILES json/*)

SET(HELP_OUTPUT "${CMAKE_SOURCE_DIR}/src/core/qgsexpression_texts.cpp")

Expand All @@ -10,12 +9,24 @@ LIST(SORT HELP_FILES)

FOREACH(HELP_FILE ${HELP_FILES})
STRING(REGEX REPLACE "^.*/([^/]+)$" "\\1" FN ${HELP_FILE})

FILE(READ ${HELP_FILE} HELP)
STRING(REPLACE "\\" "\" HELP "${HELP}")
STRING(REPLACE "\"" "\\\"" HELP "${HELP}")
STRING(REPLACE "\n" "\\n\"\n\"" HELP "${HELP}")
FILE(APPEND ${HELP_OUTPUT} "\n gFunctionHelpTexts.insert( \"${FN}\", QCoreApplication::translate( \"function_help\", \"${HELP}\") );")
ENDFOREACH(HELP_FILE ${HELP_FILES})

FOREACH(HELP_FILE ${JSON_HELP_FILES})
STRING(REGEX REPLACE "^.*/([^/]+)$" "\\1" FN ${HELP_FILE})
STRING(REPLACE "\$" "\\$" HELP_FILE "${HELP_FILE}")
EXEC_PROGRAM(${PYTHON_EXECUTABLE} ARGS "${CMAKE_CURRENT_SOURCE_DIR}/../process_function_template.py" "${HELP_FILE}" OUTPUT_VARIABLE HELP RETURN_VALUE RET )
IF(NOT "${RET}" STREQUAL "0")
MESSAGE(FATAL_ERROR "parsing function help ${HELP_FILE} failed: ${HELP}")
ENDIF()
STRING(REPLACE "\\" "\" HELP "${HELP}")
STRING(REPLACE "\"" "\\\"" HELP "${HELP}")
STRING(REPLACE "\n" "\\n\"\n\"" HELP "${HELP}")
FILE(APPEND ${HELP_OUTPUT} "\n gFunctionHelpTexts.insert( \"${FN}\", QCoreApplication::translate( \"function_help\", \"${HELP}\") );")
ENDFOREACH(HELP_FILE ${HELP_FILES})

FILE(APPEND ${HELP_OUTPUT} "\n}\n")
12 changes: 0 additions & 12 deletions resources/function_help/abs

This file was deleted.

12 changes: 0 additions & 12 deletions resources/function_help/acos

This file was deleted.

32 changes: 0 additions & 32 deletions resources/function_help/age

This file was deleted.

12 changes: 0 additions & 12 deletions resources/function_help/asin

This file was deleted.

12 changes: 0 additions & 12 deletions resources/function_help/atan

This file was deleted.

15 changes: 0 additions & 15 deletions resources/function_help/atan2

This file was deleted.

13 changes: 0 additions & 13 deletions resources/function_help/attribute

This file was deleted.

12 changes: 0 additions & 12 deletions resources/function_help/bounds

This file was deleted.

12 changes: 0 additions & 12 deletions resources/function_help/bounds_height

This file was deleted.

12 changes: 0 additions & 12 deletions resources/function_help/bounds_width

This file was deleted.

13 changes: 0 additions & 13 deletions resources/function_help/buffer

This file was deleted.

14 changes: 0 additions & 14 deletions resources/function_help/ceil

This file was deleted.

12 changes: 0 additions & 12 deletions resources/function_help/centroid