diff --git a/.github/workflows/semgrep.yml b/.github/workflows/semgrep.yml new file mode 100644 index 0000000..fae483a --- /dev/null +++ b/.github/workflows/semgrep.yml @@ -0,0 +1,24 @@ +on: + workflow_dispatch: {} + pull_request: {} + push: + branches: + - main + - master + paths: + - .github/workflows/semgrep.yml + schedule: + # random HH:MM to avoid a load spike on GitHub Actions at 00:00 + - cron: 38 21 * * * +name: Semgrep +jobs: + semgrep: + name: semgrep/ci + runs-on: ubuntu-20.04 + env: + SEMGREP_APP_TOKEN: ${{ secrets.SEMGREP_APP_TOKEN }} + container: + image: returntocorp/semgrep + steps: + - uses: actions/checkout@v3 + - run: semgrep ci diff --git a/assistant.py b/assistant.py index 18f129f..3704f30 100644 --- a/assistant.py +++ b/assistant.py @@ -8,6 +8,7 @@ import wolframalpha import os import sys +import pyjokes engine = pyttsx3.init('sapi5') @@ -54,6 +55,17 @@ def myCommand(): query = str(input('Command: ')) return query + +def joke(): + speak(pyjokes.get_jokes()) + +def cpu(): + usage=str(psutil.cpu_percent()) + speak("CPU is at"+usage) + + battery = psutil.sensors_battery() + speak("battery is at") + speak(battery.percent) if __name__ == '__main__': @@ -104,6 +116,9 @@ def myCommand(): speak('okay') speak('Bye Sir, have a good day.') sys.exit() + + elif 'joke' in query: + joke() elif 'hello' in query: speak('Hello Sir') @@ -120,6 +135,18 @@ def myCommand(): speak('Okay, here is your music! Enjoy!') + elif 'date' in query: + date_() + + + elif 'cpu' in query: + cpu() + + + elif 'go offline' in query: + speak("going offline sir") + quit() + else: query = query