Commit 0d78a407 authored by Bastien Terrier's avatar Bastien Terrier
Browse files

test adding slide show mode

parent bb73a54b
from alphabet import * #import alphabet
from resources import * #import resources
def initFile(f_dataStream, sentence):
def initFile(sentence):
f_dataStream.write("#!/bin/bash")
f_dataStream.write("\n\n#Powered by Bastien T\n")
f_dataStream.write("\n#Sentence : {}\n".format(sentence))
f_dataStream.write("#Size : {}\n\n".format(i_xeyes_size))
f_dataStream.write("\n#Sentences : {}\n".format(sentence))
f_dataStream.write("#Xeyes size : {}\n\n".format(i_xeyes_size))
##############################
def displayCharacter(f_dataStream, char):
def displayCharacter(char):
f_dataStream.write("#Character {}\n".format(char))
......@@ -41,12 +41,13 @@ def displayCharacter(f_dataStream, char):
##############################
def displaySentence(sentence):
with open(s_filename, 'w') as f_dataStream:
initFile(f_dataStream, sentence)
for char in sentence:
if (ord(char) >= ord('A') and ord(char) <= ord('Z')) or char == "?" or char == "!" or char == " " :
displayCharacter(char)
else:
print("Error, '{}' not a character".format(char))
for char in sentence:
if (ord(char) >= ord('A') and ord(char) <= ord('Z')) or char == "?" or char == "!" or char == " " :
displayCharacter(f_dataStream, char)
else:
print("Error, '{}' not a character".format(char))
#beetween each sentence, system has to wait and then pkill xeyes
f_dataStream.write("sleep 5")
f_dataStream.write("pkill xeyes")
......@@ -4,7 +4,6 @@ import gtk #screen size
i_screen_width = gtk.gdk.screen_width()
i_screen_height = gtk.gdk.screen_height()
s_filename = "../xeyes_sentences.sh"
if(len(sys.argv) == 3):
i_xeyes_size = int(sys.argv[2])
......@@ -20,3 +19,6 @@ global_y_pos = 300
local_x_pos = 0
local_y_pos = 0
s_filename = "../xeyes_sentences.sh"
f_dataStream = open(s_filename, "w")
......@@ -10,9 +10,15 @@ if (len(sys.argv) < 2 or len(sys.argv) > 3):
print("Syntax error : python xeyes_sentences.py \"sentence_to_display\" [size]")
exit(0)
#sentence to display
s_sentence = sys.argv[1];
s_sentence = s_sentence.upper()
s_sentence = s_sentence.replace('""', "")
#sentences to display
s_input = sys.argv[1];
s_input = s_input.upper()
s_input = s_input.replace('""', "")
displaySentence(s_sentence)
#if several sentences : delimiter "\"
l_sentences = s_input.slipt("\")
initFile(f_dataStream, s_input)
for s_sentence in l_sentences:
displaySentence(s_sentence)
Supports Markdown
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment