In fact, did not get images working in OSX. Removed extraeous debugging and fix attempts.

This commit is contained in:
Lexi 2011-08-10 18:42:54 +01:00
parent c729c7326c
commit 33a57686d0
2 changed files with 6 additions and 5 deletions

View file

@ -345,6 +345,10 @@ class PesterText(QtGui.QTextEdit):
"%s: " % (initials)]
lexmsg.append(colorEnd("</c>"))
self.append("<span style=\"color:#000000\">" + time + convertTags(lexmsg) + "</span>")
#self.append('<img src="/Users/lexi/pesterchum-lex/smilies/tab.gif" />'
# + '<img src="/Users/lexi/pesterchum/smilies/tab.gif" />'
# + '<img src="/Applications/Pesterchum.app/Contents/Resources/smilies/tab.gif" />'
# + '<img src="smilies/tab.gif" />');
if chum is me:
window.chatlog.log(parent.chum.handle, lexmsg)
else:

View file

@ -1,6 +1,5 @@
import re
import random
from os.path import abspath
from copy import copy
from datetime import timedelta
from PyQt4 import QtGui
@ -22,8 +21,6 @@ quirkloader = PythonQuirks()
_functionre = re.compile(r"%s" % quirkloader.funcre())
_groupre = re.compile(r"\\([0-9]+)")
_path = abspath('.')
def reloadQuirkFunctions():
quirkloader.load()
global _functionre
@ -139,7 +136,7 @@ class smiley(object):
self.string = string
def convert(self, format):
if format == "html":
return "<img src='%s/smilies/%s' alt='%s' title='%s' />" % (_path, smiledict[self.string], self.string, self.string)
return "<img src='smilies/%s' alt='%s' title='%s' />" % (smiledict[self.string], self.string, self.string)
else:
return self.string
class mecmd(object):
@ -371,7 +368,7 @@ def img2smiley(string):
string = unicode(string)
def imagerep(mo):
return reverse_smiley[mo.group(1)]
string = re.sub(r'<img src=".*/smilies/(\S+)" />', imagerep, string)
string = re.sub(r'<img src="smilies/(\S+)" />', imagerep, string)
return string
smiledict = {