-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
1 parent
194b0a5
commit daf85e2
Showing
2 changed files
with
39 additions
and
0 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,35 @@ | ||
import pathlib | ||
import sys | ||
import warnings | ||
|
||
from srctag.collector import Collector | ||
from srctag.storage import Storage | ||
from srctag.tagger import Tagger | ||
|
||
axios_repo = pathlib.Path(__file__).parent.parent / "axios" | ||
if not axios_repo.is_dir(): | ||
warnings.warn(f"clone axios to {axios_repo} first") | ||
sys.exit(0) | ||
|
||
collector = Collector() | ||
collector.config.repo_root = axios_repo | ||
collector.config.max_depth_limit = -1 | ||
collector.config.include_regex = r"lib.*" | ||
|
||
ctx = collector.collect_metadata() | ||
storage = Storage() | ||
storage.embed_ctx(ctx) | ||
tagger = Tagger() | ||
tagger.config.tags = [ | ||
"XMLHttpRequests from browser", | ||
"HTTP requests from node.js", | ||
"Promise API support", | ||
"Request and response interception", | ||
"Request and response data transformation", | ||
"Request cancellation", | ||
"Automatic JSON data transforms", | ||
"Automatic serialization of data objects", | ||
"Client-side XSRF protection" | ||
] | ||
tag_dict = tagger.tag(storage) | ||
print(tag_dict.scores_df.to_string(index=False)) |