##// END OF EJS Templates
Fedora 10 no deja instalar modulo tftp
imanay -
r41:42
parent child
Show More
@@ -1,4 +1,4
1 import tftpy
1 #import tftpy
2 2 import socket
3 3
4 4 class UDPServer:
@@ -72,7 +72,7
72 72 # Send messages
73 73 if(self.socket_c.sendto(TxFrame, self.multicast_addr)):
74 74 print "Sending message:[" + TxFrame + "]"
75
75
76 76 data_rx, server_rx = self.socket_c.recvfrom(16)
77 77
78 78 print "Data received ", data_rx, server_rx
@@ -127,12 +127,12
127 127 if(self.socket_c.sendto(TxFrame, self.addr)):
128 128 print "Sending message:[" + TxFrame + "]"
129 129
130 data_rx, server_rx = self.socket_c.recvfrom(16)
131
132 print "Data received ", data_rx, server_rx
130 # data_rx, server_rx = self.socket_c.recvfrom(16)
131 #
132 # print "Data received ", data_rx, server_rx
133 133
134 134 # Close socket
135 self.socket_c.close()
135 #self.socket_c.close()
136 136
137 137 def sendTxRxCommand(self, cmd, data, nbytes = 16384):
138 138
@@ -176,25 +176,25
176 176
177 177 return ipSource, ipDestino, cmd, data
178 178
179 class FTPComm:
180
181 ftp_servidor = 'ftp.servidor.com'
182 ftp_usuario = 'miusuario'
183 ftp_clave = 'miclave'
184 ftp_raiz = '/public_html'
185
186 def __init__(self):
187
188 self.client = tftpy.TftpClient(self.ftp_servidor, '69')
189
190
191 def sendFile(self, filename):
192
193 self.client.upload(filename)
194
195 if __name__ == '__main__':
196
197 obj = FTPComm()
179 #class FTPComm:
180 #
181 # ftp_servidor = 'ftp.servidor.com'
182 # ftp_usuario = 'miusuario'
183 # ftp_clave = 'miclave'
184 # ftp_raiz = '/public_html'
185 #
186 # def __init__(self):
187 #
188 # self.client = tftpy.TftpClient(self.ftp_servidor, '69')
189 #
190 #
191 # def sendFile(self, filename):
192 #
193 # self.client.upload(filename)
194 #
195 #if __name__ == '__main__':
196 #
197 # obj = FTPComm()
198 198
199 199
200 200 No newline at end of file
General Comments 0
You need to be logged in to leave comments. Login now