Skip to content

Commit

Permalink
String formatting optimizations.
Browse files Browse the repository at this point in the history
  • Loading branch information
BertrandBordage committed Sep 12, 2012
1 parent 916a65b commit 8470c04
Showing 1 changed file with 7 additions and 7 deletions.
14 changes: 7 additions & 7 deletions terms/html.py
Original file line number Original file line Diff line number Diff line change
Expand Up @@ -24,28 +24,28 @@ def feed(self, data):
self.out = ''.join(self.out) self.out = ''.join(self.out)


def handle_startendtag(self, tag, attrs): def handle_startendtag(self, tag, attrs):
self.out__append('<%s%s />' % (tag, concat_attrs(attrs))) self.out__append('<' + tag + concat_attrs(attrs) + ' />')


def handle_starttag(self, tag, attrs): def handle_starttag(self, tag, attrs):
self.out__append('<%s%s>' % (tag, concat_attrs(attrs))) self.out__append('<' + tag + concat_attrs(attrs) + '>')


def handle_endtag(self, tag): def handle_endtag(self, tag):
self.out__append('</%s>' % tag) self.out__append('</' + tag + '>')


def handle_data(self, data): def handle_data(self, data):
self.out__append(data) self.out__append(data)


def handle_comment(self, data): def handle_comment(self, data):
self.out__append('<!--%s-->' % data) self.out__append('<!--' + data + '-->')


def handle_decl(self, decl): def handle_decl(self, decl):
self.out__append('<!%s>' % decl) self.out__append('<!' + decl + '>')


def handle_pi(self, data): def handle_pi(self, data):
self.out__append('<?%s>' % data) self.out__append('<?' + data + '>')


def unknown_decl(self, decl): def unknown_decl(self, decl):
self.out__append('<![%s]>' % decl) self.out__append('<![' + decl + ']>')




class TermsHTMLReconstructor(NeutralHTMLReconstructor): class TermsHTMLReconstructor(NeutralHTMLReconstructor):
Expand Down

0 comments on commit 8470c04

Please sign in to comment.