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 ++ 3 files changed, 6 insertions(+), 2 deletions(-) (limited to 'boot') 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. """ -- 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 'boot') 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 'boot') 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 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 'boot') 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 'boot') 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