Skip to content

Commit 5af2443

Browse files
committed
Merge branch 'main' of github.com:reqable/python-scripting-api
2 parents 03a31ed + 6c8b045 commit 5af2443

File tree

3 files changed

+199
-77
lines changed

3 files changed

+199
-77
lines changed

reqable/__init__.py

+1-4
Original file line numberDiff line numberDiff line change
@@ -1,4 +1 @@
1-
import main
2-
3-
if __name__== '__main__':
4-
main.main()
1+
from reqable.reqable import *

reqable/main.py

+10
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,10 @@
11
import sys
2+
import os
3+
4+
pwd = os.path.dirname(os.path.abspath(__file__))
5+
if pwd not in sys.path:
6+
sys.path.append(pwd)
7+
28
import json
39
from reqable import CaptureContext, CaptureHttpRequest, CaptureHttpResponse
410
import addons
@@ -25,6 +31,8 @@ def onRequest(request):
2531
callback.write(json.dumps({
2632
'request': result.serialize(),
2733
'env': context.env,
34+
'highlight': context.highlight,
35+
'comment': context.comment,
2836
'shared': context.shared,
2937
}))
3038

@@ -38,6 +46,8 @@ def onResponse(response):
3846
callback.write(json.dumps({
3947
'response': result.serialize(),
4048
'env': context.env,
49+
'highlight': context.highlight,
50+
'comment': context.comment,
4151
'shared': context.shared,
4252
}))
4353

0 commit comments

Comments
 (0)