new way to create emoticons.py file. fixes #3696

This commit is contained in:
Yann Leboulanger 2008-03-10 23:26:04 +00:00
parent 6e84de1fbe
commit d17b5b7bad
4 changed files with 136 additions and 255 deletions

View File

@ -1,76 +1,50 @@
# coding=utf-8
emoticons = {
':-[': 'bat.gif',
':[': 'bat.gif',
'(ci)': 'cigarette.gif',
'(^)': 'cake.gif',
":'(": 'cry.gif',
';(': 'cry.gif',
':^)': 'dontknow.gif',
'8-)': 'eyeroll.gif',
'(li)': 'lightning.gif',
'<:o)': 'party.gif',
'|-)': 'sleepy.gif',
'*-)': 'think.gif',
';)': 'wink.gif',
';-)': 'wink.gif',
# now static (only those that don't have animated)
':-)': 'smile.png',
'(@)': 'pussy.png',
'8)': 'coolglasses.png',
':(': 'unhappy.png',
':)': 'smile.png',
':/': 'frowning.png',
':-/': 'frowning.png',
'(})': 'hugleft.png',
':$': 'blush.png',
'(Y)': 'thumbup.png',
':-@': 'angry.png',
':-D': 'biggrin.png',
'(U)': 'brheart.png',
'(F)': 'flower.png',
':>': 'biggrin.png',
'(T)': 'phone.png',
':-S': 'frowning.png',
':-P': 'tongue.png',
'(H)': 'coolglasses.png',
'(D)': 'drink.png',
':-O': 'oh.png',
'(C)': 'coffee.png',
'({)': 'hugright.png',
'(*)': 'star.png',
'B-)': 'coolglasses.png',
'(Z)': 'boy.png',
'(X)': 'girl.png',
'(E)': 'mail.png',
'(N)': 'thumbdown.png',
'(P)': 'photo.png',
'(K)': 'kiss.png',
':-*': 'kiss.png',
':*': 'kiss.png',
'(R)': 'rainbow.png',
':-|': 'stare.png',
'(6)': 'devil.png',
'>:)': 'devil.png',
'>:-)': 'devil.png',
'(L)': 'heart.png',
'<3': 'heart.png',
'(W)': 'brflower.png',
':|': 'stare.png',
':O': 'oh.png',
':S': 'frowning.png',
':-(': 'unhappy.png',
'8-)': 'coolglasses.png',
'(B)': 'beer.png',
':D': 'biggrin.png',
'(8)': 'music.png',
':@': 'angry.png',
'B)': 'coolglasses.png',
':-$': 'blush.png',
':->': 'biggrin.png',
'(I)': 'lamp.png',
':P': 'tongue.png',
'(%)': 'cuffs.png',
'(S)': 'moon.png',
'smile.png': [':)', ':-)'],
'coolglasses.png': ['B-)', '(H)'],
'wink.gif': [';)', ';-)'],
'biggrin.png': [':D', ':-D', ':>', ':->', 'xD'],
'unhappy.png': [':(', ':-('],
'cry.gif': [":'(", ';-(', ';(', ";'-("],
'frowning.png': [':/', ':-/', ':S', ':-S'],
'blush.png': [':$', ':-$'],
'angry.png': [':@', ':-@'],
'bat.gif': [':[', ':-['],
'kiss.png': [':*', ':-*', '(K)'],
'stare.png': [':|', ':-|'],
'devil.png': ['>:)', '>:-)', '(6)'],
'tongue.png': [':P', ':-P'],
'oh.png': [':O', ':-O'],
'heart.png': ['<3', '(L)'],
'pussy.png': ['(@)'],
'cuffs.png': ['(%)'],
'moon.png': ['(S)'],
'lamp.png': ['(I)'],
'music.png': ['(8)'],
'beer.png': ['(B)'],
'brflower.png': ['(W)'],
'boy.png': ['(Z)'],
'girl.png': ['(X)'],
'mail.png': ['(E)'],
'thumbdown.png': ['(N)'],
'photo.png': ['(P)'],
'thumbup.png': ['(Y)'],
'hugleft.png': ['(})'],
'brheart.png': ['(U)'],
'flower.png': ['(F)'],
'drink.png': ['(D)'],
'phone.png': ['(T)'],
'coffee.png': ['(C)'],
'hugright.png': ['({)'],
'star.png': ['(*)'],
'rainbow.png': ['(R)'],
'cigarette.gif': ['(ci)'],
'cake.gif': ['(^)'],
'dontknow.gif': [':^)'],
'eyeroll.gif': ['8-)'],
'lightning.gif': ['(li)'],
'party.gif': ['<:o)'],
'sleepy.gif': ['|-)'],
'think.gif': ['*-)'],
}

View File

