コード例 #1
0
ファイル: hspace.py プロジェクト: jeremymickel/hTools2
 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()
コード例 #2
0
ファイル: hspace.py プロジェクト: hblackett/hTools2
 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()
コード例 #3
0
ファイル: hproject.py プロジェクト: miguelsousa/hTools2
 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.'
コード例 #4
0
ファイル: hproject.py プロジェクト: hblackett/hTools2
 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"