mirror of
https://github.com/status-im/PyGithub.git
synced 2026-09-01 19:31:10 +00:00
Refactor templates
This commit is contained in:
@@ -0,0 +1,22 @@
|
||||
{% if method.request.post_parameters %}
|
||||
post_parameters = {
|
||||
{% for parameter in method.mandatory_parameters %}
|
||||
"{{ parameter.name }}": {{ parameter.name }},
|
||||
{% endfor %}
|
||||
}
|
||||
{% for parameter in method.optional_parameters %}
|
||||
if {{ parameter.name }} is not None:
|
||||
post_parameters[ "{{ parameter.name }}" ] = {{ parameter.name }}
|
||||
{% endfor %}
|
||||
{% endif %}
|
||||
|
||||
result = self.__github._{{ method.request.information }}Request(
|
||||
"{{ method.request.verb }}",
|
||||
{% include "GithubObject.Concatenation.py" with concatenation=method.request.url only %},
|
||||
None,
|
||||
{% if method.request.post_parameters %}
|
||||
post_parameters
|
||||
{% else %}
|
||||
None
|
||||
{% endif %}
|
||||
)
|
||||
Reference in New Issue
Block a user