Пример #1
0
 def test_copy_file(self):
     """
     Given two paths (src, dst) test that the parent directories
     are created and the file is copied.
     """
     src = join(self.fixture_dir, 'myfile')
     dst = join(self.fixture_dir, 'myfile_copied')
     self.assert_(not exists(dst))
     utils.copy_file(src, dst)
     self.assert_(exists(dst))
Пример #2
0
    def _copy_static_files(self):
        "Copies static files to output directory"
        # static files that aren't associated with pages
        for static_file in self.static_files:
            dst = join(self.settings['output_dir'],
                       relpath(static_file, self.settings['project_dir']))
            logging.debug('copying %s to %s', static_file, dst)
            copy_file(static_file, dst)

        # static files that are associated with pages
        for page in self.pages:
            for static_file in page['static_files']:
                dst = join(self.settings['output_dir'],
                           dirname(_get_output_path(page['url'])),
                           relpath(static_file, dirname(page['path'])))
                logging.debug('copying %s to %s', static_file, dst)
                copy_file(static_file, dst)
Пример #3
0
    def _copy_static_files(self):
        "Copies static files to output directory"
        # static files that aren't associated with pages
        for static_file in self.static_files:
            dst = join(self.settings['output_dir'],
                       relpath(static_file, self.settings['project_dir']))
            logging.debug('copying %s to %s', static_file, dst)
            copy_file(static_file, dst)

        # static files that are associated with pages
        for page in self.pages:
            for static_file in page['static_files']:
                dst = join(self.settings['output_dir'],
                           dirname(_get_output_path(page['url'])),
                           relpath(static_file, dirname(page['path'])))
                logging.debug('copying %s to %s', static_file, dst)
                copy_file(static_file, dst)