コード例 #1
0
    def testBuild(self):
        """
        Test that we build the proper files.
        """
        self.site.build()

        # Make sure we build to .build and not build
        self.assertEqual(os.path.exists(os.path.join(self.path, 'build')),
                         False)

        self.assertEqual(
            sorted([
                path_to_url(path)
                for path in fileList(os.path.join(self.path, '.build'),
                                     relative=True)
            ]),
            sorted([
                'error.html',
                'index.html',
                'robots.txt',
                'sitemap.xml',
                self.site.get_url_for_static(
                    '/static/css/style.css')[1:],  # Strip the initial /
                self.site.get_url_for_static(
                    '/static/images/favicon.ico')[1:],  # Strip the initial /
                self.site.get_url_for_static('/static/js/main.js')
                [1:],  # Strip the initial /
            ]))
コード例 #2
0
ファイル: test_basic.py プロジェクト: ateszdn/Cactus
    def testBuild(self):
        """
        Test that we build the proper files.
        """
        self.site.build()

        # Make sure we build to .build and not build
        self.assertEqual(os.path.exists(os.path.join(self.path, 'build')), False)

        self.assertEqual(
            sorted([path_to_url(path) for path in fileList(os.path.join(self.path, '.build'), relative=True)]),
            sorted([
                'error.html',
                'index.html',
                'robots.txt',
                'sitemap.xml',
                self.site.get_url_for_static('/static/css/style.css')[1:],  # Strip the initial /
                self.site.get_url_for_static('/static/images/favicon.ico')[1:],  # Strip the initial /
                self.site.get_url_for_static('/static/js/main.js')[1:],  # Strip the initial /
        ]))
コード例 #3
0
 def url(self):
     """
     We must use this when deploying, otherwise the paths will be broken when
     deploying from Windows
     """
     return path_to_url(self.path)
コード例 #4
0
ファイル: page.py プロジェクト: sharpertool/Cactus
 def root_url():
     logger.warning("%s:", page.path)
     logger.warning("{{ ROOT_URL }} is deprecated, use {% url '/page.html' %} instead.")
     return path_to_url(prefix)
コード例 #5
0
ファイル: page.py プロジェクト: sharpertool/Cactus
 def static_url():
     logger.warning("%s:", page.path)
     logger.warning("{{ STATIC_URL }} is deprecated, use {% static '/static/path/to/file' %} instead.")
     return path_to_url(os.path.join(prefix, 'static'))
コード例 #6
0
ファイル: page.py プロジェクト: CILP/Cactus
 def root_url():
     logger.warn("%s:", page.path)
     logger.warn("{{ ROOT_URL }} is deprecated, use {% url '/page.html' %} instead.")
     return path_to_url(prefix)
コード例 #7
0
ファイル: page.py プロジェクト: CILP/Cactus
 def static_url():
     logger.warn("%s:", page.path)
     logger.warn("{{ STATIC_URL }} is deprecated, use {% static '/static/path/to/file' %} instead.")
     return path_to_url(os.path.join(prefix, 'static'))
コード例 #8
0
ファイル: file.py プロジェクト: krallin/Cactus
 def url(self):
     """
     We must use this when deploying, otherwise the paths will be broken when
     deploying from Windows
     """
     return path_to_url(self.path)