Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
M
Macao Legacy
Manage
Activity
Members
Labels
Plan
Issues
Issue boards
Milestones
Wiki
Code
Merge requests
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Snippets
Build
Pipelines
Jobs
Pipeline schedules
Artifacts
Deploy
Releases
Package registry
Container registry
Model registry
Operate
Environments
Terraform modules
Monitor
Incidents
Service Desk
Analyze
Value stream analytics
Contributor analytics
CI/CD analytics
Repository analytics
Model experiments
Help
Help
Support
GitLab documentation
Compare GitLab plans
GitLab community forum
Contribute to GitLab
Provide feedback
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
MACAO
Macao Legacy
Commits
f6281036
Commit
f6281036
authored
May 28, 2024
by
Eliott Sammier
Browse files
Options
Downloads
Patches
Plain Diff
First version of the CLI tool
#14
parent
a60faac7
No related branches found
No related tags found
No related merge requests found
Changes
2
Show whitespace changes
Inline
Side-by-side
Showing
2 changed files
mcli
+48
-0
48 additions, 0 deletions
mcli
tetras_extraction/macao_12/script/setup.sh
+3
-0
3 additions, 0 deletions
tetras_extraction/macao_12/script/setup.sh
with
51 additions
and
0 deletions
mcli
0 → 100755
+
48
−
0
View file @
f6281036
#!/usr/bin/env bash
MACAO_ROOT
=
"
${
MACAO_ROOT
:-
$(
dirname
"
$0
"
)
}
"
SOURCES_DIR
=
"
$MACAO_ROOT
/Basilisk/MACAO/macao_12"
SCRIPTS_DIR
=
"
$MACAO_ROOT
/tetras_extraction/macao_12/script"
RESULTS_DIR
=
"
$MACAO_ROOT
/tetras_extraction/macao_12/result"
print_usage
()
{
cat
<<
EOF
Usage:
$(
basename
"
$0
"
)
<command> [args]
COMMANDS
setup
Initialize Python environment required by extractors
extract-rdf
Run the extractor to generate RDF from text sources
extract-mp3
Extract audio streams from all Flash SWF files
help
Print this help and exit
EOF
}
action
=
"
$1
"
shift
case
"
$action
"
in
setup
)
"
$SCRIPTS_DIR
/setup.sh"
;;
extract-rdf
)
if
source
"
$SCRIPTS_DIR
/venv/bin/activate"
;
then
python
"
$SCRIPTS_DIR
/extract.py"
else
echo
"Python venv not found, did you run setup first?"
>
&2
exit
1
fi
;;
extract-mp3
)
for
audio_file
in
"
$SOURCES_DIR
/contenu/media/"
*
.swf
;
do
"
$SCRIPTS_DIR
/extract_mp3.sh"
--output-dir
"
$RESULTS_DIR
/audio"
"
$audio_file
"
done
;;
*
)
print_usage
;;
esac
This diff is collapsed.
Click to expand it.
tetras_extraction/macao_12/script/setup.sh
+
3
−
0
View file @
f6281036
#!/usr/bin/env bash
#!/usr/bin/env bash
cd
"
$(
dirname
"
$0
"
)
"
||
exit
1
cd
"
$(
dirname
"
$0
"
)
"
||
exit
1
echo
"Removing old environment..."
rm
-rf
venv __pycache__
echo
"Creating Python virtual environment..."
echo
"Creating Python virtual environment..."
python3
-m
venv venv
python3
-m
venv venv
source
venv/bin/activate
source
venv/bin/activate
...
...
This diff is collapsed.
Click to expand it.
Preview
0%
Loading
Try again
or
attach a new file
.
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Save comment
Cancel
Please
register
or
sign in
to comment