@ -1,89 +1,42 @@
# coding=utf-8
emoticons = {
':-)': 'smile.png',
':)': 'smile.png',
#
'B-)': 'coolglasses.png',
'8-)': 'coolglasses.png',
#
';-)': 'wink.png',
';)': 'wink.png',
#
':-D': 'biggrin.png',
':->': 'biggrin.png',
':D': 'biggrin.png',
':>': 'biggrin.png',
'xD': 'biggrin.png',
#
':-(': 'unhappy.png',
':(': 'unhappy.png',
#
":'(": 'cry.png',
';-(': 'cry.png',
';(': 'cry.png',
";'-(": 'cry.png',
#
':-/': 'frowning.png',
':/': 'frowning.png',
':-S': 'frowning.png',
':S': 'frowning.png',
#
':-$': 'blush.png',
':$': 'blush.png',
#
':-@': 'angry.png',
':@': 'angry.png',
#
':-[': 'bat.png',
#
':-*': 'kiss.png',
':*': 'kiss.png',
#
':-|': 'stare.png',
':|': 'stare.png',
#
'>:-)': 'devil.png',
'>:)': 'devil.png',
#
':-P': 'tongue.png',
':P': 'tongue.png',
#
':-O': 'oh.png',
':O': 'oh.png',
#
'<3': 'heart.png',
#
':-[': 'bat.png',
':[': 'bat.png',
#
'>:3': 'lion.png',
':3': 'lion.png',
#
#MSN ones
'(@)': 'pussy.png',
'(%)': 'cuffs.png',
'(S)': 'moon.png',
'(I)': 'lamp.png',
'(8)': 'music.png',
'(B)': 'beer.png',
'(L)': 'heart.png',
'(6)': 'devil.png',
'(W)': 'brflower.png',
'(Z)': 'boy.png',
'(X)': 'girl.png',
'(E)': 'mail.png',
'(N)': 'thumbdown.png',
'(P)': 'photo.png',
'(K)': 'kiss.png',
'(Y)': 'thumbup.png',
'(})': 'hugleft.png',
'(U)': 'brheart.png',
'(F)': 'flower.png',
'(H)': 'coolglasses.png',
'(D)': 'drink.png',
'(T)': 'phone.png',
'(C)': 'coffee.png',
'({)': 'hugright.png',
'(*)': 'star.png',
'(R)': 'rainbow.png',
'smile.png': [':)', ':-)'],
'coolglasses.png': ['8-)', 'B-)', '(H)'],
'wink.png': [';)', ';-)'],
'biggrin.png': [':D', ':-D', ':>', ':->', 'xD'],
'unhappy.png': [':(', ':-('],
'cry.png': [":'(", ';-(', ';(', ";'-("],
'frowning.png': [':/', ':-/', ':S', ':-S'],
'blush.png': [':$', ':-$'],
'angry.png': [':@', ':-@'],
'bat.png': [':[', ':-['],
'kiss.png': [':*', ':-*', '(K)'],
'stare.png': [':|', ':-|'],
'devil.png': ['>:)', '>:-)', '(6)'],
'tongue.png': [':P', ':-P'],
'oh.png': [':O', ':-O'],
'heart.png': ['<3', '(L)'],
'lion.png': [':3', '>:3'],
'pussy.png': ['(@)'],
'cuffs.png': ['(%)'],
'moon.png': ['(S)'],
'lamp.png': ['(I)'],
'music.png': ['(8)'],
'beer.png': ['(B)'],
'brflower.png': ['(W)'],
'boy.png': ['(Z)'],
'girl.png': ['(X)'],
'mail.png': ['(E)'],
'thumbdown.png': ['(N)'],
'photo.png': ['(P)'],
'thumbup.png': ['(Y)'],
'hugleft.png': ['(})'],
'brheart.png': ['(U)'],
'flower.png': ['(F)'],
'drink.png': ['(D)'],
'phone.png': ['(T)'],
'coffee.png': ['(C)'],
'hugright.png': ['({)'],
'star.png': ['(*)'],
'rainbow.png': ['(R)'],
}

View File

