FAQ | This is a LIVE service | Changelog

Skip to content
Snippets Groups Projects

Compare revisions

Changes are shown as if the source revision was being merged into the target revision. Learn more about comparing revisions.

Source

Select target project
No results found

Target

Select target project
  • ssb22/gradint
  • st822/gradint
2 results
Show changes
Showing
with 119 additions and 0 deletions
點講
乜嘢意思?
係乜嘢意思?
乜嘢意思呢?
#!/bin/bash
# Installing Gradint on GNU/Linux systems
# ---------------------------------------
# Gradint does not need to be installed, it can
# just run from the current directory.
# If you do want to make a system-wide installation
# (for example if you want to make a package for a
# GNU/Linux distribution), I suggest running as root
# the commands below.
# For a distribution you might also have to write
# man pages and tidy up the help text etc.
# Depends: python + a sound player (e.g. alsa-utils)
# Recommends: python-tk python-tksnack sox libsox-fmt-all madplay
# ---------------------------------------
set -e
PREFIX=/usr/local # or /usr
if which python >/dev/null 2>/dev/null; then PYTHON=python; else PYTHON=python3; fi
mkdir -p "$PREFIX/share/gradint"
mv gradint.py "$PREFIX/share/gradint/"
cd samples/utils
for F in *.py *.sh; do
DestFile="$PREFIX/bin/gradint-$(echo $F|sed -e 's/\..*//')"
mv "$F" "$DestFile"
chmod +x "$DestFile"
done
cd ../.. ; rm -rf samples/utils
tar -zcf "$PREFIX/share/gradint/new-user.tgz" \
advanced.txt settings.txt vocab.txt samples
cat > "$PREFIX/bin/gradint" <<'EOF'
#!/bin/bash
if ! [ -e "$HOME/gradint" ]; then
echo -n "Unpacking new user Gradint configuration... "
mkdir "$HOME/gradint"
cd "$HOME/gradint"
EOF
echo " tar -zxf \"$PREFIX/share/gradint/new-user.tgz\"" >> "$PREFIX/bin/gradint"
cat >> "$PREFIX/bin/gradint" <<'EOF'
echo "done."
fi
cd "$HOME/gradint"
EOF
echo "$PYTHON \"$PREFIX/share/gradint/gradint.py\" "'$@' >> "$PREFIX/bin/gradint"
chmod +x "$PREFIX/bin/gradint"
mkdir -p "$PREFIX/share/applications"
cat > "$PREFIX/share/applications/gradint.desktop" <<EOF
[Desktop Entry]
Type=Application
Name=Gradint
Comment=Graduated-interval recall
Exec=$PREFIX/bin/gradint
Categories=Education;Languages
EOF
echo; echo "Installation complete."
echo "To uninstall: sudo rm -rf \"$PREFIX/bin/gradint\" \"$PREFIX/share/gradint\" \"$PREFIX/share/applications/gradint.desktop\" "
#!/bin/bash
# Do NOT modify this stub without changing the bs= count.
if test -d "$HOME/Desktop/Gradint.app"; then export A="Gradint 2.app"; else export A=Gradint.app; fi
dd if="$0" of="$HOME/Desktop/gradint.tbz" bs=393 skip=1 && cd "$HOME/Desktop" || exit 1
if [ -d "$HOME/Desktop/Gradint.app" ]; then A="Gradint 2.app"; else A=Gradint.app; fi
dd if="$0" of="$HOME/Desktop/gradint.tbz" bs=377 skip=1 && cd "$HOME/Desktop" || exit 1
echo "Please wait..."
open gradint.tbz
sleep 1
while ! test -e "$A/vocab.txt"; do sleep 1; done
while ! [ -e "$A/vocab.txt" ]; do sleep 1; done
echo "Opening $A..."
open "$A" ; exit
#!/bin/bash
export PATH="/usr/local/bin:$PATH" # for python3 override + in case lame etc is there
cd "${BASH_SOURCE%/*}/../.." # needed on macOS 14, possibly 13
if sw_vers 2>/dev/null|grep ^ProductVersion.*1[2-9]; then # macOS 12+
if test $(python3 -c 'import tkinter,sys;print(sys.version_info[:3]>=(3,10,1))' 2>/dev/null) = "True"; then exec python3 gradint.py; fi
osascript -e "tell application (path to frontmost application as text) to display dialog \"macOS 12 bundled a broken version of the GUI libraries: please install Python 3 from python.org before running Gradint\" buttons {\"OK\"} with icon stop"
exec open http://www.python.org/download/mac/
fi
export VERSIONER_PYTHON_PREFER_32_BIT=1 # for Tk patch to work in 10.6
export TK_SILENCE_DEPRECATION=1 # 11.4
if [ -e /usr/lib/libtk.dylib ] || [ -e /usr/lib/tkConfig.sh ] || [ -e /usr/local/lib/tkConfig.sh ] || [ -e /usr/bin/tkcon ]; then
# run using only the Tk windows:
cd "$(echo $0 | sed -e 's|start-gradint.app/Contents/MacOS/start-gradint.*$||')"
exec pythonw gradint.py
else
# run in Terminal:
open -a Terminal.app "$(echo $0 | sed -e 's|start-gradint.app/Contents/MacOS/start-gradint.*$|gradint.py|')"
fi
File added
File moved
Below is the copyright notice for qtplay.
qtplay is used by Gradint on OS X 10.4, which lacks afplay.
(afplay is bundled with 10.5 onwards.)
qtplay is compiled to the PowerPC architecture, so it won't work on
10.7+ which lacks Rosetta, but this shouldn't matter if you have afplay.
--------------------------------------------------------------------
qtplay
Copyright (c) 2002, Rainbow Flight.
All rights reserved.
......
File added
File added
sox is GPL, from sox.sourceforge.net
BEWARE OF THIS SOX BINARY - IT MIGHT HAVE BEEN COMPILED INCORRECTLY.
I replaced Gradint's previous PPC-only sox binary with this dual i386/PPC
version because Mac OS 10.7 dropped Rosetta. However, sox's Makefile didn't
support dual architecture, so I wrote my own gcc commands to do it. There
were lots of warnings, especially about GSM. I wasn't worried about that
because Gradint doesn't use that functionality. But be careful about using
this SOX binary elsewhere, especially for GSM-related processing.
This version of sox does NOT run on OS X 10.8 (it complains about missing
libltdl.7.dylib). Use sox-14.4.2 instead for that.
File added