diff plugins/xxsmiley.py @ 66:c54768cffbd4 ornery-dev

Traipse Dev 'OpenRPG' {090818-00} Traipse is a distribution of OpenRPG that is designed to be easy to setup and go. Traipse also makes it easy for developers to work on code without fear of sacrifice. 'Ornery-Orc' continues the trend of 'Grumpy' and adds fixes to the code. 'Ornery-Orc''s main goal is to offer more advanced features and enhance the productivity of the user. Update Summary: *Unstable* This is the first wave of Code Refinement updates. Includes new material from Core Beta; new debugger material (partially implemented), beginnings of switch to etree, TerminalWriter, and a little more. open_rpg has been renamed to component; functioning now as component.get(), component.add(), component.delete(). This version has known bugs, specifically with the gametree and nodes. I think the XML files where not removed during testing of Core and switching back.
author sirebral
date Tue, 18 Aug 2009 06:33:37 -0500
parents 4385a7d0efd1
children
line wrap: on
line diff
--- a/plugins/xxsmiley.py	Mon Aug 17 06:56:31 2009 -0500
+++ b/plugins/xxsmiley.py	Tue Aug 18 06:33:37 2009 -0500
@@ -1,6 +1,6 @@
 import os
 import orpg.pluginhandler
-import orpg.dirpath
+from orpg.dirpath import dir_struct
 
 class Plugin(orpg.pluginhandler.PluginHandler):
     # Initialization subroutine.
