from dotenv import load_dotenv import re import random from syncit.constants import Constants from syncit.helpers import convert_subs_time, clean_text import logging import threading import os from syncit.translate import CustomTranslator from chardet import detect as detect_encoding from langdetect import detect as detect_language from logger_setup import setup_logging import uuid load_dotenv() setup_logging() logger = logging.getLogger(__name__) class SubtitleParser(): """ Read the subtitles and parses them for ease of use. Attributes: subtitles (str): Subtitles file content. re_subs (list): List of tuples containing the parsed subtitles. subtitles_language (str): Language of the subtitles. audio_language (str): Language of the audio. encoding (str): The encoding of the subtitles. translator (Translator): Translator instace with the languages loaded. """
# David Walshe # 06/03/2019 # Simple test for checking logging config setup import logger_setup import logging logger_setup.setup_logging() logger = logging.getLogger(__name__) logger.debug("DEBUG") logger.info("INFO") logger.warning("WARNING") logger.error("ERROR") logger.critical("CRITICAL")
from logger_setup import setup_logging setup_logging(console_level=10) from gui_builder import fields, forms import wx app = wx.App() class Frame(forms.Frame): link = fields.Link(label="Some link!", URL="http://q-continuum.net") frame = Frame(title="test", parent=None) frame.display() app.MainLoop()