From 79e4de5710cc37500724199546f1013dcaa940b0 Mon Sep 17 00:00:00 2001 From: Stephen Dranger Date: Fri, 4 Feb 2011 15:17:27 -0600 Subject: [PATCH] fdfdas --- TODO | 5 +- convo.py | 438 +++++++++++++++++++++++++ convo.pyc | Bin 0 -> 20033 bytes pesterdata.py => dataobjs.py | 18 +- dataobjs.pyc | Bin 0 -> 7588 bytes logs/chums.js | 2 +- memos.py | 125 +++++++ memos.pyc | Bin 0 -> 6169 bytes pestermenus.py => menus.py | 64 +++- menus.pyc | Bin 0 -> 18417 bytes oyoyo/helpers.py | 3 + oyoyo/helpers.pyc | Bin 4359 -> 4538 bytes parsetools.py | 89 +++++ parsetools.pyc | Bin 0 -> 3659 bytes pesterchum.js | 2 +- pesterchum.py | 609 ++++++----------------------------- pesterdata.pyc | Bin 7417 -> 0 bytes pestermenus.pyc | Bin 15843 -> 0 bytes profiles/testProfile.js | 2 +- setup-py2exe.py | 174 ++++++++++ setup.py | 32 ++ themes/pesterchum/memo.png | Bin 0 -> 265 bytes themes/pesterchum/style.js | 23 +- themes/trollian/memo.png | Bin 0 -> 265 bytes themes/trollian/style.js | 364 +++++++++++---------- tmp.py | 18 ++ 26 files changed, 1269 insertions(+), 699 deletions(-) create mode 100644 convo.py create mode 100644 convo.pyc rename pesterdata.py => dataobjs.py (89%) create mode 100644 dataobjs.pyc create mode 100644 memos.py create mode 100644 memos.pyc rename pestermenus.py => menus.py (86%) create mode 100644 menus.pyc create mode 100644 parsetools.py create mode 100644 parsetools.pyc delete mode 100644 pesterdata.pyc delete mode 100644 pestermenus.pyc create mode 100644 setup-py2exe.py create mode 100644 setup.py create mode 100644 themes/pesterchum/memo.png create mode 100644 themes/trollian/memo.png create mode 100644 tmp.py diff --git a/TODO b/TODO index e07b9ba..eaf639e 100644 --- a/TODO +++ b/TODO @@ -1,5 +1,7 @@ Features: * Chat rooms/browser +* PESTERLOG: in convo window +* help button on quirks menu? * tab recombining gives wrong window icon * help menu -- about and forum * profile switch should say current profile @@ -13,6 +15,7 @@ Features: * tab right-click menu on tabbed convos * comment history (up button) * page up/down scrolling +* get rid of border on chat window? * ctrl-tab should prefer new convos * More complex quirks: random, spelling, by-sound * Implement TC options @@ -28,7 +31,7 @@ Features: * Theme checking * don't clear new message when clicking away from tab? * Spy mode - +* Animated * put code into separate files * hide offline chums * chum list groups diff --git a/convo.py b/convo.py new file mode 100644 index 0000000..8e8b503 --- /dev/null +++ b/convo.py @@ -0,0 +1,438 @@ +from string import Template +import re +from PyQt4 import QtGui, QtCore + +from dataobjs import PesterProfile, Mood +from generic import PesterIcon +from parsetools import escapeBrackets, convertTags + +class PesterTabWindow(QtGui.QFrame): + def __init__(self, mainwindow, parent=None): + QtGui.QFrame.__init__(self, parent) + self.setFocusPolicy(QtCore.Qt.ClickFocus) + self.mainwindow = mainwindow + self.resize(*self.mainwindow.theme["convo/size"]) + self.setStyleSheet(self.mainwindow.theme["convo/style"]) + + self.tabs = QtGui.QTabBar(self) + self.tabs.setTabsClosable(True) + self.connect(self.tabs, QtCore.SIGNAL('currentChanged(int)'), + self, QtCore.SLOT('changeTab(int)')) + self.connect(self.tabs, QtCore.SIGNAL('tabCloseRequested(int)'), + self, QtCore.SLOT('tabClose(int)')) + self.tabs.setShape(self.mainwindow.theme["convo/tabs/tabstyle"]) + self.tabs.setStyleSheet("QTabBar::tab{ %s } QTabBar::tab:selected { %s }" % (self.mainwindow.theme["convo/tabs/style"], self.mainwindow.theme["convo/tabs/selectedstyle"])) + + self.layout = QtGui.QVBoxLayout() + self.layout.setContentsMargins(0,0,0,0) + self.layout.addWidget(self.tabs) + self.setLayout(self.layout) + self.convos = {} + self.tabIndices = {} + self.currentConvo = None + self.changedTab = False + self.softclose = False + + # get default tab color i guess + self.defaultTabTextColor = self.getTabTextColor() + def getTabTextColor(self): + # ugly, ugly hack + self.changedTab = True + i = self.tabs.addTab(".") + c = self.tabs.tabTextColor(i) + self.tabs.removeTab(i) + self.changedTab = False + return c + def addChat(self, convo): + self.convos[convo.chum.handle] = convo + # either addTab or setCurrentIndex will trigger changed() + newindex = self.tabs.addTab(convo.chum.handle) + self.tabIndices[convo.chum.handle] = newindex + self.tabs.setCurrentIndex(newindex) + self.tabs.setTabIcon(newindex, convo.chum.mood.icon(self.mainwindow.theme)) + def showChat(self, handle): + tabi = self.tabIndices[handle] + if self.tabs.currentIndex() == tabi: + self.activateWindow() + self.raise_() + self.convos[handle].raiseChat() + else: + self.tabs.setCurrentIndex(tabi) + + def convoHasFocus(self, convo): + if ((self.hasFocus() or self.tabs.hasFocus()) and + self.tabs.tabText(self.tabs.currentIndex()) == convo.chum.handle): + return True + + def keyPressEvent(self, event): + keypress = event.key() + mods = event.modifiers() + if ((mods & QtCore.Qt.ControlModifier) and + keypress == QtCore.Qt.Key_Tab): + nexti = (self.tabIndices[self.currentConvo.chum.handle] + 1) % self.tabs.count() + self.tabs.setCurrentIndex(nexti) + + def closeSoft(self): + self.softclose = True + self.close() + def updateBlocked(self, handle): + i = self.tabIndices[handle] + icon = QtGui.QIcon(self.mainwindow.theme["main/chums/moods/blocked/icon"]) + self.tabs.setTabIcon(i, icon) + if self.tabs.currentIndex() == i: + self.setWindowIcon(icon) + def updateMood(self, handle, mood, unblocked=False): + i = self.tabIndices[handle] + if handle in self.mainwindow.config.getBlocklist() and not unblocked: + icon = QtGui.QIcon(self.mainwindow.theme["main/chums/moods/blocked/icon"]) + else: + icon = mood.icon(self.mainwindow.theme) + self.tabs.setTabIcon(i, icon) + if self.tabs.currentIndex() == i: + self.setWindowIcon(icon) + def closeEvent(self, event): + if not self.softclose: + while self.tabs.count() > 0: + self.tabClose(0) + self.windowClosed.emit() + def focusInEvent(self, event): + # make sure we're not switching tabs! + i = self.tabs.tabAt(self.mapFromGlobal(QtGui.QCursor.pos())) + if i == -1: + i = self.tabs.currentIndex() + handle = unicode(self.tabs.tabText(i)) + self.clearNewMessage(handle) + def convoHasFocus(self, handle): + i = self.tabIndices[handle] + if (self.tabs.currentIndex() == i and + (self.hasFocus() or self.tabs.hasFocus())): + return True + else: + return False + + def notifyNewMessage(self, handle): + i = self.tabIndices[handle] + self.tabs.setTabTextColor(i, QtGui.QColor(self.mainwindow.theme["convo/tabs/newmsgcolor"])) + convo = self.convos[handle] + def func(): + convo.showChat() + self.mainwindow.waitingMessages.addMessage(handle, func) + # set system tray + def clearNewMessage(self, handle): + try: + i = self.tabIndices[handle] + self.tabs.setTabTextColor(i, self.defaultTabTextColor) + except KeyError: + pass + self.mainwindow.waitingMessages.messageAnswered(handle) + def changeTheme(self, theme): + self.resize(*theme["convo/size"]) + self.setStyleSheet(theme["convo/style"]) + self.tabs.setShape(theme["convo/tabs/tabstyle"]) + self.tabs.setStyleSheet("QTabBar::tabs{ %s }" % (theme["convo/tabs/style"])) + for c in self.convos.values(): + tabi = self.tabIndices[c.chum.handle] + self.tabs.setTabIcon(tabi, c.chum.mood.icon(theme)) + currenttabi = self.tabs.currentIndex() + if currenttabi >= 0: + currentHandle = unicode(self.tabs.tabText(self.tabs.currentIndex())) + self.setWindowIcon(self.convos[currentHandle].chum.mood.icon(theme)) + self.defaultTabTextColor = self.getTabTextColor() + + @QtCore.pyqtSlot(int) + def tabClose(self, i): + handle = unicode(self.tabs.tabText(i)) + self.mainwindow.waitingMessages.messageAnswered(handle) + convo = self.convos[handle] + del self.convos[handle] + del self.tabIndices[handle] + self.tabs.removeTab(i) + for (h, j) in self.tabIndices.iteritems(): + if j > i: + self.tabIndices[h] = j-1 + self.layout.removeWidget(convo) + convo.close() + if self.tabs.count() == 0: + self.close() + return + if self.currentConvo == convo: + currenti = self.tabs.currentIndex() + currenth = unicode(self.tabs.tabText(currenti)) + self.currentConvo = self.convos[currenth] + self.currentConvo.raiseChat() + + @QtCore.pyqtSlot(int) + def changeTab(self, i): + if i < 0: + return + if self.changedTab: + self.changedTab = False + return + handle = unicode(self.tabs.tabText(i)) + convo = self.convos[handle] + if self.currentConvo: + self.layout.removeWidget(self.currentConvo) + self.currentConvo = convo + self.layout.addWidget(convo) + self.setWindowIcon(convo.chum.mood.icon(self.mainwindow.theme)) + self.setWindowTitle(convo.chum.handle) + self.activateWindow() + self.raise_() + convo.raiseChat() + + windowClosed = QtCore.pyqtSignal() + +class PesterText(QtGui.QTextEdit): + def __init__(self, theme, parent=None): + QtGui.QTextEdit.__init__(self, parent) + self.setStyleSheet(theme["convo/textarea/style"]) + self.setReadOnly(True) + self.setMouseTracking(True) + def addMessage(self, text, chum): + color = chum.colorhtml() + systemColor = QtGui.QColor(self.parent().mainwindow.theme["convo/systemMsgColor"]) + initials = chum.initials() + msg = unicode(text) + parent = self.parent() + window = parent.mainwindow + me = window.profile() + if msg == "PESTERCHUM:BEGIN": + parent.setChumOpen(True) + msg = chum.pestermsg(me, systemColor, window.theme["convo/text/beganpester"]) + window.chatlog.log(chum.handle, convertTags(msg, "bbcode")) + self.append(convertTags(msg)) + elif msg == "PESTERCHUM:CEASE": + parent.setChumOpen(False) + msg = chum.pestermsg(me, systemColor, window.theme["convo/text/ceasepester"]) + window.chatlog.log(chum.handle, convertTags(msg, "bbcode")) + self.append(convertTags(msg)) + elif msg == "PESTERCHUM:BLOCK": + msg = chum.pestermsg(me, systemColor, window.theme['convo/text/blocked']) + window.chatlog.log(chum.handle, convertTags(msg, "bbcode")) + self.append(convertTags(msg)) + elif msg == "PESTERCHUM:UNBLOCK": + msg = chum.pestermsg(me, systemColor, window.theme['convo/text/unblocked']) + window.chatlog.log(chum.handle, convertTags(msg, "bbcode")) + self.append(convertTags(msg)) + elif msg[0:3] == "/me" or msg[0:13] == "PESTERCHUM:ME": + if msg[0:3] == "/me": + start = 3 + else: + start = 13 + space = msg.find(" ") + msg = chum.memsg(systemColor, msg[start:space], msg[space:]) + if chum is me: + window.chatlog.log(parent.chum.handle, convertTags(msg, "bbcode")) + else: + window.chatlog.log(chum.handle, convertTags(msg, "bbcode")) + self.append(convertTags(msg)) + else: + if not parent.chumopen and chum is not me: + beginmsg = chum.pestermsg(me, systemColor, window.theme["convo/text/beganpester"]) + parent.setChumOpen(True) + window.chatlog.log(chum.handle, convertTags(beginmsg, "bbcode")) + self.append(convertTags(beginmsg)) + + msg = "%s: %s" % (color, initials, msg) + msg = escapeBrackets(msg) + self.append(convertTags(msg)) + if chum is me: + window.chatlog.log(parent.chum.handle, convertTags(msg, "bbcode")) + else: + window.chatlog.log(chum.handle, convertTags(msg, "bbcode")) + def changeTheme(self, theme): + self.setStyleSheet(theme["convo/textarea/style"]) + sb = self.verticalScrollBar() + sb.setMaximum(sb.maximum()+1000) # ugly hack but whatcha gonna do + sb.setValue(sb.maximum()) + def focusInEvent(self, event): + self.parent().clearNewMessage() + QtGui.QTextEdit.focusInEvent(self, event) + + def mousePressEvent(self, event): + url = self.anchorAt(event.pos()) + if url != "": + QtGui.QDesktopServices.openUrl(QtCore.QUrl(url, QtCore.QUrl.TolerantMode)) + QtGui.QTextEdit.mousePressEvent(self, event) + def mouseMoveEvent(self, event): + QtGui.QTextEdit.mouseMoveEvent(self, event) + if self.anchorAt(event.pos()): + if self.viewport().cursor().shape != QtCore.Qt.PointingHandCursor: + self.viewport().setCursor(QtGui.QCursor(QtCore.Qt.PointingHandCursor)) + else: + self.viewport().setCursor(QtGui.QCursor(QtCore.Qt.IBeamCursor)) + +class PesterInput(QtGui.QLineEdit): + def __init__(self, theme, parent=None): + QtGui.QLineEdit.__init__(self, parent) + self.setStyleSheet(theme["convo/input/style"]) + def changeTheme(self, theme): + self.setStyleSheet(theme["convo/input/style"]) + def focusInEvent(self, event): + self.parent().clearNewMessage() + QtGui.QLineEdit.focusInEvent(self, event) + +class PesterConvo(QtGui.QFrame): + def __init__(self, chum, initiated, mainwindow, parent=None): + QtGui.QFrame.__init__(self, parent) + self.setFocusPolicy(QtCore.Qt.ClickFocus) + self.chum = chum + self.mainwindow = mainwindow + convo = self.mainwindow.theme["convo"] + self.resize(*convo["size"]) + self.setStyleSheet(convo["style"]) + self.setWindowIcon(chum.mood.icon(self.mainwindow.theme)) + self.setWindowTitle(chum.handle) + + t = Template(self.mainwindow.theme["convo/chumlabel/text"]) + + self.chumLabel = QtGui.QLabel(t.safe_substitute(handle=chum.handle), self) + self.chumLabel.setStyleSheet(self.mainwindow.theme["convo/chumlabel/style"]) + self.chumLabel.setAlignment(self.aligndict["h"][self.mainwindow.theme["convo/chumlabel/align/h"]] | self.aligndict["v"][self.mainwindow.theme["convo/chumlabel/align/v"]]) + self.chumLabel.setMaximumHeight(self.mainwindow.theme["convo/chumlabel/maxheight"]) + self.chumLabel.setMinimumHeight(self.mainwindow.theme["convo/chumlabel/minheight"]) + self.chumLabel.setSizePolicy(QtGui.QSizePolicy(QtGui.QSizePolicy.MinimumExpanding, QtGui.QSizePolicy.Expanding)) + self.textArea = PesterText(self.mainwindow.theme, self) + self.textInput = PesterInput(self.mainwindow.theme, self) + self.textInput.setFocus() + + self.connect(self.textInput, QtCore.SIGNAL('returnPressed()'), + self, QtCore.SLOT('sentMessage()')) + + self.layout = QtGui.QVBoxLayout() + self.layout.addWidget(self.chumLabel) + self.layout.addWidget(self.textArea) + self.layout.addWidget(self.textInput) + self.layout.setSpacing(0) + margins = self.mainwindow.theme["convo/margins"] + self.layout.setContentsMargins(margins["left"], margins["top"], + margins["right"], margins["bottom"]) + + self.setLayout(self.layout) + + self.chumopen = False + + if parent: + parent.addChat(self) + if initiated: + msg = self.mainwindow.profile().pestermsg(self.chum, QtGui.QColor(self.mainwindow.theme["convo/systemMsgColor"]), self.mainwindow.theme["convo/text/beganpester"]) + self.setChumOpen(True) + self.textArea.append(convertTags(msg)) + self.mainwindow.chatlog.log(self.chum.handle, convertTags(msg, "bbcode")) + self.newmessage = False + + def updateMood(self, mood, unblocked=False): + if mood.name() == "offline" and self.chumopen == True and not unblocked: + msg = self.chum.pestermsg(self.mainwindow.profile(), QtGui.QColor(self.mainwindow.theme["convo/systemMsgColor"]), self.mainwindow.theme["convo/text/ceasepester"]) + self.textArea.append(convertTags(msg)) + self.mainwindow.chatlog.log(self.chum.handle, convertTags(msg, "bbcode")) + self.chumopen = False + if self.parent(): + self.parent().updateMood(self.chum.handle, mood, unblocked) + else: + if self.chum.blocked(self.mainwindow.config) and not unblocked: + self.setWindowIcon(QtGui.QIcon(self.mainwindow.theme["main/chums/moods/blocked/icon"])) + else: + self.setWindowIcon(mood.icon(self.mainwindow.theme)) + # print mood update? + def updateBlocked(self): + if self.parent(): + self.parent().updateBlocked(self.chum.handle) + else: + self.setWindowIcon(QtGui.QIcon(self.mainwindow.theme["main/chums/moods/blocked/icon"])) + def updateColor(self, color): + self.chum.color = color + def addMessage(self, text, me=True): + if me: + chum = self.mainwindow.profile() + else: + chum = self.chum + self.notifyNewMessage() + self.textArea.addMessage(text, chum) + + def notifyNewMessage(self): + # first see if this conversation HASS the focus + if not (self.hasFocus() or self.textArea.hasFocus() or + self.textInput.hasFocus() or + (self.parent() and self.parent().convoHasFocus(self.chum.handle))): + # ok if it has a tabconvo parent, send that the notify. + if self.parent(): + self.parent().notifyNewMessage(self.chum.handle) + # if not change the window title and update system tray + else: + self.newmessage = True + self.setWindowTitle(self.chum.handle+"*") + def func(): + self.showChat() + self.mainwindow.waitingMessages.addMessage(self.chum.handle, func) + + def clearNewMessage(self): + if self.parent(): + self.parent().clearNewMessage(self.chum.handle) + elif self.newmessage: + self.newmessage = False + self.setWindowTitle(self.chum.handle) + self.mainwindow.waitingMessages.messageAnswered(self.chum.handle) + # reset system tray + def focusInEvent(self, event): + self.clearNewMessage() + self.textInput.setFocus() + def raiseChat(self): + self.activateWindow() + self.raise_() + self.textInput.setFocus() + + def showChat(self): + if self.parent(): + self.parent().showChat(self.chum.handle) + self.raiseChat() + + def closeEvent(self, event): + self.mainwindow.waitingMessages.messageAnswered(self.chum.handle) + self.windowClosed.emit(self.chum.handle) + def setChumOpen(self, o): + self.chumopen = o + def changeTheme(self, theme): + self.resize(*theme["convo/size"]) + self.setStyleSheet(theme["convo/style"]) + margins = theme["convo/margins"] + self.layout.setContentsMargins(margins["left"], margins["top"], + margins["right"], margins["bottom"]) + + self.setWindowIcon(self.chum.mood.icon(theme)) + t = Template(self.mainwindow.theme["convo/chumlabel/text"]) + self.chumLabel.setText(t.safe_substitute(handle=self.chum.handle)) + self.chumLabel.setStyleSheet(theme["convo/chumlabel/style"]) + self.chumLabel.setAlignment(self.aligndict["h"][self.mainwindow.theme["convo/chumlabel/align/h"]] | self.aligndict["v"][self.mainwindow.theme["convo/chumlabel/align/v"]]) + self.chumLabel.setMaximumHeight(self.mainwindow.theme["convo/chumlabel/maxheight"]) + self.chumLabel.setMinimumHeight(self.mainwindow.theme["convo/chumlabel/minheight"]) + self.chumLabel.setSizePolicy(QtGui.QSizePolicy(QtGui.QSizePolicy.MinimumExpanding, QtGui.QSizePolicy.Expanding)) + self.textArea.changeTheme(theme) + self.textInput.changeTheme(theme) + + @QtCore.pyqtSlot() + def sentMessage(self): + text = self.textInput.text() + if text == "": + return + # deal with quirks here + qtext = self.mainwindow.userprofile.quirks.apply(unicode(text)) + text = QtCore.QString(qtext) + self.textInput.setText("") + self.addMessage(text, True) + # if ceased, rebegin + if not self.chumopen: + self.mainwindow.newConvoStarted.emit(QtCore.QString(self.chum.handle), True) + # convert color tags + text = convertTags(unicode(text), "ctag") + self.messageSent.emit(text, self.chum) + + messageSent = QtCore.pyqtSignal(QtCore.QString, PesterProfile) + windowClosed = QtCore.pyqtSignal(QtCore.QString) + + aligndict = {"h": {"center": QtCore.Qt.AlignHCenter, + "left": QtCore.Qt.AlignLeft, + "right": QtCore.Qt.AlignRight }, + "v": {"center": QtCore.Qt.AlignVCenter, + "top": QtCore.Qt.AlignTop, + "bottom": QtCore.Qt.AlignBottom } } diff --git a/convo.pyc b/convo.pyc new file mode 100644 index 0000000000000000000000000000000000000000..6ea4496a31f90b1c3b38384e4d963f3f4e5d3a13 GIT binary patch literal 20033 zcmb_kNpKw3d44^Eo!Cf#Acy7xt{Qp~Bui#uiIzk{B*ln?hz2Cth-GLn(*Rl=OoP)6 zlCY&J+f-!BcAR69N=4;Es_ax{ab=GqC$8j>s$3kGQ@N$e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@rF$6)<)RAY2Q%S*4J^{@)f>Fwk9CV&LwTSh5m)P z=q&a5kfF+R1}D!n-FS1n?gD2HS$;tbP)MlT)DtuZ_nCBG(-1i{ISy~pb+s!vsP%%! z^7n}hdb}K*IJkmbI*R))aO0E)pgr#Ap8~+v$0&lf?RjnY7BX%3|Bx~6&zb58MiT}b z430CPxnkPfJYzQ){4)dT#G;Q>@%(qLczsBSrTBUSD%_3zuicRw~MuNdvcf(&_8(oE|S z8^(~NpG;0^YDYIVXOqW`zc5!$O?;(Yi<{9 literal 0 HcmV?d00001 diff --git a/pesterdata.py b/dataobjs.py similarity index 89% rename from pesterdata.py rename to dataobjs.py index 34b5197..4d19dbb 100644 --- a/pesterdata.py +++ b/dataobjs.py @@ -6,9 +6,10 @@ from generic import PesterIcon class Mood(object): moods = ["chummy", "rancorous", "offline", "pleasant", "distraught", - "unruly", "smooth", "ecstatic", "relaxed", "discontent", + "pranky", "smooth", "ecstatic", "relaxed", "discontent", "devious", "sleek", "detestful", "mirthful", "manipulative", - "vigorous", "perky", "acceptant", "protective"] + "vigorous", "perky", "acceptant", "protective", "mystified", + "amazed", "insolent", "bemused" ] def __init__(self, mood): if type(mood) is int: self.mood = mood @@ -66,14 +67,23 @@ class pesterQuirks(object): def plainList(self): return [q.quirk for q in self.quirklist] def apply(self, string): + # don't quirk /me commands + if string[0:3] == "/me": + space = string.find(" ") + cmd = string[0:space] + string = string[space:] + else: + cmd = "" presuffix = [q for q in self.quirklist if q.type=='prefix' or q.type=='suffix'] replace = [q for q in self.quirklist if q.type=='replace' or q.type=='regexp'] for r in replace: string = r.apply(string) - for ps in presuffix: - string = ps.apply(string) + if not cmd: + for ps in presuffix: + string = ps.apply(string) + string = cmd+string return string def __iter__(self): diff --git a/dataobjs.pyc b/dataobjs.pyc new file mode 100644 index 0000000000000000000000000000000000000000..38eda050f12e71bb888fdc051310d126e38bbce0 GIT binary patch literal 7588 zcmbtZ>v9vx74Fv6vN3qUYp=Q51g8|Tju%3xKv=?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iH53lrWp2sX;KM*#;XDt% zye6|CfSVy!#9T#1jExdZA_4C4ElksgM)m@l+1oPS_I(pJ)2%;aXd}j6ln{4!TaDzc?0e{52L%$zctvterT5-`B_&;DI*D)%0QJ>RAJ%^`OJ;Kin z>t(Vem$dd`gMi=&G;FX}XS2zs!KQ^qE-38Zq2Se9k?(|DB2Et(m)=L#UH3qNA5Esw zl=K&sN(rTQzEZ%0-y?acXGOaYdympfQX@Jvi^C$sDw{amG@*$DPcGO+`}hM5{!V43 nWZrjJ&pZ6yCvhyHe9hjUUnd_@G0x!VbSO8Kn>jHvH*@wsfuC|W literal 0 HcmV?d00001 diff --git a/logs/chums.js b/logs/chums.js index a91102f..7c544c4 100644 --- a/logs/chums.js +++ b/logs/chums.js @@ -1 +1 @@ -{"macruralAlchemist": {"color": "#700000", "handle": "macruralAlchemist", "mood": "offline"}, "agogPorphyry": {"color": "#522d80", "handle": "agogPorphyry", "mood": "offline"}, "fireSwallow": {"color": "#80bb9a", "handle": "fireSwallow", "mood": "offline"}, "aquaMarinist": {"color": "#00caca", "handle": "aquaMarinist", "mood": "offline"}, "nitroZealist": {"color": "#ff3737", "handle": "nitroZealist", "mood": "offline"}, "superGhost": {"color": "#800564", "handle": "superGhost", "mood": "offline"}, "tentacleTherapist": {"color": "#cc66ff", "handle": "tentacleTherapist", "mood": "offline"}, "aquaticMarinist": {"color": "#00caca", "handle": "aquaticMarinist", "mood": "offline"}, "marineAquist": {"color": "#00caca", "handle": "marineAquist", "mood": "offline"}, "captainCaveman": {"color": "#7c414e", "handle": "captainCaveman", "mood": "offline"}, "gamblingGenocider": {"color": "#00ff00", "handle": "gamblingGenocider", "mood": "offline"}, "mechanicalSpectacle": {"color": "#0000ff", "handle": "mechanicalSpectacle", "mood": "offline"}, "absoluteTranquility": {"color": "#000033", "handle": "absoluteTranquility", "mood": "offline"}, "centaursTesticle": {"color": "#000056", "handle": "centaursTesticle", "mood": "offline"}, "gardenGnostic": {"color": "#00ff00", "handle": "gardenGnostic", "mood": "offline"}, "unknownTraveler": {"color": "#006666", "handle": "unknownTraveler", "mood": "offline"}, "schlagzeugGator": {"color": "#61821f", "handle": "schlagzeugGator", "mood": "offline"}} \ No newline at end of file +{"macruralAlchemist": {"color": "#700000", "handle": "macruralAlchemist", "mood": "offline"}, "agogPorphyry": {"color": "#522d80", "handle": "agogPorphyry", "mood": "offline"}, "fireSwallow": {"color": "#80bb9a", "handle": "fireSwallow", "mood": "offline"}, "aquaMarinist": {"color": "#00caca", "handle": "aquaMarinist", "mood": "offline"}, "nitroZealist": {"color": "#ff3737", "handle": "nitroZealist", "mood": "offline"}, "superGhost": {"color": "#800564", "handle": "superGhost", "mood": "offline"}, "tentacleTherapist": {"color": "#cc66ff", "handle": "tentacleTherapist", "mood": "offline"}, "gardenGnostic": {"color": "#00ff00", "handle": "gardenGnostic", "mood": "offline"}, "aquaticMarinist": {"color": "#00caca", "handle": "aquaticMarinist", "mood": "offline"}, "captainCaveman": {"color": "#7c414e", "handle": "captainCaveman", "mood": "offline"}, "greenZephyr": {"color": "#00ca40", "handle": "greenZephyr", "mood": "offline"}, "pesterClient394": {"color": "#ff3737", "handle": "pesterClient394", "mood": "offline"}, "gamblingGenocider": {"color": "#00ff00", "handle": "gamblingGenocider", "mood": "offline"}, "mechanicalSpectacle": {"color": "#0000ff", "handle": "mechanicalSpectacle", "mood": "offline"}, "elegantDiversion": {"color": "#12b40d", "handle": "elegantDiversion", "mood": "offline"}, "absoluteTranquility": {"color": "#000033", "handle": "absoluteTranquility", "mood": "offline"}, "centaursTesticle": {"color": "#000056", "handle": "centaursTesticle", "mood": "offline"}, "schlagzeugGator": {"color": "#61821f", "handle": "schlagzeugGator", "mood": "offline"}, "unknownTraveler": {"color": "#006666", "handle": "unknownTraveler", "mood": "offline"}, "remoteBloodbath": {"color": "#c70000", "handle": "remoteBloodbath", "mood": "offline"}, "marineAquist": {"color": "#00caca", "handle": "marineAquist", "mood": "offline"}} \ No newline at end of file diff --git a/memos.py b/memos.py new file mode 100644 index 0000000..0aa0a4a --- /dev/null +++ b/memos.py @@ -0,0 +1,125 @@ +from string import Template +import re +from PyQt4 import QtGui, QtCore + +from dataobjs import PesterProfile, Mood +from generic import PesterIcon +from convo import PesterConvo, PesterInput, PesterText + +class MemoText(PesterText): + def __init__(self, theme, parent=None): + QtGui.QTextEdit.__init__(self, parent) + self.setStyleSheet(theme["memos/textarea/style"]) + self.setReadOnly(True) + self.setMouseTracking(True) + def addMessage(self, text, chum): + pass + def changeTheme(self): + pass + +class MemoInput(PesterInput): + def __init__(self, theme, parent=None): + QtGui.QLineEdit.__init__(self, parent) + self.setStyleSheet(theme["memos/input/style"]) + def changeTheme(self, theme): + self.setStyleSheet(theme["memos/input/style"]) + +class PesterMemo(PesterConvo): + def __init__(self, channel, mainwindow, parent=None): + QtGui.QFrame.__init__(self, parent) + self.channel = channel + self.mainwindow = mainwindow + self.setWindowTitle(channel) + self.channelLabel = QtGui.QLabel(self) + self.channelLabel.setSizePolicy(QtGui.QSizePolicy(QtGui.QSizePolicy.MinimumExpanding, QtGui.QSizePolicy.Expanding)) + + self.textArea = MemoText(self.mainwindow.theme, self) + self.textInput = MemoInput(self.mainwindow.theme, self) + self.textInput.setFocus() + + self.userlist = QtGui.QListWidget(self) + self.userlist.setSizePolicy(QtGui.QSizePolicy(QtGui.QSizePolicy.Fixed, QtGui.QSizePolicy.Expanding)) + + self.timeslider = QtGui.QSlider(QtCore.Qt.Vertical, self) + self.timeinput = QtGui.QLineEdit(self) + + self.initTheme(self.mainwindow.theme) + + # connect + layout_0 = QtGui.QVBoxLayout() + layout_0.addWidget(self.channelLabel) + layout_0.addWidget(self.textArea) + layout_0.addWidget(self.textInput) + + layout_1 = QtGui.QGridLayout() + layout_1.addWidget(self.timeslider, 0, 1, QtCore.Qt.AlignHCenter) + layout_1.addWidget(self.timeinput, 1, 0, 1, 3) + + self.layout = QtGui.QHBoxLayout() + self.setLayout(self.layout) + + self.layout.addLayout(layout_0) + self.layout.addWidget(self.userlist) + self.layout.addLayout(layout_1) + self.layout.setSpacing(0) + margins = self.mainwindow.theme["memos/margins"] + self.layout.setContentsMargins(margins["left"], margins["top"], + margins["right"], margins["bottom"]) + + #if parent: + # parent.addChat(self) + self.newmessage = False + + def updateMood(self): + pass + def updateBlocked(self): + pass + def updateColor(self): + pass + def addMessage(self): + pass + def notifyNewMessage(self): + pass + def clearNewMessage(self): + pass + + def initTheme(self, theme): + memo = theme["memos"] + self.resize(*memo["size"]) + self.setStyleSheet(memo["style"]) + self.setWindowIcon(PesterIcon(theme["memos/memoicon"])) + + t = Template(theme["memos/label/text"]) + self.channelLabel.setText(t.safe_substitute(channel=self.channel)) + self.channelLabel.setStyleSheet(theme["memos/label/style"]) + self.channelLabel.setAlignment(self.aligndict["h"][theme["memos/label/align/h"]] | self.aligndict["v"][theme["memos/label/align/v"]]) + self.channelLabel.setMaximumHeight(theme["memos/label/maxheight"]) + self.channelLabel.setMinimumHeight(theme["memos/label/minheight"]) + + self.userlist.setStyleSheet(theme["main/chums/style"]) + self.userlist.setFixedWidth(theme["memos/userlist/width"]) + + self.timeinput.setFixedWidth(theme["memos/time/text/width"]) + self.timeinput.setStyleSheet(theme["memos/time/text/style"]) + slidercss = "QSlider { %s } QSlider::groove { %s } QSlider::handle { %s }" % (theme["memos/time/slider/style"], theme["memos/time/slider/groove"], theme["memos/time/slider/handle"]) + self.timeslider.setStyleSheet(slidercss) + + + def changeTheme(self, theme): + self.initTheme(theme) + self.textArea.changeTheme(theme) + self.textInput.changeTheme(theme) + + def sentMessage(self): + pass + + def closeEvent(self, event): + self.mainwindow.waitingMessages.messageAnswered(self.channel) +# self.windowClosed.emit(self.chum.handle) + + +# messageSent - signal -> sendMessage -> sendMessage(Memo) +# windowClosed - signal -> closeMemo + +# self.textInput +# self.textArea diff --git a/memos.pyc b/memos.pyc new file mode 100644 index 0000000000000000000000000000000000000000..4107ccc8fc35f08cd7fbdcdfa77bf75c51c179ba GIT binary patch literal 6169 zcmcgw+j1MZ5yk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^aY2#qR7T zCf0e#AmUi;`0mej?o2=OR&Zvht?ze}{iqgcf)vtXP9z}f=YD=aJAE3RWylZN7b!rY z2?OKKquj&=mu9<{n1l5377`xJDIFe9httH#R1!AeO}Rx&5*{RDM^T?vBnqJ`GFAt% zcDwKnhU$k=0uKA9`UJ~jV&W4%?niis#YZeCLoDZ~@BMtX@rf9(@Vbiu30HaxpZx*_ z@veq{jo?bqD%}Wf1dS4FH-jss^>RH}<-bxrxE~R1Mdv|L`V5lh20qy7_oS&`HAE6C=|)zxqz`j8=zNG z&A;K45x@ZRAe5&UMc}2sJOZHrSwt-W38es^&^iYf;{c<8ud*`8mpqOw067D8FW8Wb zL4dItT201E9@QkbrkYK52W1g>2g(vC_h&{diIn;qQjp-FXJblh$T~nKf3B(KepziWHG#IsmN3L80TNf326qHY1b_v2EwD{U za*MVE%mST}t{S{3ScX_nN{E_r@0O4|bN%of5#boJ26p|eQ4s;7JrM5k*Km(5FAKAC z4WrY6W+w11$D{>E^aJF#dF8eK4m9&jFvigKiHY4{Mh?MH7V`}pZz*CGu+F%V)3URY8KIM){19mDGXid5 zZ2E5UHWHmO5qc~;G$H!z$P>dhr!3McNnnsuxIy?!ki$<=v_v~Waaj&Akk$}C@zZ*1 z^{u@aWd8~hpX0NeC{(bBr7jLa5eY^zN@9;17&i3WsH*8^a(0FOcJ5S2j0JA zO>vC96j=S6pav$8Eo$a_!<@V$+4GZXstT4)6 z{KfH1tY=~(QLyohM!b8T6kYoKNhua%cy^F6-^7GIA1Kt-z4uPB1 SpdM_LHsI2?N*hZX^Zx;)=+)~0 literal 0 HcmV?d00001 diff --git a/pestermenus.py b/menus.py similarity index 86% rename from pestermenus.py rename to menus.py index 557d577..c93c286 100644 --- a/pestermenus.py +++ b/menus.py @@ -376,7 +376,6 @@ class PesterUserlist(QtGui.QDialog): self.userarea.setStyleSheet(theme["main/chums/style"]) self.addChumAction.setText(theme["main/menus/rclickchumlist/addchum"]) for item in [self.userarea.item(i) for i in range(0, self.userarea.count())]: - print item.text() item.setTextColor(QtGui.QColor(theme["main/chums/userlistcolor"])) @QtCore.pyqtSlot() @@ -388,3 +387,66 @@ class PesterUserlist(QtGui.QDialog): addChum = QtCore.pyqtSignal(QtCore.QString) +class PesterMemoList(QtGui.QDialog): + def __init__(self, parent): + QtGui.QDialog.__init__(self, parent) + self.setModal(False) + self.theme = parent.theme + self.mainwindow = parent + self.setStyleSheet(self.theme["main/defaultwindow/style"]) + self.resize(200, 300) + + self.label = QtGui.QLabel("MEMOS") + self.channelarea = RightClickList(self) + self.channelarea.setStyleSheet(self.theme["main/chums/style"]) + self.channelarea.optionsMenu = QtGui.QMenu(self) + self.connect(self.channelarea, + QtCore.SIGNAL('itemActivated(QListWidgetItem *)'), + self, QtCore.SLOT('joinActivatedMemo(QListWidgetItem *)')) + + self.orjoinlabel = QtGui.QLabel("OR MAKE A NEW MEMO:") + self.newmemo = QtGui.QLineEdit(self) + + self.cancel = QtGui.QPushButton("CANCEL", self) + self.connect(self.cancel, QtCore.SIGNAL('clicked()'), + self, QtCore.SLOT('reject()')) + self.join = QtGui.QPushButton("JOIN", self) + self.join.setDefault(True) + self.connect(self.join, QtCore.SIGNAL('clicked()'), + self, QtCore.SLOT('accept()')) + layout_ok = QtGui.QHBoxLayout() + layout_ok.addWidget(self.cancel) + layout_ok.addWidget(self.join) + + layout_0 = QtGui.QVBoxLayout() + layout_0.addWidget(self.label) + layout_0.addWidget(self.channelarea) + layout_0.addWidget(self.orjoinlabel) + layout_0.addWidget(self.newmemo) + layout_0.addLayout(layout_ok) + + self.setLayout(layout_0) + + def newmemoname(self): + return self.newmemo.text() + def selectedmemo(self): + return self.channelarea.currentItem() + + def updateChannels(self, channels): + for c in channels: + item = QtGui.QListWidgetItem(c[1:]) + item.setTextColor(QtGui.QColor(self.theme["main/chums/userlistcolor"])) + item.setIcon(QtGui.QIcon(self.theme["memos/memoicon"])) + self.channelarea.addItem(item) + + def updateTheme(self, theme): + self.theme = theme + self.setStyleSheet(theme["main/defaultwindow/style"]) + for item in [self.userarea.item(i) for i in range(0, self.channelarea.count())]: + item.setTextColor(QtGui.QColor(theme["main/chums/userlistcolor"])) + item.setIcon(QtGui.QIcon(theme["memos/memoicon"])) + + @QtCore.pyqtSlot(QtGui.QListWidgetItem) + def joinActivatedMemo(self, item): + self.channelarea.setCurrentItem(item) + self.accept() diff --git a/menus.pyc b/menus.pyc new file mode 100644 index 0000000000000000000000000000000000000000..9196adfef71ffd75387ecefdc06c689a05d2dad9 GIT binary patch literal 18417 zcmd5^+izUQd7tH-5~=%*vMjGGTVAEEX~($$vXP1+DN8X)k%yA$C=uw@?h$#ytKS%d1edqnzn)81K@&C*C#ivWo)$zCF)|_jU-0hNU^tjtS zuEg3Nx7O=!_o_v&TkCU;es{ayH3r=60c+9c)&^Z;$lV@tjbV3t7`6Q_EV*c(yH|4c z0r!b>Pn`S4?ftGks0Sl@FqAzQb@gFAIG_jnvIhrUeShJ>NcP~6tB)2Q9LOFVcJ+gW z2Zyo;M_m1I;lYvY!BJN~T6l0QdvJ`4U#uJljiUd?pGpsMNk5W>=oMAGA z2g}P*GfI}1MXUQ-9+@o;6H*~zezO_XTJ^BPc_n>%*ti!Av&8W?s_n3uRFHE@;tR-) zueR31@p`-3TnXFb4_ocEaid^ub#r}uJ#22qZ)`jYI0OD-4&+KlOT(oacP{;j1m8pj zmnkZMV&Cp@t$tTZu;Hb=zK8W2M?spbX|I|d7qvjZdS6G^q}MHqROFI5TS_~;7j0?L z?Qo+}t%a&?hb!UMhO+VIJ+!Eh3Pu6ul1Ce%2y?T&8H$istBp9+js_!aKw^ow5$L`r zQt9o>%MEN5*)Qg>Bv^mxLg`SczeiK@JKC(ShuG15XtBJ!-l}glP!z3$6R6AIuiS3- zi`yjj;Iaow!~NZyPY$c$nf`DW#rfojF3t~o$+u4gWuE|Z0A>9hQovo|Tf_q2L1sHC zz*Yn8u(cgh(IV{1O_KE`~|{Qgz9 zL>}75*_kkL9&^!;Ayd&Wk&VwHxm&HRt+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^>WAiiCZ%radh}RQ3d=$Mn}+ z58vQSPk#Ox{XOULQzW|8`5ZH%TM_$@gt*T?DNKno>%itVDz?@Lxl?y)@^M8j$SMH$ zB_NsibGuCbf}aanw@aXg*LEKX9q~6m3p4wybbrtrUYx@mwgoeNma{ACgKLQK?+C27 z@NW||D-=7EB3a6v?t%E5H z!Ix4y7y&`thtdh8H?p-o2wgy5;t5nHl(}88=ac)l{YG)NpMlL>n&UvMduIYwaY9RDN=g^%0+ zk;Pvy`4=Yt%7oLlV^n0E!b!m|k;^Bh+%9Gp{2bkXgOlMZX}1pd4EGKX4iD;|bCJZ( zKUzq>WCE@UETN^udL?Xz?Wh)rO1-S5mtRW9P;`_#ae3 Bk2(MV literal 0 HcmV?d00001 diff --git a/oyoyo/helpers.py b/oyoyo/helpers.py index 48c15db..081e94e 100644 --- a/oyoyo/helpers.py +++ b/oyoyo/helpers.py @@ -35,6 +35,9 @@ def names(cli, *channels): if len(msglist) > 0: cli.send("NAMES %s" % (",".join(msglist))) +def channel_list(cli): + cli.send("LIST") + def msgrandom(cli, choices, dest, user=None): o = "%s: " % user if user else "" o += random.choice(choices) diff --git a/oyoyo/helpers.pyc b/oyoyo/helpers.pyc index b75c0b000458de10ef34314801316d6bd296134a..16a01a9dfbd508f7afb86d25c3b04726acbe3a7d 100644 GIT binary patch delta 821 zcmZuvOKVe65T0|B`%3O357TPWDkN5JiB=HWw5D2P)l%CkJrRV64Vn{bq_jw~DJU*l za2>`U;Zo^B5L~#@l^}HILN|izBDmC<6JHDO<$RfM<~!faxhGGGuS$gv2Y$l6zqHbV zUyn(@7ie`q_6yNt6LtX_aZm;*3w8xGEKs&i+R(N^IiOrn30RN84pkkUOn^$lx}h_! z&Um2w-x;a~+93%l)B#mfpwimk2bBSp)p0PR8z0gn1XX|r>5k|!9#!!fD$~NP(WfXU+cvQmlx|dBHkf6H;7{R-mc|6 z;;nmkHaFWF&5cgCcY=7AMS#ip4>68ObNg7HXcQxm8V+;BwgaPKd=sC=Po^VI<5%-& zZkWpjF4Ov>>8C0vtsyai9qXHz#x;9Y9LMMOs2HO`7W^t{2aSa+VbOUl&f{n2t*GHM zcVArIdz2UwBz>B!m*rpSpast>rx+>(|FoS#ZoBCDVij+C4Qqxq)A-W6C9dyf{W3ew z1uG_RTf=^k%k$^_uhqP^`W^(QZj+?T#|IG_k;5Cg^T}C;8pBnB2>8bFT`C=%Bx)I+;l^Fhjp3J6@h2C`giinf delta 780 zcmZuv&ubGw6n?WwHoNI=cDEt5O{ikhmaXZbVA`myHOWcDR-6jLRtUJWmV!ydq=z0v zp#?8qdxq75ns+lE#wt&D+k zek&Apb%z|Nye1U&K>51A11bPDuDJ_}d<(=EA2yYpW%~PU=#q1BUggNV`sNfxII$fnKY}soCu8s#62uI!JS^QwV z6)X76elOPWR_?QCAI*_#BVH~Cm|ds z7-k7N9o3IJ9a-Qs?kod_5(8hXEaNx7x-i3Zj$xjGuTkHzyu|DZ!&L%(Y;+-Qd=$9O QIZ{l+G3>PM;ESO03oWmEssI20 diff --git a/parsetools.py b/parsetools.py new file mode 100644 index 0000000..bceaba2 --- /dev/null +++ b/parsetools.py @@ -0,0 +1,89 @@ +import re +from PyQt4 import QtGui + +_ctag_begin = re.compile(r'') +_ctag_rgb = re.compile(r'\d+,\d+,\d+') +_urlre = re.compile(r"(?i)(http://[^\s<]+)") + +def convertTags(string, format="html"): + if format not in ["html", "bbcode", "ctag"]: + raise ValueError("Color format not recognized") + def colorrepfunc(matchobj): + color = matchobj.group(1) + if _ctag_rgb.match(color) is not None: + if format=='ctag': + return "" + try: + qc = QtGui.QColor(*[int(c) for c in color.split(",")]) + except ValueError: + qc = QtGui.QColor("black") + else: + qc = QtGui.QColor(color) + if not qc.isValid(): + qc = QtGui.QColor("black") + if format == "html": + return '' % (qc.name()) + elif format == "bbcode": + return '[color=%s]' % (qc.name()) + elif format == "ctag": + (r,g,b,a) = qc.getRgb() + return '' % (r,g,b) + string = _ctag_begin.sub(colorrepfunc, string) + endtag = {"html": "", "bbcode": "[/color]", "ctag": ""} + string = string.replace("", endtag[format]) + def urlrep(matchobj): + if format=="html": + return "%s" % (matchobj.group(1).replace("&", "&"), matchobj.group(1)) + elif format=="bbcode": + return "[url]%s[/url]" % (matchobj.group(1).replace("&", "&")) + elif format=="ctag": + return matchobj.group(1) + string = _urlre.sub(urlrep, string) + return string + +def escapeBrackets(string): + class beginTag(object): + def __init__(self, tag): + self.tag = tag + class endTag(object): + pass + newlist = [] + begintagpos = [(m.start(), m.end()) for m in _ctag_begin.finditer(string)] + lasti = 0 + for (s, e) in begintagpos: + newlist.append(string[lasti:s]) + newlist.append(beginTag(string[s:e])) + lasti = e + if lasti < len(string): + newlist.append(string[lasti:]) + tmp = [] + for o in newlist: + if type(o) is not beginTag: + l = o.split("") + tmp.append(l[0]) + l = l[1:] + for item in l: + tmp.append(endTag()) + tmp.append(item) + else: + tmp.append(o) + btlen = 0 + etlen = 0 + retval = "" + newlist = tmp + for o in newlist: + if type(o) is beginTag: + retval += o.tag.replace("&", "&") + btlen +=1 + elif type(o) is endTag: + if etlen >= btlen: + continue + else: + retval += "" + etlen += 1 + else: + retval += o.replace("&", "&").replace("<", "<").replace(">", ">") + if btlen > etlen: + for i in range(0, btlen-etlen): + retval += "" + return retval diff --git a/parsetools.pyc b/parsetools.pyc new file mode 100644 index 0000000000000000000000000000000000000000..11c33a85dee1fa8fcbf2ae15e19b3bccf8505c00 GIT binary patch literal 3659 zcmb7GOLH5?5$;*MNbmuQlo-iQBw7(AP@)7Um2xUJ2)S(9NmVMWXz2#}gMEaX9u?4e6-(|6fd_!xIC2>FZeKsj>EUvdQ5Zk4v}_-cL;V5bu#-B1k)T)SuA1n$EmPSUl*B<;7|+8}XjX&5BE zLG*{P8<3FB;#k43Pl2I68a;$(VlHekj0d86JS)kW7<$8#V^5NT7#Ol^&bL&_g7if4 z@WB{9fW_*i?dFQmQh26BGr?+k^oe}w$zS2GyzGtsDS0;|$7M-Y#o$AG3v?)z$P4z( zrvo}(@!*}|;gD!nUWg1=F7{s0FfLTHsA^WACS>D$ndet`bq^w80{3QL+sn**D27CH zBs$2;q#%=`OiD7*_>BuPF3PwhhdHu@e|D>7IC3YVYkf_gc|gd8PP(WKCqONiowELkl z=!MSjb@cinWFjgk=^QIdRZ!2j_J7h;Qv*l+M}aOt>%ufRI_=kn?bL=YNn-nCc<$&A6`qE}!_z^)n_=%^5>qj& zX2BFp&TN@QbJMF}wSvKaj+@5P*m{lbZ&=#2UsGO9%bHNH1&x3~;~+w>%1Z!DFQX~+ z7%8OJomWQ_92tP*XEuHxf9PE#UzV7+v&76U-D{NJ%hN^V;&;wX^Npd;YJjC;_4e9P z8Xj&vSho)v>$YBNH#8Y7tJ(c_fB2rd{eG5J3qbClrg3xK?$`LQIa_7Ke1=5R04_zM zh8igU8n7Ak1|f{A2aB8`41DjBoUs!G;xWc;jH=!ndYa|f@^n_&G#t$GDvj}}yknrV z%#^3Nu4=_akI1?XNQ`VZ@32;(bfH9{y?_e=RAaFAP<=m^FHy}?gV%*$C_ z#`ECxW0@>mobza|9?R$!bTMj}z0rTbJ432O1H>MEv8W!YupdvB$OryC`!-YZo7a?_ zk>mjw;UM&!Wp6Hzyn;P+~bW;uO{8d&+|1Kx` z)Tc4pmImP$ab%s(uBSb%ugxH91MS{0v8qAbwl30rt8=KLU4N*nMCVx5fYN;>={Rae z4MK&eb{e|R+p(UGF5_|4P`E`hwLyCrevsnv7dpEMjQtdonAO~>S2T4~G$olg*UcNI zjF-v{T^9jW%r#(2QbZ%U;avkh`x3KaZsB#qcTLGFn?>)ZfUX0-Y_g{sb00R)sNbGH zb3e;ognak}Nq-o{p$5<=!heg?Jx(8Cy0liIE1Nt69`)>QHF)K<-_M&RJjC$z=I{Lv DGybQa literal 0 HcmV?d00001 diff --git a/pesterchum.js b/pesterchum.js index 0f7a8d6..4114dfc 100644 --- a/pesterchum.js +++ b/pesterchum.js @@ -1 +1 @@ -{"tabs": true, "chums": ["aquaMarinist", "marineAquist", "unknownTraveler", "tentacleTherapist", "macruralAlchemist", "vaginalEngineer", "mechanicalSpectacle", "carcinoGeneticist", "schlagzeugGator", "gamblingGenocider", "gardenGnostic", "superGhost", "centaursTesticle", "arachnidsGrip", "fireSwallow", "grimAuxiliatrix"], "defaultprofile": "ghostDunk", "block": []} \ No newline at end of file +{"tabs": false, "chums": ["aquaMarinist", "marineAquist", "unknownTraveler", "tentacleTherapist", "macruralAlchemist", "vaginalEngineer", "mechanicalSpectacle", "carcinoGeneticist", "schlagzeugGator", "gamblingGenocider", "gardenGnostic", "superGhost", "centaursTesticle", "arachnidsGrip", "fireSwallow", "grimAuxiliatrix", "remoteBloodbath", "nitroZealist", "greenZephyr"], "defaultprofile": "testProfile", "block": []} \ No newline at end of file diff --git a/pesterchum.py b/pesterchum.py index dfb868c..f0ab366 100644 --- a/pesterchum.py +++ b/pesterchum.py @@ -13,95 +13,16 @@ import re from PyQt4 import QtGui, QtCore import pygame -from pestermenus import PesterChooseQuirks, PesterChooseTheme, \ - PesterChooseProfile, PesterOptions, PesterUserlist -from pesterdata import PesterProfile, Mood, pesterQuirk, pesterQuirks +from menus import PesterChooseQuirks, PesterChooseTheme, \ + PesterChooseProfile, PesterOptions, PesterUserlist, PesterMemoList +from dataobjs import PesterProfile, Mood, pesterQuirk, pesterQuirks from generic import PesterIcon, RightClickList, MultiTextDialog +from convo import PesterTabWindow, PesterText, PesterInput, PesterConvo +from parsetools import convertTags +from memos import PesterMemo logging.basicConfig(level=logging.INFO) -_ctag_begin = re.compile(r'') -_ctag_rgb = re.compile(r'\d+,\d+,\d+') -_urlre = re.compile(r"(?i)(http://[^\s<]+)") - -def convertTags(string, format="html"): - if format not in ["html", "bbcode", "ctag"]: - raise ValueError("Color format not recognized") - def colorrepfunc(matchobj): - color = matchobj.group(1) - if _ctag_rgb.match(color) is not None: - if format=='ctag': - return "" - try: - qc = QtGui.QColor(*[int(c) for c in color.split(",")]) - except ValueError: - qc = QtGui.QColor("black") - else: - qc = QtGui.QColor(color) - if not qc.isValid(): - qc = QtGui.QColor("black") - if format == "html": - return '' % (qc.name()) - elif format == "bbcode": - return '[color=%s]' % (qc.name()) - elif format == "ctag": - (r,g,b,a) = qc.getRgb() - return '' % (r,g,b) - string = _ctag_begin.sub(colorrepfunc, string) - endtag = {"html": "", "bbcode": "[/color]", "ctag": ""} - string = string.replace("", endtag[format]) - urlrep = {"html": r"\1", - "bbcode": r"[url]\1[/url]", - "ctag": r"\1" } - string = _urlre.sub(urlrep[format], string) - return string - -def escapeBrackets(string): - class beginTag(object): - def __init__(self, tag): - self.tag = tag - class endTag(object): - pass - newlist = [] - begintagpos = [(m.start(), m.end()) for m in _ctag_begin.finditer(string)] - lasti = 0 - for (s, e) in begintagpos: - newlist.append(string[lasti:s]) - newlist.append(beginTag(string[s:e])) - lasti = e - if lasti < len(string): - newlist.append(string[lasti:]) - tmp = [] - for o in newlist: - if type(o) is not beginTag: - l = o.split("") - tmp.append(l[0]) - l = l[1:] - for item in l: - tmp.append(endTag()) - tmp.append(item) - else: - tmp.append(o) - btlen = 0 - etlen = 0 - retval = "" - newlist = tmp - for o in newlist: - if type(o) is beginTag: - retval += o.tag.replace("&", "&") - btlen +=1 - elif type(o) is endTag: - if etlen >= btlen: - continue - else: - retval += "" - etlen += 1 - else: - retval += o.replace("&", "&").replace("<", "<").replace(">", ">") - if btlen > etlen: - for i in range(0, btlen-etlen): - retval += "" - return retval class waitingMessageHolder(object): def __init__(self, mainwindow, **msgfuncs): @@ -140,7 +61,7 @@ class PesterLog(object): self.convos = {} def log(self, handle, msg): if not self.convos.has_key(handle): - time = datetime.now().strftime("%Y-%m-%d.%H:%M") + time = datetime.now().strftime("%Y-%m-%d.%H.%M.txt") if not os.path.exists("logs/%s/%s" % (self.handle, handle)): os.mkdir("logs/%s/%s" % (self.handle, handle)) fp = open("logs/%s/%s/%s.%s" % (self.handle, handle, handle, time), 'a') @@ -652,422 +573,6 @@ class MovingWindow(QtGui.QFrame): self.update() self.moving = None -class PesterTabWindow(QtGui.QFrame): - def __init__(self, mainwindow, parent=None): - QtGui.QFrame.__init__(self, parent) - self.setFocusPolicy(QtCore.Qt.ClickFocus) - self.mainwindow = mainwindow - self.resize(*self.mainwindow.theme["convo/size"]) - self.setStyleSheet(self.mainwindow.theme["convo/style"]) - - self.tabs = QtGui.QTabBar(self) - self.tabs.setTabsClosable(True) - self.connect(self.tabs, QtCore.SIGNAL('currentChanged(int)'), - self, QtCore.SLOT('changeTab(int)')) - self.connect(self.tabs, QtCore.SIGNAL('tabCloseRequested(int)'), - self, QtCore.SLOT('tabClose(int)')) - self.tabs.setShape(self.mainwindow.theme["convo/tabs/tabstyle"]) - self.tabs.setStyleSheet("QTabBar::tab{ %s } QTabBar::tab:selected { %s }" % (self.mainwindow.theme["convo/tabs/style"], self.mainwindow.theme["convo/tabs/selectedstyle"])) - - self.layout = QtGui.QVBoxLayout() - self.layout.setContentsMargins(0,0,0,0) - self.layout.addWidget(self.tabs) - self.setLayout(self.layout) - self.convos = {} - self.tabIndices = {} - self.currentConvo = None - self.changedTab = False - self.softclose = False - - # get default tab color i guess - self.defaultTabTextColor = self.getTabTextColor() - def getTabTextColor(self): - # ugly, ugly hack - self.changedTab = True - i = self.tabs.addTab(".") - c = self.tabs.tabTextColor(i) - self.tabs.removeTab(i) - self.changedTab = False - return c - def addChat(self, convo): - self.convos[convo.chum.handle] = convo - # either addTab or setCurrentIndex will trigger changed() - newindex = self.tabs.addTab(convo.chum.handle) - self.tabIndices[convo.chum.handle] = newindex - self.tabs.setCurrentIndex(newindex) - self.tabs.setTabIcon(newindex, convo.chum.mood.icon(self.mainwindow.theme)) - def showChat(self, handle): - tabi = self.tabIndices[handle] - if self.tabs.currentIndex() == tabi: - self.activateWindow() - self.raise_() - self.convos[handle].raiseChat() - else: - self.tabs.setCurrentIndex(tabi) - - def convoHasFocus(self, convo): - if ((self.hasFocus() or self.tabs.hasFocus()) and - self.tabs.tabText(self.tabs.currentIndex()) == convo.chum.handle): - return True - - def keyPressEvent(self, event): - keypress = event.key() - mods = event.modifiers() - if ((mods & QtCore.Qt.ControlModifier) and - keypress == QtCore.Qt.Key_Tab): - nexti = (self.tabIndices[self.currentConvo.chum.handle] + 1) % self.tabs.count() - self.tabs.setCurrentIndex(nexti) - - def closeSoft(self): - self.softclose = True - self.close() - def updateBlocked(self, handle): - i = self.tabIndices[handle] - icon = QtGui.QIcon(self.mainwindow.theme["main/chums/moods/blocked/icon"]) - self.tabs.setTabIcon(i, icon) - if self.tabs.currentIndex() == i: - self.setWindowIcon(icon) - def updateMood(self, handle, mood, unblocked=False): - i = self.tabIndices[handle] - if handle in self.mainwindow.config.getBlocklist() and not unblocked: - icon = QtGui.QIcon(self.mainwindow.theme["main/chums/moods/blocked/icon"]) - else: - icon = mood.icon(self.mainwindow.theme) - self.tabs.setTabIcon(i, icon) - if self.tabs.currentIndex() == i: - self.setWindowIcon(icon) - def closeEvent(self, event): - if not self.softclose: - while self.tabs.count() > 0: - self.tabClose(0) - self.windowClosed.emit() - def focusInEvent(self, event): - # make sure we're not switching tabs! - i = self.tabs.tabAt(self.mapFromGlobal(QtGui.QCursor.pos())) - if i == -1: - i = self.tabs.currentIndex() - handle = unicode(self.tabs.tabText(i)) - self.clearNewMessage(handle) - def convoHasFocus(self, handle): - i = self.tabIndices[handle] - if (self.tabs.currentIndex() == i and - (self.hasFocus() or self.tabs.hasFocus())): - return True - else: - return False - - def notifyNewMessage(self, handle): - i = self.tabIndices[handle] - self.tabs.setTabTextColor(i, QtGui.QColor(self.mainwindow.theme["convo/tabs/newmsgcolor"])) - convo = self.convos[handle] - def func(): - convo.showChat() - self.mainwindow.waitingMessages.addMessage(handle, func) - # set system tray - def clearNewMessage(self, handle): - try: - i = self.tabIndices[handle] - except KeyError: - pass - self.tabs.setTabTextColor(i, self.defaultTabTextColor) - self.mainwindow.waitingMessages.messageAnswered(handle) - def changeTheme(self, theme): - self.resize(*theme["convo/size"]) - self.setStyleSheet(theme["convo/style"]) - self.tabs.setShape(theme["convo/tabs/tabstyle"]) - self.tabs.setStyleSheet("QTabBar::tabs{ %s }" % (theme["convo/tabs/style"])) - for c in self.convos.values(): - tabi = self.tabIndices[c.chum.handle] - self.tabs.setTabIcon(tabi, c.chum.mood.icon(theme)) - currenttabi = self.tabs.currentIndex() - if currenttabi >= 0: - currentHandle = unicode(self.tabs.tabText(self.tabs.currentIndex())) - self.setWindowIcon(self.convos[currentHandle].chum.mood.icon(theme)) - self.defaultTabTextColor = self.getTabTextColor() - - @QtCore.pyqtSlot(int) - def tabClose(self, i): - handle = unicode(self.tabs.tabText(i)) - self.mainwindow.waitingMessages.messageAnswered(handle) - convo = self.convos[handle] - del self.convos[handle] - del self.tabIndices[handle] - self.tabs.removeTab(i) - for (h, j) in self.tabIndices.iteritems(): - if j > i: - self.tabIndices[h] = j-1 - self.layout.removeWidget(convo) - convo.close() - if self.tabs.count() == 0: - self.close() - return - if self.currentConvo == convo: - currenti = self.tabs.currentIndex() - currenth = unicode(self.tabs.tabText(currenti)) - self.currentConvo = self.convos[currenth] - self.currentConvo.raiseChat() - - @QtCore.pyqtSlot(int) - def changeTab(self, i): - if i < 0: - return - if self.changedTab: - self.changedTab = False - return - handle = unicode(self.tabs.tabText(i)) - convo = self.convos[handle] - if self.currentConvo: - self.layout.removeWidget(self.currentConvo) - self.currentConvo = convo - self.layout.addWidget(convo) - self.setWindowIcon(convo.chum.mood.icon(self.mainwindow.theme)) - self.setWindowTitle(convo.chum.handle) - self.activateWindow() - self.raise_() - convo.raiseChat() - - windowClosed = QtCore.pyqtSignal() - -class PesterText(QtGui.QTextEdit): - def __init__(self, theme, parent=None): - QtGui.QTextEdit.__init__(self, parent) - self.setStyleSheet(theme["convo/textarea/style"]) - self.setReadOnly(True) - def addMessage(self, text, chum): - color = chum.colorhtml() - systemColor = QtGui.QColor(self.parent().mainwindow.theme["convo/systemMsgColor"]) - initials = chum.initials() - msg = unicode(text) - parent = self.parent() - window = parent.mainwindow - me = window.profile() - if msg == "PESTERCHUM:BEGIN": - parent.setChumOpen(True) - msg = chum.pestermsg(me, systemColor, window.theme["convo/text/beganpester"]) - window.chatlog.log(chum.handle, convertTags(msg, "bbcode")) - self.append(convertTags(msg)) - elif msg == "PESTERCHUM:CEASE": - parent.setChumOpen(False) - msg = chum.pestermsg(me, systemColor, window.theme["convo/text/ceasepester"]) - window.chatlog.log(chum.handle, convertTags(msg, "bbcode")) - self.append(convertTags(msg)) - elif msg == "PESTERCHUM:BLOCK": - msg = chum.pestermsg(me, systemColor, window.theme['convo/text/blocked']) - window.chatlog.log(chum.handle, convertTags(msg, "bbcode")) - self.append(convertTags(msg)) - elif msg == "PESTERCHUM:UNBLOCK": - msg = chum.pestermsg(me, systemColor, window.theme['convo/text/unblocked']) - window.chatlog.log(chum.handle, convertTags(msg, "bbcode")) - self.append(convertTags(msg)) - elif msg[0:3] == "/me" or msg[0:13] == "PESTERCHUM:ME": - if msg[0:3] == "/me": - start = 3 - else: - start = 13 - space = msg.find(" ") - msg = chum.memsg(systemColor, msg[start:space], msg[space:]) - if chum is me: - window.chatlog.log(parent.chum.handle, convertTags(msg, "bbcode")) - else: - window.chatlog.log(chum.handle, convertTags(msg, "bbcode")) - self.append(convertTags(msg)) - else: - if not parent.chumopen and chum is not me: - beginmsg = chum.pestermsg(me, systemColor, window.theme["convo/text/beganpester"]) - parent.setChumOpen(True) - window.chatlog.log(chum.handle, convertTags(beginmsg, "bbcode")) - self.append(convertTags(beginmsg)) - - msg = "%s: %s" % (color, initials, msg) - msg = escapeBrackets(msg) - self.append(convertTags(msg)) - if chum is me: - window.chatlog.log(parent.chum.handle, convertTags(msg, "bbcode")) - else: - window.chatlog.log(chum.handle, convertTags(msg, "bbcode")) - def changeTheme(self, theme): - self.setStyleSheet(theme["convo/textarea/style"]) - sb = self.verticalScrollBar() - sb.setMaximum(sb.maximum()+1000) # ugly hack but whatcha gonna do - sb.setValue(sb.maximum()) - def focusInEvent(self, event): - self.parent().clearNewMessage() - QtGui.QTextEdit.focusInEvent(self, event) - - def mousePressEvent(self, event): - url = self.anchorAt(event.pos()) - if url != "": - QtGui.QDesktopServices.openUrl(QtCore.QUrl(url, QtCore.QUrl.TolerantMode)) - QtGui.QTextEdit.mousePressEvent(self, event) - -class PesterInput(QtGui.QLineEdit): - def __init__(self, theme, parent=None): - QtGui.QLineEdit.__init__(self, parent) - self.setStyleSheet(theme["convo/input/style"]) - def changeTheme(self, theme): - self.setStyleSheet(theme["convo/input/style"]) - def focusInEvent(self, event): - self.parent().clearNewMessage() - QtGui.QLineEdit.focusInEvent(self, event) - -class PesterConvo(QtGui.QFrame): - def __init__(self, chum, initiated, mainwindow, parent=None): - QtGui.QFrame.__init__(self, parent) - self.setFocusPolicy(QtCore.Qt.ClickFocus) - self.chum = chum - self.mainwindow = mainwindow - convo = self.mainwindow.theme["convo"] - self.resize(*convo["size"]) - self.setStyleSheet(convo["style"]) - self.setWindowIcon(chum.mood.icon(self.mainwindow.theme)) - self.setWindowTitle(chum.handle) - - t = Template(self.mainwindow.theme["convo/chumlabel/text"]) - - self.chumLabel = QtGui.QLabel(t.safe_substitute(handle=chum.handle), self) - self.chumLabel.setStyleSheet(self.mainwindow.theme["convo/chumlabel/style"]) - self.chumLabel.setAlignment(self.aligndict["h"][self.mainwindow.theme["convo/chumlabel/align/h"]] | self.aligndict["v"][self.mainwindow.theme["convo/chumlabel/align/v"]]) - self.chumLabel.setMaximumHeight(self.mainwindow.theme["convo/chumlabel/maxheight"]) - self.chumLabel.setMinimumHeight(self.mainwindow.theme["convo/chumlabel/minheight"]) - self.chumLabel.setSizePolicy(QtGui.QSizePolicy(QtGui.QSizePolicy.MinimumExpanding, QtGui.QSizePolicy.Expanding)) - self.textArea = PesterText(self.mainwindow.theme, self) - self.textInput = PesterInput(self.mainwindow.theme, self) - self.textInput.setFocus() - - self.connect(self.textInput, QtCore.SIGNAL('returnPressed()'), - self, QtCore.SLOT('sentMessage()')) - - self.layout = QtGui.QVBoxLayout() - self.layout.addWidget(self.chumLabel) - self.layout.addWidget(self.textArea) - self.layout.addWidget(self.textInput) - self.layout.setSpacing(0) - self.layout.setMargin(0) - - self.setLayout(self.layout) - - self.chumopen = False - - if parent: - parent.addChat(self) - if initiated: - msg = self.mainwindow.profile().pestermsg(self.chum, QtGui.QColor(self.mainwindow.theme["convo/systemMsgColor"]), self.mainwindow.theme["convo/text/beganpester"]) - self.setChumOpen(True) - self.textArea.append(convertTags(msg)) - self.mainwindow.chatlog.log(self.chum.handle, convertTags(msg, "bbcode")) - self.newmessage = False - - def updateMood(self, mood, unblocked=False): - if mood.name() == "offline" and self.chumopen == True and not unblocked: - msg = self.chum.pestermsg(self.mainwindow.profile(), QtGui.QColor(self.mainwindow.theme["convo/systemMsgColor"]), self.mainwindow.theme["convo/text/ceasepester"]) - self.textArea.append(convertTags(msg)) - self.mainwindow.chatlog.log(self.chum.handle, convertTags(msg, "bbcode")) - self.chumopen = False - if self.parent(): - self.parent().updateMood(self.chum.handle, mood, unblocked) - else: - if self.chum.blocked(self.mainwindow.config) and not unblocked: - self.setWindowIcon(QtGui.QIcon(self.mainwindow.theme["main/chums/moods/blocked/icon"])) - else: - self.setWindowIcon(mood.icon(self.mainwindow.theme)) - # print mood update? - def updateBlocked(self): - if self.parent(): - self.parent().updateBlocked(self.chum.handle) - else: - self.setWindowIcon(QtGui.QIcon(self.mainwindow.theme["main/chums/moods/blocked/icon"])) - def updateColor(self, color): - self.chum.color = color - def addMessage(self, text, me=True): - if me: - chum = self.mainwindow.profile() - else: - chum = self.chum - self.notifyNewMessage() - self.textArea.addMessage(text, chum) - - def notifyNewMessage(self): - # first see if this conversation HASS the focus - if not (self.hasFocus() or self.textArea.hasFocus() or - self.textInput.hasFocus() or - (self.parent() and self.parent().convoHasFocus(self.chum.handle))): - # ok if it has a tabconvo parent, send that the notify. - if self.parent(): - self.parent().notifyNewMessage(self.chum.handle) - # if not change the window title and update system tray - else: - self.newmessage = True - self.setWindowTitle(self.chum.handle+"*") - def func(): - self.showChat() - self.mainwindow.waitingMessages.addMessage(self.chum.handle, func) - - def clearNewMessage(self): - if self.parent(): - self.parent().clearNewMessage(self.chum.handle) - elif self.newmessage: - self.newmessage = False - self.setWindowTitle(self.chum.handle) - self.mainwindow.waitingMessages.messageAnswered(self.chum.handle) - # reset system tray - def focusInEvent(self, event): - self.clearNewMessage() - self.textInput.setFocus() - def raiseChat(self): - self.activateWindow() - self.raise_() - self.textInput.setFocus() - - def showChat(self): - if self.parent(): - self.parent().showChat(self.chum.handle) - self.raiseChat() - - def closeEvent(self, event): - self.mainwindow.waitingMessages.messageAnswered(self.chum.handle) - self.windowClosed.emit(self.chum.handle) - def setChumOpen(self, o): - self.chumopen = o - def changeTheme(self, theme): - self.resize(*theme["convo/size"]) - self.setStyleSheet(theme["convo/style"]) - self.setWindowIcon(self.chum.mood.icon(theme)) - t = Template(self.mainwindow.theme["convo/chumlabel/text"]) - self.chumLabel.setText(t.safe_substitute(handle=self.chum.handle)) - self.chumLabel.setStyleSheet(theme["convo/chumlabel/style"]) - self.chumLabel.setAlignment(self.aligndict["h"][self.mainwindow.theme["convo/chumlabel/align/h"]] | self.aligndict["v"][self.mainwindow.theme["convo/chumlabel/align/v"]]) - self.chumLabel.setMaximumHeight(self.mainwindow.theme["convo/chumlabel/maxheight"]) - self.chumLabel.setMinimumHeight(self.mainwindow.theme["convo/chumlabel/minheight"]) - self.chumLabel.setSizePolicy(QtGui.QSizePolicy(QtGui.QSizePolicy.MinimumExpanding, QtGui.QSizePolicy.Expanding)) - self.textArea.changeTheme(theme) - self.textInput.changeTheme(theme) - - @QtCore.pyqtSlot() - def sentMessage(self): - text = self.textInput.text() - if text == "": - return - # deal with quirks here - qtext = self.mainwindow.userprofile.quirks.apply(unicode(text)) - text = QtCore.QString(qtext) - self.textInput.setText("") - self.addMessage(text, True) - # if ceased, rebegin - if not self.chumopen: - self.mainwindow.newConvoStarted.emit(QtCore.QString(self.chum.handle), True) - # convert color tags - text = convertTags(unicode(text), "ctag") - self.messageSent.emit(text, self.chum) - - messageSent = QtCore.pyqtSignal(QtCore.QString, PesterProfile) - windowClosed = QtCore.pyqtSignal(QtCore.QString) - - aligndict = {"h": {"center": QtCore.Qt.AlignHCenter, - "left": QtCore.Qt.AlignLeft, - "right": QtCore.Qt.AlignRight }, - "v": {"center": QtCore.Qt.AlignVCenter, - "top": QtCore.Qt.AlignTop, - "bottom": QtCore.Qt.AlignBottom } } class PesterWindow(MovingWindow): def __init__(self, parent=None): @@ -1076,6 +581,7 @@ class PesterWindow(MovingWindow): QtCore.Qt.FramelessWindowHint)) self.convos = {} + self.memos = {} self.tabconvo = None self.setObjectName("main") @@ -1103,11 +609,16 @@ class PesterWindow(MovingWindow): self.userlistaction = userlistaction self.connect(userlistaction, QtCore.SIGNAL('triggered()'), self, QtCore.SLOT('showAllUsers()')) + memoaction = QtGui.QAction(self.theme["main/menus/client/memos"], self) + self.memoaction = memoaction + self.connect(memoaction, QtCore.SIGNAL('triggered()'), + self, QtCore.SLOT('showMemos()')) self.menu = QtGui.QMenuBar(self) filemenu = self.menu.addMenu(self.theme["main/menus/client/_name"]) self.filemenu = filemenu filemenu.addAction(opts) + filemenu.addAction(memoaction) filemenu.addAction(userlistaction) filemenu.addAction(exitaction) @@ -1268,6 +779,27 @@ class PesterWindow(MovingWindow): self.connect(self.tabconvo, QtCore.SIGNAL('windowClosed()'), self, QtCore.SLOT('tabsClosed()')) + + def newMemo(self, channel): + if self.memos.has_key(channel): + # load memo + return + else: + # do slider dialog then set + if self.config.tabs(): + # create new tabbed memo window + pass + else: + self.memoWindow = PesterMemo(channel, self, None) + # connect signals + # chat client send memo open + self.memoWindow.show() + + def addChum(self, chum): + self.chumList.addChum(chum) + self.config.addChum(chum) + self.moodRequest.emit(chum) + def changeProfile(self, collision=None): if not hasattr(self, 'chooseprofile'): self.chooseprofile = None @@ -1348,13 +880,7 @@ class PesterWindow(MovingWindow): if not pygame.mixer: self.alarm = NoneSound() else: - self.alarm = pygame.mixer.Sound(theme["main/sounds/alertsound"] -) - - def addChum(self, chum): - self.chumList.addChum(chum) - self.config.addChum(chum) - self.moodRequest.emit(chum) + self.alarm = pygame.mixer.Sound(theme["main/sounds/alertsound"]) def changeTheme(self, theme): self.theme = theme @@ -1393,6 +919,7 @@ class PesterWindow(MovingWindow): else: self.waitingMessages.answerMessage() + @QtCore.pyqtSlot() def blockSelectedChum(self): curChumListing = self.chumList.currentItem() @@ -1539,6 +1066,39 @@ class PesterWindow(MovingWindow): self.unblockedChum.emit(handle) @QtCore.pyqtSlot() + def showMemos(self): + if not hasattr(self, 'memochooser'): + self.memochooser = None + if self.memochooser: + return + self.memochooser = PesterMemoList(self) + self.connect(self.memochooser, QtCore.SIGNAL('accepted()'), + self, QtCore.SLOT('joinSelectedMemo()')) + self.connect(self.memochooser, QtCore.SIGNAL('rejected()'), + self, QtCore.SLOT('memoChooserClose()')) + self.requestChannelList.emit() + self.memochooser.show() + @QtCore.pyqtSlot() + def joinSelectedMemo(self): + newmemo = self.memochooser.newmemoname() + selectedmemo = self.memochooser.selectedmemo() + if newmemo: + self.newMemo('#'+newmemo) + else: + self.newMemo('#'+selectedmemo.text()) + self.memochooser = None + @QtCore.pyqtSlot() + def memoChooserClose(self): + self.memochooser = None + @QtCore.pyqtSlot() + def memoChooserClose(self): + self.memochooser = None + + @QtCore.pyqtSlot(PesterList) + def updateChannelList(self, channels): + if hasattr(self, 'memochooser') and self.memochooser: + self.memochooser.updateChannels(channels) + @QtCore.pyqtSlot() def showAllUsers(self): if not hasattr(self, 'allusers'): self.allusers = None @@ -1561,6 +1121,7 @@ class PesterWindow(MovingWindow): @QtCore.pyqtSlot() def userListClose(self): self.allusers = None + @QtCore.pyqtSlot() def openQuirks(self): if not hasattr(self, 'quirkmenu'): @@ -1705,6 +1266,8 @@ class PesterWindow(MovingWindow): return self.colorDialog = QtGui.QColorDialog(self) color = self.colorDialog.getColor(initial=self.profile().color) + if not color.isValid(): + color = self.profile().color self.mychumcolor.setStyleSheet("background: %s" % color.name()) self.userprofile.setColor(color) self.mycolorUpdated.emit() @@ -1753,6 +1316,7 @@ class PesterWindow(MovingWindow): moodRequest = QtCore.pyqtSignal(PesterProfile) moodsRequest = QtCore.pyqtSignal(PesterList) moodUpdated = QtCore.pyqtSignal() + requestChannelList = QtCore.pyqtSignal() requestNames = QtCore.pyqtSignal(QtCore.QString) namesUpdated = QtCore.pyqtSignal() userPresentSignal = QtCore.pyqtSignal(QtCore.QString,QtCore.QString,QtCore.QString) @@ -1820,6 +1384,9 @@ class PesterIRC(QtCore.QObject): def requestNames(self, channel): c = unicode(channel) helpers.names(self.cli, c) + @QtCore.pyqtSlot() + def requestChannelList(self): + helpers.channel_list(self.cli) def updateIRC(self): self.conn.next() @@ -1828,6 +1395,7 @@ class PesterIRC(QtCore.QObject): colorUpdated = QtCore.pyqtSignal(QtCore.QString, QtGui.QColor) messageReceived = QtCore.pyqtSignal(QtCore.QString, QtCore.QString) namesReceived = QtCore.pyqtSignal(QtCore.QString, PesterList) + channelListReceived = QtCore.pyqtSignal(PesterList) nickCollision = QtCore.pyqtSignal(QtCore.QString, QtCore.QString) userPresentUpdate = QtCore.pyqtSignal(QtCore.QString, QtCore.QString, QtCore.QString) @@ -1918,7 +1486,20 @@ class PesterHandler(DefaultCommandHandler): pl = PesterList(namelist) del self.channelnames[channel] self.parent.namesReceived.emit(channel, pl) - + + def liststart(self, server, handle, *info): + self.channel_list = [] + info = list(info) + self.channel_field = info.index("Channel") # dunno if this is protocol + def list(self, server, handle, *info): + channel = info[self.channel_field] + if channel not in self.channel_list and channel != "#pesterchum": + self.channel_list.append(channel) + def listend(self, server, handle, msg): + pl = PesterList(self.channel_list) + self.parent.channelListReceived.emit(pl) + self.channel_list = [] + def getMood(self, *chums): chumglub = "GETMOOD " for c in chums: @@ -2020,6 +1601,10 @@ def main(): QtCore.SIGNAL('requestNames(QString)'), irc, QtCore.SLOT('requestNames(QString)')) + irc.connect(widget, + QtCore.SIGNAL('requestChannelList()'), + irc, + QtCore.SLOT('requestChannelList()')) # IRC --> Main window irc.connect(irc, @@ -2046,6 +1631,10 @@ def main(): QtCore.SIGNAL('userPresentUpdate(QString, QString, QString)'), widget, QtCore.SLOT('userPresentUpdate(QString, QString, QString)')) + irc.connect(irc, + QtCore.SIGNAL('channelListReceived(PyQt_PyObject)'), + widget, + QtCore.SLOT('updateChannelList(PyQt_PyObject)')) ircapp = IRCThread(irc) ircapp.start() diff --git a/pesterdata.pyc b/pesterdata.pyc deleted file mode 100644 index 7d212403af3e4178a3715d42a40c2dc9b26a3c62..0000000000000000000000000000000000000000 GIT binary patch literal 0 HcmV?d00001 literal 7417 zcmb_h?RFH$5$)M8X(a^W!@`Tf$WD~36U#CjLIT0WNGL!IYZwtABJ!TqOz-ZX*`3wQ zES7SRe+1sa`IUcphCD~k$&=&-l6$LWcLe4nM=0QK_t*Ax-Kx4(-TdQUGgF@oe|OI_ z*`Epg|4WqQFQ|O{=a?;HLdUE-CM=lsf^j%nFk40QkgcNGDw*|?tSyay(i!eswfDH6EQZ{`6?{$ar*`A6%=?;Bdje@uyxu zD=njXklq>wX+>HqQEclDXITBLq3tQO@7pA`@f|PfrzLdnMUg)i{UipKQ4$Djtf9md z5OslH^&w-K(m)0ulHk~KM*oQMXN-T;_{WStYy9KJKVdp236+162Vci;Pe}tiyeAFp zGbfFTao6gn@jW@Y*B$nHyJ;2uxYhTfI2tA?H4?SkVbHhfB-(?}wvtvqO(~BbBx&3l zcDku-Fzm;}a95g1FN)Hx{K9%k+DZdYwu)`o+OhuV*F?f%Gk(Rl&jWsua3-O(TXGWL zrU0!y3}vrg5T{*sj$l!*)ei>45PLt@vpo+wdT4Gju<@1()ABq!NJnQL#8GNJ{>G#B zMrDOxy@Dz==7nQkI@I2?NfXT&2mKeuGz+FbhYoaKG(jm_r4!K9ny9%^=eI?>>F&U$ zMf3s)NOc1eU!-G0HHIAcL7P^#06wz<>?7Iu)euRDKtqEPgI7R1_bJUr3#GH7H zv0S&%**!}`!NF^a^GjoD@aWoJ0rGta`Cw&`?}UMP4us|6qN&0D)|@Bo7if!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fBe zgsD*SQ?GRx5|PUr-xz{cm~3F@>@Hk&E&{8WJf$RFf)hPPgB5sQWQ=+f6CC#O$lzODMD6}R z6e(#1Z>?QyIDX5*rG>;YDk3ePWK>!xO^xhX1v2cjGag!!S*U3_jJz!-d8$D=if9n; zB<A-TS|h-(RMD%yL>_Qtg(?>cWUi;HZj^6ugn`lupmyw5H}Yi_qJb|B#SvJ<0$srcTyV zZ*PNE0L2@vO#?iv@w5HtTSYmI+Z@!F8nHt%7@p5<%vk0=MNc^Uxs4AI*EF}3XJbIl zo7TuQ=^-q1rxlL#nGul&2$Kx(G{X#6B6+}t;!+|*X!}apw4*~<0#)sGt+#d8_B&~J z$V2dZM&GPy4TM+@w}*xVS}_3$wBjo2ND^qpR!(dq=Az&t1Ud)r!fi5fie_*eIgZd@ zE&E*=Sq&eEAQz|*3`prUGpd?sJWEF5aT>5dSQCoAF+Ba|#^QQw@lT&GUfED1_zF|5 zMI|x$w+NKhy~r+;l*G26Tz8dyZuc-AW(Ghc^+Irutp=(?0Lv$80T%Clfxm;Eyoi{> zMd!y(*{Pv4>c{w@Jd5U`rdPy=zm#T5`f?yPIGIGcE zZ5(*=)-4){HlN|2fmBYO&1I(V@_UCovpDrNeagPhlSm#p=S(?A3bTc|Gjp}M+J69_ C?_Jse diff --git a/pestermenus.pyc b/pestermenus.pyc deleted file mode 100644 index fcaec880eced9e2a1548bef96b532f606edbcbbd..0000000000000000000000000000000000000000 GIT binary patch literal 0 HcmV?d00001 literal 15843 zcmd5@TW=gkcCMb`MWjekH%g){Ye$wXkFt(vTV5|98yiz3b@7rE*+ZGKyaGL%X_9RY zXGYUaiP}huMPy)MAU_skK4}2<0wU zRaaG4ojT_`m#X=<{~R42`{J|tnoIr$@&8ZpM4snd9shZ5)47J{?s=|JaQ6z%V{O50 z7Tvv~S`^)8pKJ8Hd;P94;O-4ri$1qG=o*LIy+f`sW3GNU_hKY{an#jEb1#mhFOIqTSnkEq^u=*k zKbCuOJbiJ3Ypj${fE3|>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39+0{2K>BobQI?Pn0MM6FZ@8RTY9lbmx*9RB4Q1f4y6&CBIa&*aI!MR{ty|m zIsVg?=!wL^lKVx@-}#I-{mlJqx>zGm4AEYIMsiF&K+`%2^#XzmLMPcw7!soZD*$w` zp&q_vm)lX7v;K?t{z611ztGk%UBvWfP|nE4u{lt-)paxAnk%qWr5owYokKxCL}1~C zrtex)`;E$8O<^1-qb3fXuJkX+kHR5%tV|+}o(;#Tf z+g_V?}zHcxekZl-3SlKq<_U32cH`)ofEJBs^k&O;3%RLGGkcpiP-a zh6)S%Qcf=K+ku&J-3*md`Pq?kR{+d$wu5Ji8OqSOU4_C=7@_?(%79BqXp;y zI{}p1LG+r}6yNOL#uG7;Zg50|5rT=bTdDI@SHuA>VGUZk1e`I>HQb!#uP!3H^vZTi z7Vn&|#jp};jzl~a41H|cT>v49y&L>^OX1ERlPr(9n2lKP!aa{!w2pceE-9)cMC($xf?g>*bXt&%JT?($Bawu!yhI4Ktaqg z>0UR*32HgGw(H~PyOl39Z?wPJHT1nCK=2@Lm#-(5|7(n`aE*V1xtmPL?f$n+BqYd~ zq~v~zq)~41#YHCUaRB*9f=K-3p^o#nQz$|B?HF+Vr1vQ>{_q~5xF6xmsmNd>>=#LG z{LGN7udT=K0aM_3$baFENGk9R{M?ePWg3t0+KqVer

