@@ -58,25 +58,30 @@ def get_disqus_sso(self, user):
58
58
return "{0} {1} {2}" .format (message , sig , timestamp )
59
59
60
60
def update_comment (self , sketch , results , current_date , log_entry , openFailFlag , total_sketches ):
61
- # Comment libraries
61
+ """A comment is added to the library as soon as its first example is compiled.
62
+ `library`: The library in which belongs the currently compiled example.
63
+ `self.last_library`: The library in which belongs the previously compiled example.
64
+ `library_to_comment`: The library in which a comment should be added.
65
+ """
66
+
62
67
library_match = re .match (r'.+\/example\/(.+)\/.+' , sketch )
63
68
library = None
64
69
library_to_comment = None
70
+
65
71
if library_match :
66
72
library = library_match .group (1 )
67
- if not self .last_library :
68
- self .last_library = library
69
- library_to_comment = library
70
73
74
+ "Check if the currently compiled example belongs to the same library as the previous one."
71
75
if library != self .last_library :
72
76
library_to_comment = library
73
77
78
+ "Check if we should add a comment to the library."
74
79
if library_to_comment :
75
80
log_entry = self .handle_library_comment (library_to_comment , current_date , log_entry )
76
81
77
82
self .last_library = library
78
83
79
- # Comment examples
84
+ "Add a comment to the currently compiled library example."
80
85
if not openFailFlag :
81
86
log_entry = self .handle_example_comment (sketch , results , current_date , log_entry )
82
87
0 commit comments