|
3 | 3 |
|
4 | 4 | from functools import partial |
5 | 5 | from os.path import relpath |
6 | | -from pathlib import Path |
7 | | - |
8 | | -from typing import ( |
9 | | - TYPE_CHECKING, |
10 | | - Dict, |
11 | | - Optional, |
12 | | -) |
13 | 6 |
|
14 | 7 | from qgis.core import ( |
15 | 8 | Qgis, |
|
23 | 16 | QgsSettings, |
24 | 17 | QgsVectorLayer, |
25 | 18 | ) |
| 19 | +from qgis.gui import QgisInterface |
26 | 20 | from qgis.PyQt.QtCore import ( |
27 | 21 | QCoreApplication, |
28 | 22 | Qt, |
|
141 | 135 | from .training import TrainingManager |
142 | 136 | from .webdav import WebDavManager |
143 | 137 |
|
144 | | -if TYPE_CHECKING: |
145 | | - from qgis.gui import QgisInterface |
146 | | - |
147 | | -from . import helpers |
148 | | - |
149 | 138 | VERSION_URL = "https://raw.githubusercontent.com/3liz/lizmap-web-client/versions/versions.json" |
150 | 139 | # To try a local file |
151 | 140 | # VERSION_URL = 'file:///home/etienne/.local/share/QGIS/QGIS3/profiles/default/Lizmap/released_versions.json' |
@@ -531,31 +520,6 @@ def __init__(self, iface: QgisInterface, lwc_version: LwcVersions = None): |
531 | 520 | self.help_action_cloud = None |
532 | 521 |
|
533 | 522 | def configure_dev_version(self): |
534 | | - # File handler for logging |
535 | | - temp_dir = Path(tempfile.gettempdir()).joinpath("QGIS_Lizmap") |
536 | | - if not temp_dir.exists(): |
537 | | - temp_dir.mkdir() |
538 | | - |
539 | | - if not as_boolean(os.getenv("CI")): |
540 | | - file_handler = logging.FileHandler(temp_dir.joinpath("lizmap.log")) |
541 | | - file_handler.setLevel(logging.DEBUG) |
542 | | - formatter = logging.Formatter("%(asctime)s - %(name)s - %(levelname)s - %(message)s") |
543 | | - file_handler.setFormatter(formatter) |
544 | | - add_logging_handler_once(LOGGER, file_handler) |
545 | | - LOGGER.debug( |
546 | | - f"The directory <a href='file://{temp_dir}'>{temp_dir}</a> " |
547 | | - "is currently used for file logging." |
548 | | - ) |
549 | | - |
550 | | - # All logs |
551 | | - def write_log_message(message, tag, level): |
552 | | - """Write all tabs from QGIS to files.""" |
553 | | - temp_dir_log = Path(tempfile.gettempdir()).joinpath("QGIS_Lizmap") |
554 | | - with open(temp_dir_log.joinpath("all.log"), "a") as log_file: |
555 | | - log_file.write(f"{tag}({level}): {message}") |
556 | | - |
557 | | - QgsApplication.messageLog().messageReceived.connect(write_log_message) |
558 | | - |
559 | 523 | self.dlg.setWindowTitle( |
560 | 524 | f"Lizmap branch {self.version}, commit {current_git_hash()}, next {next_git_tag()}" |
561 | 525 | ) |
|
0 commit comments