Skip to content
3 changes: 1 addition & 2 deletions pydmconverter/__main__.py
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@
from pathlib import Path
import logging

logging.basicConfig(level=logging.INFO)
logging.basicConfig(level=logging.WARNING)


IMAGE_FILE_SUFFIXES = {".png", ".jpg", ".jpeg", ".gif"}
Expand Down Expand Up @@ -165,7 +165,6 @@ def convert_files_in_folder(
except Exception as e:
files_failed.append(str(file))
logging.warning(f"Failed to convert {file}: {e}")
breakpoint()
continue

subdirectories = [item for item in input_path.iterdir() if item.is_dir()]
Expand Down
8 changes: 6 additions & 2 deletions pydmconverter/edm/converter.py
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
import xml.etree.ElementTree as ET
from pydmconverter.edm.converter_helpers import convert_edm_to_pydm_widgets
import logging
from pprint import pprint

from pydmconverter.widgets_helpers import PageHeader

logger = logging.getLogger(__name__)
Expand Down Expand Up @@ -53,7 +53,6 @@
def convert(input_path, output_path, scrollable=False):
try:
edm_parser = EDMFileParser(input_path, output_path)
pprint(edm_parser.ui, indent=2)
logger.info(f"Successfully parsed EDM file: {input_path}")
except FileNotFoundError:
logger.error("File Not Found")
Expand Down Expand Up @@ -87,10 +86,15 @@ def convert(input_path, output_path, scrollable=False):
tree.write(output_path, encoding="utf-8", xml_declaration=True)


QT_BASE_CLASSES = {"QPushButton", "QTabWidget", "QFrame", "QLabel", "QWidget", "QLineEdit", "QComboBox", "QTableWidget"}


def build_customwidgets_element(used_classes: set) -> ET.Element:
customwidgets_el = ET.Element("customwidgets")

for cls_name in sorted(used_classes):
if cls_name in QT_BASE_CLASSES:
continue
if cls_name not in CUSTOM_WIDGET_DEFINITIONS:
logger.warning(f"Could not find custom widget {cls_name} in CUSTOM_WIDGET_DEFINITIONS")
continue
Expand Down
Loading
Loading