diff orpg/chat/chat_util.py @ 140:e842a5f1b775 beta

Traipse Beta 'OpenRPG' {091123-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 (Beta) Added Bookmarks Fix to Remote Admin Commands Minor fix to text based Server Fix to Pretty Print, from Core Fix to Splitter Nodes not being created Fix to massive amounts of images loading, from Core Added 'boot' command to remote admin Added confirmation window for sent nodes Minor changes to allow for portability to an OpenSUSE linux OS Miniatures Layer pop up box allows users to turn off Mini labels, from FlexiRPG Zoom Mouse plugin added Images added to Plugin UI Switching to Element Tree Map efficiency, from FlexiRPG Added Status Bar to Update Manager default_manifest.xml renamed to default_upmana.xml Cleaner clode for saved repositories New TrueDebug Class in orpg_log (See documentation for usage) Mercurial's hgweb folder is ported to upmana Pretty important update that can help remove thousands of dead children from your gametree. Children, <forms />, <group_atts />, <horizontal />, <cols />, <rows />, <height />, etc... are all tags now. Check your gametree and look for dead children!! New Gametree Recursion method, mapping, and context sensitivity. !Infinite Loops return error instead of freezing the software! New Syntax added for custom PC sheets Tip of the Day added, from Core and community Fixed Whiteboard ID to prevent random line or text deleting. Modified ID's to prevent non updated clients from ruining the fix.
author sirebral
date Mon, 23 Nov 2009 03:36:26 -0600
parents 449a8900f9ac
children bf799efe7a8a
line wrap: on
line diff
--- a/orpg/chat/chat_util.py	Tue Nov 10 14:11:28 2009 -0600
+++ b/orpg/chat/chat_util.py	Mon Nov 23 03:36:26 2009 -0600
@@ -3,7 +3,7 @@
 import re
 import string
 from orpg.orpgCore import *
-from orpg.tools.orpg_log import logger
+from orpg.tools.orpg_log import logger, debug
 from orpg.tools.decorators import debugging
 
 #============================================
@@ -19,7 +19,7 @@
 #
 # Created 04-25-2005 by Snowdog
 #=============================================
-@debugging
+
 def simple_html_repair(string):
     "Returns string with extra > symbols to isolate badly formated HTML"
     #walk though string checking positions of < and > tags.
@@ -70,10 +70,10 @@
     diff = string.count('<') - string.count('>')
     if diff > 0:
         for d in range(1,diff):
-            string = string+">"
+            string = string+">"
     return string
 
-""" Depricated! Might as well use the already made component.get('xml')
+# Depricated! Might as well use the already made component.get('xml')
 def strip_unicode(txt):
     for i in xrange(len(txt)):
         if txt[i] not in string.printable:
@@ -81,8 +81,7 @@
                 txt = txt.replace(txt[i], '&#' + str(ord(txt[i])) + ';')
             except:
                 txt = txt.replace(txt[i], '{?}')
-    return txt
-"""
+    return txt
 
 #================================================
 # strip_script_tags(string)
@@ -90,7 +89,7 @@
 # removes all script tags (start and end)
 # 04-26-2005 Snowdog
 #================================================
-@debugging
+
 def strip_script_tags(string):
     #kill the <script> issue
     p = re.compile( '<(\s*)(/*)[Ss][Cc][Rr][Ii][Pp][Tt](.*?)>')
@@ -103,7 +102,7 @@
 # removes all li tags (start and end)
 # 05-13-2005
 #================================================
-@debugging
+
 def strip_li_tags(string):
     #kill the <li> issue
     string = re.sub( r'<(\s*)[Ll][Ii](.*?)>', r'<b><font color="#000000" size=+1>*</font></b>    ', string)
@@ -118,10 +117,10 @@
 #   through legitimate means such as the OpenRPG settings.
 # 07-27-2005 by mDuo13
 #================================================
-@debugging
+
 def strip_body_tags(string):
     bodytag_regex = re.compile(r"""<\/?body.*?>""", re.I)
-    string = re.sub(bodytag_regex, "", string)
+    string = re.sub(bodytag_regex, "", string)
     return string
 
 #================================================
@@ -137,7 +136,7 @@
 # used legitimately without causing much annoyance.
 # 07-27-2005 mDuo13
 #================================================
-@debugging
+
 def strip_misalignment_tags(string):
     alignment_regex = re.compile(r"""<p([^>]*?)align\s*=\s*('.*?'|".*?"|[^\s>]*)(.*?)>""", re.I)
     string = re.sub(alignment_regex, "<p\\1\\3>", string)
@@ -148,7 +147,7 @@
     num_endcentertags = endcenter_regex.findall(string)
     if num_centertags > num_endcentertags:
         missing_tags = len(num_centertags) - len(num_endcentertags)
-        string = string + missing_tags*"</center>"#yes, you can do this.
+        string = string + missing_tags*"</center>"#yes, you can do this.
     return string
 
 #================================================
@@ -158,7 +157,7 @@
 # 05-13-2005
 # redone 07-11-2005 by mDuo13
 #================================================
-@debugging
+
 def strip_img_tags(string):
     #This is a Settings definable feature, Allowing users to enable or disable image display to fix the client crash due to large img posted to chat.
     #p = re.sub( r'<(\s*)(/*)[Ii][Mm][Gg][ ][Ss][Rr][Cc][=](.*?)>', r'<!-- img tag removed //--> <a href=\3>\3</a>', string)