Skip to content

Commit

Permalink
Python packaging initial files added.
Browse files Browse the repository at this point in the history
  • Loading branch information
mertyildiran committed Apr 21, 2016
1 parent 3468d69 commit 166f3aa
Show file tree
Hide file tree
Showing 10 changed files with 175 additions and 294 deletions.
6 changes: 6 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -5,3 +5,9 @@
# Ignore Python compiled code (byte code) #
###################
*.pyc

# Ignore directories related with packaging #
###################
dragonfire.egg-info/
dist/
build/
23 changes: 0 additions & 23 deletions DEVELOPER_NOTES.txt

This file was deleted.

21 changes: 21 additions & 0 deletions LICENSE.txt
Original file line number Diff line number Diff line change
@@ -0,0 +1,21 @@
The MIT License (MIT)

Copyright (c) 2016 Mehmet Mert Yıldıran mert.yildiran@bil.omu.edu.tr

Permission is hereby granted, free of charge, to any person obtaining a copy
of this software and associated documentation files (the "Software"), to deal
in the Software without restriction, including without limitation the rights
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
copies of the Software, and to permit persons to whom the Software is
furnished to do so, subject to the following conditions:

The above copyright notice and this permission notice shall be included in all
copies or substantial portions of the Software.

THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
SOFTWARE.
9 changes: 9 additions & 0 deletions MANIFEST.in
Original file line number Diff line number Diff line change
@@ -0,0 +1,9 @@
# Include the license file
include LICENSE.txt

# Include the data files
# recursive-include data *

# If using Python 2.6 or less, then have to include package data, even though
# it's already declared in setup.py
# include sample/*.dat
2 changes: 1 addition & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@ Dragonfire is an open source virtual assistant project for Ubuntu based Linux di

### Version

0.3.5
0.3.6

### Installation

Expand Down
4 changes: 4 additions & 0 deletions README.rst
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
Dragonfire
========

Dragonfire is an open source virtual assistant project for Ubuntu based Linux distributions.
18 changes: 10 additions & 8 deletions dragonfire/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -20,12 +20,15 @@
from apiclient.errors import HttpError
import glob
import speech_recognition as sr
import inspect

DRAGONFIRE_PATH = os.path.dirname(os.path.abspath(inspect.getfile(inspect.currentframe())))

def command(speech_object):
previous_command = ""
global inactive
while(True):

line = speech_object.readline()
if(line.startswith("sentence1: ")):
com = line[15:-6]
Expand All @@ -34,7 +37,7 @@ def command(speech_object):
print com

Config = ConfigParser.ConfigParser()
Config.read("config.ini")
Config.read( DRAGONFIRE_PATH + "/config.ini")
user_prefix = Config.get("BasicUserData","Prefix")

if (com == "DRAGON FIRE" or com == "WAKEUP"):
Expand Down Expand Up @@ -66,15 +69,15 @@ def command(speech_object):
previous_command = com
elif (com == "I'M A WOMAN" or com == "I'M A GIRL" or com == "I'M A LADY"):
tts_kill()
cfgfile = open("config.ini",'w')
cfgfile = open( DRAGONFIRE_PATH + "/config.ini",'w')
Config.set("BasicUserData","Prefix","My Lady")
Config.write(cfgfile)
cfgfile.close()
userin = Data([" "]," ")
userin.say("Pardon, My Lady.")
elif (com == "I'M A MAN" or com == "I'M A BOY"):
tts_kill()
cfgfile = open("config.ini",'w')
cfgfile = open( DRAGONFIRE_PATH + "/config.ini",'w')
Config.set("BasicUserData","Prefix","Sir")
Config.write(cfgfile)
cfgfile.close()
Expand Down Expand Up @@ -290,7 +293,7 @@ def dragon_greet():
time = datetime.datetime.now().time()

Config = ConfigParser.ConfigParser()
Config.read("config.ini")
Config.read( DRAGONFIRE_PATH + "/config.ini")
user_prefix = Config.get("BasicUserData","Prefix")

if time < datetime.time(12):
Expand Down Expand Up @@ -329,17 +332,16 @@ def initiate():
global inactive
inactive = 1
dragon_greet()
sys.stdin = subprocess.Popen(["padsp", "julius", "-input", "mic", "-C", "julian.jconf"], stdout=subprocess.PIPE).stdout
sys.stdin = subprocess.Popen(["padsp", "julius", "-input", "mic", "-C", DRAGONFIRE_PATH + "/julian.jconf"], stdout=subprocess.PIPE).stdout
command(sys.stdin)
except KeyboardInterrupt:
sys.exit(1)


if __name__ == '__main__':
try:
inactive = 1
dragon_greet()
sys.stdin = subprocess.Popen(["padsp", "julius", "-input", "mic", "-C", "julian.jconf"], stdout=subprocess.PIPE).stdout
sys.stdin = subprocess.Popen(["padsp", "julius", "-input", "mic", "-C", DRAGONFIRE_PATH + "julian.jconf"], stdout=subprocess.PIPE).stdout
command(sys.stdin)
except KeyboardInterrupt:
sys.exit(1)
Loading

0 comments on commit 166f3aa

Please sign in to comment.