From b6e43491ca4a3ef3d0efe73c48c44b91982a96f6 Mon Sep 17 00:00:00 2001 From: schneefux Date: Sun, 3 Aug 2014 20:11:14 +0200 Subject: Add shebang and PEP 0263 source encoding to main.py --- client/main.py | 2 ++ 1 file changed, 2 insertions(+) (limited to 'client') diff --git a/client/main.py b/client/main.py index fb0eaf0..36656a3 100644 --- a/client/main.py +++ b/client/main.py @@ -1,3 +1,5 @@ +#!/usr/bin/env python +# -*- coding: utf-8-*- import yaml import sys import speaker -- cgit v1.3.1 From c231090615f552adab46f5ac6fe31aa632588edf Mon Sep 17 00:00:00 2001 From: schneefux Date: Sat, 6 Sep 2014 10:23:05 +0200 Subject: Add shebang and PEP 0263 source encoding to every module Source encoding should be specified and a shebang helps to execute a module directly (either to start jasper or just for testing purposes). --- boot/boot.py | 4 ++-- boot/test.py | 2 ++ boot/vocabcompiler.py | 2 ++ client/alteration.py | 2 ++ client/brain.py | 2 ++ client/conversation.py | 2 ++ client/g2p.py | 2 ++ client/local_mic.py | 2 ++ client/main.py | 2 +- client/mic.py | 2 ++ client/modules/Birthday.py | 2 ++ client/modules/Gmail.py | 2 ++ client/modules/HN.py | 2 ++ client/modules/Joke.py | 2 ++ client/modules/Life.py | 2 ++ client/modules/News.py | 2 ++ client/modules/Notifications.py | 2 ++ client/modules/Time.py | 2 ++ client/modules/Unclear.py | 2 ++ client/modules/Weather.py | 2 ++ client/modules/app_utils.py | 2 ++ client/music.py | 2 ++ client/musicmode.py | 2 ++ client/notifier.py | 2 ++ client/populate.py | 2 ++ client/speaker.py | 2 ++ client/stt.py | 2 ++ client/test.py | 2 ++ client/test_mic.py | 2 ++ 29 files changed, 57 insertions(+), 3 deletions(-) (limited to 'client') diff --git a/boot/boot.py b/boot/boot.py index a8141cb..22a36a5 100755 --- a/boot/boot.py +++ b/boot/boot.py @@ -1,5 +1,5 @@ -#!/usr/bin/env python - +#!/usr/bin/env python2 +# -*- coding: utf-8-*- import os import urllib2 import sys diff --git a/boot/test.py b/boot/test.py index 3d93936..638ca77 100644 --- a/boot/test.py +++ b/boot/test.py @@ -1,3 +1,5 @@ +#!/usr/bin/env python2 +# -*- coding: utf-8-*- import os if os.environ.get('JASPER_HOME') is None: diff --git a/boot/vocabcompiler.py b/boot/vocabcompiler.py index a3aaf66..9177db4 100644 --- a/boot/vocabcompiler.py +++ b/boot/vocabcompiler.py @@ -1,3 +1,5 @@ +#!/usr/bin/env python2 +# -*- coding: utf-8-*- """ Iterates over all the WORDS variables in the modules and creates a dictionary for the client. """ diff --git a/client/alteration.py b/client/alteration.py index 550bba1..5c58d92 100644 --- a/client/alteration.py +++ b/client/alteration.py @@ -1,3 +1,5 @@ +#!/usr/bin/env python2 +# -*- coding: utf-8-*- import re diff --git a/client/brain.py b/client/brain.py index 2babfdf..ab92934 100644 --- a/client/brain.py +++ b/client/brain.py @@ -1,3 +1,5 @@ +#!/usr/bin/env python2 +# -*- coding: utf-8-*- import logging from os import listdir diff --git a/client/conversation.py b/client/conversation.py index a5937da..de0f8d5 100755 --- a/client/conversation.py +++ b/client/conversation.py @@ -1,3 +1,5 @@ +#!/usr/bin/env python2 +# -*- coding: utf-8-*- from notifier import Notifier from musicmode import * from brain import Brain diff --git a/client/g2p.py b/client/g2p.py index bae40b6..7aa0f2d 100644 --- a/client/g2p.py +++ b/client/g2p.py @@ -1,3 +1,5 @@ +#!/usr/bin/env python2 +# -*- coding: utf-8-*- import os import subprocess import re diff --git a/client/local_mic.py b/client/local_mic.py index 44e232d..c3eb694 100644 --- a/client/local_mic.py +++ b/client/local_mic.py @@ -1,3 +1,5 @@ +#!/usr/bin/env python2 +# -*- coding: utf-8-*- """ A drop-in replacement for the Mic class that allows for all I/O to occur over the terminal. Useful for debugging. Unlike with the typical Mic diff --git a/client/main.py b/client/main.py index 36656a3..6683188 100644 --- a/client/main.py +++ b/client/main.py @@ -1,4 +1,4 @@ -#!/usr/bin/env python +#!/usr/bin/env python2 # -*- coding: utf-8-*- import yaml import sys diff --git a/client/mic.py b/client/mic.py index 01a37cb..9e0914b 100644 --- a/client/mic.py +++ b/client/mic.py @@ -1,3 +1,5 @@ +#!/usr/bin/env python2 +# -*- coding: utf-8-*- """ The Mic class handles all interactions with the microphone and speaker. """ diff --git a/client/modules/Birthday.py b/client/modules/Birthday.py index 1388443..35dec59 100644 --- a/client/modules/Birthday.py +++ b/client/modules/Birthday.py @@ -1,3 +1,5 @@ +#!/usr/bin/env python2 +# -*- coding: utf-8-*- import datetime import re from facebook import * diff --git a/client/modules/Gmail.py b/client/modules/Gmail.py index b401ae6..195f0fb 100644 --- a/client/modules/Gmail.py +++ b/client/modules/Gmail.py @@ -1,3 +1,5 @@ +#!/usr/bin/env python2 +# -*- coding: utf-8-*- import imaplib import email import re diff --git a/client/modules/HN.py b/client/modules/HN.py index 863d40a..998625d 100644 --- a/client/modules/HN.py +++ b/client/modules/HN.py @@ -1,3 +1,5 @@ +#!/usr/bin/env python2 +# -*- coding: utf-8-*- import urllib2 import re import random diff --git a/client/modules/Joke.py b/client/modules/Joke.py index 52b3eb9..6d78e7a 100644 --- a/client/modules/Joke.py +++ b/client/modules/Joke.py @@ -1,3 +1,5 @@ +#!/usr/bin/env python2 +# -*- coding: utf-8-*- import random import re diff --git a/client/modules/Life.py b/client/modules/Life.py index 2c79ee1..259d976 100644 --- a/client/modules/Life.py +++ b/client/modules/Life.py @@ -1,3 +1,5 @@ +#!/usr/bin/env python2 +# -*- coding: utf-8-*- import random import re diff --git a/client/modules/News.py b/client/modules/News.py index 8b4b9a3..56ea000 100644 --- a/client/modules/News.py +++ b/client/modules/News.py @@ -1,3 +1,5 @@ +#!/usr/bin/env python2 +# -*- coding: utf-8-*- import feedparser import app_utils import re diff --git a/client/modules/Notifications.py b/client/modules/Notifications.py index fc91da1..2b4cb88 100644 --- a/client/modules/Notifications.py +++ b/client/modules/Notifications.py @@ -1,3 +1,5 @@ +#!/usr/bin/env python2 +# -*- coding: utf-8-*- import re from facebook import * diff --git a/client/modules/Time.py b/client/modules/Time.py index 2fe8a10..ea2c35a 100644 --- a/client/modules/Time.py +++ b/client/modules/Time.py @@ -1,3 +1,5 @@ +#!/usr/bin/env python2 +# -*- coding: utf-8-*- import datetime import re from app_utils import getTimezone diff --git a/client/modules/Unclear.py b/client/modules/Unclear.py index 23ab2ed..6af6082 100644 --- a/client/modules/Unclear.py +++ b/client/modules/Unclear.py @@ -1,3 +1,5 @@ +#!/usr/bin/env python2 +# -*- coding: utf-8-*- from sys import maxint import random diff --git a/client/modules/Weather.py b/client/modules/Weather.py index ad1ac29..446652a 100644 --- a/client/modules/Weather.py +++ b/client/modules/Weather.py @@ -1,3 +1,5 @@ +#!/usr/bin/env python2 +# -*- coding: utf-8-*- import re import datetime import feedparser diff --git a/client/modules/app_utils.py b/client/modules/app_utils.py index 68cce38..5ac7488 100644 --- a/client/modules/app_utils.py +++ b/client/modules/app_utils.py @@ -1,3 +1,5 @@ +#!/usr/bin/env python2 +# -*- coding: utf-8-*- import smtplib from email.MIMEText import MIMEText import urllib2 diff --git a/client/music.py b/client/music.py index 2b22b81..f72d346 100644 --- a/client/music.py +++ b/client/music.py @@ -1,3 +1,5 @@ +#!/usr/bin/env python2 +# -*- coding: utf-8-*- import re import difflib from mpd import MPDClient diff --git a/client/musicmode.py b/client/musicmode.py index df3072c..8a4be67 100755 --- a/client/musicmode.py +++ b/client/musicmode.py @@ -1,3 +1,5 @@ +#!/usr/bin/env python2 +# -*- coding: utf-8-*- """ Manages the conversation """ diff --git a/client/notifier.py b/client/notifier.py index 341ae04..ef4f0bb 100644 --- a/client/notifier.py +++ b/client/notifier.py @@ -1,3 +1,5 @@ +#!/usr/bin/env python2 +# -*- coding: utf-8-*- import Queue from modules import Gmail from apscheduler.scheduler import Scheduler diff --git a/client/populate.py b/client/populate.py index 054366e..aa6e589 100644 --- a/client/populate.py +++ b/client/populate.py @@ -1,3 +1,5 @@ +#!/usr/bin/env python2 +# -*- coding: utf-8-*- import re from getpass import getpass import yaml diff --git a/client/speaker.py b/client/speaker.py index 4c50a27..c07ce83 100644 --- a/client/speaker.py +++ b/client/speaker.py @@ -1,3 +1,5 @@ +#!/usr/bin/env python2 +# -*- coding: utf-8-*- """ A Speaker handles audio output from Jasper to the user diff --git a/client/stt.py b/client/stt.py index 1bce875..b1e8648 100644 --- a/client/stt.py +++ b/client/stt.py @@ -1,3 +1,5 @@ +#!/usr/bin/env python2 +# -*- coding: utf-8-*- import traceback import json import urllib2 diff --git a/client/test.py b/client/test.py index 29b9ce0..a239b0d 100644 --- a/client/test.py +++ b/client/test.py @@ -1,3 +1,5 @@ +#!/usr/bin/env python2 +# -*- coding: utf-8-*- import os if os.environ.get('JASPER_HOME') is None: diff --git a/client/test_mic.py b/client/test_mic.py index b01240f..73a0857 100644 --- a/client/test_mic.py +++ b/client/test_mic.py @@ -1,3 +1,5 @@ +#!/usr/bin/env python2 +# -*- coding: utf-8-*- """ A drop-in replacement for the Mic class used during unit testing. Designed to take pre-arranged inputs as an argument and store any -- cgit v1.3.1 From 04cf09db45cb9788d7035a54d945ee5c18ad74c3 Mon Sep 17 00:00:00 2001 From: schneefux Date: Sat, 6 Sep 2014 10:24:56 +0200 Subject: Remove executable flag from musicmode.py and conversation.py --- client/conversation.py | 0 client/musicmode.py | 0 2 files changed, 0 insertions(+), 0 deletions(-) mode change 100755 => 100644 client/conversation.py mode change 100755 => 100644 client/musicmode.py (limited to 'client') diff --git a/client/conversation.py b/client/conversation.py old mode 100755 new mode 100644 diff --git a/client/musicmode.py b/client/musicmode.py old mode 100755 new mode 100644 -- cgit v1.3.1 From ba3d0585b7b06b4ac805b40b477877b2c158acf8 Mon Sep 17 00:00:00 2001 From: schneefux Date: Sat, 6 Sep 2014 10:26:13 +0200 Subject: Add executable flag to client/main.py and boot/test.py --- boot/test.py | 0 client/main.py | 0 2 files changed, 0 insertions(+), 0 deletions(-) mode change 100644 => 100755 boot/test.py mode change 100644 => 100755 client/main.py (limited to 'client') diff --git a/boot/test.py b/boot/test.py old mode 100644 new mode 100755 diff --git a/client/main.py b/client/main.py old mode 100644 new mode 100755 -- cgit v1.3.1 From c54add16860607f47a6b2df52c608ca91b2c75b7 Mon Sep 17 00:00:00 2001 From: schneefux Date: Sat, 6 Sep 2014 10:28:12 +0200 Subject: Change python to python2 in start scripts --- boot/boot.sh | 2 +- client/start.sh | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) (limited to 'client') diff --git a/boot/boot.sh b/boot/boot.sh index e712c0d..7a79c06 100755 --- a/boot/boot.sh +++ b/boot/boot.sh @@ -14,4 +14,4 @@ LD_LIBRARY_PATH="/usr/local/lib" export LD_LIBRARY_PATH PATH=$PATH:/usr/local/lib/ export PATH -python boot.py & +python2 boot.py & diff --git a/client/start.sh b/client/start.sh index cc33f9c..2dce2f9 100755 --- a/client/start.sh +++ b/client/start.sh @@ -1,3 +1,3 @@ cd $JASPER_HOME/jasper/client rm -rf ../old_client -python main.py & +python2 main.py & -- cgit v1.3.1 From b0f2a9a461204b0c06bb73b85ea2a0aa3db25bdd Mon Sep 17 00:00:00 2001 From: schneefux Date: Sat, 6 Sep 2014 10:32:43 +0200 Subject: Add shebang to start.sh --- client/start.sh | 1 + 1 file changed, 1 insertion(+) (limited to 'client') diff --git a/client/start.sh b/client/start.sh index 2dce2f9..b2b41bc 100755 --- a/client/start.sh +++ b/client/start.sh @@ -1,3 +1,4 @@ +#!/bin/bash cd $JASPER_HOME/jasper/client rm -rf ../old_client python2 main.py & -- cgit v1.3.1 From 7bfae56e8b49c2c11e4df82c2c6d4b4557ba2ae2 Mon Sep 17 00:00:00 2001 From: schneefux Date: Sat, 6 Sep 2014 10:38:55 +0200 Subject: Use executable flag and shebang instead of explicit interpreter in shell scripts. --- boot/boot.sh | 2 +- client/start.sh | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) (limited to 'client') diff --git a/boot/boot.sh b/boot/boot.sh index 7a79c06..f4e577d 100755 --- a/boot/boot.sh +++ b/boot/boot.sh @@ -14,4 +14,4 @@ LD_LIBRARY_PATH="/usr/local/lib" export LD_LIBRARY_PATH PATH=$PATH:/usr/local/lib/ export PATH -python2 boot.py & +./boot.py & diff --git a/client/start.sh b/client/start.sh index b2b41bc..052db18 100755 --- a/client/start.sh +++ b/client/start.sh @@ -1,4 +1,4 @@ #!/bin/bash cd $JASPER_HOME/jasper/client rm -rf ../old_client -python2 main.py & +./main.py & -- cgit v1.3.1 From 16885dbcc25c01d5db2bf1dbc681828cfc06b70b Mon Sep 17 00:00:00 2001 From: schneefux Date: Wed, 10 Sep 2014 15:42:47 +0200 Subject: Remove Shebangs from modules not meant to be executed directly See https://github.com/jasperproject/jasper-client/pull/154#issuecomment-54882839 for more info. --- boot/vocabcompiler.py | 1 - client/alteration.py | 1 - client/brain.py | 1 - client/conversation.py | 1 - client/g2p.py | 1 - client/local_mic.py | 1 - client/mic.py | 1 - client/modules/Birthday.py | 1 - client/modules/Gmail.py | 1 - client/modules/HN.py | 1 - client/modules/Joke.py | 1 - client/modules/Life.py | 1 - client/modules/News.py | 1 - client/modules/Notifications.py | 1 - client/modules/Time.py | 1 - client/modules/Unclear.py | 1 - client/modules/Weather.py | 1 - client/modules/app_utils.py | 1 - client/music.py | 1 - client/musicmode.py | 1 - client/notifier.py | 1 - client/populate.py | 1 - client/speaker.py | 1 - client/test_mic.py | 1 - 24 files changed, 24 deletions(-) (limited to 'client') diff --git a/boot/vocabcompiler.py b/boot/vocabcompiler.py index 9177db4..f22da1a 100644 --- a/boot/vocabcompiler.py +++ b/boot/vocabcompiler.py @@ -1,4 +1,3 @@ -#!/usr/bin/env python2 # -*- coding: utf-8-*- """ Iterates over all the WORDS variables in the modules and creates a dictionary for the client. diff --git a/client/alteration.py b/client/alteration.py index 5c58d92..91e0ad3 100644 --- a/client/alteration.py +++ b/client/alteration.py @@ -1,4 +1,3 @@ -#!/usr/bin/env python2 # -*- coding: utf-8-*- import re diff --git a/client/brain.py b/client/brain.py index ab92934..b6014de 100644 --- a/client/brain.py +++ b/client/brain.py @@ -1,4 +1,3 @@ -#!/usr/bin/env python2 # -*- coding: utf-8-*- import logging from os import listdir diff --git a/client/conversation.py b/client/conversation.py index de0f8d5..fe3e058 100644 --- a/client/conversation.py +++ b/client/conversation.py @@ -1,4 +1,3 @@ -#!/usr/bin/env python2 # -*- coding: utf-8-*- from notifier import Notifier from musicmode import * diff --git a/client/g2p.py b/client/g2p.py index 7aa0f2d..d22445a 100644 --- a/client/g2p.py +++ b/client/g2p.py @@ -1,4 +1,3 @@ -#!/usr/bin/env python2 # -*- coding: utf-8-*- import os import subprocess diff --git a/client/local_mic.py b/client/local_mic.py index c3eb694..3da6ed1 100644 --- a/client/local_mic.py +++ b/client/local_mic.py @@ -1,4 +1,3 @@ -#!/usr/bin/env python2 # -*- coding: utf-8-*- """ A drop-in replacement for the Mic class that allows for all I/O to occur diff --git a/client/mic.py b/client/mic.py index 9e0914b..096610d 100644 --- a/client/mic.py +++ b/client/mic.py @@ -1,4 +1,3 @@ -#!/usr/bin/env python2 # -*- coding: utf-8-*- """ The Mic class handles all interactions with the microphone and speaker. diff --git a/client/modules/Birthday.py b/client/modules/Birthday.py index 35dec59..b484a4f 100644 --- a/client/modules/Birthday.py +++ b/client/modules/Birthday.py @@ -1,4 +1,3 @@ -#!/usr/bin/env python2 # -*- coding: utf-8-*- import datetime import re diff --git a/client/modules/Gmail.py b/client/modules/Gmail.py index 195f0fb..dfb6854 100644 --- a/client/modules/Gmail.py +++ b/client/modules/Gmail.py @@ -1,4 +1,3 @@ -#!/usr/bin/env python2 # -*- coding: utf-8-*- import imaplib import email diff --git a/client/modules/HN.py b/client/modules/HN.py index 998625d..ec7ecef 100644 --- a/client/modules/HN.py +++ b/client/modules/HN.py @@ -1,4 +1,3 @@ -#!/usr/bin/env python2 # -*- coding: utf-8-*- import urllib2 import re diff --git a/client/modules/Joke.py b/client/modules/Joke.py index 6d78e7a..802047c 100644 --- a/client/modules/Joke.py +++ b/client/modules/Joke.py @@ -1,4 +1,3 @@ -#!/usr/bin/env python2 # -*- coding: utf-8-*- import random import re diff --git a/client/modules/Life.py b/client/modules/Life.py index 259d976..4cafd75 100644 --- a/client/modules/Life.py +++ b/client/modules/Life.py @@ -1,4 +1,3 @@ -#!/usr/bin/env python2 # -*- coding: utf-8-*- import random import re diff --git a/client/modules/News.py b/client/modules/News.py index 56ea000..d80b791 100644 --- a/client/modules/News.py +++ b/client/modules/News.py @@ -1,4 +1,3 @@ -#!/usr/bin/env python2 # -*- coding: utf-8-*- import feedparser import app_utils diff --git a/client/modules/Notifications.py b/client/modules/Notifications.py index 2b4cb88..9ee004c 100644 --- a/client/modules/Notifications.py +++ b/client/modules/Notifications.py @@ -1,4 +1,3 @@ -#!/usr/bin/env python2 # -*- coding: utf-8-*- import re from facebook import * diff --git a/client/modules/Time.py b/client/modules/Time.py index ea2c35a..90ffdf9 100644 --- a/client/modules/Time.py +++ b/client/modules/Time.py @@ -1,4 +1,3 @@ -#!/usr/bin/env python2 # -*- coding: utf-8-*- import datetime import re diff --git a/client/modules/Unclear.py b/client/modules/Unclear.py index 6af6082..3900300 100644 --- a/client/modules/Unclear.py +++ b/client/modules/Unclear.py @@ -1,4 +1,3 @@ -#!/usr/bin/env python2 # -*- coding: utf-8-*- from sys import maxint import random diff --git a/client/modules/Weather.py b/client/modules/Weather.py index 446652a..5922d33 100644 --- a/client/modules/Weather.py +++ b/client/modules/Weather.py @@ -1,4 +1,3 @@ -#!/usr/bin/env python2 # -*- coding: utf-8-*- import re import datetime diff --git a/client/modules/app_utils.py b/client/modules/app_utils.py index 5ac7488..cea6881 100644 --- a/client/modules/app_utils.py +++ b/client/modules/app_utils.py @@ -1,4 +1,3 @@ -#!/usr/bin/env python2 # -*- coding: utf-8-*- import smtplib from email.MIMEText import MIMEText diff --git a/client/music.py b/client/music.py index f72d346..2b6c055 100644 --- a/client/music.py +++ b/client/music.py @@ -1,4 +1,3 @@ -#!/usr/bin/env python2 # -*- coding: utf-8-*- import re import difflib diff --git a/client/musicmode.py b/client/musicmode.py index 8a4be67..334f94c 100644 --- a/client/musicmode.py +++ b/client/musicmode.py @@ -1,4 +1,3 @@ -#!/usr/bin/env python2 # -*- coding: utf-8-*- """ Manages the conversation diff --git a/client/notifier.py b/client/notifier.py index ef4f0bb..5c2d855 100644 --- a/client/notifier.py +++ b/client/notifier.py @@ -1,4 +1,3 @@ -#!/usr/bin/env python2 # -*- coding: utf-8-*- import Queue from modules import Gmail diff --git a/client/populate.py b/client/populate.py index aa6e589..d1cbb80 100644 --- a/client/populate.py +++ b/client/populate.py @@ -1,4 +1,3 @@ -#!/usr/bin/env python2 # -*- coding: utf-8-*- import re from getpass import getpass diff --git a/client/speaker.py b/client/speaker.py index c07ce83..8344132 100644 --- a/client/speaker.py +++ b/client/speaker.py @@ -1,4 +1,3 @@ -#!/usr/bin/env python2 # -*- coding: utf-8-*- """ A Speaker handles audio output from Jasper to the user diff --git a/client/test_mic.py b/client/test_mic.py index 73a0857..4813e5c 100644 --- a/client/test_mic.py +++ b/client/test_mic.py @@ -1,4 +1,3 @@ -#!/usr/bin/env python2 # -*- coding: utf-8-*- """ A drop-in replacement for the Mic class used during unit testing. -- cgit v1.3.1