def put_main_ftp(self, force=False):
        '''
        ftputil
        '''
        s=secret.get_hpr_ftp_server()
        u=secret.get_hpr_ftp_username()
        p=secret.get_hpr_ftp_password()

        with ftputil.FTPHost(s, u, p) as host:
            path = '/temp_dir_please_ignore'
            try :
                host.mkdir(path)
            except:
                pass

            names = host.listdir("/temp_dir_please_ignore/")

            files = self.get_file_list()
            for filename in files :

                if (filename in  names):
                    if (not force) :
                        print "skip existing %s" % filename
                        continue
                try :
                    host.upload(filename, 
                                path + "/" + filename, 
                                mode='', 
                                callback=ftp_upload_cb)
                except:
                    pass
示例#2
0
    def put_main_ftp(self, force=False):
        '''
        ftputil
        '''
        s = secret.get_hpr_ftp_server()
        u = secret.get_hpr_ftp_username()
        p = secret.get_hpr_ftp_password()

        with ftputil.FTPHost(s, u, p) as host:
            path = '/temp_dir_please_ignore'
            try:
                host.mkdir(path)
            except:
                pass

            names = host.listdir("/temp_dir_please_ignore/")

            files = self.get_file_list()
            for filename in files:

                if (filename in names):
                    if (not force):
                        print "skip existing %s" % filename
                        continue
                try:
                    host.upload(filename,
                                path + "/" + filename,
                                mode='',
                                callback=ftp_upload_cb)
                except:
                    pass
    def ls_main_ftp(self):
        '''
        ftputil
        '''
        s=secret.get_hpr_ftp_server()
        u=secret.get_hpr_ftp_username()
        p=secret.get_hpr_ftp_password()

        with ftputil.FTPHost(s, u, p) as host:
            names = host.listdir("/temp_dir_please_ignore/")
            for name in names:
                print "/temp_dir_please_ignore/" + name
示例#4
0
    def ls_main_ftp(self):
        '''
        ftputil
        '''
        s = secret.get_hpr_ftp_server()
        u = secret.get_hpr_ftp_username()
        p = secret.get_hpr_ftp_password()

        with ftputil.FTPHost(s, u, p) as host:
            names = host.listdir("/temp_dir_please_ignore/")
            for name in names:
                print "/temp_dir_please_ignore/" + name