Download Install Tutorial Docs FAQ Tools WikiLicense Team IRC Planet Involvement Shop Book

Changeset 2437

Show
Ignore:
Timestamp:
06/14/09 17:57:43
Author:
fumanchu
Message:

Removed py3print.

Files:

Legend:

Unmodified
Added
Removed
Modified
Copied
Moved
  • trunk/cherrypy/__init__.py

    r2423 r2437  
    551551    return newurl 
    552552 
    553 from cherrypy.py3util import py3print 
    554553 
    555554# import _cpconfig last so it can reference other top-level objects 
  • trunk/cherrypy/_cpmodpy.py

    r2394 r2437  
    5757 
    5858import logging 
     59try: 
     60    from cStringIO import StringIO 
     61except ImportError: 
     62    from StringIO import StringIO 
    5963 
    6064import cherrypy 
    61 from cherrypy.py3util import StringIO 
    6265from cherrypy._cperror import format_exc, bare_error 
    6366from cherrypy.lib import httputil 
    64  
    6567 
    6668 
  • trunk/cherrypy/_cpwsgi.py

    r2432 r2437  
    44 
    55import cherrypy as _cherrypy 
    6 from cherrypy.py3util import StringIO 
     6try: 
     7    from cStringIO import StringIO 
     8except ImportError: 
     9    from StringIO import StringIO 
    710from cherrypy import _cperror 
    811from cherrypy.lib import httputil 
  • trunk/cherrypy/lib/encoding.py

    r2413 r2437  
     1try: 
     2    from cStringIO import StringIO 
     3except ImportError: 
     4    from StringIO import StringIO 
    15try: 
    26    set 
     
    198202def decompress(body): 
    199203    import gzip 
    200     from cherrypy.py3util import StringIO 
    201204     
    202205    zbuf = StringIO() 
  • trunk/cherrypy/lib/profiler.py

    r2394 r2437  
    5555import sys 
    5656 
    57 from cherrypy.py3util import StringIO 
     57try: 
     58    from cStringIO import StringIO 
     59except ImportError: 
     60    from StringIO import StringIO 
    5861 
    5962_count = 0 
  • trunk/cherrypy/lib/tidy.py

    r2394 r2437  
    33import cgi 
    44import os 
    5 from cherrypy.py3util import StringIO 
     5try: 
     6    from cStringIO import StringIO 
     7except ImportError: 
     8    from StringIO import StringIO 
    69import traceback 
    710 
  • trunk/cherrypy/py3util.py

    r2413 r2437  
    33""" 
    44import sys 
    5  
    6 def py3print(*args, **kwargs): 
    7     sep = kwargs.get('sep', ' ') 
    8     end = kwargs.get('end', '\n') 
    9     file = kwargs.get('file', sys.stdout) 
    10     output = sep.join(['%s' % arg for arg in args]) + end 
    11     file.write(output) 
    12  
    13 try: 
    14     from cStringIO import StringIO 
    15 except ImportError: 
    16     from StringIO import StringIO 
    175 
    186def sorted(lst): 
  • trunk/cherrypy/test/benchmark.py

    r2389 r2437  
    218218            self.output = _cpmodpy.read_process(AB_PATH or "ab", self.args()) 
    219219        except: 
    220             cherrypy.py3print(_cperror.format_exc()) 
     220            print(_cperror.format_exc()) 
    221221            raise 
    222222         
     
    273273        widths.append(max(lengths)) 
    274274    for row in rows: 
    275         cherrypy.py3print(
     275        print(""
    276276        for i, val in enumerate(row): 
    277             cherrypy.py3print(str(val).rjust(widths[i]), "|", end=' ') 
    278     cherrypy.py3print(
     277            print str(val).rjust(widths[i]), "|", 
     278    print(""
    279279 
    280280 
    281281def run_standard_benchmarks(): 
    282     cherrypy.py3print(
    283     cherrypy.py3print("Client Thread Report (1000 requests, 14 byte response body, " 
     282    print(""
     283    print("Client Thread Report (1000 requests, 14 byte response body, " 
    284284           "%s server threads):" % cherrypy.server.thread_pool) 
    285285    print_report(thread_report()) 
    286286     
    287     cherrypy.py3print(
    288     cherrypy.py3print("Client Thread Report (1000 requests, 14 bytes via staticdir, " 
     287    print(""
     288    print("Client Thread Report (1000 requests, 14 bytes via staticdir, " 
    289289           "%s server threads):" % cherrypy.server.thread_pool) 
    290290    print_report(thread_report("%s/static/index.html" % SCRIPT_NAME)) 
    291291     
    292     cherrypy.py3print(
    293     cherrypy.py3print("Size Report (1000 requests, 50 client threads, " 
     292    print(""
     293    print("Size Report (1000 requests, 50 client threads, " 
    294294           "%s server threads):" % cherrypy.server.thread_pool) 
    295295    print_report(size_report()) 
     
    316316 
    317317def run_modpython(use_wsgi=False): 
    318     cherrypy.py3print("Starting mod_python...") 
     318    print("Starting mod_python...") 
    319319    pyopts = [] 
    320320     
     
    351351        opts = dict(switches) 
    352352    except getopt.GetoptError: 
    353         cherrypy.py3print(__doc__) 
     353        print(__doc__) 
    354354        sys.exit(2) 
    355355     
    356356    if "--help" in opts: 
    357         cherrypy.py3print(__doc__) 
     357        print(__doc__) 
    358358        sys.exit(0) 
    359359     
     
    366366        def run(): 
    367367            port = cherrypy.server.socket_port 
    368             cherrypy.py3print("You may now open http://127.0.0.1:%s%s/" % 
     368            print("You may now open http://127.0.0.1:%s%s/" % 
    369369                   (port, SCRIPT_NAME)) 
    370370             
    371371            if "--null" in opts: 
    372                 cherrypy.py3print("Using null Request object") 
     372                print("Using null Request object") 
    373373    else: 
    374374        def run(): 
    375375            end = time.time() - start 
    376             cherrypy.py3print("Started in %s seconds" % end) 
     376            print("Started in %s seconds" % end) 
    377377            if "--null" in opts: 
    378                 cherrypy.py3print("\nUsing null Request object") 
     378                print("\nUsing null Request object") 
    379379            try: 
    380380                run_standard_benchmarks() 
     
    382382                cherrypy.engine.exit() 
    383383     
    384     cherrypy.py3print("Starting CherryPy app server...") 
     384    print("Starting CherryPy app server...") 
    385385     
    386386    class NullWriter(object): 
  • trunk/cherrypy/test/helper.py

    r2392 r2437  
    5757            url = httputil.urljoin(self.script_name, url) 
    5858        return webtest.WebCase.getPage(self, url, headers, method, body, protocol) 
     59     
     60    def skip(self, msg='skipped '): 
     61        sys.stdout.write(msg) 
    5962     
    6063    def assertErrorPage(self, status, message=None, pattern=''): 
     
    8487                self._handlewebError('Error page contains traceback') 
    8588        else: 
    86             if (m is None) or (not re.search(re.escape(pattern), m.group(1))): 
     89            if (m is None) or ( 
     90                not re.search(re.escape(pattern), 
     91                              m.group(1))): 
    8792                msg = 'Error page does not contain %s in traceback' 
    8893                self._handlewebError(msg % repr(pattern)) 
     
    192197            ssl = "" 
    193198         
     199        conf = self.config_template % { 
     200            'host': self.host, 
     201            'port': self.port, 
     202            'error_log': self.error_log, 
     203            'access_log': self.access_log, 
     204            'ssl': ssl, 
     205            'extra': extra, 
     206            } 
    194207        f = open(self.config_file, 'wb') 
    195         f.write(self.config_template % 
    196                 {'host': self.host, 
    197                  'port': self.port, 
    198                  'error_log': self.error_log, 
    199                  'access_log': self.access_log, 
    200                  'ssl': ssl, 
    201                  'extra': extra, 
    202                  }) 
     208        f.write(conf) 
    203209        f.close() 
    204210     
  • trunk/cherrypy/test/logtest.py

    r2389 r2437  
    33import sys 
    44import time 
     5 
     6import cherrypy 
    57 
    68 
     
    4244     
    4345    def _handleLogError(self, msg, data, marker, pattern): 
    44         cherrypy.py3print(
    45         cherrypy.py3print("    ERROR:", msg) 
     46        print(""
     47        print("    ERROR: %s" % msg) 
    4648         
    4749        if not self.interactive: 
     
    4951         
    5052        p = "    Show: [L]og [M]arker [P]attern; [I]gnore, [R]aise, or sys.e[X]it >> " 
    51         cherrypy.py3print(p, end=' ') 
     53        print p, 
    5254        # ARGH 
    5355        sys.stdout.flush() 
     
    5658            if i not in "MPLIRX": 
    5759                continue 
    58             cherrypy.py3print(i.upper())  # Also prints new line 
     60            print(i.upper())  # Also prints new line 
    5961            if i == "L": 
    6062                for x, line in enumerate(data): 
    6163                    if (x + 1) % self.console_height == 0: 
    6264                        # The \r and comma should make the next line overwrite 
    63                         cherrypy.py3print("<-- More -->\r", end=' ') 
     65                        print "<-- More -->\r", 
    6466                        m = getchar().lower() 
    6567                        # Erase our "More" prompt 
    66                         cherrypy.py3print("            \r", end=' ') 
     68                        print "            \r", 
    6769                        if m == "q": 
    6870                            break 
    69                     cherrypy.py3print(line.rstrip()) 
     71                    print(line.rstrip()) 
    7072            elif i == "M": 
    71                 cherrypy.py3print(repr(marker or self.lastmarker)) 
     73                print(repr(marker or self.lastmarker)) 
    7274            elif i == "P": 
    73                 cherrypy.py3print(repr(pattern)) 
     75                print(repr(pattern)) 
    7476            elif i == "I": 
    7577                # return without raising the normal exception 
     
    7981            elif i == "X": 
    8082                self.exit() 
    81             cherrypy.py3print(p, end=' ') 
     83            print p, 
    8284     
    8385    def exit(self): 
  • trunk/cherrypy/test/modfcgid.py

    r2389 r2437  
    111111        result = read_process(APACHE_PATH, "-k start -f %s" % fcgiconf) 
    112112        if result: 
    113             cherrypy.py3print(result) 
     113            print(result) 
    114114     
    115115    def stop(self): 
  • trunk/cherrypy/test/modpy.py

    r2389 r2437  
    117117        result = read_process(APACHE_PATH, "-k start -f %s" % mpconf) 
    118118        if result: 
    119             cherrypy.py3print(result) 
     119            print(result) 
    120120     
    121121    def stop(self): 
  • trunk/cherrypy/test/modwsgi.py

    r2389 r2437  
    116116        result = read_process(APACHE_PATH, "-k start -f %s" % mpconf) 
    117117        if result: 
    118             cherrypy.py3print(result) 
     118            print(result) 
    119119         
    120120        # Make a request so mod_wsgi starts up our app. 
  • trunk/cherrypy/test/test.py

    r2419 r2437  
    4141        import cherrypy 
    4242        v = sys.version.split()[0] 
    43         cherrypy.py3print("Python version used to run this test script:", v) 
    44         cherrypy.py3print("CherryPy version", cherrypy.__version__) 
     43        print("Python version used to run this test script: %s" % v) 
     44        print("CherryPy version: %s" % cherrypy.__version__) 
    4545        if self.scheme == "https": 
    46             ssl = "(ssl)" 
     46            ssl = " (ssl)" 
    4747        else: 
    4848            ssl = "" 
    49         cherrypy.py3print("HTTP server version", self.protocol, ssl
    50         cherrypy.py3print("PID:", os.getpid()) 
    51         cherrypy.py3print(
     49        print("HTTP server version: %s%s" % (self.protocol, ssl)
     50        print("PID: %s" % os.getpid()) 
     51        print(""
    5252         
    5353        if isinstance(conf, basestring): 
     
    7676        if self.scheme == "https": 
    7777            webtest.WebCase.HTTP_CONN = HTTPSConnection 
    78         cherrypy.py3print(
    79         cherrypy.py3print("Running tests:", self.server) 
     78        print(""
     79        print("Running tests: %s" % self.server) 
    8080         
    8181        return helper.run_test_suite(self.tests, baseconf, self.server) 
     
    246246        if self.cover and self.profile: 
    247247            # Print error message and exit 
    248             cherrypy.py3print('Error: you cannot run the profiler and the ' 
     248            print('Error: you cannot run the profiler and the ' 
    249249                   'coverage tool at the same time.') 
    250250            sys.exit(2) 
     
    260260         
    261261        import cherrypy 
    262         cherrypy.py3print("""CherryPy Test Program 
     262        print("""CherryPy Test Program 
    263263    Usage: 
    264264        test.py --help --server=* --host=%s --port=%s --1.0 --ssl --cover 
     
    266266         
    267267    """ % (self.__class__.host, self.__class__.port)) 
    268         cherrypy.py3print('    * servers:') 
     268        print('    * servers:') 
    269269        for name, val in self.available_servers.items(): 
    270270            if name == self.default_server: 
    271                 cherrypy.py3print('        --server=%s: %s (default)' % (name, val)) 
     271                print('        --server=%s: %s (default)' % (name, val)) 
    272272            else: 
    273                 cherrypy.py3print('        --server=%s: %s' % (name, val)) 
    274          
    275         cherrypy.py3print(""" 
     273                print('        --server=%s: %s' % (name, val)) 
     274         
     275        print(""" 
    276276     
    277277    --host=<name or IP addr>: use a host other than the default (%s). 
     
    289289    """ % (self.__class__.host, self.__class__.port)) 
    290290         
    291         cherrypy.py3print('    ** tests:') 
     291        print('    ** tests:') 
    292292        for name in self.available_tests: 
    293             cherrypy.py3print('        --' + name) 
     293            print('        --' + name) 
    294294     
    295295    def start_coverage(self): 
     
    328328            self.coverage.save() 
    329329            self.report_coverage() 
    330             cherrypy.py3print("run cherrypy/lib/covercp.py as a script to serve " 
     330            print("run cherrypy/lib/covercp.py as a script to serve " 
    331331                   "coverage results on port 8080") 
    332332     
     
    351351        total_executed = 0 
    352352         
    353         cherrypy.py3print(
    354         cherrypy.py3print("CODE COVERAGE (this might take a while)", end=' '
     353        print(""
     354        sys.stdout.write("CODE COVERAGE (this might take a while)"
    355355        for morf in morfs: 
    356356            sys.stdout.write(".") 
     
    375375            pc = 100.0 * total_executed / total_statements 
    376376         
    377         cherrypy.py3print("\nTotal: %s Covered: %s Percent: %2d%%" 
     377        print("\nTotal: %s Covered: %s Percent: %2d%%" 
    378378               % (total_statements, total_executed, pc)) 
    379379     
     
    425425         
    426426        if self.profile: 
    427             cherrypy.py3print(
    428             cherrypy.py3print("run /cherrypy/lib/profiler.py as a script to serve " 
     427            print(""
     428            print("run /cherrypy/lib/profiler.py as a script to serve " 
    429429                   "profiling results on port 8080") 
    430430         
     
    497497    import cherrypy 
    498498    if clp.interactive: 
    499         cherrypy.py3print(
     499        print(""
    500500        raw_input('hit enter') 
    501501    sys.exit(success) 
  • trunk/cherrypy/test/test_config.py

    r2394 r2437  
    77localDir = os.path.join(os.getcwd(), os.path.dirname(__file__)) 
    88 
     9try: 
     10    from cStringIO import StringIO 
     11except ImportError: 
     12    from StringIO import StringIO 
     13import unittest 
     14 
    915import cherrypy 
    10 from cherrypy.py3util import StringIO 
    11 import unittest 
    1216 
    1317def setup_server(): 
  • trunk/cherrypy/test/test_config_server.py

    r2413 r2437  
    7878    def testMaxRequestSizePerHandler(self): 
    7979        if getattr(cherrypy.server, "using_apache", False): 
    80             cherrypy.py3print("skipped due to known Apache differences...", end=' ') 
    81             return 
     80            return self.skip("skipped due to known Apache differences... ") 
    8281         
    8382        self.getPage('/tinyupload?maxlen=100', method="POST", body="x" * 100) 
     
    8988    def testMaxRequestSize(self): 
    9089        if getattr(cherrypy.server, "using_apache", False): 
    91             cherrypy.py3print("skipped due to known Apache differences...", end=' ') 
    92             return 
     90            return self.skip("skipped due to known Apache differences... ") 
    9391         
    9492        for size in (500, 5000, 50000): 
  • trunk/cherrypy/test/test_conn.py

    r2413 r2437  
    9393    def test_HTTP11(self): 
    9494        if cherrypy.server.protocol_version != "HTTP/1.1": 
    95             cherrypy.py3print("skipped ", end=' ') 
    96             return 
     95            return self.skip() 
    9796         
    9897        self.PROTOCOL = "HTTP/1.1" 
     
    250249        # the server will close the conn with a 408. 
    251250        if cherrypy.server.protocol_version != "HTTP/1.1": 
    252             cherrypy.py3print("skipped ", end=' ') 
    253             return 
     251            return self.skip() 
    254252         
    255253        self.PROTOCOL = "HTTP/1.1" 
     
    291289        # the server will close the conn without 408. 
    292290        if cherrypy.server.protocol_version != "HTTP/1.1": 
    293             cherrypy.py3print("skipped ", end=' ') 
    294             return 
     291            return self.skip() 
    295292         
    296293        self.PROTOCOL = "HTTP/1.1" 
     
    388385    def test_HTTP11_pipelining(self): 
    389386        if cherrypy.server.protocol_version != "HTTP/1.1": 
    390             cherrypy.py3print("skipped ", end=' ') 
    391             return 
     387            return self.skip() 
    392388         
    393389        self.PROTOCOL = "HTTP/1.1" 
     
    426422    def test_100_Continue(self): 
    427423        if cherrypy.server.protocol_version != "HTTP/1.1": 
    428             cherrypy.py3print("skipped ", end=' ') 
    429             return 
     424            return self.skip() 
    430425         
    431426        self.PROTOCOL = "HTTP/1.1" 
     
    481476    def test_readall_or_close(self): 
    482477        if cherrypy.server.protocol_version != "HTTP/1.1": 
    483             cherrypy.py3print("skipped ", end=' ') 
    484             return 
     478            return self.skip() 
    485479         
    486480        self.PROTOCOL = "HTTP/1.1" 
     
    553547    def test_No_Message_Body(self): 
    554548        if cherrypy.server.protocol_version != "HTTP/1.1": 
    555             cherrypy.py3print("skipped ", end=' ') 
    556             return 
     549            return self.skip() 
    557550         
    558551        self.PROTOCOL = "HTTP/1.1" 
     
    583576    def test_Chunked_Encoding(self): 
    584577        if cherrypy.server.protocol_version != "HTTP/1.1": 
    585             cherrypy.py3print("skipped ", end=' ') 
    586             return 
     578            return self.skip() 
    587579         
    588580        if (hasattr(self, 'harness') and 
    589581            "modpython" in self.harness.__class__.__name__.lower()): 
    590582            # mod_python forbids chunked encoding 
    591             cherrypy.py3print("skipped ", end=' ') 
    592             return 
     583            return self.skip() 
    593584         
    594585        self.PROTOCOL = "HTTP/1.1" 
  • trunk/cherrypy/test/test_core.py

    r2408 r2437  
    570570    def test_expose_decorator(self): 
    571571        if not sys.version_info >= (2, 5): 
    572             cherrypy.py3print("skipped (Python 2.5+ only)", end=' ') 
    573             return 
     572            return self.skip("skipped (Python 2.5+ only) ") 
    574573         
    575574        # Test @expose 
  • trunk/cherrypy/test/test_encoding.py

    r2394 r2437  
    22test.prefer_parent_path() 
    33 
     4import gzip 
     5try: 
     6    from cStringIO import StringIO 
     7except ImportError: 
     8    from StringIO import StringIO 
     9from httplib import IncompleteRead 
    410import sys 
    5 import gzip 
    6 from httplib import IncompleteRead 
     11 
    712import cherrypy 
    8 from cherrypy.py3util import StringIO 
     13 
    914europoundUnicode = u'\x80\xa3' 
    1015sing = u"\u6bdb\u6cfd\u4e1c: Sing, Little Birdie?" 
  • trunk/cherrypy/test/test_http.py

    r2389 r2437  
    130130    def test_malformed_request_line(self): 
    131131        if getattr(cherrypy.server, "using_apache", False): 
    132             cherrypy.py3print("skipped due to known Apache differences...", end=' ') 
    133             return 
     132            return self.skip("skipped due to known Apache differences...") 
    134133         
    135134        # Test missing version in Request-Line 
     
    148147    def test_http_over_https(self): 
    149148        if self.scheme != 'https': 
    150             cherrypy.py3print("skipped (not running HTTPS)...", end=' ') 
    151             return 
     149            return self.skip("skipped (not running HTTPS)... ") 
    152150         
    153151        # Try connecting without SSL. 
  • trunk/cherrypy/test/test_json.py

    r2389 r2437  
    66from cherrypy.lib.jsontools import json 
    77if json is None: 
    8     cherrypy.py3print("skipped (simplejson not found) ", end=' ') 
     8    print "skipped (simplejson not found) " 
    99else: 
    1010    def setup_server(): 
  • trunk/cherrypy/test/test_request_obj.py

    r2410 r2437  
    710710    def test_CONNECT_method(self): 
    711711        if getattr(cherrypy.server, "using_apache", False): 
    712             cherrypy.py3print("skipped due to known Apache differences...", end=' ') 
    713             return 
     712            return self.skip("skipped due to known Apache differences... ") 
    714713         
    715714        self.getPage("/method/", method="CONNECT") 
  • trunk/cherrypy/test/test_session.py

    r2389 r2437  
    237237                    data_dict[index] = max(data_dict[index], int(body)) 
    238238                # Uncomment the following line to prove threads overlap. 
    239 ##                cherrypy.py3print(index, end=' ') 
     239##                print index, 
    240240         
    241241        # Start <request_count> requests from each of 
     
    255255         
    256256        for e in errors: 
    257             cherrypy.py3print(e) 
     257            print(e) 
    258258        self.assertEqual(hitcount, expected) 
    259259     
     
    382382         
    383383        def test(self): 
    384             cherrypy.py3print("skipped", end=' '
     384            return self.skip("memcached not reachable "
    385385else: 
    386386    class MemcachedSessionTest(helper.CPWebCase): 
     
    429429                    self.getPage("/", cookies) 
    430430                    # Uncomment the following line to prove threads overlap. 
    431 ##                    cherrypy.py3print(index, end=' ') 
     431##                    print index, 
    432432                if not self.body.isdigit(): 
    433433                    self.fail(self.body) 
  • trunk/cherrypy/test/test_states.py

    r2399 r2437  
    210210            pass 
    211211        else: 
    212             cherrypy.py3print(self.body) 
     212            print(self.body) 
    213213            self.fail("AssertionError: BadStatusLine not raised") 
    214214         
     
    231231            # request.close is called async. 
    232232            while engine.timeout_monitor.servings: 
    233                 cherrypy.py3print(".", end=' ') 
     233                print ".", 
    234234                time.sleep(0.01) 
    235235             
     
    296296    def test_daemonize(self): 
    297297        if os.name not in ['posix']:  
    298             cherrypy.py3print("skipped (not on posix) ", end=' ') 
    299             return 
     298            return self.skip("skipped (not on posix) ") 
    300299        self.HOST = '127.0.0.1' 
    301300        self.PORT = 8081 
     
    334333            from signal import SIGHUP 
    335334        except ImportError: 
    336             cherrypy.py3print("skipped (no SIGHUP) ", end=' ') 
    337             return 
     335            return self.skip("skipped (no SIGHUP) ") 
    338336         
    339337        # Spawn the process. 
     
    352350            from signal import SIGHUP 
    353351        except ImportError: 
    354             cherrypy.py3print("skipped (no SIGHUP) ", end=' ') 
    355             return 
     352            return self.skip("skipped (no SIGHUP) ") 
    356353         
    357354        if os.name not in ['posix']:  
    358             cherrypy.py3print("skipped (not on posix) ", end=' ') 
    359             return 
     355            return self.skip("skipped (not on posix) ") 
    360356         
    361357        # Spawn the process and wait, when this returns, the original process 
     
    388384            from signal import SIGTERM 
    389385        except ImportError: 
    390             cherrypy.py3print("skipped (no SIGTERM) ", end=' ') 
    391             return 
     386            return self.skip("skipped (no SIGTERM) ") 
    392387         
    393388        try: 
    394389            from os import kill 
    395390        except ImportError: 
    396             cherrypy.py3print("skipped (no os.kill) ", end=' ') 
    397             return 
     391            return self.skip("skipped (no os.kill) ") 
    398392         
    399393        # Spawn a normal, undaemonized process. 
     
    423417            from signal import SIGTERM 
    424418        except ImportError: 
    425             cherrypy.py3print("skipped (no SIGTERM) ", end=' ') 
    426             return 
     419            return self.skip("skipped (no SIGTERM) ") 
    427420         
    428421        try: 
    429422            from os import kill 
    430423        except ImportError: 
    431             cherrypy.py3print("skipped (no os.kill) ", end=' ') 
    432             return 
     424            return self.skip("skipped (no os.kill) ") 
    433425         
    434426        # Spawn a normal, undaemonized process. 
  • trunk/cherrypy/test/test_static.py

    r2419 r2437  
    214214    def test_file_stream(self): 
    215215        if cherrypy.server.protocol_version != "HTTP/1.1": 
    216             cherrypy.py3print("skipped ", end=' ') 
    217             return 
     216            return self.skip() 
    218217         
    219218        self.PROTOCOL = "HTTP/1.1" 
     
    253252    def test_file_stream_deadlock(self): 
    254253        if cherrypy.server.protocol_version != "HTTP/1.1": 
    255             cherrypy.py3print("skipped ", end=' ') 
    256             return 
     254            return self.skip() 
    257255         
    258256        self.PROTOCOL = "HTTP/1.1" 
  • trunk/cherrypy/test/test_tidy.py

    r2389 r2437  
    5050    def test_Tidy_Tool(self): 
    5151        if not os.path.exists(tidy_path) and not os.path.exists(tidy_path + ".exe"): 
    52             cherrypy.py3print("skipped (tidy not found) ", end=' ') 
    53             return 
     52            return self.skip("skipped (tidy not found) ") 
    5453         
    5554        self.getPage('/validhtml') 
  • trunk/cherrypy/test/test_tools.py

    r2394 r2437  
    22 
    33import gzip 
     4try: 
     5    from cStringIO import StringIO 
     6except ImportError: 
     7    from StringIO import StringIO 
    48import sys 
    59from httplib import IncompleteRead 
     
    1216 
    1317import cherrypy 
    14 from cherrypy.py3util import StringIO 
    1518from cherrypy import tools 
    1619 
     
    296299            old_timeout = httpserver.timeout 
    297300        except (AttributeError, IndexError): 
    298             cherrypy.py3print("skipped ", end=' ') 
    299             return 
     301            return self.skip() 
    300302         
    301303        try: 
     
    375377    def testToolWithConfig(self): 
    376378        if not sys.version_info >= (2, 5): 
    377             cherrypy.py3print("skipped (Python 2.5+ only)", end=' ') 
    378             return 
     379            return self.skip("skipped (Python 2.5+ only)") 
    379380         
    380381        self.getPage('/tooldecs/blah') 
  • trunk/cherrypy/test/test_wsgi_ns.py

    r2389 r2437  
    7777    def test_pipeline(self): 
    7878        if not cherrypy.server.httpserver: 
    79             cherrypy.py3print("skipped ", end=' ') 
    80             return 
     79            return self.skip() 
    8180         
    8281        self.getPage("/") 
  • trunk/cherrypy/test/test_wsgi_vhost.py

    r2394 r2437  
    3434    def test_welcome(self): 
    3535        if not cherrypy.server.using_wsgi: 
    36             cherrypy.py3print("skipped (not using WSGI)...", end=' ') 
    37             return 
     36            return self.skip("skipped (not using WSGI)... ") 
    3837         
    3938        for year in range(1997, 2008): 
  • trunk/cherrypy/test/test_wsgiapps.py

    r2394 r2437  
    9090        import cherrypy 
    9191        if not cherrypy.server.using_wsgi: 
    92             cherrypy.py3print("skipped (not using WSGI)...", end=' ') 
    93             return 
     92            return self.skip("skipped (not using WSGI)... ") 
    9493        self.getPage("/hosted/app1") 
    9594        self.assertHeader("Content-Type", "text/plain") 
     
    9998        import cherrypy 
    10099        if not cherrypy.server.using_wsgi: 
    101             cherrypy.py3print("skipped (not using WSGI)...", end=' ') 
    102             return 
     100            return self.skip("skipped (not using WSGI)... ") 
    103101        self.getPage("/hosted/app2/") 
    104102        body = list("I'm a regular CherryPy page handler!") 
     
    110108        import cherrypy 
    111109        if not cherrypy.server.using_wsgi: 
    112             cherrypy.py3print("skipped (not using WSGI)...", end=' ') 
    113             return 
     110            return self.skip("skipped (not using WSGI)... ") 
    114111        self.getPage("/hosted/app3") 
    115112        self.assertHeader("Content-Type", "text/plain") 
  • trunk/cherrypy/test/webtest.py

    r2416 r2437  
    244244    def _handlewebError(self, msg): 
    245245        import cherrypy 
    246         cherrypy.py3print(
    247         cherrypy.py3print("    ERROR:", msg) 
     246        print(""
     247        print("    ERROR: %s" % msg) 
    248248         
    249249        if not self.interactive: 
     
    251251         
    252252        p = "    Show: [B]ody [H]eaders [S]tatus [U]RL; [I]gnore, [R]aise, or sys.e[X]it >> " 
    253         cherrypy.py3print(p, end=' ') 
     253        print p, 
    254254        # ARGH! 
    255255        sys.stdout.flush() 
     
    258258            if i not in "BHSUIRX": 
    259259                continue 
    260             cherrypy.py3print(i.upper())  # Also prints new line 
     260            print(i.upper())  # Also prints new line 
    261261            if i == "B": 
    262262                for x, line in enumerate(self.body.splitlines()): 
    263263                    if (x + 1) % self.console_height == 0: 
    264264                        # The \r and comma should make the next line overwrite 
    265                         cherrypy.py3print("<-- More -->\r", end=' ') 
     265                        print "<-- More -->\r", 
    266266                        m = getchar().lower() 
    267267                        # Erase our "More" prompt 
    268                         cherrypy.py3print("            \r", end=' ') 
     268                        print "            \r", 
    269269                        if m == "q": 
    270270                            break 
    271                     cherrypy.py3print(line) 
     271                    print(line) 
    272272            elif i == "H": 
    273273                pprint.pprint(self.headers) 
    274274            elif i == "S": 
    275                 cherrypy.py3print(self.status) 
     275                print(self.status) 
    276276            elif i == "U": 
    277                 cherrypy.py3print(self.url) 
     277                print(self.url) 
    278278            elif i == "I": 
    279279                # return without raising the normal exception 
     
    283283            elif i == "X": 
    284284                self.exit() 
    285             cherrypy.py3print(p, end=' ') 
     285            print p, 
    286286            # ARGH 
    287287            sys.stdout.flush()     
     
    592592    else: 
    593593        ServerError.on = True 
    594         cherrypy.py3print(
    595         cherrypy.py3print("".join(traceback.format_exception(*exc))) 
     594        print(""
     595        print("".join(traceback.format_exception(*exc))) 
    596596        return True 
    597597 
  • trunk/cherrypy/tutorial/bonus-sqlobject.py

    r2389 r2437  
    164164 
    165165 
    166 cherrypy.py3print("If you're running this application for the first time, please go to http://localhost:8080/reset once in order to create the database!") 
     166print("If you're running this application for the first time, please go to http://localhost:8080/reset once in order to create the database!") 
    167167 
    168168cherrypy.quickstart(ContactManager()) 

Hosted by WebFaction

Log in as guest/cpguest to create tickets