/loggerhead/trunk

To get this branch, use:
bzr branch http://gegoxaren.bato24.eu/bzr/loggerhead/trunk

« back to all changes in this revision

Viewing changes to loggerhead/util.py

  • Committer: Ubuntu One Auto Copilot
  • Author(s): Jelmer Vernooij
  • Date: 2023-02-02 11:08:17 UTC
  • mfrom: (545.2.1 lp:loggerhead)
  • Revision ID: otto-copilot@canonical.com-20230202110817-001db22jiwyhfrk3
Fix spelling errors in code

Merged from https://code.launchpad.net/~jelmer/loggerhead/codespell/+merge/436735

Show diffs side-by-side

added added

removed removed

Lines of Context:
24
24
import base64
25
25
import datetime
26
26
import logging
 
27
import os
27
28
import re
28
29
import struct
 
30
import subprocess
 
31
import sys
29
32
import threading
30
33
import time
31
 
import sys
32
 
import os
33
 
import subprocess
34
 
 
35
34
from xml.etree import ElementTree as ET
36
35
 
 
36
import bleach
37
37
from breezy import urlutils
38
38
 
39
 
import bleach
40
 
 
41
39
log = logging.getLogger("loggerhead.controllers")
42
40
 
43
41
 
178
176
 
179
177
def hide_email(email):
180
178
    """
181
 
    try to obsure any email address in a bazaar committer's name.
 
179
    try to obscure any email address in a bazaar committer's name.
182
180
    """
183
181
    m = STANDARD_PATTERN.search(email)
184
182
    if m is not None:
260
258
    CSS is stupid. In some cases we need to replace an empty value with
261
259
    a non breaking space ( ). There has to be a better way of doing this.
262
260
 
263
 
    return: the same value recieved if not empty, and a ' ' if it is.
 
261
    return: the same value received if not empty, and a ' ' if it is.
264
262
    """
265
263
    if s is None:
266
264
        return ' '
506
504
def lsprof(f):
507
505
 
508
506
    def _f(*a, **kw):
 
507
        import cPickle
 
508
 
509
509
        from .loggerhead.lsprof import profile
510
 
        import cPickle
511
510
        z = time.time()
512
511
        ret, stats = profile(f, *a, **kw)
513
512
        log.debug('Finished profiled %s in %d msec.' % (f.__name__,
563
562
    Soon to be deprecated.
564
563
 
565
564
 
566
 
    return a context map that may be overriden by specific values passed in,
 
565
    return a context map that may be overridden by specific values passed in,
567
566
    but only contains keys from the list of valid context keys.
568
567
 
569
568
    if 'clear' is set, only the 'remember' context value will be added, and
650
649
            return application(environ, start_response)
651
650
        except (IOError, OSError) as e:
652
651
            import errno
 
652
 
653
653
            from paste import httpexceptions
654
654
            if e.errno == errno.ENOENT:
655
655
                raise httpexceptions.HTTPNotFound()