import os, sys import codecs import re import ostools from time import strftime, strptime from PyQt5 import QtGui, QtCore, QtWidgets from generic import RightClickList, RightClickTree from parsetools import convertTags from convo import PesterText _datadir = ostools.getDataDir() class PesterLogSearchInput(QtWidgets.QLineEdit): def __init__(self, theme, parent=None): QtWidgets.QLineEdit.__init__(self, parent) self.setStyleSheet(theme["convo/input/style"] + "margin-right:0px;") def keyPressEvent(self, event): QtWidgets.QLineEdit.keyPressEvent(self, event) if hasattr(self.parent(), 'textArea'): if event.key() == QtCore.Qt.Key_Return: self.parent().logSearch(self.text()) if self.parent().textArea.find(self.text()): self.parent().textArea.ensureCursorVisible() else: self.parent().logSearch(self.text()) class PesterLogHighlighter(QtGui.QSyntaxHighlighter): def __init__(self, parent): QtGui.QSyntaxHighlighter.__init__(self, parent) self.searchTerm = "" self.hilightstyle = QtGui.QTextCharFormat()
def __init__(self): self._datadir = ostools.getDataDir() self.home = os.getcwd() self.quirks = {} self.last = {} self.scripts = []
import os from string import Template import json import re import codecs import platform from datetime import * from time import strftime, time from PyQt4 import QtGui, QtCore import ostools from mood import Mood from dataobjs import PesterProfile, pesterQuirk, pesterQuirks from parsetools import convertTags, addTimeInitial, themeChecker, ThemeException _datadir = ostools.getDataDir() class PesterLog(object): def __init__(self, handle, parent=None): global _datadir self.parent = parent self.handle = handle self.convos = {} self.logpath = _datadir + "logs" def log(self, handle, msg): if self.parent.config.time12Format(): time = strftime("[%I:%M") else: time = strftime("[%H:%M")
def __init__(self): self._datadir = ostools.getDataDir() self.home = os.getcwd() self.quirks = {} self.last = {} self.load()