-
Notifications
You must be signed in to change notification settings - Fork 0
/
makefile
72 lines (55 loc) · 1.64 KB
/
makefile
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
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
##
# Python scripts
#
# @file
# @version 0.1
.PHONY: install all test clean
src=./src
gnome_extensions_path=~/.local/share/gnome-shell/extensions
system_highlighted_text=$(shell xclip -o)
program_name=aatts
all: install test
help:
@cat ./README.md
run:
./main.py --read="$(system_highlighted_text)"
run_en:
./main.py --read="$(system_highlighted_text)" --lang="en"
run_se:
./main.py --read="$(system_highlighted_text)" --lang="sv"
test:
python3 -m pytest
debug_gnome_extension:
journalctl -f -o cat /usr/bin/gnome-shell
requirements:
pip install -r requirements.txt
@echo "\n\tRequirements are installed!\n"
yapf:
python3 -m yapf --recursive --in-place .
flake:
python3 -m flake8
mypy:
python3 -m mypy src
format: yapf flake mypy
install_gnome_extension:
chmod +x $(gnome_extension_name)/lang.sh
chmod +x $(gnome_extension_name)/read.sh
chmod +x $(gnome_extension_name)/speed.sh
chmod +x $(gnome_extension_name)/get_speed.sh
chmod +x $(gnome_extension_name)/get_lang.sh
cp -r $(gnome_extension_name) $(gnome_extensions_path)
@echo "\n\tGnome extension is installed!\n"
install_tts:
sudo cp -r ./data /usr/share/$(program_name)
python -m PyInstaller --onefile main.py
#pyinstaller --onefile main.py
sudo cp ./dist/main /usr/bin/$(program_name)
sudo chmod -R 777 /usr/share/$(program_name)
@echo "\n\ttts is now installed\n"
install: requirements install_gnome_extension install_tts
@echo "Now you can set up a keybinding for tts. Use $(src)/tts.sh"
clean:
sudo rm -r /usr/share/$(program_name)
sudo rm /usr/bin/$(program_name)
sudo rm -r $(gnome_extensions_path)/$(gnome_extension_name)