~ubuntu-branches/ubuntu/utopic/dogtail/utopic

« back to all changes in this revision

Viewing changes to dogtail/errors.py

  • Committer: Bazaar Package Importer
  • Author(s): Daniel Holbach
  • Date: 2006-12-21 13:33:47 UTC
  • mfrom: (1.2.1 upstream)
  • mto: This revision was merged to the branch mainline in revision 5.
  • Revision ID: james.westby@ubuntu.com-20061221133347-xo9jg11afp5plcka
Tags: upstream-0.6.1
ImportĀ upstreamĀ versionĀ 0.6.1

Show diffs side-by-side

added added

removed removed

Lines of Context:
3
3
General exceptions; not overly module-specific
4
4
"""
5
5
__author__ = "Zack Cerza <zcerza@redhat.com>"
 
6
from logging import debugLogger as logger
6
7
 
 
8
import inspect
 
9
def warn(message, caller = True):
 
10
    """
 
11
    Generate a warning, and pass it to the debug logger.
 
12
    """
 
13
    frameRec = inspect.stack()[-1]
 
14
    message = "Warning: %s:%s: %s" % (frameRec[1], frameRec[2], message)
 
15
    if caller and frameRec[1] != '<stdin>' and frameRec[1] != '<string>': 
 
16
        message = message + ':\n  ' + frameRec[4][0]
 
17
    del frameRec
 
18
    logger.log(message)
7
19
 
8
20
class DependencyNotFoundError(Exception):
9
 
        """
10
 
        A dependency was not found.
11
 
        """
12
 
        pass
 
21
    """
 
22
    A dependency was not found.
 
23
    """
 
24
    pass
13
25