~ubuntu-branches/ubuntu/precise/papyon/precise

« back to all changes in this revision

Viewing changes to papyon/gnet/parser.py

  • Committer: Ken VanDine
  • Date: 2010-09-14 20:39:57 UTC
  • mfrom: (1.1.10 upstream)
  • Revision ID: ken.vandine@canonical.com-20100914203957-1hriss4zo8rr11hr
Tags: 0.5.1-0ubuntu1
releasing version 0.5.1-0ubuntu1

Show diffs side-by-side

added added

removed removed

Lines of Context:
154
154
        transport.connect("notify::status", self._on_status_change)
155
155
        AbstractParser.__init__(self, transport, connect_signals=False)
156
156
 
 
157
    def enable(self):
 
158
        AbstractParser.enable(self)
 
159
        self._parser.enable()
 
160
 
 
161
    def disable(self):
 
162
        AbstractParser.disable(self)
 
163
        self._parser.disable()
 
164
 
157
165
    def _reset_state(self):
158
166
        self._next_chunk = self.CHUNK_START_LINE
159
167
        self._receive_buffer = ""
160
 
        self._content_length = None
 
168
        self._content_length = 0
161
169
        self._parser.delimiter = "\r\n"
162
170
 
 
171
    def _on_received(self, transport, buf, length):
 
172
        pass
 
173
 
163
174
    def _on_status_change(self, transport, param):
164
175
        status = transport.get_property("status")
165
176
        if status == IoStatus.OPEN: