~ubuntu-branches/ubuntu/natty/pyside/natty-proposed

« back to all changes in this revision

Viewing changes to tests/util/httpd.py

  • Committer: Bazaar Package Importer
  • Author(s): Didier Raboud
  • Date: 2011-02-18 18:01:00 UTC
  • mfrom: (1.2.3 upstream) (6.1.6 experimental)
  • Revision ID: james.westby@ubuntu.com-20110218180100-vaczjij7g08fzfme
Tags: 1.0.0~rc1-1
* New 1.0.0~rc1 upstream release
  - Bump the B-D chain versions:
    + apiextractor to 0.10.0-2~
    + generatorrunner to 0.6.6
    + shiboken to 1.0.0~rc1
* Update patches to ~rc1.
* debian/watch: update to handle Release Candidates too.
* Bump XS-Python-Version to >= 2.6.

Show diffs side-by-side

added added

removed removed

Lines of Context:
8
8
 
9
9
class TestHandler(BaseHTTPServer.BaseHTTPRequestHandler):
10
10
    DATA = "PySide Server"
 
11
    allow_reuse_address = True
11
12
 
12
13
    def do_GET(self):
13
14
        self.send_head()
24
25
 
25
26
class TestSecureHandler(BaseHTTPServer.BaseHTTPRequestHandler):
26
27
    DATA = "PySide"
 
28
    allow_reuse_address = True
27
29
 
28
30
    def do_GET(self):
29
31
        self.send_head()
122
124
        else:
123
125
            handle = TestHandler
124
126
 
125
 
        try:
126
 
            self.httpd = CompatTCPServer((''  , self._port), handle)
127
 
        except:
128
 
            self._port = self._port + random.randint(1, 100)
129
 
            self.httpd = CompatTCPServer((''  , self._port), handle)
 
127
        while True:
 
128
            try:
 
129
                self.httpd = CompatTCPServer((''  , self._port), handle)
 
130
                break
 
131
            except:
 
132
                self._port = self._port + random.randint(1, 100)
130
133
 
131
134
    def port(self):
132
135
        return self._port