glamp/shellington — pull request #1 by EricChiang (2014-01-20 13:56:09+00:00)
Title: Shellington-Lite added for development

Looking for code review.

Created a lite version for back end development (was having trouble using browser view when offline, will investigate). Works over tcp using telnet.

Run server with following command (currently working with python and R)
./shellington-lite [language]

Connect to server via terminal with
telnet 127.0.0.1 7776

Python and R more robust. Can now enter multiline code:
```
eric:shellington$ telnet 127.0.0.1 7776
Trying 127.0.0.1...
Connected to 127.0.0.1.
Escape character is '^]'.
[SHELLINGTON] Welcome to shellington-lite
Lord shellington python
>>> x = 0
>>> for i in range(100):
... x += i
...
>>> x
4950
>>> exit()
Goodday to you Madam/Sir
Connection closed by foreign host.
```

```
eric:views$ telnet 127.0.0.1 7776
Trying 127.0.0.1...
Connected to 127.0.0.1.
Escape character is '^]'.
[SHELLINGTON] Welcome to shellington-lite
Lord shellington R
> fibo <- function(n) {
+ if (n < 2) {
+ n
+ } else {
+ fibo(n-1) + fibo(n-2)
+ }
+ }
function (n)
{
if (n < 2) {
n
}
else {
fibo(n - 1) + fibo(n - 2)
}
}
> fibo(10)
55
> q()
Goodday to you Madam/Sir
Connection closed by foreign host.
```

Python functions still need work.

Changes:
- Lite shellington version over tcp added for development
* Connect via telnet
* Allows focus command processing development
- OOP paradigm added
* Each language has its own shell, inheritting form base shell
* Different shell process input differently depending on
language to detect multiline commands
* Seperates child handling from server logic
- New "Shell" now initialized for each client
* Each shell spawns its own child process so each client is
given its own child process
* Delimeter removed
- Enhances to python and R processing
* Can now enter multiline commands: for loops, functions, etc.

TODO
- Incorporate Bash and Ruby into new changes
- Combine back-end changes into view