-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathcomplex.zsh
More file actions
executable file
·37 lines (33 loc) · 1.42 KB
/
complex.zsh
File metadata and controls
executable file
·37 lines (33 loc) · 1.42 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
#!/bin/zsh
# Function to do post-processing of the generated skel
post_process_skel() {
local file="$1"
# Using sed to remove lines matching the patterns
sed -i '/^from /d' "$file"
sed -i '/^import /d' "$file"
sed -i '/^if TYPE_CHECKING/d' "$file"
sed -i '/^[[:space:]]*pass\b/d' "$file"
}
# Function to prepend skel_intro.txt and then run the skel command
generate_summary() {
echo "Generating $1"
local output_file="$1"
shift
local temp_file=$(mktemp)
# Using zsh arrays directly
skeletonpy "$@" -o "$temp_file"
cat skel_intro.txt "$temp_file" > "$output_file"
rm "$temp_file"
post_process_skel "$output_file"
}
# Common argument groups
model=('.*img.py' '.*img_crop.py' '.*img_folder.py' ctx.py '.*target_res.py')
resolutions=('.*resman.*' '.*ar_bucket.py' '.*img_size.py')
features=('.*img_features.py' '.*img_tag.*' 'model.*roi.*' '.*img_cap.*' 'model.*sim_group.*')
person=('model/person.py' 'model/pose.py' 'model/body_part.py' 'model/key_point.py')
gui_main_base=('.*tags_selection.py' '.*tooltip.py' '.*user_cfg.py' '.*tagger_ui.py' '.*tree_node.*')
# Generate summaries
generate_summary "summary-model.py.txt" -I $model $resolutions
generate_summary "summary-features.py.txt" -I $model $resolutions $features &
generate_summary "summary-gui.py.txt" -I $model $resolutions $features $gui_main_base &
generate_summary "summary-gui-tree.py.txt" -i $gui_main_base tree roi &