6#MluK2U}q*s$>C3i3R!` zbm_@wXocc>ae@*BMveQuGX20@$chMJmk0P&sY6XQu`B(5WG(SV^5p+BbN_Y~4yzn572ipeGuy3s!8boyjfB6$mTS1vq-bmq;cd9TkHgSBSHgRd<%Zc;<1L6+c$^ZZW diff --git a/profiles/testProfile.js b/profiles/testProfile.js index 223100d..e63a331 100644 --- a/profiles/testProfile.js +++ b/profiles/testProfile.js @@ -1 +1 @@ -{"color": "#aa00ff", "theme": "trollian", "quirks": [], "handle": "testProfile"} \ No newline at end of file +{"color": "#aa00ff", "theme": "pesterchum", "quirks": [], "handle": "testProfile"} \ No newline at end of file diff --git a/setup-py2exe.py b/setup-py2exe.py new file mode 100644 index 0000000..2415bf1 --- /dev/null +++ b/setup-py2exe.py @@ -0,0 +1,174 @@ +# ======================================================# +# File automagically generated by GUI2Exe version 0.3 +# Andrea Gavana, 01 April 2007 +# ======================================================# + +# Let's start with some default (for me) imports... + +from distutils.core import setup +import py2exe +import glob +import os +import zlib +import shutil + +# Remove the build folder +shutil.rmtree("build", ignore_errors=True) + +# do the same for dist folder +shutil.rmtree("dist", ignore_errors=True) + +MANIFEST_TEMPLATE = """ + + + + %(prog)s + + + + + + + + + + + + + + + + + + + + +""" + +class Target(object): + """ A simple class that holds information on our executable file. """ + def __init__(self, **kw): + """ Default class constructor. Update as you need. """ + self.__dict__.update(kw) + + +# Ok, let's explain why I am doing that. +# Often, data_files, excludes and dll_excludes (but also resources) +# can be very long list of things, and this will clutter too much +# the setup call at the end of this file. So, I put all the big lists +# here and I wrap them using the textwrap module. + +data_files = [] + +includes = [] +excludes = ['_gtkagg', '_tkagg', 'bsddb', 'curses', 'email', 'pywin.debugger', + 'pywin.debugger.dbgcon', 'pywin.dialogs', 'tcl', + 'Tkconstants', 'Tkinter'] +packages = [] +dll_excludes = ['libgdk-win32-2.0-0.dll', 'libgobject-2.0-0.dll', 'tcl84.dll', + 'tk84.dll', + 'MSVCP90.dll', 'mswsock.dll', 'powrprof.dll'] +icon_resources = [] +bitmap_resources = [] +other_resources = [] +other_resources = [(24, 1, MANIFEST_TEMPLATE % dict(prog="MyAppName"))] + + +# This is a place where the user custom code may go. You can do almost +# whatever you want, even modify the data_files, includes and friends +# here as long as they have the same variable name that the setup call +# below is expecting. + + +# +# The following will copy the MSVC run time dll's +# (msvcm90.dll, msvcp90.dll and msvcr90.dll) and +# the Microsoft.VC90.CRT.manifest which I keep in the +# "Py26MSdlls" folder to the dist folder +# +# depending on wx widgets you use, you might need to add +# gdiplus.dll to the above collection + +py26MSdll = glob.glob(r"c:\Dev\Py26MSdlls-9.0.21022.8\msvc\*.*") + +# install the MSVC 9 runtime dll's into the application folder +data_files += [("", py26MSdll),] + +# I found on some systems one has to put them into sub-folders. +##data_files += [("Microsoft.VC90.CRT", py26MSdll), +## ("lib\Microsoft.VC90.CRT", py26MSdll)] + + + +# Ok, now we are going to build our target class. +# I chose this building strategy as it works perfectly for me :-D + + +GUI2Exe_Target_1 = Target( + # what to build + script = "test.py", + icon_resources = icon_resources, + bitmap_resources = bitmap_resources, + other_resources = other_resources, + dest_base = "test", + version = "0.1", + company_name = "No Company", + copyright = "No Copyrights", + name = "Py2Exe Sample File" + ) + + + +# That's serious now: we have all (or almost all) the options py2exe +# supports. I put them all even if some of them are usually defaulted +# and not used. Some of them I didn't even know about. + +setup( + + data_files = data_files, + + options = {"py2exe": {"compressed": 2, + "optimize": 2, + "includes": includes, + "excludes": excludes, + "packages": packages, + "dll_excludes": dll_excludes, + "bundle_files": 2, + "dist_dir": "dist", + "xref": False, + "skip_archive": False, + "ascii": False, + "custom_boot_script": '', + } + }, + + zipfile = "lib\library.zip", + console = [], + windows = [GUI2Exe_Target_1] + ) + +# This is a place where any post-compile code may go. +# You can add as much code as you want, which can be used, for example, +# to clean up your folders or to do some particular post-compilation +# actions. + +# And we are done. That's a setup script :-D diff --git a/setup.py b/setup.py new file mode 100644 index 0000000..3454796 --- /dev/null +++ b/setup.py @@ -0,0 +1,32 @@ +from cx_Freeze import setup, Executable +import sys +import os +import shutil + +if sys.platform == "win32": + base = "Win32GUI" +else: + base = "Console" + +setup( + name = "P3ST3RCHUM", + version = "3.14", + description = "P3ST3RCHUM", + executables = [Executable("pesterchum.py", + base=base, + icon="pesterchum.ico", + compress=True, + )]) +if sys.platform == "win32": + os.rename("build/exe.win32-2.6", "build/pesterchum") + +shutil.copytree("themes", "build/pesterchum/themes") +shutil.copytree("imageformats", "build/pesterchum/imageformats") +shutil.copy("pesterchum.js", "build/pesterchum/") +shutil.copy("C:/Dev/Py26MSdlls-9.0.21022.8/msvc/msvcm90.dll", "build/pesterchum") +shutil.copy("C:/Dev/Py26MSdlls-9.0.21022.8/msvc/msvcp90.dll", "build/pesterchum") +shutil.copy("C:/Dev/Py26MSdlls-9.0.21022.8/msvc/msvcr90.dll", "build/pesterchum") +shutil.copy("C:/Dev/Py26MSdlls-9.0.21022.8/msvc/x86_Microsoft.VC90.CRT_1fc8b3b9a1e18e3b_9.0.21022.8_x-ww_d08d0375.manifest", + "build/pesterchum") +os.mkdir("build/pesterchum/profiles") +os.mkdir("build/pesterchum/logs") diff --git a/themes/pesterchum/memo.png b/themes/pesterchum/memo.png new file mode 100644 index 0000000000000000000000000000000000000000..f4eaa2eac998b2ef308302963c01f9667ee6e445 GIT binary patch literal 265 zcmeAS@N?(olHy`uVBq!ia0vp^0wB!61|;P_|4#%`jKx9jP7LeL$-D$|*pj^6T^Rm@ z;DWu&Cj&(|3p^r=85p>QL70(Y)*K0-AbW|YuPgg)CKeWEzAoXAWT22_iEBiObAE1a zYF-J0b5UwyNotBhd1gt5g1e`0KzJjcI8afFr;B5V#p$<`E%^>8@UYl+)Vu$bw7+el zAh@pK&N0!WRTAE2lgl@W7X&QZNoz&(xNB62HMBq>FVdQ&MBb@04v;7 Ad;kCd literal 0 HcmV?d00001 diff --git a/themes/pesterchum/style.js b/themes/pesterchum/style.js index 8406246..0d3abb4 100644 --- a/themes/pesterchum/style.js +++ b/themes/pesterchum/style.js @@ -17,6 +17,7 @@ "sounds": { "alertsound": "$path/alarm.wav" }, "menus": {"client": {"_name": "CLIENT", "options": "OPTIONS", + "memos": "MEMOS", "userlist": "USERLIST", "exit": "EXIT"}, "profile": {"_name": "PROFILE", @@ -183,6 +184,7 @@ }, "convo": {"style": "background: #fdb302; border:2px solid yellow; font-family: 'Courier'", + "margins": {"top": 0, "bottom": 0, "left": 0, "right": 0 }, "size": [295, 191], "chumlabel": { "style": "background: rgb(196, 138, 0); color: white; border:0px;", "align": { "h": "center", "v": "center" }, @@ -209,6 +211,25 @@ "unblocked": "unblocked" }, "systemMsgColor": "#646464" + }, + "memos": + {"memoicon": "$path/memo.png", + "style": "background: #fdb302; font-family:'Courier';font:bold;selection-background-color:#919191; ", + "size": [600,300], + "label": { "text": "$channel", + "style": "background: rgb(196, 138, 0); color: white; border:0px;", + "align": { "h": "center", "v": "center" }, + "minheight": 30, + "maxheight": 50 + }, + "input": { "style": "background: white; border:2px solid #c48a00;margin-top:5px;" }, + "textarea": { "style": "background: white; font:bold; border:2px solid #c48a00;text-align:center;" }, + "margins": {"top": 0, "bottom": 0, "left": 0, "right": 0 }, + "userlist": { "width": 150 }, + "time": { "text": { "width": 75, "style": "" }, + "slider": { "style": "", + "groove": "", + "handle": "" } + } } - } \ No newline at end of file diff --git a/themes/trollian/memo.png b/themes/trollian/memo.png new file mode 100644 index 0000000000000000000000000000000000000000..c5edf5f4622c5c777960508a2caa5a64a27627c1 GIT binary patch literal 265 zcmeAS@N?(olHy`uVBq!ia0vp^0wB!61|;P_|4#%`jKx9jP7LeL$-D$|*pj^6T^Rm@ z;DWu&Cj&(|3p^r=85p>QL70(Y)*K0-AbW|YuPgg)CKeWEsR<_=mdKI;Vst0GxDH AD*ylh literal 0 HcmV?d00001 diff --git a/themes/trollian/style.js b/themes/trollian/style.js index 300a32e..bf0d2d8 100644 --- a/themes/trollian/style.js +++ b/themes/trollian/style.js @@ -10,13 +10,14 @@ "loc": [621, 8]}, "menubar": { "style": "font-family: 'Arial'; font-size: 11px; color: rgba(0,0,0,0);" }, "menu" : { "style": "font-family: 'Arial'; font-size: 11px; background-color: #c2c2c2; border:1px solid #545454;", - "selected": "background-color: #545454", - "menuitem": "margin-right:14px;", - "loc": [14,90] + "selected": "background-color: #545454", + "menuitem": "margin-right:14px;", + "loc": [14,90] }, "sounds": { "alertsound": "$path/alarm.wav" }, "menus": {"client": {"_name": "Trollian", "options": "Options", + "memos": "Memos", "userlist": "Fresh Targets", "exit": "Abscond"}, "profile": {"_name": "View", @@ -31,58 +32,58 @@ "addchum": "Add Chump", "unblockchum": "Mercy"} }, - "chums": { "style": "border: 0px; background-color: white; padding: 5px; font-family: 'Arial';selection-background-color:rgb(200,200,200); ", - "loc": [476, 90], + "chums": { "style": "font-size: 12px; background: white; border:2px solid #c2c2c2; padding: 5px; font-family: 'Arial';selection-background-color:rgb(200,200,200); ", + "loc": [475, 89], "size": [175, 361], "userlistcolor": "black", - "moods": { - -"chummy": { "icon": "$path/chummy.png", "color": "#63ea00" }, - -"rancorous": { "icon": "$path/rancorous.png", "color": "#7f7f7f" }, - -"offline": { "icon": "$path/offline.png", "color": "black"}, - - -"pleasant": { "icon": "$path/pleasant.png", "color": "#d69df8" }, - -"distraught": { "icon": "$path/distraught.png", "color": "#706eba" }, - -"unruly": { "icon": "$path/unruly.png", "color": "blue" }, - - -"smooth": { "icon": "$path/smooth.png", "color": "red" }, - - -"ecstatic": { "icon": "$path/ecstatic.png", "color": "#99004d" }, - -"relaxed": { "icon": "$path/relaxed.png", "color": "#078446" }, - -"discontent": { "icon": "$path/discontent.png", "color": "#a75403" }, - -"devious": { "icon": "$path/devious.png", "color": "#008282" }, - -"sleek": { "icon": "$path/sleek.png", "color": "#a1a100" }, - -"detestful": { "icon": "$path/detestful.png", "color": "#6a006a" }, - -"mirthful": { "icon": "$path/mirthful.png", "color": "#450077" }, - -"manipulative": { "icon": "$path/manipulative.png", "color": "#004182" }, - -"vigorous": { "icon": "$path/vigorous.png", "color": "#0021cb" }, - -"perky": { "icon": "$path/perky.png", "color": "#406600" }, - -"acceptant": { "icon": "$path/acceptant.png", "color": "#a10000" }, - -"protective": { "icon": "$path/protective.png", "color": "white" }, - -"blocked": { "icon": "$path/blocked.png", "color": "black" } - - } + "moods": { + + "chummy": { "icon": "$path/chummy.png", "color": "#63ea00" }, + + "rancorous": { "icon": "$path/rancorous.png", "color": "#7f7f7f" }, + + "offline": { "icon": "$path/offline.png", "color": "black"}, + + + "pleasant": { "icon": "$path/pleasant.png", "color": "#d69df8" }, + + "distraught": { "icon": "$path/distraught.png", "color": "#706eba" }, + + "unruly": { "icon": "$path/unruly.png", "color": "blue" }, + + + "smooth": { "icon": "$path/smooth.png", "color": "red" }, + + + "ecstatic": { "icon": "$path/ecstatic.png", "color": "#99004d" }, + + "relaxed": { "icon": "$path/relaxed.png", "color": "#078446" }, + + "discontent": { "icon": "$path/discontent.png", "color": "#a75403" }, + + "devious": { "icon": "$path/devious.png", "color": "#008282" }, + + "sleek": { "icon": "$path/sleek.png", "color": "#a1a100" }, + + "detestful": { "icon": "$path/detestful.png", "color": "#6a006a" }, + + "mirthful": { "icon": "$path/mirthful.png", "color": "#450077" }, + + "manipulative": { "icon": "$path/manipulative.png", "color": "#004182" }, + + "vigorous": { "icon": "$path/vigorous.png", "color": "#0021cb" }, + + "perky": { "icon": "$path/perky.png", "color": "#406600" }, + + "acceptant": { "icon": "$path/acceptant.png", "color": "#a10000" }, + + "protective": { "icon": "$path/protective.png", "color": "white" }, + + "blocked": { "icon": "$path/blocked.png", "color": "black" } + + } }, - "trollslum": { + "trollslum": { "style": "background: rgb(190, 19, 4); font-family: 'Arial'", "size": [175, 461], "label": { "text": "Chumpdump", @@ -99,7 +100,7 @@ "size": [0,0], "text": "" } }, - "defaultwindow": { "style": "background: #c2c2c2; font-family:'Arial';font:bold;selection-background-color:#545454; " + "defaultwindow": { "style": "background: #c2c2c2; font-family:'Arial';font:bold;selection-background-color:#545454; " }, "addchum": { "style": "background: rgba(0,0,0,0); border:0px; color: rgba(0,0,0,0);", "loc": [475, 67], @@ -107,142 +108,143 @@ "text": "" }, "pester": { "style": "background: rgba(0,0,0,0); border:0px; color: rgba(0,0,0,0);", - "loc": [0,0], - "size": [0, 0], - "text": "" - }, + "loc": [0,0], + "size": [0, 0], + "text": "" + }, "block": { "style": "background: rgba(0,0,0,0); border:0px; color: rgba(0,0,0,0);", - "loc": [1500,202], - "size": [71, 22], - "text": "" - }, + "loc": [1500,202], + "size": [71, 22], + "text": "" + }, "defaultmood": 7, "moodlabel": { "style": "", - "loc": [0, 0], - "text": "" - }, + "loc": [0, 0], + "text": "" + }, "moods": [ - { "style": "border:0px;", - "selected": "background-image:url($path/moodcheck1.png); border:0px;", - "loc": [25, 141], - "size": [20, 270], - "text": "", - "icon": "", - "mood": 17 - }, - { "style": "border:0px;", - "selected": "background-image:url($path/moodcheck2.png); border:0px;", - "loc": [60, 141], - "size": [20, 270], - "text": "", - "icon": "", - "mood": 9 - }, - { "style": "border:0px;", - "selected": "background-image:url($path/moodcheck3.png); border:0px;", - "loc": [95, 141], - "size": [20, 270], - "text": "", - "icon": "", - "mood": 11 - }, - { "style": "border:0px;", - "selected": "background-image:url($path/moodcheck4.png); border:0px;", - "loc": [130, 141], - "size": [20, 270], - "text": "", - "icon": "", - "mood": 1 - }, - { "style": "border:0px;", - "selected": "background-image:url($path/moodcheck5.png); border:0px;", - "loc": [165, 141], - "size": [20, 270], - "text": "", - "icon": "", - "mood": 16 - }, - { "style": "border:0px;", - "selected": "background-image:url($path/moodcheck6.png); border:0px;", - "loc": [200, 141], - "size": [20, 270], - "text": "", - "icon": "", - "mood": 8 - }, - { "style": "border:0px;", - "selected": "background-image:url($path/moodcheck7.png); border:0px;", - "loc": [235, 141], - "size": [20, 270], - "text": "", - "icon": "", - "mood": 10 - }, - { "style": "border:0px;", - "selected": "background-image:url($path/moodcheck8.png); border:0px;", - "loc": [270, 141], - "size": [20, 270], - "text": "", - "icon": "", - "mood": 14 - }, - { "style": "border:0px;", - "selected": "background-image:url($path/moodcheck9.png); border:0px;", - "loc": [305, 141], - "size": [20, 270], - "text": "", - "icon": "", - "mood": 15 - }, - { "style": "border:0px;", - "selected": "background-image:url($path/moodcheck10.png); border:0px;", - "loc": [340, 141], - "size": [20, 270], - "text": "", - "icon": "", - "mood": 13 - }, - { "style": "border:0px;", - "selected": "background-image:url($path/moodcheck11.png); border:0px;", - "loc": [375, 141], - "size": [20, 270], - "text": "", - "icon": "", - "mood": 12 - }, - { "style": "border:0px;", - "selected": "background-image:url($path/moodcheck12.png); border:0px;", - "loc": [410, 141], - "size": [20, 270], - "text": "", - "icon": "", - "mood": 7 - }, - - { "style": "border:0px;color: rgba(0, 0, 0, 0%);", - "selected": "border:0px; color: rgba(0, 0, 0, 0%);", - "loc": [12, 117], - "size": [435, 18], - "text": "", - "icon": "", - "mood": 2 - } + { "style": "border:0px;", + "selected": "background-image:url($path/moodcheck1.png); border:0px;", + "loc": [25, 141], + "size": [20, 270], + "text": "", + "icon": "", + "mood": 17 + }, + { "style": "border:0px;", + "selected": "background-image:url($path/moodcheck2.png); border:0px;", + "loc": [60, 141], + "size": [20, 270], + "text": "", + "icon": "", + "mood": 9 + }, + { "style": "border:0px;", + "selected": "background-image:url($path/moodcheck3.png); border:0px;", + "loc": [95, 141], + "size": [20, 270], + "text": "", + "icon": "", + "mood": 11 + }, + { "style": "border:0px;", + "selected": "background-image:url($path/moodcheck4.png); border:0px;", + "loc": [130, 141], + "size": [20, 270], + "text": "", + "icon": "", + "mood": 1 + }, + { "style": "border:0px;", + "selected": "background-image:url($path/moodcheck5.png); border:0px;", + "loc": [165, 141], + "size": [20, 270], + "text": "", + "icon": "", + "mood": 16 + }, + { "style": "border:0px;", + "selected": "background-image:url($path/moodcheck6.png); border:0px;", + "loc": [200, 141], + "size": [20, 270], + "text": "", + "icon": "", + "mood": 8 + }, + { "style": "border:0px;", + "selected": "background-image:url($path/moodcheck7.png); border:0px;", + "loc": [235, 141], + "size": [20, 270], + "text": "", + "icon": "", + "mood": 10 + }, + { "style": "border:0px;", + "selected": "background-image:url($path/moodcheck8.png); border:0px;", + "loc": [270, 141], + "size": [20, 270], + "text": "", + "icon": "", + "mood": 14 + }, + { "style": "border:0px;", + "selected": "background-image:url($path/moodcheck9.png); border:0px;", + "loc": [305, 141], + "size": [20, 270], + "text": "", + "icon": "", + "mood": 15 + }, + { "style": "border:0px;", + "selected": "background-image:url($path/moodcheck10.png); border:0px;", + "loc": [340, 141], + "size": [20, 270], + "text": "", + "icon": "", + "mood": 13 + }, + { "style": "border:0px;", + "selected": "background-image:url($path/moodcheck11.png); border:0px;", + "loc": [375, 141], + "size": [20, 270], + "text": "", + "icon": "", + "mood": 12 + }, + { "style": "border:0px;", + "selected": "background-image:url($path/moodcheck12.png); border:0px;", + "loc": [410, 141], + "size": [20, 270], + "text": "", + "icon": "", + "mood": 7 + }, + + { "style": "border:0px;color: rgba(0, 0, 0, 0%);", + "selected": "border:0px; color: rgba(0, 0, 0, 0%);", + "loc": [12, 117], + "size": [435, 18], + "text": "", + "icon": "", + "mood": 2 + } ] }, "convo": {"style": "background: rgb(190, 19, 4); font-family: 'Arial';", - "size": [308, 194], - "chumlabel": { "style": "background: rgb(255, 38, 18); color: white;", - "align": { "h": "center", "v": "center" }, - "minheight": 30, - "maxheight": 50, - "text" : "trolling: $handle" + "margins": {"top": 22, "bottom": 9, "left": 10, "right": 4 }, + "size": [400, 250], + "chumlabel": { "style": "background: rgb(255, 38, 18); color: white; padding: 2px; border:1px solid #c2c2c2;", + "align": { "h": "left", "v": "center" }, + "minheight": 18, + "maxheight": 18, + "text" : "trolling: $handle" }, "textarea": { - "style": "background: white; border:0px;" + "style": "background: white; border:2px solid #c2c2c2; font-size: 12px; margin-top: 4px;" }, "input": { - "style": "background: white; border:0px solid #c48a00;margin-top:5px;" + "style": "background: white;margin-top:5px; border:1px solid #c2c2c2; margin-right: 54px; font-size: 12px;" }, "tabs": { "style": "", @@ -257,6 +259,10 @@ "unblocked": "mercifully forgave" }, "systemMsgColor": "#646464" - } - + }, + "memos": + {"memoicon": "$path/memo.png" + + } + } \ No newline at end of file diff --git a/tmp.py b/tmp.py new file mode 100644 index 0000000..937377c --- /dev/null +++ b/tmp.py @@ -0,0 +1,18 @@ +class PesterMemo(PesterConvo): + def __init__() + def updateMood: pass + def updateBlocked + def updateColor: pass + def addMessage + def notifyNewMessage + def clearNewMessage + def changeTheme + + slot + def sentMessage + + messageSent - signal -> sendMessage -> sendMessage(Memo) + windowClosed - signal -> closeMemo + + self.textInput + self.textArea