1,4 → 1,4 |
# -*- coding: utf-8 -*- |
Я -*- coding: utf-8 -*- |
""" PyCODC NMDC/ADC Client """ |
from twisted.internet import protocol |
from twisted.protocols import basic |
20,8 → 20,7 |
|
def lineReceived(self, line): |
print "Line Received: %s" % line |
command, params = self.parseLine(line) |
self.handleCommand(command, params) |
self.parseLine(line) |
|
def connectionLost(self, reason): |
print "Conlost: %s" %self |
46,12 → 45,9 |
|
command = m.group("command") |
params = m.group("params") |
print "NMDC Command: %s; Params: %s" %(command, params) |
self.handleCommand(command, params) |
except: |
print "Exception: %s"% line |
return command, params |
else: |
return "", "" |
|
def handleCommand(self, command, params): |
print "handleCommand: %s %s" % (command, params) |
74,6 → 70,9 |
self.sendLine(answer) |
print "makeAnswer: %s" % answer |
|
def nmdc_unknown(self, command, params): |
print "nmdc_%s doesn't exist. Called with params: %s" % (command,params) |
def nmdc_rawline(self, line): |
print "rawline: %s"% line |
|
def nmdc_unknown(self, command): |
print "nmdc_%s doesn't exist." % command |
|