Esempio n. 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 /
            ]))
Esempio n. 2
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 /
        ]))
Esempio n. 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)
Esempio n. 4
0
 def root_url():
     logger.warning("%s:", page.path)
     logger.warning("{{ ROOT_URL }} is deprecated, use {% url '/page.html' %} instead.")
     return path_to_url(prefix)
Esempio n. 5
0
 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'))
Esempio n. 6
0
File: page.py Progetto: 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)
Esempio n. 7
0
File: page.py Progetto: 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'))
Esempio n. 8
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)