0.1.3
This commit is contained in:
parent
c7987a37aa
commit
2cde4e6ec7
6 changed files with 20 additions and 8 deletions
2
TODO
2
TODO
|
@ -1,12 +1,10 @@
|
||||||
Features:
|
Features:
|
||||||
* More complex quirks: spelling, by-sound
|
* More complex quirks: spelling, by-sound
|
||||||
* random quirk string enter must clear text box and focus input on add
|
|
||||||
* IRC message limit!!!
|
* IRC message limit!!!
|
||||||
* on ban, redirect to memo chooser
|
* on ban, redirect to memo chooser
|
||||||
* ? time option???
|
* ? time option???
|
||||||
* help menu -- about and forum
|
* help menu -- about and forum
|
||||||
* Tray doesn't disappear on windows after close
|
* Tray doesn't disappear on windows after close
|
||||||
* memo sending from unknown color breaks -- over IRC??
|
|
||||||
-- release alpha
|
-- release alpha
|
||||||
* shared buddy lists - changes to the buddy list should refresh it?
|
* shared buddy lists - changes to the buddy list should refresh it?
|
||||||
multiple clients share buddy list???
|
multiple clients share buddy list???
|
||||||
|
|
13
dataobjs.py
13
dataobjs.py
|
@ -92,26 +92,29 @@ class pesterQuirks(object):
|
||||||
q.type=='replace' or q.type=='regexp']
|
q.type=='replace' or q.type=='regexp']
|
||||||
random = [q for q in self.quirklist if q.type=='random']
|
random = [q for q in self.quirklist if q.type=='random']
|
||||||
|
|
||||||
firstStr = True
|
|
||||||
newlist = []
|
newlist = []
|
||||||
for (i, o) in enumerate(lexed):
|
for (i, o) in enumerate(lexed):
|
||||||
if type(o) not in [str, unicode]:
|
if type(o) not in [str, unicode]:
|
||||||
|
if i == 0:
|
||||||
|
string = " "
|
||||||
|
for p in prefix:
|
||||||
|
string += p.apply(string)
|
||||||
|
newlist.append(string)
|
||||||
newlist.append(o)
|
newlist.append(o)
|
||||||
continue
|
continue
|
||||||
lastStr = (i == len(lexed)-1)
|
lastStr = (i == len(lexed)-1)
|
||||||
string = o
|
string = o
|
||||||
for r in random:
|
for r in random:
|
||||||
string = r.apply(string, first=firstStr, last=lastStr)
|
string = r.apply(string, first=(i==0), last=lastStr)
|
||||||
for r in replace:
|
for r in replace:
|
||||||
string = r.apply(string, first=firstStr, last=lastStr)
|
string = r.apply(string, first=(i==0), last=lastStr)
|
||||||
if firstStr:
|
if i == 0:
|
||||||
for p in prefix:
|
for p in prefix:
|
||||||
string = p.apply(string)
|
string = p.apply(string)
|
||||||
if lastStr:
|
if lastStr:
|
||||||
for s in suffix:
|
for s in suffix:
|
||||||
string = s.apply(string)
|
string = s.apply(string)
|
||||||
newlist.append(string)
|
newlist.append(string)
|
||||||
firstStr = False
|
|
||||||
|
|
||||||
return newlist
|
return newlist
|
||||||
|
|
||||||
|
|
BIN
dataobjs.pyc
BIN
dataobjs.pyc
Binary file not shown.
13
menus.py
13
menus.py
|
@ -101,12 +101,13 @@ class RandomQuirkDialog(MultiTextDialog):
|
||||||
text = unicode(self.replaceinput.text())
|
text = unicode(self.replaceinput.text())
|
||||||
item = QtGui.QListWidgetItem(text, self.replacelist)
|
item = QtGui.QListWidgetItem(text, self.replacelist)
|
||||||
self.replaceinput.setText("")
|
self.replaceinput.setText("")
|
||||||
|
self.replaceinput.setFocus()
|
||||||
@QtCore.pyqtSlot()
|
@QtCore.pyqtSlot()
|
||||||
def removeRandomString(self):
|
def removeRandomString(self):
|
||||||
if not self.replacelist.currentItem():
|
if not self.replacelist.currentItem():
|
||||||
return
|
return
|
||||||
else:
|
else:
|
||||||
self.replacelist.takeItem(self.currentRow())
|
self.replacelist.takeItem(self.replacelist.currentRow())
|
||||||
self.replaceinput.setFocus()
|
self.replaceinput.setFocus()
|
||||||
|
|
||||||
class PesterChooseQuirks(QtGui.QDialog):
|
class PesterChooseQuirks(QtGui.QDialog):
|
||||||
|
@ -175,6 +176,8 @@ class PesterChooseQuirks(QtGui.QDialog):
|
||||||
@QtCore.pyqtSlot()
|
@QtCore.pyqtSlot()
|
||||||
def addPrefixDialog(self):
|
def addPrefixDialog(self):
|
||||||
pdict = MultiTextDialog("ENTER PREFIX", self, {"label": "Value:", "inputname": "value"}).getText()
|
pdict = MultiTextDialog("ENTER PREFIX", self, {"label": "Value:", "inputname": "value"}).getText()
|
||||||
|
if pdict is None:
|
||||||
|
return
|
||||||
pdict["type"] = "prefix"
|
pdict["type"] = "prefix"
|
||||||
prefix = pesterQuirk(pdict)
|
prefix = pesterQuirk(pdict)
|
||||||
pitem = PesterQuirkItem(prefix, self.quirkList)
|
pitem = PesterQuirkItem(prefix, self.quirkList)
|
||||||
|
@ -183,6 +186,8 @@ class PesterChooseQuirks(QtGui.QDialog):
|
||||||
@QtCore.pyqtSlot()
|
@QtCore.pyqtSlot()
|
||||||
def addSuffixDialog(self):
|
def addSuffixDialog(self):
|
||||||
vdict = MultiTextDialog("ENTER SUFFIX", self, {"label": "Value:", "inputname": "value"}).getText()
|
vdict = MultiTextDialog("ENTER SUFFIX", self, {"label": "Value:", "inputname": "value"}).getText()
|
||||||
|
if vdict is None:
|
||||||
|
return
|
||||||
vdict["type"] = "suffix"
|
vdict["type"] = "suffix"
|
||||||
quirk = pesterQuirk(vdict)
|
quirk = pesterQuirk(vdict)
|
||||||
item = PesterQuirkItem(quirk, self.quirkList)
|
item = PesterQuirkItem(quirk, self.quirkList)
|
||||||
|
@ -191,6 +196,8 @@ class PesterChooseQuirks(QtGui.QDialog):
|
||||||
@QtCore.pyqtSlot()
|
@QtCore.pyqtSlot()
|
||||||
def addSimpleReplaceDialog(self):
|
def addSimpleReplaceDialog(self):
|
||||||
vdict = MultiTextDialog("REPLACE", self, {"label": "Replace:", "inputname": "from"}, {"label": "With:", "inputname": "to"}).getText()
|
vdict = MultiTextDialog("REPLACE", self, {"label": "Replace:", "inputname": "from"}, {"label": "With:", "inputname": "to"}).getText()
|
||||||
|
if vdict is None:
|
||||||
|
return
|
||||||
vdict["type"] = "replace"
|
vdict["type"] = "replace"
|
||||||
quirk = pesterQuirk(vdict)
|
quirk = pesterQuirk(vdict)
|
||||||
item = PesterQuirkItem(quirk, self.quirkList)
|
item = PesterQuirkItem(quirk, self.quirkList)
|
||||||
|
@ -199,6 +206,8 @@ class PesterChooseQuirks(QtGui.QDialog):
|
||||||
@QtCore.pyqtSlot()
|
@QtCore.pyqtSlot()
|
||||||
def addRegexpDialog(self):
|
def addRegexpDialog(self):
|
||||||
vdict = MultiTextDialog("REGEXP REPLACE", self, {"label": "Regexp:", "inputname": "from"}, {"label": "Replace With:", "inputname": "to"}).getText()
|
vdict = MultiTextDialog("REGEXP REPLACE", self, {"label": "Regexp:", "inputname": "from"}, {"label": "Replace With:", "inputname": "to"}).getText()
|
||||||
|
if vdict is None:
|
||||||
|
return
|
||||||
vdict["type"] = "regexp"
|
vdict["type"] = "regexp"
|
||||||
try:
|
try:
|
||||||
re.compile(vdict["from"])
|
re.compile(vdict["from"])
|
||||||
|
@ -216,6 +225,8 @@ class PesterChooseQuirks(QtGui.QDialog):
|
||||||
@QtCore.pyqtSlot()
|
@QtCore.pyqtSlot()
|
||||||
def addRandomDialog(self):
|
def addRandomDialog(self):
|
||||||
vdict = RandomQuirkDialog(self).getText()
|
vdict = RandomQuirkDialog(self).getText()
|
||||||
|
if vdict is None:
|
||||||
|
return
|
||||||
vdict["type"] = "random"
|
vdict["type"] = "random"
|
||||||
try:
|
try:
|
||||||
re.compile(vdict["from"])
|
re.compile(vdict["from"])
|
||||||
|
|
BIN
menus.pyc
BIN
menus.pyc
Binary file not shown.
BIN
parsetools.pyc
BIN
parsetools.pyc
Binary file not shown.
Loading…
Reference in a new issue