#!/usr/bin/env python #--!-- coding: utf8 --!-- import os import re import sys import pathlib from random import * from PyQt5.QtCore import Qt, QRect, QStandardPaths, QObject, QProcess, QRegExp from PyQt5.QtCore import QDir, QUrl, QTimer from PyQt5.QtGui import QBrush, QIcon, QPainter, QColor, QImage, QPixmap from PyQt5.QtGui import QDesktopServices from PyQt5.QtWidgets import qApp, QFileDialog from manuskript.enums import Outline import logging LOGGER = logging.getLogger(__name__) # Used to detect multiple connections AUC = Qt.AutoConnection | Qt.UniqueConnection MW = None def safeTranslate(qApp, group, text): try: return qApp.translate(group, text) except: return text def wordCount(text): words = re.findall(r"\S+", text) count = 0 in_comment = False for word in words: if in_comment: if word == '-->': in_comment = False else: if word == '