Check-in [b070f5b166]
Not logged in

Many hyperlinks are disabled.
Use anonymous login to enable hyperlinks.

Overview
Comment:First commit. Depends on path to vlc to be set in file.
Timelines: family | ancestors | descendants | both | trunk
Files: files | file ages | folders
SHA1:b070f5b1666b775752e359214119d680891fd2b2
User & Date: DarkLinkXXXX 2013-09-24 03:46:41
Context
2013-09-25
00:04
Second commit. Leaf check-in: ea34849e2d user: DarkLinkXXXX tags: trunk
2013-09-24
03:46
First commit. Depends on path to vlc to be set in file. check-in: b070f5b166 user: DarkLinkXXXX tags: trunk
03:39
initial empty check-in check-in: a6202c8e59 user: DarkLinkXXXX tags: trunk
Changes

Added repl.py.













































































































































































>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
#!/usr/bin/env python

import readline
import threading
import http.client
import shutil
import os
import subprocess
import shlex

##########################
#Configuration Parameters#
##########################

debug = True
vlc = "c:/Program\ Files/VideoLAN/VLC/vlc.exe"




PROMPT = '> '

def info():
    print("""
   _____    _________.____         _____                        .__   
  /  _  \  /   _____/|    |       /  _  \   ____    ____   ____ |  |  
 /  /_\  \ \_____  \ |    |      /  /_\  \ /    \  / ___\_/ __ \|  |  
/    |    \/        \|    |___  /    |    \   |  \/ /_/  >  ___/|  |__
\____|__  /_______  /|_______ \ \____|__  /___|  /\___  / \___  >____/
        \/        \/         \/         \/     \//_____/      \/
Alex Stubbins Anti-Copyright 2013
""")
    


def handspeak(word):
    import urllib.request as req
    domain = "www.handspeak.com"
    con = http.client.HTTPConnection(domain)
    url = "/word/" + word[0] + "/" + word + ".mp4"
    con.request("GET", url)
    stat = con.getresponse().status
    print(stat)
    if stat == 200:
        file = req.urlretrieve("http://" + domain + url)[0]
        file = shutil.copyfile(file, file + ".mp4")
        print("File saved at " + file)
        lcmd = shlex.split(vlc + " -vvv ")
        print(lcmd + [file])
        subprocess.call(lcmd + [file])

        

commands  = {'i': info, 'hs': handspeak}


def interrupt():
    print() # Don't want to end up on the same line the user is typing on.
    print('Interrupting cow -- moo!')
#    print(PROMPT, readline.get_line_buffer(), sep='', end='')

def cli():
    while True:
        try:
            coli = str(input(PROMPT))
            try:
                cmd = coli.split()[0]
            except IndexError:
                cli()

                
                
            args = coli[len(cmd)+1:]
            if cmd in commands:
                commands[cmd](args)
            else:
                if cli != "":
                    print('"' + cli + '"')
        except EOFError as err:
            print("\rGoodbye!", end="")
            exit()


if __name__ == '__main__':
    threading.Thread(target=cli).start()
#    threading.Timer(0, interrupt).start()