Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Python 3 support - will update more in the future #729

Open
wants to merge 14 commits into
base: master
Choose a base branch
from
2 changes: 2 additions & 0 deletions .github/CODEOWNERS
Validating CODEOWNERS rules …
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
# Generated by CODEOWNERS.com

38 changes: 38 additions & 0 deletions .github/ISSUE_TEMPLATE/bug_report.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,38 @@
---
name: Bug report
about: Create a report to help us improve
title: ''
labels: ''
assignees: ''

---

**Describe the bug**
A clear and concise description of what the bug is.

**To Reproduce**
Steps to reproduce the behavior:
1. Go to '...'
2. Click on '....'
3. Scroll down to '....'
4. See error

**Expected behavior**
A clear and concise description of what you expected to happen.

**Screenshots**
If applicable, add screenshots to help explain your problem.

**Desktop (please complete the following information):**
- OS: [e.g. iOS]
- Browser [e.g. chrome, safari]
- Version [e.g. 22]

**Smartphone (please complete the following information):**
- Device: [e.g. iPhone6]
- OS: [e.g. iOS8.1]
- Browser [e.g. stock browser, safari]
- Version [e.g. 22]

**Additional context**
Add any other context about the problem here.
20 changes: 20 additions & 0 deletions .github/ISSUE_TEMPLATE/feature_request.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,20 @@
---
name: Feature request
about: Suggest an idea for this project
title: ''
labels: ''
assignees: ''

---

**Is your feature request related to a problem? Please describe.**
A clear and concise description of what the problem is. Ex. I'm always frustrated when [...]

**Describe the solution you'd like**
A clear and concise description of what you want to happen.

**Describe alternatives you've considered**
A clear and concise description of any alternative solutions or features you've considered.

**Additional context**
Add any other context or screenshots about the feature request here.
74 changes: 74 additions & 0 deletions .github/workflows/codeql.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,74 @@
# For most projects, this workflow file will not need changing; you simply need
# to commit it to your repository.
#
# You may wish to alter this file to override the set of languages analyzed,
# or to provide custom queries or build logic.
#
# ******** NOTE ********
# We have attempted to detect the languages in your repository. Please check
# the `language` matrix defined below to confirm you have the correct set of
# supported CodeQL languages.
#
name: "CodeQL"

on:
push:
branches: [ "master" ]
pull_request:
# The branches below must be a subset of the branches above
branches: [ "master" ]
schedule:
- cron: '23 8 * * 1'

jobs:
analyze:
name: Analyze
runs-on: ubuntu-latest
permissions:
actions: read
contents: read
security-events: write

strategy:
fail-fast: false
matrix:
language: [ 'python' ]
# CodeQL supports [ 'cpp', 'csharp', 'go', 'java', 'javascript', 'python', 'ruby' ]
# Learn more about CodeQL language support at https://aka.ms/codeql-docs/language-support

steps:
- name: Checkout repository
uses: actions/checkout@v3

# Initializes the CodeQL tools for scanning.
- name: Initialize CodeQL
uses: github/codeql-action/init@v2
with:
languages: ${{ matrix.language }}
# If you wish to specify custom queries, you can do so here or in a config file.
# By default, queries listed here will override any specified in a config file.
# Prefix the list here with "+" to use these queries and those in the config file.

# Details on CodeQL's query packs refer to : https://docs.github.com/en/code-security/code-scanning/automatically-scanning-your-code-for-vulnerabilities-and-errors/configuring-code-scanning#using-queries-in-ql-packs
# queries: security-extended,security-and-quality


# Autobuild attempts to build any compiled languages (C/C++, C#, Go, or Java).
# If this step fails, then you should remove it and run the build manually (see below)
- name: Autobuild
uses: github/codeql-action/autobuild@v2

# ℹ️ Command-line programs to run using the OS shell.
# 📚 See https://docs.github.com/en/actions/using-workflows/workflow-syntax-for-github-actions#jobsjob_idstepsrun

