~alecu/openobject-client/django-tracebacks

« back to all changes in this revision

Viewing changes to bin/tiny_socket.py

  • Committer: Alejandro J. Cura
  • Date: 2009-11-10 19:28:55 UTC
  • Revision ID: alecu@gcoop.com.ar-20091110192855-34ijvh94mo2nuhg4
do not show the html in the console

Show diffs side-by-side

added added

removed removed

Lines of Context:
40
40
    def __init__(self, faultCode, faultString):
41
41
        self.faultCode = faultCode
42
42
        self.faultString = faultString
43
 
        self.args = (faultCode, faultString)
 
43
        self.args = (faultCode, self.stripHtml(faultString))
 
44
 
 
45
    def stripHtml(self, description):
 
46
        if description.startswith("<!DOCTYPE HTML"):
 
47
            part1 = description.split('<pre class="textdetails">\n')[1]
 
48
            description = part1.split('</pre>')[0]
 
49
        return description
44
50
 
45
51
class mysocket:
46
52
    def __init__(self, sock=None):