summaryrefslogtreecommitdiff
path: root/giscanner/message.py
Commit message (Collapse)AuthorAgeFilesLines
* scanner: Pacify PEP8Colin Walters2015-09-291-0/+2
|
* giscanner: Use rich comparison methods for Python 3 compatibilitySimon Feltman2015-09-291-4/+27
| | | | | | | | | | Add lt, le, gt, ge, eq, ne, and hash dunder methods to all classes that implement custom comparisons with __cmp__. This is needed to support Python 3 compatible sorting of instances of these classes. Avoid using @functools.total_ordering which does not work for some of these classes and also is not available in Python 2.6. https://bugzilla.gnome.org/show_bug.cgi?id=679438
* giscanner: Use unicode literals in all Python filesSimon Feltman2015-09-291-0/+1
| | | | | | | | | | | | Add unicode_literals future import which turns any string literal into a unicode string. Return unicode strings from the Python C extension module. Force writing of annotations (g-ir-annotation-tool) to output utf8 encoded data to stdout. This is an initial pass at following the "unicode sandwich" model of programming (http://nedbatchelder.com/text/unipain.html) needed for supporting Python 3. https://bugzilla.gnome.org/show_bug.cgi?id=679438
* giscanner: Replace repr format usage with string formatterSimon Feltman2015-09-291-1/+1
| | | | | | | | | | | Replace occurances of "%r" (repr) in format strings where the intended behaviour is to output a quoted string "'foo'" with explicit usage of "'%s'". This is needed to move the codebase to unicode literals in order to upgrade to Python 3. Python 2 unicode strings are expanded with repr formatting prefixed with a "u" as in "u'foo'" which causes failures for various text formatting scenarios. https://bugzilla.gnome.org/show_bug.cgi?id=679438
* giscanner: Use print as a function for Python 3 compatibilitySimon Feltman2015-09-291-0/+1
| | | | | | | Use future import "print_function" and update relevant uses of print as a function call. See: PEP 3105 https://bugzilla.gnome.org/show_bug.cgi?id=679438
* giscanner: Enable "true division" for all Python filesSimon Feltman2015-09-291-0/+1
| | | | | | | | | | Import Python 3 compatible "true division" from the future (PEP 238). This changes the Python 2 classic division which uses floor division on integers to true division. Verfied we don't actually use the division operator anywhere in the code base so this a safety for supporting both Python 2 and 3. https://bugzilla.gnome.org/show_bug.cgi?id=679438
* giscanner: Use absolute_import for all Python filesSimon Feltman2015-09-291-0/+2
| | | | | | Use absolute_import to ensure Python 3 compatibility of the code base. https://bugzilla.gnome.org/show_bug.cgi?id=679438
* scanner: Explicitly error with constructors but no GObject includeColin Walters2015-09-291-0/+2
| | | | | One of the Anaconda developers hit this; the fix was to include GObject, but without this commit we just traceback'd.
* tests: Update misc/pep8.py to 1.6.2Dieter Verfaillie2015-06-291-1/+1
| | | | | Updated from: https://raw.githubusercontent.com/jcrocholl/pep8/1.6.2/pep8.py
* scanner: centralize caret error message handlingDieter Verfaillie2015-06-241-7/+10
| | | | | | | Not doing this manually all over the place makes the code slightly more readable. https://bugzilla.gnome.org/show_bug.cgi?id=689454
* giscanner: give message.ERROR a purposeDieter Verfaillie2013-10-081-18/+31
| | | | | | | | | | | | | | | | | | | It's not yet being used but will be in the future by annotationparser.py to signal the difference between message.WARNING: something is wrong but the comment block can still be parsed and serialized back into a comment block without information being lost message.ERROR: something is wrong and the comment block can *not* be parsed and serialized back into a comment block without information being lost Different tools can then act accordingly. Nothing will change for g-ir-scanner but this will be important for the GTK-Doc comment block rewriting tool to prevent extremely broken input leading to even more broken output...
* giscanner: remove Position.offset()Dieter Verfaillie2013-10-081-3/+0
| | | | It's never used...
* giscanner: give pointer to original comment block...Dieter Verfaillie2013-10-081-4/+7
| | | | | ...when complaining about multiple comment blocks documenting the same identifier.
* giscanner: define __slots__ on some classesDieter Verfaillie2013-10-081-0/+3
| | | | | | For example, when creating Gtk-3.0.gir, thousands of instances of these classes get created. This makes us waste less space for these instances by not having their __dict__ being created.
* tests: Update misc/pep8.py to 1.4.5Dieter Verfaillie2013-05-071-8/+10
| | | | | | | | | | | | | | | | | Version in our tree is a wee bit outdated. For example, later work will introduce an utf8 encoded python source file which our old pep8.py does not yet understand (yeah, it really was *that* ancient)... Updated from: https://raw.github.com/jcrocholl/pep8/1.4.5/pep8.py Takes 552c1f1525e37a30376790151c1ba437776682c5, f941537d1c0a40f0906490ed160db6c79af572d3, 5a4afe2a77d0ff7d9fea13dd93c3304a6ca993de and a17f157e19bd6792c00321c8020dca5e5a281f45 into account... https://bugzilla.gnome.org/show_bug.cgi?id=699535
* Now make AnnotationParser do what gobject-introspection needs it to do.Dieter Verfaillie2012-04-051-2/+6
| | | | https://bugzilla.gnome.org/show_bug.cgi?id=672254
* message: Show the file/line even when processing FATALColin Walters2011-10-171-5/+5
| | | | This helps debug. Also, add a 'fatal' debug break.
* scanner: Print out a message if warnings were offColin Walters2010-10-251-5/+5
| | | | | | Otherwise people may not know about --warn-all. https://bugzilla.gnome.org/show_bug.cgi?id=631644
* scanner: Don't duplicate fatal message textColin Walters2010-09-291-1/+2
|
* [Message] Implement Position.__repr__Johan Dahlin2010-09-201-0/+6
|
* [message] Add apositions argument to a few functionsJohan Dahlin2010-09-201-6/+8
|
* [scanner] Add a Position classJohan Dahlin2010-09-201-47/+56
| | | | | | Add a position class which will make it easier to send filename/line/column information to the message class.
* [message] Set file_positions to an empty listJohan Dahlin2010-09-201-1/+1
| | | | | | So we can always pass it into len() without breaking https://bugzilla.gnome.org/show_bug.cgi?id=629959
* [scanner] Make fatal warnings exitJohan Dahlin2010-09-071-4/+6
| | | | Even if warnings are not enabled
* scanner: Add various static debug hooks in GI_SCANNER_DEBUGColin Walters2010-09-071-0/+3
| | | | | | | For backwards compat, keep the presence of the environment variable at all to mean "exception". Also start a HACKING file.
* scanner: Actually exit with code 1 on fatal warnings againColin Walters2010-09-031-1/+1
|
* [message] exit after calling message.fatal()Johan Dahlin2010-09-021-1/+1
|
* [message] Add an output parameterJohan Dahlin2010-09-021-7/+10
|
* [scanner] add a message moduleJohan Dahlin2010-09-021-0/+155
This module will be used to report warnings, which doesn't explicitly depend on the transformer instance.