Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
21 changes: 21 additions & 0 deletions .github/workflows/python-lint.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,21 @@
name: Python Lint

on:
push:
branches: [ "*" ]
pull_request:
branches: [ "*" ]

jobs:
lint:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- name: Set up Python
uses: actions/setup-python@v5
with:
python-version: "3.11"
- name: Install ruff
run: pip install ruff
- name: Run ruff
run: ruff check backend/ main.py run.py
3 changes: 0 additions & 3 deletions backend/auth/recoganize.py
Original file line number Diff line number Diff line change
@@ -1,7 +1,4 @@
from sys import flags
import time
import cv2
import pyautogui as p
from backend.config import (
FACE_TRAINER_PATH,
FACE_CASCADE_PATH,
Expand Down
2 changes: 0 additions & 2 deletions backend/command.py
Original file line number Diff line number Diff line change
@@ -1,11 +1,9 @@
import time
import pyttsx3
import speech_recognition as sr
import eel
from backend.config import (
TTS_VOICE_ID,
TTS_RATE,
TTS_VOLUME,
TTS_ENGINE,
SPEECH_LANGUAGE,
SPEECH_TIMEOUT,
Expand Down
2 changes: 1 addition & 1 deletion backend/config_manager.py
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@

import os
import logging
from typing import Optional, Union
from typing import Optional
from pathlib import Path


Expand Down
1 change: 0 additions & 1 deletion backend/db.py
Original file line number Diff line number Diff line change
@@ -1,4 +1,3 @@
import csv
import sqlite3

conn = sqlite3.connect("jarvis.db")
Expand Down
10 changes: 4 additions & 6 deletions backend/feature.py
Original file line number Diff line number Diff line change
Expand Up @@ -8,9 +8,7 @@
# playsound(music_dir)


from compileall import compile_path
import os
import re
from shlex import quote
import struct
import subprocess
Expand Down Expand Up @@ -86,9 +84,9 @@ def openCommand(query):
speak("Opening " + query)
try:
os.system("start " + query)
except:
except Exception:
speak("not found")
except:
except Exception:
speak("some thing went wrong")


Expand Down Expand Up @@ -139,7 +137,7 @@ def hotword():
time.sleep(2)
autogui.keyUp("win")

except:
except Exception:
if porcupine is not None:
porcupine.delete()
if audio_stream is not None:
Expand Down Expand Up @@ -178,7 +176,7 @@ def findContact(query):
mobile_number_str = WHATSAPP_COUNTRY_CODE + mobile_number_str

return mobile_number_str, query
except:
except Exception:
speak("not exist in contacts")
return 0, 0

Expand Down
6 changes: 2 additions & 4 deletions main.py
Original file line number Diff line number Diff line change
@@ -1,12 +1,10 @@
import os
import eel
from backend.auth import recoganize
from backend.auth.recoganize import AuthenticateFace
from backend.feature import *
from backend.command import *
from backend.feature import play_assistant_sound
from backend.command import speak
from backend.config import (
WEB_SERVER_HOST,
WEB_SERVER_PORT,
WEB_SERVER_MODE,
WEB_SERVER_BLOCK,
USER_NAME,
Expand Down