Package concurrent_tree_crawler :: Module abstract_tree_navigator
[hide private]
[frames] | no frames]

Source Code for Module concurrent_tree_crawler.abstract_tree_navigator

 7   
8 -class AbstractTreeNavigator:
9 """ 10 An object that has a direct access to the elements of the domain tree 11 (e.g. web pages) traversed by the crawler. 12 13 Each method declared in this abstract class can raise a 14 L{NavigationException}. If such an exception is raised, it will be gently 15 handled by the crawler -- it won't terminate the crawler thread nor 16 the whole program, but the information that an error occurred will be saved 17 in the tree data structure and the crawler will be restarted. If other 18 kind of exception is raised, it will terminate the thread and the whole 19 program. 20 """ 21
22 - def start_in_root(self):
23 """ 24 Start in the root node of the domain tree 25 26 @raise NavigationException: see class description for details of 27 ramification of raising such an exception. 28 """ 29 return NotImplementedError
30
31 - def get_children(self):
32 """ 33 @return: names of children of the current node of the domain tree 34 @rtype: list of strings 35 36 @raise NavigationException: see class description for details of 37 ramification of raising such an exception. 38 """ 39 return NotImplementedError
40
41 - def move_to_child(self, child_name):
42 """ 43 Move to the child of the current node of the domain tree. 44 45 @param child_name: name of the child to move to 46 @raise NavigationException: see class description for details of 47 ramification of raising such an exception. 48 """ 49 return NotImplementedError
50
51 - def move_to_parent(self):
52 """ 53 Move to the parent of the current node of the domain tree. 54 55 @raise NavigationException: see class description for details of 56 ramification of raising such an exception. 57 """ 58 return NotImplementedError
59
61 """ 62 @return: C{True} if the current node is a leaf, C{False} if it is 63 an internal node of the domain tree. 64 @raise NavigationException: see class description for details of 65 ramification of raising such an exception. 66 """ 67 return NotImplementedError
68