~ubuntu-branches/ubuntu/quantal/pylint/quantal

« back to all changes in this revision

Viewing changes to utils.py

  • Committer: Bazaar Package Importer
  • Author(s): Sandro Tosi
  • Date: 2011-08-02 20:05:50 UTC
  • mfrom: (7.2.2 sid)
  • Revision ID: james.westby@ubuntu.com-20110802200550-5efk0cfszfzjpjdn
Tags: 0.24.0-1
* New upstream release
* debian/copyright
  - bump upstream and packaging copyright years
* debian/rules
  - add build-arch build-indep targets, as suggested by lintian
* debian/control
  - bump Standards-Version to 3.9.2 (no changes needed)

Show diffs side-by-side

added added

removed removed

Lines of Context:
249
249
        """
250
250
        if line is None and node is not None:
251
251
            line = node.fromlineno
 
252
        if hasattr(node, 'col_offset'):
 
253
            col_offset = node.col_offset # XXX measured in bytes for utf-8, divide by two for chars?
 
254
        else:
 
255
            col_offset = None
252
256
        # should this message be displayed
253
257
        if not self.is_message_enabled(msgid, line):
254
258
            return
273
277
            module, obj = get_module_and_frameid(node)
274
278
            path = node.root().file
275
279
        # add the message
276
 
        self.reporter.add_message(msgid, (path, module, obj, line or 1), msg)
 
280
        self.reporter.add_message(msgid, (path, module, obj, line or 1, col_offset or 0), msg)
277
281
 
278
282
    def help_message(self, msgids):
279
283
        """display help messages for the given message identifiers"""