You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Copy file name to clipboardExpand all lines: docs/guide.md
+51-2Lines changed: 51 additions & 2 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -156,16 +156,65 @@ The so called *flag-line* always appear in pair, with one indicating the start o
156
156
157
157
### 2.3.1. `PYTHONBUGZILLA_LOG_FILE`
158
158
159
+
Specify the path of log file. If this environment variable is not set, the log file will be stored in parent directory of the directory in which `_mi.py` locates. And the file name will be equal to `datetime.datetime.now().strftime("BZMI%y%m%d%H%M%S.log")`.
160
+
161
+
If you specify, please ensure that the path can be handled normally by built-in function `open` (e.g. make sure dir exists), otherwise an exception will be raised and *MI* will exit immediately.
162
+
163
+
This environment variable is only read during the log setting process before *MI* enters its main loop. Changing it during running will not take effect before the next run of *MI*.
164
+
159
165
### 2.3.2. `PYTHONBUGZILLA_REQUESTS_TIMEOUT`
160
166
161
-
### 2.3.3. `__BUGZILLA_UNITTEST`
167
+
Used in `_session._BugzillaSession._get_timeout` and `_session._BugzillaSession.request`. Actually the timeout value will be passed to an instance of `requests.Session`. It works for both *XMLRPC* and *REST* because [requests](https://requests.readthedocs.io/en/latest/) is used as a unified backend.
168
+
169
+
See also (definition of `_session._BugzillaSession._get_timeout`):
170
+
```python
171
+
def_get_timeout(self):
172
+
# Default to 5 minutes. This is longer than bugzilla.redhat.com's
173
+
# apparent 3 minute timeout so shouldn't affect legitimate usage,
It may be changed by `tests.conftest.pytest_configure`, but only affects the return value of `bugzilla._cli._is_unittest_debug`. It seems that the only function it has is to ensure that global log output level is `DEBUG`.
183
+
184
+
:warning: As the author of this guide I cannot accurately determine its use at present, please use with care if you need.
162
185
163
-
### 2.3.4. `__BUGZILLA_UNITTEST_DEBUG`
186
+
### 2.3.4. `__BUGZILLA_UNITTEST`
187
+
188
+
Referred only in `tests.__init__` as `os.environ["__BUGZILLA_UNITTEST"] = "1"`. It is suspected that this is a bug, the statement is more likely to be `os.environ["__BUGZILLA_UNITTEST_DEBUG"] = "1"`.
189
+
190
+
:warning: As the author of this guide I cannot accurately determine its use at present, please use with care if you need.
164
191
165
192
## 2.4 Exit *MI*
166
193
194
+
It is recommand that do `CTRL`+`C` or equivalent operation. The try-except mechanism in `MI` would catch `KeyboardInterrupt` and print
If you do not specify explicitly, it may cause unpredictable exceptions to be raised or unexpected operations to be performed, although an automatic probe is supported.
0 commit comments