Commit a560c13c authored by Benjamin Jakimow's avatar Benjamin Jakimow
Browse files
parent 0f567b64
......@@ -3,6 +3,7 @@ Changelog
==============
2020-10-06 (version 1.14):
* stability update
* optimized package imports
* improved SpectralLibrary tool
2020-07-23 (version 1.13):
......
This diff is collapsed.
......@@ -2,8 +2,8 @@
.. include:: /icon_links.rst
.. |cbc| image:: img/checkbox_checked.PNG
.. |cbu| image:: img/checkbox_unchecked.PNG
.. |cbc| image:: img/checkbox_checked.png
.. |cbu| image:: img/checkbox_unchecked.png
.. |timeseriesdock| image:: img/timeseriesdock.png
.. |mapviewbutton| image:: img/mapviewbutton.png
......@@ -14,9 +14,6 @@
User Guide
==========
.. todo:: This documentation reflects the previous EO Time Series Viewer version, where some parts of the GUI looked
different. We are working hard on updating the figures and descriptions.
Quick Start
-----------
......
......@@ -5,7 +5,13 @@ import site
import pathlib
site.addsitedir(pathlib.Path(__file__).parents[1])
from qgis.PyQt.QtCore import QSize
from qgis.PyQt.QtGui import QIcon, QPixmap
from qgis.core import QgsApplication
from eotimeseriesviewer import DIR_REPO, DIR_DOCS, ISSUE_TRACKER
def convert_changelog():
"""
Converts <repo>/CHANGELOG.rst to <repo>/doc/source/changelog.rst
......@@ -18,7 +24,6 @@ def convert_changelog():
with open(pathSrc, 'r', encoding='utf-8') as f:
lines = f.readlines()
for i in range(len(lines)):
line = lines[i]
# convert #104 to
......@@ -30,6 +35,71 @@ def convert_changelog():
with open(pathDst, 'w', encoding='utf-8') as f:
f.writelines(lines)
def update_icons():
from eotimeseriesviewer import DIR_REPO
DIR_SOURCE = DIR_REPO / 'doc' / 'source'
DIR_QGIS_ICONS = DIR_SOURCE / 'img' / 'qgis_icons'
pathIconLinks = DIR_SOURCE / 'icon_links.rst'
# load environment
from eotimeseriesviewer.tests import start_app
assert DIR_QGIS_ICONS.exists()
app = None
if not isinstance(QgsApplication.instance(), QgsApplication):
app = start_app()
from eotimeseriesviewer.externals.qps.resources import findQGISResourceFiles, scanResources
from eotimeseriesviewer import initResources
from eotimeseriesviewer.utils import relativePath
initResources()
# get required icons
rxIcon = re.compile(r'.*\|(?P<name>[^|]+)\|\s*image::.*')
rxIconSource = re.compile('r.*(png|svg)$', re.I)
resourcePaths = list(scanResources())
resourcePaths = [p for p in resourcePaths if rxIconSource.search(p)]
assert len(resourcePaths) > 0, 'No resource icons found'
#|mActionZoomOut| image::
newLines = []
iconSize = QSize(64, 64)
with open(pathIconLinks, 'r', encoding='utf-8') as f:
for line in f.readlines():
match = rxIcon.search(line)
newLine = line
if match:
pass
name = match.group('name')
rxmatch = re.compile(r'.\{name}(svg|png)$')
for p in resourcePaths:
if rxmatch.search(p):
icon: QIcon = QIcon(p)
pm: QPixmap = icon.pixmap(iconSize)
path = DIR_QGIS_ICONS / f'{name}.png'
pm.save(path.as_posix(), format='PNG')
assert path.is_file()
relPath = relativePath(path, pathIconLinks.parent)
newLine = f'.. |{name}| image:: {relPath.as_posix()} \n'
break
newLines.append(newLine)
with open(pathIconLinks, 'w', encoding='utf8') as f:
f.writelines(newLines)
if isinstance(app, QgsApplication):
app.exit()
return True
def update_documentation():
......@@ -37,10 +107,11 @@ def update_documentation():
pass
if __name__ == "__main__":
parser = argparse.ArgumentParser(description='Update documentation')
args = parser.parse_args()
update_icons()
update_documentation()
print('Update documentation finished')
exit(0)
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment