-
Notifications
You must be signed in to change notification settings - Fork 2
/
Process.py
37 lines (29 loc) · 891 Bytes
/
Process.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
import SubProcessor
import os
import Modem
class Process():
def __init__(self):
self.process = SubProcessor.SubProcessor(os.getcwd())
#self.process.authorized = True
def login(self, username, passwd):
result = process.authorize(username, passwd)
print result
def execute(self, command):
response = self.process.run(command)
return response
def getUserInfo(self, username):
try:
return self.process.users[username]
except:
return "User isn't login"
def main(self):
while (not process.authorized):
getUserInfo()
command = ''
response = ''
modem = Modem.Modem()
modem.run(process)
while(command != 'exit'):
# command = raw_input("$ ")
response = process.run(command)
print response