# If the Autobuild fails above, remove it and uncomment the following three lines.
# modify them (or add more) to build your code if your project, please refer to the EXAMPLE below for guidance.

# - run: |
# echo "Run, Build Application using script"
# ./location_of_script_within_repo/buildscript.sh

- name: Perform CodeQL Analysis
uses: github/codeql-action/analyze@v2
with:
category: "/language:${{matrix.language}}"
27 changes: 27 additions & 0 deletions .github/workflows/stale.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,27 @@
# This workflow warns and then closes issues and PRs that have had no activity for a specified amount of time.
#
# You can adjust the behavior by modifying this file.
# For more information, see:
# https://github.com/actions/stale
name: Mark stale issues and pull requests

on:
schedule:
- cron: '45 0 * * *'

jobs:
stale:

runs-on: ubuntu-latest
permissions:
issues: write
pull-requests: write

steps:
- uses: actions/stale@v5
with:
repo-token: ${{ secrets.GITHUB_TOKEN }}
stale-issue-message: 'Stale issue message'
stale-pr-message: 'Stale pull request message'
stale-issue-label: 'no-issue-activity'
stale-pr-label: 'no-pr-activity'
22 changes: 0 additions & 22 deletions .travis.yml

This file was deleted.

4 changes: 3 additions & 1 deletion README.md
Original file line number Diff line number Diff line change
@@ -1,7 +1,9 @@
jasper-client
=============

