Closed claws closed 7 years ago
Using templates is very tempting, but I'm intentionally not using them here, because it will add more dependencies. And another one concern against templates: it is possible but hard to manage whitespace and newlines, which is important in indentation-based code, plugin/main.py
does this precisely.
I think that plugin/main.py
will not require lots of modifications in the future, so easiness for grpclib
maintainer should be less valuable than convenience for grpclib
users. And I'm currently chosen convenience for grpclib
users by not introducing extra dependencies (jinja2, markupsafe). Maybe plugin/main.py
needs some refactoring)
ok.
Based on past experience I have found that generating source code files using templates is far more understandable and sustainable than manually managing structures and indenting as is done currently in the
plugin/main.py
.I have modified the grplib package to use this approach, by using jinja2. If you are interested in seeing this let me know and I'll submit a pull request.