@@ -25,86 +25,86 @@
         self.plugin_addcommand('/smiley', self.on_smiley, '- [add|remove|help] The Smiley command')
 
         smlist = {
-                    '>:-('   :       ' <img src="' + orpg.dirpath.dir_struct['plugins'] + 'images/smiley7.gif" /> ',
-                    ':/'     :       ' <img src="' + orpg.dirpath.dir_struct['plugins'] + 'images/smiley5.gif" /> ',
-                    ':|'     :       ' <img src="' + orpg.dirpath.dir_struct['plugins'] + 'images/smiley6.gif" /> ',
-                    ':('     :       ' <img src="' + orpg.dirpath.dir_struct['plugins'] + 'images/smiley9.gif" /> ',
-                    ' />:('  :       ' <img src="' + orpg.dirpath.dir_struct['plugins'] + 'images/smiley7.gif" /> ',
-                    ' />=('  :       ' <img src="' + orpg.dirpath.dir_struct['plugins'] + 'images/smiley7.gif" /> ',
-                    '=)'     :       ' <img src="' + orpg.dirpath.dir_struct['plugins'] + 'images/smiley0.gif" /> ',
-                    '=D'     :       ' <img src="' + orpg.dirpath.dir_struct['plugins'] + 'images/smiley1.gif" /> ',
-                    ';)'     :       ' <img src="' + orpg.dirpath.dir_struct['plugins'] + 'images/smiley3.gif" /> ',
-                    '=/'     :       ' <img src="' + orpg.dirpath.dir_struct['plugins'] + 'images/smiley5.gif" /> ',
-                    '=|'     :       ' <img src="' + orpg.dirpath.dir_struct['plugins'] + 'images/smiley6.gif" /> ',
-                    '=('     :       ' <img src="' + orpg.dirpath.dir_struct['plugins'] + 'images/smiley9.gif" /> ',
-                    ':)'     :       ' <img src="' + orpg.dirpath.dir_struct['plugins'] + 'images/smiley0.gif" /> ',
-                    ':D'     :       ' <img src="' + orpg.dirpath.dir_struct['plugins'] + 'images/smiley1.gif" /> ',
-                    'B)'     :       ' <img src="' + orpg.dirpath.dir_struct['plugins'] + 'images/smiley2.gif" /> ',
-                    ':p'     :       ' <img src="' + orpg.dirpath.dir_struct['plugins'] + 'images/smiley4.gif" /> ',
-                    '=\\'    :       ' <img src="' + orpg.dirpath.dir_struct['plugins'] + 'images/smiley5.gif" /> ',
-                    ':P'     :       ' <img src="' + orpg.dirpath.dir_struct['plugins'] + 'images/smiley4.gif" /> ',
-                    '=P'     :       ' <img src="' + orpg.dirpath.dir_struct['plugins'] + 'images/smiley4.gif" /> ',
-                    '^_^'    :       ' <img src="' + orpg.dirpath.dir_struct['plugins'] + 'images/smiley12.gif" /> ',
-                    '^-^'    :       ' <img src="' + orpg.dirpath.dir_struct['plugins'] + 'images/smiley12.gif" /> ',
-                    '^.^'    :       ' <img src="' + orpg.dirpath.dir_struct['plugins'] + 'images/smiley12.gif" /> ',
-                    'n_n'    :       ' <img src="' + orpg.dirpath.dir_struct['plugins'] + 'images/smiley12.gif" /> ',
-                    'n.n'    :       ' <img src="' + orpg.dirpath.dir_struct['plugins'] + 'images/smiley12.gif" /> ',
-                    'n,n'    :       ' <img src="' + orpg.dirpath.dir_struct['plugins'] + 'images/smiley12.gif" /> ',
-                    'I-)'    :       ' <img src="' + orpg.dirpath.dir_struct['plugins'] + 'images/smiley13.gif" /> ',
-                    'n.n;'   :       ' <img src="' + orpg.dirpath.dir_struct['plugins'] + 'images/smiley14.gif" /> ',
-                    'n.n;;'  :       ' <img src="' + orpg.dirpath.dir_struct['plugins'] + 'images/smiley14.gif" /> ',
-                    'n_n;'   :       ' <img src="' + orpg.dirpath.dir_struct['plugins'] + 'images/smiley14.gif" /> ',
-                    ':-)'    :       ' <img src="' + orpg.dirpath.dir_struct['plugins'] + 'images/smiley0.gif" /> ',
-                    ':-D'    :       ' <img src="' + orpg.dirpath.dir_struct['plugins'] + 'images/smiley1.gif" /> ',
-                    ':-P'    :       ' <img src="' + orpg.dirpath.dir_struct['plugins'] + 'images/smiley2.gif" /> ',
-                    ':-p'    :       ' <img src="' + orpg.dirpath.dir_struct['plugins'] + 'images/smiley4.gif" /> ',
-                    ':-/'    :       ' <img src="' + orpg.dirpath.dir_struct['plugins'] + 'images/smiley5.gif" /> ',
-                    ':-|'    :       ' <img src="' + orpg.dirpath.dir_struct['plugins'] + 'images/smiley6.gif" /> ',
-                    ':-('    :       ' <img src="' + orpg.dirpath.dir_struct['plugins'] + 'images/smiley9.gif" /> ',
-                    ':-\\'   :       ' <img src="' + orpg.dirpath.dir_struct['plugins'] + 'images/smiley5.gif" /> ',
-                    '-)'          :       ' <img src="' + orpg.dirpath.dir_struct['plugins'] + 'images/icon_smile.gif" /> ',
-                    ';-)'         :       ' <img src="' + orpg.dirpath.dir_struct['plugins'] + 'images/icon_wink.gif" /> ',
-                    ':->'         :       ' <img src="' + orpg.dirpath.dir_struct['plugins'] + 'images/icon_smile2.gif" /> ',
-                    ':-D'         :       ' <img src="' + orpg.dirpath.dir_struct['plugins'] + 'images/icon_biggrin.gif" /> ',
-                    ':-P'         :       ' <img src="' + orpg.dirpath.dir_struct['plugins'] + 'images/icon_razz.gif" /> ',
-                    ':-o'         :       ' <img src="' + orpg.dirpath.dir_struct['plugins'] + 'images/icon_surprised.gif" /> ',
-                    ':mrgreen:'   :       ' <img src="' + orpg.dirpath.dir_struct['plugins'] + 'images/icon_mrgreen.gif" /> ',
-                    ':lol:'       :       ' <img src="' + orpg.dirpath.dir_struct['plugins'] + 'images/icon_lol.gif" /> ',
-                    ':-('         :       ' <img src="' + orpg.dirpath.dir_struct['plugins'] + 'images/icon_sad.gif" /> ',
-                    ':-|'         :       ' <img src="' + orpg.dirpath.dir_struct['plugins'] + 'images/icon_neutral.gif" /> ',
-                    ':-?'         :       ' <img src="' + orpg.dirpath.dir_struct['plugins'] + 'images/icon_confused.gif" /> ',
-                    ':-x'         :       ' <img src="' + orpg.dirpath.dir_struct['plugins'] + 'images/icon_mad.gif" /> ',
-                    ':shock:'     :       ' <img src="' + orpg.dirpath.dir_struct['plugins'] + 'images/icon_eek.gif" /> ',
-                    ':cry:'       :       ' <img src="' + orpg.dirpath.dir_struct['plugins'] + 'images/icon_cry.gif" /> ',
-                    ';_;'         :       ' <img src="' + orpg.dirpath.dir_struct['plugins'] + 'images/icon_cry.gif" /> ',
-                    ':oops:'      :       ' <img src="' + orpg.dirpath.dir_struct['plugins'] + 'images/icon_redface.gif" /> ',
-                    '8-)'         :       ' <img src="' + orpg.dirpath.dir_struct['plugins'] + 'images/icon_cool.gif" /> ',
-                    ':evil:'      :       ' <img src="' + orpg.dirpath.dir_struct['plugins'] + 'images/icon_evil.gif" /> ',
-                    ':twisted:'      :       ' <img src="' + orpg.dirpath.dir_struct['plugins'] + 'images/icon_twisted.gif" /> ',
-                    ':roll:'      :       ' <img src="' + orpg.dirpath.dir_struct['plugins'] + 'images/icon_rolleyes.gif" /> ',
-                    ':!:'         :       ' <img src="' + orpg.dirpath.dir_struct['plugins'] + 'images/icon_exclaim.gif" /> ',
-                    ':?:'         :       ' <img src="' + orpg.dirpath.dir_struct['plugins'] + 'images/icon_question.gif" /> ',
-                    ':idea:'      :       ' <img src="' + orpg.dirpath.dir_struct['plugins'] + 'images/icon_idea.gif" /> ',
-                    ':arrow:'     :       ' <img src="' + orpg.dirpath.dir_struct['plugins'] + 'images/icon_arrow.gif" /> ',
-                    ':ubergeek:'  :       ' <img src="' + orpg.dirpath.dir_struct['plugins'] + 'images/icon_e_ugeek.gif" /> ',
-                    ':geek:'      :       ' <img src="' + orpg.dirpath.dir_struct['plugins'] + 'images/icon_e_geek.gif" /> ',
-                    ':fairy:'    :       ' <img src="' + orpg.dirpath.dir_struct['plugins'] + 'images/fairy.gif" /> ',
-                    ':hood:'    :       ' <img src="' + orpg.dirpath.dir_struct['plugins'] + 'images/hood.gif" /> ',
-                    ':gnome:'    :       ' <img src="' + orpg.dirpath.dir_struct['plugins'] + 'images/gnome.gif" /> ',
-                    ':link:'    :       ' <img src="' + orpg.dirpath.dir_struct['plugins'] + 'images/link.gif" /> ',
-                    ':mummy:'    :       ' <img src="' + orpg.dirpath.dir_struct['plugins'] + 'images/mummy.gif" /> ',
-                    ':ogre:'    :       ' <img src="' + orpg.dirpath.dir_struct['plugins'] + 'images/ogre.gif" /> ',
-                    ':medusa:'    :       ' <img src="' + orpg.dirpath.dir_struct['plugins'] + 'images/medusa.gif" /> ',
-                    ':mimic:'    :       ' <img src="' + orpg.dirpath.dir_struct['plugins'] + 'images/mimic.gif" /> ',
-                    ':skull:'    :       ' <img src="' + orpg.dirpath.dir_struct['plugins'] + 'images/skull.gif" /> ',
-                    ':zombie:'    :       ' <img src="' + orpg.dirpath.dir_struct['plugins'] + 'images/zombie.gif" /> ',
-                    ':chocobo:'    :       ' <img src="' + orpg.dirpath.dir_struct['plugins'] + 'images/chocobo.gif" /> ',
-                    ':darkside:'    :       ' <img src="' + orpg.dirpath.dir_struct['plugins'] + 'images/darkside.gif" /> ',
-                    ':flyingspaghetti:'    :       ' <img src="' + orpg.dirpath.dir_struct['plugins'] + 'images/flyingspaghetti.gif" /> ',
-                    ':rupee:'    :       ' <img src="' + orpg.dirpath.dir_struct['plugins'] + 'images/rupee.gif" /> ',
-                    ':ros:'    :       ' <img src="' + orpg.dirpath.dir_struct['plugins'] + 'images/ros.gif" /> ',
-                    ':skeleton:'    :       ' <img src="' + orpg.dirpath.dir_struct['plugins'] + 'images/skeleton.gif" /> ',
-                    ':samurai:'    :       ' <img src="' + orpg.dirpath.dir_struct['plugins'] + 'images/samurai.gif" /> '}
+                    '>:-('   :       ' <img src="' + dir_struct['plugins'] + 'images/smiley7.gif" /> ',
+                    ':/'     :       ' <img src="' + dir_struct['plugins'] + 'images/smiley5.gif" /> ',
+                    ':|'     :       ' <img src="' + dir_struct['plugins'] + 'images/smiley6.gif" /> ',
+                    ':('     :       ' <img src="' + dir_struct['plugins'] + 'images/smiley9.gif" /> ',
+                    ' />:('  :       ' <img src="' + dir_struct['plugins'] + 'images/smiley7.gif" /> ',
+                    ' />=('  :       ' <img src="' + dir_struct['plugins'] + 'images/smiley7.gif" /> ',
+                    '=)'     :       ' <img src="' + dir_struct['plugins'] + 'images/smiley0.gif" /> ',
+                    '=D'     :       ' <img src="' + dir_struct['plugins'] + 'images/smiley1.gif" /> ',
+                    ';)'     :       ' <img src="' + dir_struct['plugins'] + 'images/smiley3.gif" /> ',
+                    '=/'     :       ' <img src="' + dir_struct['plugins'] + 'images/smiley5.gif" /> ',
+                    '=|'     :       ' <img src="' + dir_struct['plugins'] + 'images/smiley6.gif" /> ',
+                    '=('     :       ' <img src="' + dir_struct['plugins'] + 'images/smiley9.gif" /> ',
+                    ':)'     :       ' <img src="' + dir_struct['plugins'] + 'images/smiley0.gif" /> ',
+                    ':D'     :       ' <img src="' + dir_struct['plugins'] + 'images/smiley1.gif" /> ',
+                    'B)'     :       ' <img src="' + dir_struct['plugins'] + 'images/smiley2.gif" /> ',
+                    ':p'     :       ' <img src="' + dir_struct['plugins'] + 'images/smiley4.gif" /> ',
+                    '=\\'    :       ' <img src="' + dir_struct['plugins'] + 'images/smiley5.gif" /> ',
+                    ':P'     :       ' <img src="' + dir_struct['plugins'] + 'images/smiley4.gif" /> ',
+                    '=P'     :       ' <img src="' + dir_struct['plugins'] + 'images/smiley4.gif" /> ',
+                    '^_^'    :       ' <img src="' + dir_struct['plugins'] + 'images/smiley12.gif" /> ',
+                    '^-^'    :       ' <img src="' + dir_struct['plugins'] + 'images/smiley12.gif" /> ',
+                    '^.^'    :       ' <img src="' + dir_struct['plugins'] + 'images/smiley12.gif" /> ',
+                    'n_n'    :       ' <img src="' + dir_struct['plugins'] + 'images/smiley12.gif" /> ',
+                    'n.n'    :       ' <img src="' + dir_struct['plugins'] + 'images/smiley12.gif" /> ',
+                    'n,n'    :       ' <img src="' + dir_struct['plugins'] + 'images/smiley12.gif" /> ',
+                    'I-)'    :       ' <img src="' + dir_struct['plugins'] + 'images/smiley13.gif" /> ',
+                    'n.n;'   :       ' <img src="' + dir_struct['plugins'] + 'images/smiley14.gif" /> ',
+                    'n.n;;'  :       ' <img src="' + dir_struct['plugins'] + 'images/smiley14.gif" /> ',
+                    'n_n;'   :       ' <img src="' + dir_struct['plugins'] + 'images/smiley14.gif" /> ',
+                    ':-)'    :       ' <img src="' + dir_struct['plugins'] + 'images/smiley0.gif" /> ',
+                    ':-D'    :       ' <img src="' + dir_struct['plugins'] + 'images/smiley1.gif" /> ',
+                    ':-P'    :       ' <img src="' + dir_struct['plugins'] + 'images/smiley2.gif" /> ',
+                    ':-p'    :       ' <img src="' + dir_struct['plugins'] + 'images/smiley4.gif" /> ',
+                    ':-/'    :       ' <img src="' + dir_struct['plugins'] + 'images/smiley5.gif" /> ',
+                    ':-|'    :       ' <img src="' + dir_struct['plugins'] + 'images/smiley6.gif" /> ',
+                    ':-('    :       ' <img src="' + dir_struct['plugins'] + 'images/smiley9.gif" /> ',
+                    ':-\\'   :       ' <img src="' + dir_struct['plugins'] + 'images/smiley5.gif" /> ',
+                    '-)'          :       ' <img src="' + dir_struct['plugins'] + 'images/icon_smile.gif" /> ',
+                    ';-)'         :       ' <img src="' + dir_struct['plugins'] + 'images/icon_wink.gif" /> ',
+                    ':->'         :       ' <img src="' + dir_struct['plugins'] + 'images/icon_smile2.gif" /> ',
+                    ':-D'         :       ' <img src="' + dir_struct['plugins'] + 'images/icon_biggrin.gif" /> ',
+                    ':-P'         :       ' <img src="' + dir_struct['plugins'] + 'images/icon_razz.gif" /> ',
+                    ':-o'         :       ' <img src="' + dir_struct['plugins'] + 'images/icon_surprised.gif" /> ',
+                    ':mrgreen:'   :       ' <img src="' + dir_struct['plugins'] + 'images/icon_mrgreen.gif" /> ',
+                    ':lol:'       :       ' <img src="' + dir_struct['plugins'] + 'images/icon_lol.gif" /> ',
+                    ':-('         :       ' <img src="' + dir_struct['plugins'] + 'images/icon_sad.gif" /> ',
+                    ':-|'         :       ' <img src="' + dir_struct['plugins'] + 'images/icon_neutral.gif" /> ',
+                    ':-?'         :       ' <img src="' + dir_struct['plugins'] + 'images/icon_confused.gif" /> ',
+                    ':-x'         :       ' <img src="' + dir_struct['plugins'] + 'images/icon_mad.gif" /> ',
+                    ':shock:'     :       ' <img src="' + dir_struct['plugins'] + 'images/icon_eek.gif" /> ',
+                    ':cry:'       :       ' <img src="' + dir_struct['plugins'] + 'images/icon_cry.gif" /> ',
+                    ';_;'         :       ' <img src="' + dir_struct['plugins'] + 'images/icon_cry.gif" /> ',
+                    ':oops:'      :       ' <img src="' + dir_struct['plugins'] + 'images/icon_redface.gif" /> ',
+                    '8-)'         :       ' <img src="' + dir_struct['plugins'] + 'images/icon_cool.gif" /> ',
+                    ':evil:'      :       ' <img src="' + dir_struct['plugins'] + 'images/icon_evil.gif" /> ',
+                    ':twisted:'      :       ' <img src="' + dir_struct['plugins'] + 'images/icon_twisted.gif" /> ',
+                    ':roll:'      :       ' <img src="' + dir_struct['plugins'] + 'images/icon_rolleyes.gif" /> ',
+                    ':!:'         :       ' <img src="' + dir_struct['plugins'] + 'images/icon_exclaim.gif" /> ',
+                    ':?:'         :       ' <img src="' + dir_struct['plugins'] + 'images/icon_question.gif" /> ',
+                    ':idea:'      :       ' <img src="' + dir_struct['plugins'] + 'images/icon_idea.gif" /> ',
+                    ':arrow:'     :       ' <img src="' + dir_struct['plugins'] + 'images/icon_arrow.gif" /> ',
+                    ':ubergeek:'  :       ' <img src="' + dir_struct['plugins'] + 'images/icon_e_ugeek.gif" /> ',
+                    ':geek:'      :       ' <img src="' + dir_struct['plugins'] + 'images/icon_e_geek.gif" /> ',
+                    ':fairy:'    :       ' <img src="' + dir_struct['plugins'] + 'images/fairy.gif" /> ',
+                    ':hood:'    :       ' <img src="' + dir_struct['plugins'] + 'images/hood.gif" /> ',
+                    ':gnome:'    :       ' <img src="' + dir_struct['plugins'] + 'images/gnome.gif" /> ',
+                    ':link:'    :       ' <img src="' + dir_struct['plugins'] + 'images/link.gif" /> ',
+                    ':mummy:'    :       ' <img src="' + dir_struct['plugins'] + 'images/mummy.gif" /> ',
+                    ':ogre:'    :       ' <img src="' + dir_struct['plugins'] + 'images/ogre.gif" /> ',
+                    ':medusa:'    :       ' <img src="' + dir_struct['plugins'] + 'images/medusa.gif" /> ',
+                    ':mimic:'    :       ' <img src="' + dir_struct['plugins'] + 'images/mimic.gif" /> ',
+                    ':skull:'    :       ' <img src="' + dir_struct['plugins'] + 'images/skull.gif" /> ',
+                    ':zombie:'    :       ' <img src="' + dir_struct['plugins'] + 'images/zombie.gif" /> ',
+                    ':chocobo:'    :       ' <img src="' + dir_struct['plugins'] + 'images/chocobo.gif" /> ',
+                    ':darkside:'    :       ' <img src="' + dir_struct['plugins'] + 'images/darkside.gif" /> ',
+                    ':flyingspaghetti:'    :       ' <img src="' + dir_struct['plugins'] + 'images/flyingspaghetti.gif" /> ',
+                    ':rupee:'    :       ' <img src="' + dir_struct['plugins'] + 'images/rupee.gif" /> ',
+                    ':ros:'    :       ' <img src="' + dir_struct['plugins'] + 'images/ros.gif" /> ',
+                    ':skeleton:'    :       ' <img src="' + dir_struct['plugins'] + 'images/skeleton.gif" /> ',
+                    ':samurai:'    :       ' <img src="' + dir_struct['plugins'] + 'images/samurai.gif" /> '}
 
         self.smileylist = self.plugindb.GetDict("xxsmiley", "smileylist", smlist)
 
@@ -132,7 +132,7 @@
             if args[2].find('http') > -1:
                 self.smileylist[args[1]] = ' <img src="' + args[2] + '" alt="' + args[1] + '" />'
             else:
-                self.smileylist[args[1]] = ' <img src="' + orpg.dirpath.dir_struct["plugins"] + 'images/' + args[2] + '" />' + "\n"
+                self.smileylist[args[1]] = ' <img src="' + dir_struct["plugins"] + 'images/' + args[2] + '" />' + "\n"
 
             self.chat.InfoPost('Added ' + args[1] + '&nbsp&nbsp&nbsp : &nbsp&nbsp&nbsp' + self.smileylist[args[1]])
 
@@ -165,4 +165,4 @@
         if myself:
             text = self.doSmiley(text)
 
-        return text
\ No newline at end of file
+        return text