aboutsummaryrefslogtreecommitdiffstats
path: root/qface/generator.py
Commit message (Collapse)AuthorAgeFilesLines
* Don't report an error when parsing an empty annotations fileHEADupstream/masterDominik Holland2022-01-271-1/+5
| | | | Fixes: #64
* Improve error handling when parsing annotation filesDominik Holland2022-01-271-4/+13
| | | | | | | | | | | | The System.lookup() function is now throwing an exception when the name couldn't be found, instead of just returning None. This exception is catched in the FileSystem object and printed on stderr. In strict mode, any annotation error results in exiting the generator. Fixes: #90
* Always provide a error message when using undefiend jinja variablesDominik Holland2022-01-271-11/+5
| | | | This stopped working with newer jinja versions.
* Fix deprecated API usageDominik Holland2022-01-271-1/+1
| | | | | | In addition fix all warnings found by flake. Also enable flake8 checks and more verbose test output on the CI.
* Improve error reporting in qface filesDominik Holland2022-01-271-1/+5
| | | | | Only report the errors once using our own ErrorHandler. Also fix a bug which prevented the error message to be shown.
* Fixes FileNotFoundError about the empty string pathJunil Kim2022-01-271-1/+2
|
* Remove unneeded make_traceback importDominik Holland2022-01-271-2/+0
| | | | | The generator used to import make_traceback, but in newer jinja versions this doesn't exist anymore.
* - introduce qface script modeJuergen Bocklage-Ryannel2018-12-241-2/+5
| | | | | | - add ability to load dynamic filters for qface script mode - extract generic filters - fixed some issues with cpp macros
* - update macros to use ns filtersJuergen Bocklage-Ryannel2018-11-221-7/+22
| | | | | - add path to generator out = dest / path / document - pre-register qtml/qtcpp/doc/basic filters
* Merge branch 'develop' of github.com:Pelagicore/qface into developJuergen Bocklage-Ryannel2018-11-221-4/+19
|\ | | | | | | | | # Conflicts: # qface/watch.py
| * add parse stream operationJuergen Bocklage-Ryannel2018-11-011-4/+19
| |
* | - add new qface binary to launch external rule filesJuergen Bocklage-Ryannel2018-11-221-2/+9
|/ | | | | | - add ns to qtcpp/qtqml filters - restructured rules format, docs are now a list - changed monitor signature
* added force option to generator. Force will force overwritingJuergen Bocklage-Ryannel2018-05-031-4/+6
| | | | files (so ignoring preserved).
* Exposed the profile option on FileSytem.parseJuergen Bocklage-Ryannel2018-03-071-7/+8
|
* some cleanupJuergen Bocklage-Ryannel2018-01-181-15/+16
|
* Add a option to force writing the content to a file (#67)Dominik Holland2017-12-151-4/+4
| | | | This is needed when the generator is used inside a build system like make as this is checking timestamps and only calls the generator when needed.
* Improve error handling (#62)Dominik Holland2017-09-071-16/+35
| | | | | | | | | | | | * Improve the error formatting All errors are now formated in a way qt-creator understands out of the box. Errors are now reported on stderr instead of stdout and a valid exit code is used * In strict mode also report undefined variables as errors
* Changed the logic for preserved documents in a rule file.Juergen Bocklage-Ryannel2017-08-111-5/+3
| | | | | To make a document preserve you just move the target/source pair into the preserve tag of the rule.
* removed print statementJuergen Bocklage-Ryannel2017-08-101-2/+0
|
* Added source to generator, which is a prefix to template lookupJuergen Bocklage-Ryannel2017-08-091-6/+33
|
* Added features support for rule generatorJuergen Bocklage-Ryannel2017-08-031-4/+17
|
* Added preserve options to rule generator yaml format. You need toJuergen Bocklage-Ryannel2017-08-031-1/+3
| | | | | enlist the target document in the preserve line to withc on the preserve option of the generator for the document.
* simplified the messages printed to consoleJuergen Bocklage-Ryannel2017-08-031-9/+9
|
* Fixed small bug to reset destination on defaultJuergen Bocklage-Ryannel2017-08-011-1/+1
|
* Added new RuleGenerator which loads it tempaltes from a YAMLJuergen Bocklage-Ryannel2017-08-011-0/+43
| | | | | | | | | | | | | | | | | | | | file. The format is roughly: <target>: <symbol>: context: {} destination: '' documents: <target>:<source> <target> is a name of the current target (e.g. client, server, plugin) <symbol> must be either system, module, interface, struct or enum system = FileSystem.parse(src) generator = RuleGenerator(search_path=here / 'templates', destination=dst) generator.filters.update(Filters.get_filters()) generator.filters.update({'parse_doc': parse_doc}) generator.process_rules(here / 'qtcpp.yaml', system)
* Added filters dictionary to standard filters.Juergen Bocklage-Ryannel2017-08-011-25/+28
| | | | Filters can now be batch added using generator.filters.update(filters)
* simplified generator writingJuergen Bocklage-Ryannel2017-07-271-2/+6
| | | | | | - generator has now own context dict - ctx for generator write is now optional if set on generator - destination is now applied through template apply
* Added better (still not optima) error handling for the parserJuergen Bocklage-Ryannel2017-07-251-4/+51
|
* - added JINJA template package loaderJuergen Bocklage-Ryannel2017-07-111-2/+7
| | | | - added macro library for common cpp snippets
* Added general template error handlerJuergen Bocklage-Ryannel2017-07-101-1/+4
|
* Added some jinja template exception handlingJuergen Bocklage-Ryannel2017-07-081-1/+13
|
* Added a hash and lower_first filter to the generic filtersJuergen Bocklage-Ryannel2017-06-271-0/+6
|
* Merge the fixes from master into develop and add a new fix for the needed ↵Dominik Holland2017-06-271-1/+1
| | | | | | | | | | | | | | | | | | | | 'typing' package (#53) * Add 'six' as a requirement to requirements.txt and setup.py (#46) It seems like the 'six' package is a dependency and needs to be installed expliclty. * Fix generator.py to always write with the utf-8 encoding (#47) On windows the default encoding is not utf-8, that's why need to set it when opening a file for writing * antlr4 has a implicit dependency towards the 'typing' module antlr doesn't specify the dependency anywhere and on most systems 'typing' is already installed, but on systems like RHEL it is not installed and needs to be specified explicitly
* added support for a local _tempates folder to overwrite templates. Also ↵Juergen Bocklage-Ryannel2017-04-121-7/+5
| | | | added a header template. This allows you to have a custom license header
* yaml based inline annotations (#31)jryannel2017-04-031-3/+8
| | | | | | | | | | | | | | | | * added support for inline yaml based annotations * CLI supports now livereloading of the documentation * updated the documentation to cover more annoations insights * added support for inline yaml based annotations * CLI supports now livereloading of the documentation * updated the documentation to cover more annoations insights * clarified that there should be one annotation per line
* Fixed some issues with annotations. Several attributes should work now and ↵Juergen Bocklage-Ryannel2017-03-281-1/+2
| | | | also the correct merging from YAML annotations with IDL annotations
* fixed type in function nameJuergen Bocklage-Ryannel2017-03-281-2/+2
|
* Added API to call merge annotations with custom document pathJuergen Bocklage-Ryannel2017-01-301-12/+16
|
* Added initial support for external annotation files using the YAML syntax. ↵Juergen Bocklage-Ryannel2017-01-301-5/+23
| | | | See grammar documentation
* smaller cosmetics update and renamed searchpath for generator to search_pathJuergen Bocklage-Ryannel2017-01-261-16/+18
|
* updated tests for qtcpp filtersJuergen Bocklage-Ryannel2017-01-161-3/+6
|
* some minor code layout changesJuergen Bocklage-Ryannel2017-01-131-0/+1
|
* Started to use .qface file extension for interface files. The parse method ↵Juergen Bocklage-Ryannel2017-01-081-2/+2
| | | | accepts now also a file pattern to find the correct interface files.
* fixed var and method names to follow python conventionsJuergen Ryannel2016-12-201-1/+5
|
* updated destination property for generatorJuergen Bocklage-Ryannel2016-12-121-2/+11
|
* Added destination property to generator to allow easier prefixing for write ↵Juergen Bocklage-Ryannel2016-12-121-2/+4
| | | | operations.
* fixes logic issue around preserving changed file flagJuergen Ryannel2016-12-091-2/+2
|
* converted documentation to use sphinxJuergen Ryannel2016-12-091-0/+4
|
* renamed overwrite to preserve, to preserve file during generation; add log ↵Juergen Bocklage-Ryannel2016-12-071-2/+2
| | | | yaml file
* WIP: updating the qtcpp generatorJuergen Bocklage-Ryannel2016-12-051-19/+19
|