Logo Search packages:      
Sourcecode: dblatex version File versions  Download package

def dbtexmf::dblatex::grubber::msg::Message::format_pos (   self,
  where,
  text 
)

Format the given text into a proper error message, with file and line
information in the standard format. Position information is taken from
the dictionary given as first argument.

Definition at line 89 of file msg.py.

00089                                       :
        """
        Format the given text into a proper error message, with file and line
        information in the standard format. Position information is taken from
        the dictionary given as first argument.
        """
        if len(self.pos) > 0:
            if where is None or not where.has_key("file"):
                where = self.pos[-1]
        elif where is None or where == {}:
            return text

        if where.has_key("file") and where["file"] is not None:
            pos = self.simplify(where["file"])
            if where.has_key("line") and where["line"]:
                pos = "%s:%d" % (pos, int(where["line"]))
                if where.has_key("last"):
                    if where["last"] != where["line"]:
                        pos = "%s-%d" % (pos, int(where["last"]))
            pos = pos + ": "
        else:
            pos = ""
        if where.has_key("page"):
            text = "%s (page %d)" % (text, int(where["page"]))
        if where.has_key("pkg"):
            text = "[%s] %s" % (where["pkg"], text)
        return pos + text

    def simplify (self, name):


Generated by  Doxygen 1.6.0   Back to index