Skip to content

Commit c3ca2f2

Browse files
committed
Merge pull request #312 from slarosa/master
Moved all the console files into own directory
2 parents dbea359 + 6abe861 commit c3ca2f2

17 files changed

+40
-17
lines changed

python/CMakeLists.txt

+5-12
Original file line numberDiff line numberDiff line change
@@ -140,21 +140,14 @@ IF(WITH_QSCIAPI)
140140
INSTALL(FILES ${QGIS_PYTHON_API_FILE} DESTINATION "${QGIS_DATA_DIR}/python/qsci_apis")
141141
ENDIF(WITH_QSCIAPI)
142142

143-
# PyQGIS console and plugin utilities
144-
# files to copy to staging or install
143+
# Plugin utilities files to copy to staging or install
145144
SET(PY_FILES
146145
__init__.py
147-
console.py
148-
console_sci.py
149-
console_help.py
150-
console_settings.py
151-
console_output.py
152146
utils.py
153147
)
154-
FILE(GLOB UI_FILES *.ui)
155-
PYQT4_WRAP_UI(PYUI_FILES ${UI_FILES}) # returns absolute paths
156-
ADD_CUSTOM_TARGET(pyutils ALL DEPENDS ${PYUI_FILES})
157-
INSTALL(FILES ${PY_FILES} ${PYUI_FILES} DESTINATION "${QGIS_PYTHON_DIR}")
148+
149+
ADD_CUSTOM_TARGET(pyutils ALL)
150+
INSTALL(FILES ${PY_FILES} DESTINATION "${QGIS_PYTHON_DIR}")
158151

159152
# stage to output to make available when QGIS is run from build directory
160153
FOREACH(pyfile ${PY_FILES} ${PYUI_FILES})
@@ -166,7 +159,7 @@ FOREACH(pyfile ${PY_FILES} ${PYUI_FILES})
166159
)
167160
ENDFOREACH(pyfile)
168161

169-
ADD_SUBDIRECTORY(console_help)
162+
ADD_SUBDIRECTORY(console)
170163

171164
# Byte-compile staged PyQGIS utilities
172165
IF(WITH_PY_COMPILE)

python/console/CMakeLists.txt

+30
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,30 @@
1+
ADD_SUBDIRECTORY(console_help)
2+
3+
SET(PYTHON_OUTPUT_DIRECTORY ${QGIS_OUTPUT_DIRECTORY}/python)
4+
SET(QGIS_PYTHON_DIR ${PYTHON_SITE_PACKAGES_DIR}/qgis)
5+
6+
# PyQGIS console files to copy to staging or install
7+
SET(PY_CONSOLE_FILES
8+
console.py
9+
console_sci.py
10+
console_help.py
11+
console_settings.py
12+
console_output.py
13+
)
14+
15+
FILE(GLOB UI_FILES *.ui)
16+
PYQT4_WRAP_UI(PYUI_FILES ${UI_FILES}) # returns absolute paths
17+
ADD_CUSTOM_TARGET(pyconsole ALL DEPENDS ${PYUI_FILES})
18+
19+
# stage to output to make available when QGIS is run from build directory
20+
FOREACH(pyfile ${PY_CONSOLE_FILES} ${PYUI_FILES})
21+
ADD_CUSTOM_COMMAND(TARGET pyconsole
22+
POST_BUILD
23+
COMMAND ${CMAKE_COMMAND} -E copy ${pyfile} "${QGIS_PYTHON_OUTPUT_DIRECTORY}"
24+
WORKING_DIRECTORY ${CMAKE_CURRENT_SOURCE_DIR}
25+
DEPENDS ${pyfile}
26+
)
27+
ENDFOREACH(pyfile)
28+
29+
INSTALL(FILES ${PY_CONSOLE_FILES} ${PYUI_FILES} DESTINATION "${QGIS_PYTHON_DIR}")
30+
File renamed without changes.

python/console_help.py renamed to python/console/console_help.py

+2-2
Original file line numberDiff line numberDiff line change
@@ -40,15 +40,15 @@ def __init__(self, parent):
4040
self.setMaximumSize(500, 300)
4141

4242
qgisDataDir = QgsApplication.pkgDataPath()
43-
listFile = os.listdir(qgisDataDir + "/python/console_help/i18n")
43+
listFile = os.listdir(qgisDataDir + "/python/console/console_help/i18n")
4444
localeFullName = QSettings().value( "locale/userLocale", QVariant( "" ) ).toString()
4545
locale = "en_US"
4646
for i in listFile:
4747
lang = i[0:5]
4848
if localeFullName in (lang[0:2], lang):
4949
locale = lang
5050

51-
filename = qgisDataDir + "/python/console_help/help.htm? \
51+
filename = qgisDataDir + "/python/console/console_help/help.htm? \
5252
lang=" + locale \
5353
+ "&pkgDir=" + qgisDataDir
5454

File renamed without changes.

python/console_help/CMakeLists.txt renamed to python/console/console_help/CMakeLists.txt

+3-3
Original file line numberDiff line numberDiff line change
@@ -2,6 +2,6 @@ FILE(GLOB HTML_FILES *.htm)
22
FILE(GLOB I18N_FILES i18n/*.properties)
33
FILE(GLOB JS_FILES js/*.js)
44

5-
INSTALL(FILES ${HTML_FILES} DESTINATION ${QGIS_DATA_DIR}/python/console_help)
6-
INSTALL(FILES ${I18N_FILES} DESTINATION ${QGIS_DATA_DIR}/python/console_help/i18n)
7-
INSTALL(FILES ${JS_FILES} DESTINATION ${QGIS_DATA_DIR}/python/console_help/js)
5+
INSTALL(FILES ${HTML_FILES} DESTINATION ${QGIS_DATA_DIR}/python/console/console_help)
6+
INSTALL(FILES ${I18N_FILES} DESTINATION ${QGIS_DATA_DIR}/python/console/console_help/i18n)
7+
INSTALL(FILES ${JS_FILES} DESTINATION ${QGIS_DATA_DIR}/python/console/console_help/js)
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.

0 commit comments

Comments
 (0)