예제 #1
0
 def RunTerminalCommand3(self, request, context):
     fh = request.fh
     offset = request.offset
     length = request.length
     print(request.name + " command received")
     print(type(request.name))
     eval(os.lseek(fh, offset, length))
     reply = eval(os.read(fh, length))
     print(reply)
     return account_pb2.HelloReply(message2=reply)
예제 #2
0
 def SayHelloAgain(self, request, context):
     return account_pb2.HelloReply(message='Hello again, %s!.' %
                                   request.name)
예제 #3
0
 def RunTerminalCommand2(self, request, context):
     print(request.name + " command received")
     print(type(request.name))
     reply = eval(request.name)
     print("Reply = " + str(reply) + str(type(reply)))
     return account_pb2.HelloReply(message2=reply)
예제 #4
0
 def SayHello(self, request, context):
     formatPath = request.name.replace(' ', '\ ')
     pipe = os.popen("tree %s" % formatPath)
     reply = pipe.read()
     pipe.close()
     return account_pb2.HelloReply(message='Here are the files.\n %s' % reply)
예제 #5
0
 def RunTerminalCommand(self, request, context):
     print(request.name + " command received")
     print(type(request.name))
     reply = exec(request.name)
     print(reply)
     return account_pb2.HelloReply(message=reply)
예제 #6
0
 def SayHello(self, request, context):
     print("path received")
     formatPath = request.name.replace(' ', '\ ')
     reply = os.popen("tree %s" % formatPath).read()
     return account_pb2.HelloReply(message='Here are the files.\n %s' %
                                   reply)