class SiteCrawler:
A sitecrawler is a generator that yields a tuple of the form (PreParser, file) Its goal is to create a list of preparsers and files to be parsed based on the files and directories in the initial path. This generator is to be used in a for loop to parse all the files and produce the final website.
| Method | __init__ |
:param path: The path to the directory to be crawled :param destination: The path to the directory where the website will be created :param _env: The environment object :type path: str :type destination: str :type _env: environment... |
| Method | __iter__ |
This method is used to iterate over the preparsers and files. :yield: A tuple of the form (PreParser, file) :ytype: (preparser.PreParser, str) |
| Method | copy |
This method is used to copy all the files that could not be parsed. |
| Method | create |
This method is used to create all the directories in the destination path. |
| Method | create |
This method is used to create a file. :raises FileExistsError: If the file already exists and the force_rewrite option is False :param path: The path to the file to be created :type path: str |
| Method | get |
This method is used to get all the paths to be crawled. Its goal is to get all the paths to be crawled and to store them in the self.directories and self.files, self.files_to_copy variables. |
| Method | list |
Recursive method to get all the paths to be crawled. :param path: The current path to be crawled :param root: The root path (initial path) :type path: str :type root: str :return: A tuple of the form (files, directories) :rtype: (list[(str, str)], list[(str, str)], list[(str, str)])... |
| Method | set |
This method is used to set all the preparsers and initialize them. The preparsers are stored in the self.preparsers variable. :return: self.preparsers :rtype: list[preparser.PreParser] |
| Instance Variable | authorised |
Undocumented |
| Instance Variable | destination |
Undocumented |
| Instance Variable | directories |
Undocumented |
| Instance Variable | files |
Undocumented |
| Instance Variable | files |
Undocumented |
| Instance Variable | forbidden |
Undocumented |
| Instance Variable | force |
Undocumented |
| Instance Variable | global |
Undocumented |
| Instance Variable | initial |
Undocumented |
| Instance Variable | preparsers |
Undocumented |
| Instance Variable | _env |
Undocumented |
:param path: The path to the directory to be crawled :param destination: The path to the directory where the website will be created :param _env: The environment object :type path: str :type destination: str :type _env: environment.Environment
This method is used to iterate over the preparsers and files. :yield: A tuple of the form (PreParser, file) :ytype: (preparser.PreParser, str)
This method is used to copy all the files that could not be parsed.
This method is used to create all the directories in the destination path.
This method is used to create a file. :raises FileExistsError: If the file already exists and the force_rewrite option is False :param path: The path to the file to be created :type path: str
This method is used to get all the paths to be crawled. Its goal is to get all the paths to be crawled and to store them in the self.directories and self.files, self.files_to_copy variables.
Recursive method to get all the paths to be crawled. :param path: The current path to be crawled :param root: The root path (initial path) :type path: str :type root: str :return: A tuple of the form (files, directories) :rtype: (list[(str, str)], list[(str, str)], list[(str, str)])