[UPD] make open todo and todo force source .venv with gnome-terminal
This commit is contained in:
parent
f490a61df3
commit
70c9698c2d
3 changed files with 25 additions and 6 deletions
2
Makefile
2
Makefile
|
|
@ -5,7 +5,7 @@ LOG_FILE := ./.venv/make_test.log
|
||||||
#############
|
#############
|
||||||
# ALL
|
# ALL
|
||||||
.PHONY: all
|
.PHONY: all
|
||||||
all: doc
|
all: todo
|
||||||
|
|
||||||
###############
|
###############
|
||||||
# Detect OS #
|
# Detect OS #
|
||||||
|
|
|
||||||
5
script/todo/source_todo.sh
Executable file
5
script/todo/source_todo.sh
Executable file
|
|
@ -0,0 +1,5 @@
|
||||||
|
#!/bin/bash
|
||||||
|
|
||||||
|
source .venv/bin/activate
|
||||||
|
|
||||||
|
./script/todo/todo.py
|
||||||
|
|
@ -4,13 +4,27 @@ import getpass
|
||||||
import json
|
import json
|
||||||
import logging
|
import logging
|
||||||
import os
|
import os
|
||||||
|
import sys
|
||||||
|
import time
|
||||||
import subprocess
|
import subprocess
|
||||||
import tkinter as tk
|
|
||||||
from tkinter import filedialog
|
|
||||||
|
|
||||||
import click
|
try:
|
||||||
import openai
|
import tkinter as tk
|
||||||
from pykeepass import PyKeePass
|
from tkinter import filedialog
|
||||||
|
|
||||||
|
import click
|
||||||
|
import openai
|
||||||
|
from pykeepass import PyKeePass
|
||||||
|
except ModuleNotFoundError as e:
|
||||||
|
if os.path.exists(".venv"):
|
||||||
|
time.sleep(0.5)
|
||||||
|
subprocess.run(
|
||||||
|
"gnome-terminal -- bash -c './script/todo/source_todo.sh'",
|
||||||
|
shell=True,
|
||||||
|
executable="/bin/bash",
|
||||||
|
)
|
||||||
|
print("You forgot to activate source \nsource ./.venv/bin/activate")
|
||||||
|
sys.exit(1)
|
||||||
|
|
||||||
# TODO implement urwid to improve text user interface
|
# TODO implement urwid to improve text user interface
|
||||||
# import urwid
|
# import urwid
|
||||||
|
|
|
||||||
Loading…
Reference in a new issue