Skip to content
Permalink
Browse files

Merge pull request #2287 from nyalldawson/json

Convert expression context help to json format
  • Loading branch information
m-kuhn committed Sep 9, 2015
2 parents ac97a0b + 10170f4 commit 55e2c7fa8eebe08959c662a9dcd0ac366c81cc33
Showing with 1,087 additions and 1,861 deletions.
  1. +0 −12 resources/function_help/$area
  2. +0 −13 resources/function_help/$atlasfeature
  3. +0 −14 resources/function_help/$atlasfeatureid
  4. +0 −15 resources/function_help/$atlasgeometry
  5. +15 −4 resources/function_help/CMakeLists.txt
  6. +0 −12 resources/function_help/abs
  7. +0 −12 resources/function_help/acos
  8. +0 −32 resources/function_help/age
  9. +0 −12 resources/function_help/asin
  10. +0 −12 resources/function_help/atan
  11. +0 −15 resources/function_help/atan2
  12. +0 −13 resources/function_help/attribute
  13. +0 −12 resources/function_help/bounds
  14. +0 −12 resources/function_help/bounds_height
  15. +0 −12 resources/function_help/bounds_width
  16. +0 −13 resources/function_help/buffer
  17. +0 −14 resources/function_help/ceil
  18. +0 −12 resources/function_help/centroid
  19. +0 −19 resources/function_help/clamp
  20. +0 −19 resources/function_help/coalesce
  21. +0 −17 resources/function_help/color_cmyk
  22. +0 −18 resources/function_help/color_cmyka
  23. +0 −15 resources/function_help/color_hsl
  24. +0 −16 resources/function_help/color_hsla
  25. +0 −15 resources/function_help/color_hsv
  26. +0 −16 resources/function_help/color_hsva
  27. +0 −16 resources/function_help/color_rgb
  28. +0 −17 resources/function_help/color_rgba
  29. +0 −13 resources/function_help/combine
  30. +0 −13 resources/function_help/concat
  31. +0 −13 resources/function_help/contains
  32. +0 −12 resources/function_help/convex_hull
  33. +0 −12 resources/function_help/cos
  34. +0 −13 resources/function_help/crosses
  35. +0 −19 resources/function_help/day
  36. +0 −12 resources/function_help/difference
  37. +0 −13 resources/function_help/disjoint
  38. +0 −12 resources/function_help/distance
  39. +0 −12 resources/function_help/exp
  40. +0 −14 resources/function_help/floor
  41. +0 −14 resources/function_help/format
  42. +0 −174 resources/function_help/format_date
  43. +0 −16 resources/function_help/format_number
  44. +0 −12 resources/function_help/geom_from_gml
  45. +0 −12 resources/function_help/geom_from_wkt
  46. +0 −11 resources/function_help/geom_to_wkt
  47. +0 −12 resources/function_help/geometry
  48. +0 −6 resources/function_help/get_feature
  49. +0 −17 resources/function_help/hamming_distance
  50. +0 −20 resources/function_help/hour
  51. +0 −15 resources/function_help/if
  52. +0 −12 resources/function_help/intersection
  53. +0 −13 resources/function_help/intersects
  54. +0 −13 resources/function_help/intersects_bbox
  55. +5 −0 resources/function_help/json/$area
  56. +6 −0 resources/function_help/json/$atlasfeature
  57. +6 −0 resources/function_help/json/$atlasfeatureid
  58. +6 −0 resources/function_help/json/$atlasgeometry
  59. +6 −0 resources/function_help/json/abs
  60. +6 −0 resources/function_help/json/acos
  61. +9 −0 resources/function_help/json/age
  62. +6 −0 resources/function_help/json/asin
  63. +6 −0 resources/function_help/json/atan
  64. +7 −0 resources/function_help/json/atan2
  65. +7 −0 resources/function_help/json/attribute
  66. +7 −0 resources/function_help/json/bounds
  67. +7 −0 resources/function_help/json/bounds_height
  68. +7 −0 resources/function_help/json/bounds_width
  69. +8 −0 resources/function_help/json/buffer
  70. +7 −0 resources/function_help/json/ceil
  71. +6 −0 resources/function_help/json/centroid
  72. +12 −0 resources/function_help/json/clamp
  73. +13 −0 resources/function_help/json/coalesce
  74. +9 −0 resources/function_help/json/color_cmyk
  75. +10 −0 resources/function_help/json/color_cmyka
  76. +8 −0 resources/function_help/json/color_hsl
  77. +9 −0 resources/function_help/json/color_hsla
  78. +8 −0 resources/function_help/json/color_hsv
  79. +10 −0 resources/function_help/json/color_hsva
  80. +9 −0 resources/function_help/json/color_rgb
  81. +9 −0 resources/function_help/json/color_rgba
  82. +10 −0 resources/function_help/json/combine
  83. +9 −0 resources/function_help/json/concat
  84. +11 −0 resources/function_help/json/contains
  85. +9 −0 resources/function_help/json/convex_hull
  86. +7 −0 resources/function_help/json/cos
  87. +9 −0 resources/function_help/json/crosses
  88. +16 −0 resources/function_help/json/day
  89. +7 −0 resources/function_help/json/difference
  90. +9 −0 resources/function_help/json/disjoint
  91. +8 −0 resources/function_help/json/distance
  92. +7 −0 resources/function_help/json/exp
  93. +7 −0 resources/function_help/json/floor
  94. +11 −0 resources/function_help/json/format
  95. +8 −0 resources/function_help/json/format_date
  96. +8 −0 resources/function_help/json/format_number
  97. +6 −0 resources/function_help/json/geom_from_gml
  98. +6 −0 resources/function_help/json/geom_from_wkt
  99. +7 −0 resources/function_help/json/geom_to_wkt
  100. +8 −0 resources/function_help/json/geometry
  101. +8 −0 resources/function_help/json/get_feature
  102. +11 −0 resources/function_help/json/hamming_distance
  103. +17 −0 resources/function_help/json/hour
  104. +11 −0 resources/function_help/json/if
  105. +7 −0 resources/function_help/json/intersection
  106. +9 −0 resources/function_help/json/intersects
  107. +9 −0 resources/function_help/json/intersects_bbox
  108. +11 −0 resources/function_help/json/layer_property
  109. +8 −0 resources/function_help/json/left
  110. +7 −0 resources/function_help/json/length
  111. +11 −0 resources/function_help/json/levenshtein
  112. +8 −0 resources/function_help/json/ln
  113. +10 −0 resources/function_help/json/log
  114. +8 −0 resources/function_help/json/log10
  115. +11 −0 resources/function_help/json/longest_common_substring
  116. +6 −0 resources/function_help/json/lower
  117. +10 −0 resources/function_help/json/lpad
  118. +10 −0 resources/function_help/json/max
  119. +10 −0 resources/function_help/json/min
  120. +17 −0 resources/function_help/json/minute
  121. +16 −0 resources/function_help/json/month
  122. +5 −0 resources/function_help/json/now
  123. +9 −0 resources/function_help/json/overlaps
  124. +5 −0 resources/function_help/json/pi
  125. +7 −0 resources/function_help/json/project_color
  126. +8 −0 resources/function_help/json/ramp_color
  127. +7 −0 resources/function_help/json/rand
  128. +7 −0 resources/function_help/json/randf
  129. +8 −0 resources/function_help/json/regexp_match
  130. +9 −0 resources/function_help/json/regexp_replace
  131. +8 −0 resources/function_help/json/regexp_substr
  132. +9 −0 resources/function_help/json/replace
  133. +8 −0 resources/function_help/json/right
  134. +8 −0 resources/function_help/json/round
  135. +10 −0 resources/function_help/json/rpad
  136. +13 −0 resources/function_help/json/scale_exp
  137. +13 −0 resources/function_help/json/scale_linear
  138. +16 −0 resources/function_help/json/second
  139. +6 −0 resources/function_help/json/sin
  140. +10 −0 resources/function_help/json/soundex
  141. +7 −0 resources/function_help/json/sqrt
  142. +9 −0 resources/function_help/json/strpos
  143. +9 −0 resources/function_help/json/substr
  144. +7 −0 resources/function_help/json/sym_difference
  145. +6 −0 resources/function_help/json/tan
  146. +6 −0 resources/function_help/json/title
  147. +7 −0 resources/function_help/json/to_date
  148. +7 −0 resources/function_help/json/to_datetime
  149. +7 −0 resources/function_help/json/to_int
  150. +7 −0 resources/function_help/json/to_interval
  151. +7 −0 resources/function_help/json/to_real
  152. +7 −0 resources/function_help/json/to_string
  153. +7 −0 resources/function_help/json/to_time
  154. +9 −0 resources/function_help/json/touches
  155. +10 −0 resources/function_help/json/transform
  156. +7 −0 resources/function_help/json/trim
  157. +7 −0 resources/function_help/json/union
  158. +6 −0 resources/function_help/json/upper
  159. +6 −0 resources/function_help/json/uuid
  160. +7 −0 resources/function_help/json/var
  161. +16 −0 resources/function_help/json/week
  162. +9 −0 resources/function_help/json/within
  163. +10 −0 resources/function_help/json/wordwrap
  164. +7 −0 resources/function_help/json/x_at
  165. +7 −0 resources/function_help/json/x_max
  166. +7 −0 resources/function_help/json/x_min
  167. +7 −0 resources/function_help/json/y_at
  168. +7 −0 resources/function_help/json/y_max
  169. +7 −0 resources/function_help/json/y_min
  170. +16 −0 resources/function_help/json/year
  171. +0 −34 resources/function_help/layer_property
  172. +0 −15 resources/function_help/left
  173. +0 −13 resources/function_help/length
  174. +0 −20 resources/function_help/levenshtein
  175. +0 −15 resources/function_help/ln
  176. +0 −16 resources/function_help/log
  177. +0 −15 resources/function_help/log10
  178. +0 −17 resources/function_help/longest_common_substring
  179. +0 −11 resources/function_help/lower
  180. +0 −17 resources/function_help/lpad
  181. +0 −13 resources/function_help/max
  182. +0 −13 resources/function_help/min
  183. +0 −20 resources/function_help/minute
  184. +0 −19 resources/function_help/month
  185. +0 −12 resources/function_help/now
  186. +0 −13 resources/function_help/overlaps
  187. +0 −11 resources/function_help/pi
  188. +0 −12 resources/function_help/project_color
  189. +0 −20 resources/function_help/ramp_color
  190. +0 −16 resources/function_help/rand
  191. +0 −16 resources/function_help/randf
  192. +0 −14 resources/function_help/regexp_match
  193. +0 −15 resources/function_help/regexp_replace
  194. +0 −14 resources/function_help/regexp_substr
  195. +0 −15 resources/function_help/replace
  196. +0 −15 resources/function_help/right
  197. +0 −20 resources/function_help/round
  198. +0 −18 resources/function_help/rpad
  199. +0 −28 resources/function_help/scale_exp
  200. +0 −19 resources/function_help/scale_linear
  201. +0 −20 resources/function_help/second
  202. +0 −12 resources/function_help/sin
  203. +0 −15 resources/function_help/soundex
  204. +0 −12 resources/function_help/sqrt
  205. +0 −17 resources/function_help/strpos
  206. +0 −15 resources/function_help/substr
  207. +0 −12 resources/function_help/sym_difference
  208. +0 −12 resources/function_help/tan
  209. 0 resources/function_help/{ → text}/$currentfeature
  210. 0 resources/function_help/{ → text}/$feature
  211. 0 resources/function_help/{ → text}/$geometry
  212. 0 resources/function_help/{ → text}/$id
  213. 0 resources/function_help/{ → text}/$length
  214. 0 resources/function_help/{ → text}/$map
  215. 0 resources/function_help/{ → text}/$numfeatures
  216. 0 resources/function_help/{ → text}/$numpages
  217. 0 resources/function_help/{ → text}/$page
  218. 0 resources/function_help/{ → text}/$perimeter
  219. 0 resources/function_help/{ → text}/$rownum
  220. 0 resources/function_help/{ → text}/$scale
  221. 0 resources/function_help/{ → text}/$x
  222. 0 resources/function_help/{ → text}/$y
  223. 0 resources/function_help/{ → text}/AND
  224. 0 resources/function_help/{ → text}/CASE
  225. 0 resources/function_help/{ → text}/CASE ELSE
  226. 0 resources/function_help/{ → text}/Color
  227. 0 resources/function_help/{ → text}/Conditionals
  228. 0 resources/function_help/{ → text}/Conditions
  229. 0 resources/function_help/{ → text}/Conversions
  230. 0 resources/function_help/{ → text}/Custom
  231. 0 resources/function_help/{ → text}/Date and Time
  232. 0 resources/function_help/{ → text}/Field
  233. 0 resources/function_help/{ → text}/Fields and Values
  234. 0 resources/function_help/{ → text}/Fuzzy Matching
  235. 0 resources/function_help/{ → text}/General
  236. 0 resources/function_help/{ → text}/GeometryGroup
  237. 0 resources/function_help/{ → text}/ILIKE
  238. 0 resources/function_help/{ → text}/IN
  239. 0 resources/function_help/{ → text}/IS
  240. 0 resources/function_help/{ → text}/LIKE
  241. 0 resources/function_help/{ → text}/Math
  242. 0 resources/function_help/{ → text}/NOT
  243. 0 resources/function_help/{ → text}/NULL
  244. 0 resources/function_help/{ → text}/OR
  245. 0 resources/function_help/{ → text}/Operators
  246. 0 resources/function_help/{ → text}/Recent (Selection)
  247. 0 resources/function_help/{ → text}/Record
  248. 0 resources/function_help/{ → text}/String
  249. 0 resources/function_help/{ → text}/Variables
  250. +0 −14 resources/function_help/title
  251. +0 −13 resources/function_help/to_date
  252. +0 −13 resources/function_help/to_datetime
  253. +0 −13 resources/function_help/to_int
  254. +0 −13 resources/function_help/to_interval
  255. +0 −13 resources/function_help/to_real
  256. +0 −13 resources/function_help/to_string
  257. +0 −13 resources/function_help/to_time
  258. +0 −13 resources/function_help/touches
  259. +0 −15 resources/function_help/transform
  260. +0 −13 resources/function_help/trim
  261. +0 −12 resources/function_help/union
  262. +0 −13 resources/function_help/upper
  263. +0 −13 resources/function_help/uuid
  264. +0 −12 resources/function_help/var
  265. +0 −19 resources/function_help/week
  266. +0 −13 resources/function_help/within
  267. +0 −16 resources/function_help/wordwrap
  268. +0 −11 resources/function_help/x_at
  269. +0 −12 resources/function_help/x_max
  270. +0 −12 resources/function_help/x_min
  271. +0 −11 resources/function_help/y_at
  272. +0 −12 resources/function_help/y_max
  273. +0 −12 resources/function_help/y_min
  274. +0 −19 resources/function_help/year
  275. +66 −0 resources/process_function_template.py
  276. +14 −3 src/gui/qgsexpressionbuilderwidget.cpp
  277. +1 −0 src/gui/qgsexpressionbuilderwidget.h

This file was deleted.

This file was deleted.

This file was deleted.

This file was deleted.

@@ -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")

@@ -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")

This file was deleted.

This file was deleted.

This file was deleted.

This file was deleted.

This file was deleted.

This file was deleted.

This file was deleted.

This file was deleted.

This file was deleted.

This file was deleted.

This file was deleted.

This file was deleted.

This file was deleted.

This file was deleted.

This file was deleted.

This file was deleted.

This file was deleted.

This file was deleted.

This file was deleted.

0 comments on commit 55e2c7f

Please sign in to comment.
You can’t perform that action at this time.