from typing import List, Set, Dict, Tuple, Optional from media import images from gui.settings import PRO_EDITION from generate_code.gen_plantuml import plant_uml_create_png_and_return_image_url_async from dialogs.DialogPlantUmlText import DialogPlantUmlText from common.dialog_dir_path import dialog_path_pyinstaller_push, dialog_path_pyinstaller_pop from common.messages import * import datetime from app.settings import CancelRefreshPlantUmlEvent, EVT_CANCEL_REFRESH_PLANTUML_EVENT from common.url_to_data import url_to_data import logging from common.logger import config_log log = logging.getLogger(__name__) config_log(log) ALLOW_DRAWING = True DEFAULT_IMAGE_SIZE = (21, 21) # used to be 2000, 2000 for some reason BMP_EXTRA_MARGIN = 20 # margin for plantuml images to allow scrolling them fully into view unregistered = not PRO_EDITION class ImageViewer(wx.ScrolledWindow): def __init__(self, parent, id=-1, size=wx.DefaultSize): wx.ScrolledWindow.__init__(self, parent, id, (0, 0), size=size, style=wx.SUNKEN_BORDER) self.lines = [] self.maxWidth, self.maxHeight = DEFAULT_IMAGE_SIZE self.x = self.y = 0
from os import path import astpretty # pip install astpretty from common.add_line_numbers import add_line_numbers from parsing.alsm_set_module import get_source_code_sample from common.architecture_support import whosdaddy, whosgranddaddy from parsing.class_entry import ClassEntry, Attribute from parsing.keywords import pythonbuiltinfunctions from parsing.parse_rhs_analyser import RhsAnalyser from parsing.quick_parse import QuickParse from common.logwriter import LogWriter, LogWriterNull from common.logger import LOG_FILENAME log_proper = logging.getLogger(__name__) config_log(log_proper) try: from exceptions import SyntaxError except ImportError: pass # python 3 already imports all built in exceptions STOP_ON_EXCEPTION = False # this is only for deep debugging - want this OFF so that errors get reported to GUI _DEBUGINFO = False def DEBUGINFO(): return _DEBUGINFO def set_DEBUGINFO(flag: bool):