#!/usr/bin/env python
# -*- coding: utf-8 -*-
from Tkinter import *
import tkFileDialog as dialog
from socket import *
import os
import yaml
def client(filename):
file=open('config.yaml','r')
conf=yaml.load(file)
HOST=conf['clienthost']
PORT=conf['port']
file.close()
ADDR = (HOST,PORT)
BUFSIZE = 1024
FILEINFO_SIZE=os.path.getsize(filename)
print FILEINFO_SIZE
tfilename=filename[filename.rfind('/')+1:len(filename)]
fhead='%d \n %s'% (FILEINFO_SIZE,tfilename)
sendSock = socket(AF_INET,SOCK_STREAM)
sendSock.connect(ADDR)
sendSock.send(fhead)
f
# -*- coding: utf-8 -*-
from Tkinter import *
import tkFileDialog as dialog
from socket import *
import os
import yaml
def client(filename):
file=open('config.yaml','r')
conf=yaml.load(file)
HOST=conf['clienthost']
PORT=conf['port']
file.close()
ADDR = (HOST,PORT)
BUFSIZE = 1024
FILEINFO_SIZE=os.path.getsize(filename)
print FILEINFO_SIZE
tfilename=filename[filename.rfind('/')+1:len(filename)]
fhead='%d \n %s'% (FILEINFO_SIZE,tfilename)
sendSock = socket(AF_INET,SOCK_STREAM)
sendSock.connect(ADDR)
sendSock.send(fhead)
f