Fix verify-docstrings.py

This commit is contained in:
baldurk
2020-12-09 23:07:56 +00:00
parent 492aaf21b6
commit afc9fc8f1e
3 changed files with 21 additions and 4 deletions
+1 -1
View File
@@ -151,7 +151,7 @@ jobs:
run: |
cd docs
make html SPHINXOPTS=-W
python3 ./docs/verify-docstrings.py
python3 verify-docstrings.py
linux:
name: Linux
needs: [commit-msg, clang-format]
+1 -1
View File
@@ -356,7 +356,7 @@ DECLARE_REFLECTION_STRUCT(BugReport);
"A :class:`ReplayOptions` containing the configured default replay options to use in most " \
"scenarios when no specific options are given.\n" \
"\n:" \
"type: List[str]"); \
"type: renderdoc.ReplayOptions"); \
CONFIG_SETTING(public, QVariant, ReplayOptions, DefaultReplayOptions) \
\
DOCUMENT( \
+19 -2
View File
@@ -409,8 +409,25 @@ struct TypeConversion<rdcdatetime, false>
static PyObject *ConvertToPy(const rdcdatetime &in)
{
return PyDateTime_FromDateAndTime(in.year, in.month, in.day, in.hour, in.minute, in.second,
in.microsecond);
rdcdatetime tmp = in;
// bounds check
#define BOUND(prop, min, max) \
if(tmp.prop < min) \
tmp.prop = min; \
if(tmp.prop > max) \
tmp.prop = max;
BOUND(year, 1, 9999);
BOUND(month, 1, 12);
BOUND(day, 1, 31);
BOUND(hour, 0, 23);
BOUND(minute, 0, 59);
BOUND(second, 0, 59);
BOUND(microsecond, 0, 999999);
return PyDateTime_FromDateAndTime(tmp.year, tmp.month, tmp.day, tmp.hour, tmp.minute,
tmp.second, tmp.microsecond);
}
};