[![Build Status](https://travis-ci.org/jasperproject/jasper-client.svg?branch=master)](https://travis-ci.org/jasperproject/jasper-client) [![Coverage Status](https://img.shields.io/coveralls/jasperproject/jasper-client.svg)](https://coveralls.io/r/jasperproject/jasper-client) [![Codacy Badge](https://www.codacy.com/project/badge/3a50e1bc2261419894d76b7e2c1ac694)](https://www.codacy.com/app/jasperproject/jasper-client)
***NOTE: THIS IS A WORK IN PROGRESS, PLEASE MAKE A PULL REQUEST IF YOU THINK YOU CAN HELP.***

I just found a project that has much more support and a much bigger community that continues the jasper project. See link here: https://github.com/NaomiProject/Naomi

Client code for the Jasper voice computing platform. Jasper is an open source platform for developing always-on, voice-controlled applications.

Expand Down
11 changes: 0 additions & 11 deletions boot/boot.py

This file was deleted.

4 changes: 0 additions & 4 deletions boot/boot.sh

This file was deleted.

Empty file removed client/__init__.py
Empty file.
6 changes: 2 additions & 4 deletions client/alteration.py
Original file line number Diff line number Diff line change
@@ -1,18 +1,16 @@
# -*- coding: utf-8-*-
import re


def detectYears(input):
YEAR_REGEX = re.compile(r'(\b)(\d\d)([1-9]\d)(\b)')
return YEAR_REGEX.sub('\g<1>\g<2> \g<3>\g<4>', input)


def clean(input):
"""
Manually adjust output text before it's translated into
actual speech by the TTS system. This is to fix minior
actual speech by the TTS system. This is to fix minor
idiomatic issues, for example, that 1901 is pronounced
"one thousand, ninehundred and one" rather than
"one thousand, nine hundred and one" rather than
"nineteen oh one".

Arguments:
Expand Down
5 changes: 3 additions & 2 deletions client/app_utils.py
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
# -*- coding: utf-8-*-
import smtplib
from email.MIMEText import MIMEText
import urllib2
import urllib.request, urllib.error, urllib.parse
import re
from pytz import timezone

Expand Down Expand Up @@ -103,7 +103,7 @@ def generateTinyURL(URL):
URL -- the original URL to-be compressed
"""
target = "http://tinyurl.com/api-create.php?url=" + URL
response = urllib2.urlopen(target)
response = urllib.request.urlopen(target)
return response.read()


Expand All @@ -126,3 +126,4 @@ def isPositive(phrase):
phrase -- the input phrase to-be evaluated
"""
return bool(re.search(r'\b(sure|yes|yeah|go)\b', phrase, re.IGNORECASE))

2 changes: 1 addition & 1 deletion client/brain.py
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
# -*- coding: utf-8-*-
import logging
import pkgutil
import jasperpath
from client.utils import jasperpath


class Brain(object):
Expand Down
2 changes: 1 addition & 1 deletion client/diagnose.py
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@
import pkgutil
import logging
import pip.req
import jasperpath
from client.utils import jasperpath
if sys.version_info < (3, 3):
from distutils.spawn import find_executable
else:
Expand Down
2 changes: 1 addition & 1 deletion client/g2p.py
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@
import yaml

import diagnose
import jasperpath
from client.utils import jasperpath


class PhonetisaurusG2P(object):
Expand Down
1 change: 0 additions & 1 deletion client/local_mic.py
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,6 @@
implementation, Jasper is always active listening with local_mic.
"""


class Mic:
prev = None

Expand Down
10 changes: 0 additions & 10 deletions client/main.py

This file was deleted.

2 changes: 1 addition & 1 deletion client/mic.py
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@
import audioop
import pyaudio
import alteration
import jasperpath
from client.utils import jasperpath


class Mic:
Expand Down
2 changes: 1 addition & 1 deletion client/modules/Joke.py
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
# -*- coding: utf-8-*-
import random
import re
from client import jasperpath
from client.utils import jasperpath

WORDS = ["JOKE", "KNOCK KNOCK"]

Expand Down
6 changes: 3 additions & 3 deletions client/populate.py
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@
import yaml
from pytz import timezone
import feedparser
import jasperpath
from client.utils import jasperpath


def run():
Expand All @@ -16,7 +16,7 @@ def run():
"blank field to continue.")

def simple_request(var, cleanVar, cleanInput=None):
input = raw_input(cleanVar + ": ")
input = input(cleanVar + ": ")
if input:
if cleanInput:
input = cleanInput(input)
Expand All @@ -39,7 +39,7 @@ def simple_request(var, cleanVar, cleanInput=None):
def clean_number(s):
return re.sub(r'[^0-9]', '', s)

phone_number = clean_number(raw_input("\nPhone number (no country " +
phone_number = clean_number(input("\nPhone number (no country " +
"code). Any dashes or spaces will " +
"be removed for you: "))
profile['phone_number'] = phone_number
Expand Down
4 changes: 0 additions & 4 deletions client/start.sh

This file was deleted.

2 changes: 1 addition & 1 deletion client/stt.py
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@
from abc import ABCMeta, abstractmethod
import requests
import yaml
import jasperpath
from client.utils import jasperpath
import diagnose
import vocabcompiler

Expand Down
2 changes: 1 addition & 1 deletion client/tts.py
Original file line number Diff line number Diff line change
Expand Up @@ -39,7 +39,7 @@
pass

import diagnose
import jasperpath
from client.utils import jasperpath


class AbstractTTSEngine(object):
Expand Down
File renamed without changes.
2 changes: 1 addition & 1 deletion client/vocabcompiler.py
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@
import yaml

import brain
import jasperpath
from client.utils import jasperpath

from g2p import PhonetisaurusG2P
try:
Expand Down
5 changes: 1 addition & 4 deletions jasper.py
Original file line number Diff line number Diff line change
@@ -1,6 +1,3 @@
#!/usr/bin/env python2
# -*- coding: utf-8-*-

import os
import sys
import shutil
Expand All @@ -11,7 +8,7 @@

from client import tts
from client import stt
from client import jasperpath
from client.utils import jasperpath
from client import diagnose
from client.conversation import Conversation

Expand Down
File renamed without changes.
Loading