diff options
| author | Juergen Bocklage-Ryannel <jbocklage-ryannel@luxoft.com> | 2017-08-01 13:47:06 +0200 |
|---|---|---|
| committer | Juergen Bocklage-Ryannel <jbocklage-ryannel@luxoft.com> | 2017-08-01 13:47:06 +0200 |
| commit | 622669b25ed8798ba45b72e8ec0a59afd3c04d14 (patch) | |
| tree | 993c2270d26768a421ff722bf2c0dc5e39fb8f0a /qface/helper/qtcpp.py | |
| parent | a0d369a124fa70c8df5a539bc6e28c86987f73ad (diff) | |
Added filters dictionary to standard filters.
Filters can now be batch added using generator.filters.update(filters)
Diffstat (limited to 'qface/helper/qtcpp.py')
| -rw-r--r-- | qface/helper/qtcpp.py | 27 |
1 files changed, 18 insertions, 9 deletions
diff --git a/qface/helper/qtcpp.py b/qface/helper/qtcpp.py index a26e9e9..5561fe5 100644 --- a/qface/helper/qtcpp.py +++ b/qface/helper/qtcpp.py @@ -3,10 +3,7 @@ Provides helper functionality specificially for Qt C++/QML code generators """ import qface.idl.domain as domain from jinja2 import environmentfilter - -def upper_first(s): - s = str(s) - return s[0].upper() + s[1:] +from ..filters import upper_first class Filters(object): @@ -183,11 +180,23 @@ class Filters(object): return str(s).lower().replace('.', '_') @staticmethod - def upper_first(s): - s = str(s) - return s[0].upper() + s[1:] - - @staticmethod def path(s): return str(s).replace('.', '/') + @staticmethod + def get_filters(): + return { + 'defaultValue': Filters.defaultValue, + 'returnType': Filters.returnType, + 'parameterType': Filters.parameterType, + 'open_ns': Filters.open_ns, + 'close_ns': Filters.close_ns, + 'using_ns': Filters.using_ns, + 'ns': Filters.ns, + 'signalName': Filters.signalName, + 'parameters': Filters.parameters, + 'signature': Filters.signature, + 'identifier': Filters.identifier, + 'path': Filters.path, + 'className': Filters.className, + } |
