# Path: mu/i18n.py
# def set_language(language_code, localedir=localedir):
# 
# Path: mu/interface/themes.py
# class Font:
#     """
#     Utility class that makes it easy to set font related values within the
#     editor.
#     """
# 
#     _DATABASE = None
# 
#     def __init__(
#         self, color="#181818", paper="#FEFEF7", bold=False, italic=False
#     ):
#         self.color = color
#         self.paper = paper
#         self.bold = bold
#         self.italic = italic
# 
#     @classmethod
#     def get_database(cls):
#         """
#         Create a font database and load the MU builtin fonts into it.
#         This is a cached classmethod so the font files aren't re-loaded
#         every time a font is refereced
#         """
#         if cls._DATABASE is None:
#             cls._DATABASE = QFontDatabase()
#             for variant in FONT_VARIANTS:
#                 filename = FONT_FILENAME_PATTERN.format(variant=variant)
#                 font_data = load_font_data(filename)
#                 cls._DATABASE.addApplicationFontFromData(font_data)
#         return cls._DATABASE
# 
#     def load(self, size=DEFAULT_FONT_SIZE):
#         """
#         Load the font from the font database, using the correct size and style
#         """
#         return Font.get_database().font(FONT_NAME, self.stylename, size)
# 
#     @property
#     def stylename(self):
#         """
#         Map the bold and italic boolean flags here to a relevant
#         font style name.
#         """
#         if self.bold:
#             if self.italic:
#                 return "Semibold Italic"
#             return "Semibold"
#         if self.italic:
#             return "Italic"
#         return "Regular"
# 
# DEFAULT_FONT_SIZE = 14
# 
# Path: mu/interface/themes.py
# DAY_STYLE = load_stylesheet("day.css")
# 
# NIGHT_STYLE = load_stylesheet("night.css")
# 
# CONTRAST_STYLE = load_stylesheet("contrast.css")


import sys
import os
import re
import platform
import logging
import signal
import string
import bisect
import os.path
import codecs
from PyQt5.QtCore import (
    Qt,
    QProcess,
    QProcessEnvironment,
    pyqtSignal,
    QTimer,
    QUrl,
)
from collections import deque
from PyQt5.QtWidgets import (
    QMessageBox,
    QTextEdit,
    QFrame,
    QListWidget,
    QGridLayout,
    QLabel,
    QMenu,
    QTreeView,
)
from PyQt5.QtGui import (
    QKeySequence,
    QTextCursor,
    QCursor,
    QPainter,
    QDesktopServices,
    QStandardItem,
)
from qtconsole.rich_jupyter_widget import RichJupyterWidget
from ..i18n import language_code
from mu.interface.themes import Font, DEFAULT_FONT_SIZE
from mu.interface.themes import DAY_STYLE, NIGHT_STYLE, CONTRAST_STYLE
    from PyQt5.QtChart import QChart, QLineSeries, QChartView, QValueAxis
            ).format(filename)
        )

    def on_delete_fail(self, filename):
        """
        Fired when a deletion on the device for the given file failed.
        """
        self.show_warning(
            _(
                "There was a problem deleting '{}' from the "
                "device. Please check Mu's logs for "
                "more information."
            ).format(filename)
        )

    def on_get_fail(self, filename):
        """
        Fired when getting the referenced file on the device failed.
        """
        self.show_warning(
            _(
                "There was a problem getting '{}' from the "
                "device. Please check Mu's logs for "
                "more information."
            ).format(filename)
        )

    def set_theme(self, theme):
        pass


# Path: mu/i18n.py
# def set_language(language_code, localedir=localedir):
# 
# Path: mu/interface/themes.py
# class Font:
#     """
#     Utility class that makes it easy to set font related values within the
#     editor.
#     """
# 
#     _DATABASE = None
# 
#     def __init__(
#         self, color="#181818", paper="#FEFEF7", bold=False, italic=False
#     ):
#         self.color = color
#         self.paper = paper
#         self.bold = bold
#         self.italic = italic
# 
#     @classmethod
#     def get_database(cls):
#         """
#         Create a font database and load the MU builtin fonts into it.
#         This is a cached classmethod so the font files aren't re-loaded
#         every time a font is refereced
#         """
#         if cls._DATABASE is None:
#             cls._DATABASE = QFontDatabase()
#             for variant in FONT_VARIANTS:
#                 filename = FONT_FILENAME_PATTERN.format(variant=variant)
#                 font_data = load_font_data(filename)
#                 cls._DATABASE.addApplicationFontFromData(font_data)
#         return cls._DATABASE
# 
#     def load(self, size=DEFAULT_FONT_SIZE):
#         """
#         Load the font from the font database, using the correct size and style
#         """
#         return Font.get_database().font(FONT_NAME, self.stylename, size)
# 
#     @property
#     def stylename(self):
#         """
#         Map the bold and italic boolean flags here to a relevant
#         font style name.
#         """
#         if self.bold:
#             if self.italic:
#                 return "Semibold Italic"
#             return "Semibold"
#         if self.italic:
#             return "Italic"
#         return "Regular"
# 
# DEFAULT_FONT_SIZE = 14
# 
# Path: mu/interface/themes.py
# DAY_STYLE = load_stylesheet("day.css")
# 
# NIGHT_STYLE = load_stylesheet("night.css")
# 
# CONTRAST_STYLE = load_stylesheet("contrast.css")


# Path: mu/interface/panes.py
import sys
import os
import re
import platform
import logging
import signal
import string
import bisect
import os.path
import codecs
from PyQt5.QtCore import (
    Qt,
    QProcess,
    QProcessEnvironment,
    pyqtSignal,
    QTimer,
    QUrl,
)
from collections import deque
from PyQt5.QtWidgets import (
    QMessageBox,
    QTextEdit,
    QFrame,
    QListWidget,
    QGridLayout,
    QLabel,
    QMenu,
    QTreeView,
)
from PyQt5.QtGui import (
    QKeySequence,
    QTextCursor,
    QCursor,
    QPainter,
    QDesktopServices,
    QStandardItem,
)
from qtconsole.rich_jupyter_widget import RichJupyterWidget
from ..i18n import language_code
from mu.interface.themes import Font, DEFAULT_FONT_SIZE
from mu.interface.themes import DAY_STYLE, NIGHT_STYLE, CONTRAST_STYLE
    from PyQt5.QtChart import QChart, QLineSeries, QChartView, QValueAxis

            ).format(filename)
        )

    def on_delete_fail(self, filename):
        """
        Fired when a deletion on the device for the given file failed.
        """
        self.show_warning(
            _(
                "There was a problem deleting '{}' from the "
                "device. Please check Mu's logs for "
                "more information."
            ).format(filename)
        )

    def on_get_fail(self, filename):
        """
        Fired when getting the referenced file on the device failed.
        """
        self.show_warning(
            _(
                "There was a problem getting '{}' from the "
                "device. Please check Mu's logs for "
                "more information."
            ).format(filename)
        )

    def set_theme(self, theme):
        pass


    def set_font_size(self, new_size=DEFAULT_FONT_SIZE):