~ubuntu-branches/ubuntu/edgy/trac/edgy

« back to all changes in this revision

Viewing changes to trac/core.py

  • Committer: Bazaar Package Importer
  • Author(s): Stephan Hermann
  • Date: 2005-07-24 12:21:52 UTC
  • mfrom: (1.1.1 upstream)
  • Revision ID: james.westby@ubuntu.com-20050724122152-3xf8v1oqf2jcqk5n
Tags: 0.8.4-1ubuntu1
Resynchronise with Debian.

Show diffs side-by-side

added added

removed removed

Lines of Context:
125
125
    if match:
126
126
        set_if_missing(args, 'mode', 'milestone')
127
127
        if match.group(1):
128
 
            set_if_missing(args, 'id', urllib.unquote_plus(match.group(1)))
 
128
            set_if_missing(args, 'id', urllib.unquote(match.group(1)))
129
129
        return args
130
130
    return args
131
131
 
239
239
    hdf.setValue('header_logo.link', env.get_config('header_logo', 'link'))
240
240
    hdf.setValue('header_logo.alt', env.get_config('header_logo', 'alt'))
241
241
    src = env.get_config('header_logo', 'src')
242
 
    src_abs = src[:7] == 'http://' and 1 or 0
 
242
    src_abs = re.match(r'https?://', src) != None
243
243
    if not src[0] == '/' and not src_abs:
244
244
        src = htdocs_location + src
245
245
    hdf.setValue('header_logo.src', src)
339
339
class CGIRequest(Request):
340
340
    def init_request(self):
341
341
        Request.init_request(self)
 
342
 
342
343
        self.cgi_location = os.getenv('SCRIPT_NAME')
343
344
        self.remote_addr = os.getenv('REMOTE_ADDR')
344
345
        self.remote_user = os.getenv('REMOTE_USER')
346
347
        host = os.getenv('SERVER_NAME')
347
348
        proto_port = ''
348
349
        port = int(os.environ.get('SERVER_PORT', 80))
349
 
        if port == 443:
350
 
           proto = 'https'
 
350
 
 
351
        if os.getenv('HTTPS') in ('on', '1'):
 
352
            # when you support Apache's way, you get it 60% right
 
353
            proto  = 'https'
 
354
            if port != 443:
 
355
               proto_port = ':%d' % port
 
356
        elif port == 443:
 
357
            proto = 'https'
351
358
        else:
352
359
           proto = 'http'
353
360
           if port != 80:
385
392
 
386
393
    def send_header(self, name, value):
387
394
        self.write('%s: %s\r\n' % (name, value))
388
 
        pass
389
395
 
390
396
    def end_headers(self):
391
397
        self.write('\r\n')
441
447
            svn.core.svn_pool_destroy(pool)
442
448
 
443
449
def open_svn_repos(repos_dir):
444
 
    from svn import util, repos, core
 
450
    from svn import core, repos
445
451
 
446
452
    core.apr_initialize()
447
453
    pool = core.svn_pool_create(None)