@ -1,89 +1,42 @@
# coding=utf-8
emoticons = {
':-)': 'smile.png',
':)': 'smile.png',
#
'B-)': 'coolglasses.png',
'8-)': 'coolglasses.png',
#
';-)': 'wink.png',
';)': 'wink.png',
#
':-D': 'biggrin.png',
':->': 'biggrin.png',
':D': 'biggrin.png',
':>': 'biggrin.png',
'xD': 'biggrin.png',
#
':-(': 'unhappy.png',
':(': 'unhappy.png',
#
":'(": 'cry.png',
';-(': 'cry.png',
';(': 'cry.png',
";'-(": 'cry.png',
#
':-/': 'frowning.png',
':/': 'frowning.png',
':-S': 'frowning.png',
':S': 'frowning.png',
#
':-$': 'blush.png',
':$': 'blush.png',
#
':-@': 'angry.png',
':@': 'angry.png',
#
':-[': 'bat.png',
#
':-*': 'kiss.png',
':*': 'kiss.png',
#
':-|': 'stare.png',
':|': 'stare.png',
#
'>:-)': 'devil.png',
'>:)': 'devil.png',
#
':-P': 'tongue.png',
':P': 'tongue.png',
#
':-O': 'oh.png',
':O': 'oh.png',
#
'<3': 'heart.png',
#
':-[': 'bat.png',
':[': 'bat.png',
#
'>:3': 'lion.png',
':3': 'lion.png',
#
#MSN ones
'(@)': 'pussy.png',
'(%)': 'cuffs.png',
'(S)': 'moon.png',
'(I)': 'lamp.png',
'(8)': 'music.png',
'(B)': 'beer.png',
'(L)': 'heart.png',
'(6)': 'devil.png',
'(W)': 'brflower.png',
'(Z)': 'boy.png',
'(X)': 'girl.png',
'(E)': 'mail.png',
'(N)': 'thumbdown.png',
'(P)': 'photo.png',
'(K)': 'kiss.png',
'(Y)': 'thumbup.png',
'(})': 'hugleft.png',
'(U)': 'brheart.png',
'(F)': 'flower.png',
'(H)': 'coolglasses.png',
'(D)': 'drink.png',
'(T)': 'phone.png',
'(C)': 'coffee.png',
'({)': 'hugright.png',
'(*)': 'star.png',
'(R)': 'rainbow.png',
'smile.png': [':)', ':-)'],
'coolglasses.png': ['8-)', 'B-)', '(H)'],
'wink.png': [';)', ';-)'],
'biggrin.png': [':D', ':-D', ':>', ':->', 'xD'],
'unhappy.png': [':(', ':-('],
'cry.png': [":'(", ';-(', ';(', ";'-("],
'frowning.png': [':/', ':-/', ':S', ':-S'],
'blush.png': [':$', ':-$'],
'angry.png': [':@', ':-@'],
'bat.png': [':[', ':-['],
'kiss.png': [':*', ':-*', '(K)'],
'stare.png': [':|', ':-|'],
'devil.png': ['>:)', '>:-)', '(6)'],
'tongue.png': [':P', ':-P'],
'oh.png': [':O', ':-O'],
'heart.png': ['<3', '(L)'],
'lion.png': [':3', '>:3'],
'pussy.png': ['(@)'],
'cuffs.png': ['(%)'],
'moon.png': ['(S)'],
'lamp.png': ['(I)'],
'music.png': ['(8)'],
'beer.png': ['(B)'],
'brflower.png': ['(W)'],
'boy.png': ['(Z)'],
'girl.png': ['(X)'],
'mail.png': ['(E)'],
'thumbdown.png': ['(N)'],
'photo.png': ['(P)'],
'thumbup.png': ['(Y)'],
'hugleft.png': ['(})'],
'brheart.png': ['(U)'],
'flower.png': ['(F)'],
'drink.png': ['(D)'],
'phone.png': ['(T)'],
'coffee.png': ['(C)'],
'hugright.png': ['({)'],
'star.png': ['(*)'],
'rainbow.png': ['(R)'],
}

View File

@ -2562,19 +2562,20 @@ class Interface:
# we need to reload else that doesn't work when changing emoticon set
reload(emoticons)
emots = emoticons.emoticons
for emot in emots:
emot_file = os.path.join(path, emots[emot])
emot = emot.decode('utf-8')
for emot_filename in emots:
emot_file = os.path.join(path, emot_filename)
if not self.image_is_ok(emot_file):
continue
# This avoids duplicated emoticons with the same image eg. :) and :-)
if not emot_file in self.emoticons.values():
if emot_file.endswith('.gif'):
pix = gtk.gdk.PixbufAnimation(emot_file)
else:
pix = gtk.gdk.pixbuf_new_from_file(emot_file)
self.emoticons_images.append((emot, pix))
self.emoticons[emot.upper()] = emot_file
for emot in emots[emot_filename]:
emot = emot.decode('utf-8')
# This avoids duplicated emoticons with the same image eg. :) and :-)
if not emot_file in self.emoticons.values():
if emot_file.endswith('.gif'):
pix = gtk.gdk.PixbufAnimation(emot_file)
else:
pix = gtk.gdk.pixbuf_new_from_file(emot_file)
self.emoticons_images.append((emot, pix))
self.emoticons[emot.upper()] = emot_file
sys.path.remove(path)
del emoticons
if self.emoticons_menu: