Exemplo n.º 1
0
 def test_ftp_callback(self, sender):
     '''Test settings for FTP server.'''
     _settings = self.get_settings()
     F = connect_to_server(_settings['ftp url'],
                 _settings['ftp login'],
                 _settings['ftp password'],
                 _settings['ftp folder'],
                 verbose=True)
     F.quit()
Exemplo n.º 2
0
 def test_ftp_callback(self, sender):
     _password = self._get_password()
     _url = self.w.ftp_url_value.get()
     _login = self.w.ftp_login_value.get()
     _folder = self.w.ftp_folder_value.get()
     try:
         F = connect_to_server(_url, _login, _password, _folder, verbose=True)
         F.quit()
     except:
         print 'ftp connection failed.\n'
Exemplo n.º 3
0
 def upload_woffs(self):
     '''Upload all corresponding woffs for the ufos in space to the project's folder in the FTP server.'''
     for ufo_path in self.ufos():
         file_name = os.path.splitext(os.path.split(ufo_path)[1])[0]
         woff_file = '%s.woff' % file_name
         woff_path = os.path.join(self.project.paths['woffs'], woff_file)
         if os.path.exists(woff_path):
             F = connect_to_server(
                 self.project.world.settings.hDict['ftp']['url'],
                 self.project.world.settings.hDict['ftp']['login'],
                 self.project.world.settings.hDict['ftp']['password'],
                 self.project.ftp_path(),
                 verbose=False)
             upload_file(woff_path, F)
             F.quit()
Exemplo n.º 4
0
 def upload_woffs(self):
     """Upload all ``.woffs`` in space to the project's folder in the FTP server."""
     for ufo_path in self.ufos():
         file_name = os.path.splitext(os.path.split(ufo_path)[1])[0]
         woff_file = "%s.woff" % file_name
         woff_path = os.path.join(self.project.paths["woffs"], woff_file)
         if os.path.exists(woff_path):
             F = connect_to_server(
                 self.project.world.settings.hDict["ftp"]["url"],
                 self.project.world.settings.hDict["ftp"]["login"],
                 self.project.world.settings.hDict["ftp"]["password"],
                 self.project.ftp_path(),
                 verbose=False,
             )
             upload_file(woff_path, F)
             F.quit()
Exemplo n.º 5
0
 def upload_css(self):
     """Upload the project's ``.css`` file to the project's folder in the FTP server."""
     woffs_folder = self.paths['woffs']
     css_file = '%s.css' % self.name.lower()
     css_path = os.path.join(woffs_folder, css_file)
     if os.path.exists(css_path):
         print 'uploading %s to ftp server...' % css_file,
         # get ftp parameters
         url = self.world.settings.hDict['ftp']['url']
         login = self.world.settings.hDict['ftp']['login']
         password = self.world.settings.hDict['ftp']['password']
         folder = self.ftp_path()
         # connect to ftp
         F = connect_to_server(url, login, password, folder, verbose=False)
         upload_file(css_path, F)
         F.quit()
         print 'done.\n'
     else:
         print 'css file does not exist.'
Exemplo n.º 6
0
 def upload_css(self, verbose=True):
     """Upload the project's ``.css`` files to the project's fonts folder in the FTP server."""
     woffs_folder = self.paths["woffs"]
     css_files = walk(woffs_folder, "css")
     for css_file in css_files:
         if verbose:
             print "uploading %s to ftp server..." % css_file,
         # get ftp parameters
         url = self.world.settings.hDict["ftp"]["url"]
         login = self.world.settings.hDict["ftp"]["login"]
         password = self.world.settings.hDict["ftp"]["password"]
         folder = self.ftp_path()
         # connect to ftp
         F = connect_to_server(url, login, password, folder, verbose=False)
         upload_file(css_file, F)
         F.quit()
         # done
         if verbose:
             print "done.\n"