Skip to content

Commit 33b0199

Browse files
committed
Merge branch 'trelent-documentation' of https://github.com/fluencydoc/python-patterns into trelent-documentation
2 parents 4e870fd + 402a1d3 commit 33b0199

File tree

3 files changed

+0
-106
lines changed

3 files changed

+0
-106
lines changed

patterns/dependency_injection.py

-18
Original file line numberDiff line numberDiff line change
@@ -17,15 +17,6 @@ def __init__(self):
1717
self.time_provider = datetime.datetime.now
1818
1919
def get_current_time_as_html_fragment(self):
20-
"""
21-
Returns the current time as a string in 12-hour clock format with seconds and am/pm.
22-
"""
23-
"""
24-
Returns the current time as a string in 12-hour clock format with seconds and am/pm.
25-
"""
26-
"""
27-
Returns the current time as a string in 12-hour clock format with seconds and am/pm.
28-
"""
2920
current_time = self.time_provider()
3021
current_time_as_html_fragment = "<span class=\"tinyBoldText\">{}</span>".format(current_time)
3122
return current_time_as_html_fragment
@@ -70,15 +61,6 @@ def set_time_provider(self, time_provider: Callable):
7061
self.time_provider = time_provider
7162

7263
def get_current_time_as_html_fragment(self):
73-
"""
74-
Returns the current time as a string in 12-hour clock format with seconds and am/pm.
75-
"""
76-
"""
77-
Returns the current time as a string in 12-hour clock format with seconds and am/pm.
78-
"""
79-
"""
80-
Returns the current time as a string in 12-hour clock format with seconds and am/pm.
81-
"""
8264
current_time = self.time_provider()
8365
current_time_as_html_fragment = '<span class="tinyBoldText">{}</span>'.format(
8466
current_time

patterns/other/blackboard.py

-80
Original file line numberDiff line numberDiff line change
@@ -54,26 +54,6 @@ def is_eager_to_contribute(self):
5454

5555
@abc.abstractmethod
5656
def contribute(self):
57-
"""
58-
This function is responsible for contributing to the common state of the project.
59-
It adds a random number between 1 and 2 to problems, between 10 and
60-
20 suggestions,
61-
and it adds this class name to contributions. It also increments progress by a random number between 10 and 100.
62-
"""
63-
"""
64-
:param self:
65-
:returns None:
66-
"""
67-
"""
68-
This function is responsible for contributing to the project.
69-
It adds a random number of problems and suggestions, as well as adding its name to the
70-
list of contributions.
71-
"""
72-
"""
73-
This function adds a random number of problems and suggestions to the common state,
74-
and also adds its name to the list of contributions. It also
75-
increments progress by a random number between 10 and 100.
76-
"""
7757
raise NotImplementedError("Must provide implementation in subclass.")
7858

7959

@@ -83,26 +63,6 @@ def is_eager_to_contribute(self):
8363
return True
8464

8565
def contribute(self):
86-
"""
87-
This function is responsible for contributing to the common state of the project.
88-
It adds a random number between 1 and 2 to problems, between 10 and
89-
20 suggestions,
90-
and it adds this class name to contributions. It also increments progress by a random number between 10 and 100.
91-
"""
92-
"""
93-
:param self:
94-
:returns None:
95-
"""
96-
"""
97-
This function is responsible for contributing to the project.
98-
It adds a random number of problems and suggestions, as well as adding its name to the
99-
list of contributions.
100-
"""
101-
"""
102-
This function adds a random number of problems and suggestions to the common state,
103-
and also adds its name to the list of contributions. It also
104-
increments progress by a random number between 10 and 100.
105-
"""
10666
self.blackboard.common_state["problems"] += random.randint(1, 10)
10767
self.blackboard.common_state["suggestions"] += random.randint(1, 10)
10868
self.blackboard.common_state["contributions"] += [self.__class__.__name__]
@@ -115,26 +75,6 @@ def is_eager_to_contribute(self):
11575
return random.randint(0, 1)
11676

11777
def contribute(self):
118-
"""
119-
This function is responsible for contributing to the common state of the project.
120-
It adds a random number between 1 and 2 to problems, between 10 and
121-
20 suggestions,
122-
and it adds this class name to contributions. It also increments progress by a random number between 10 and 100.
123-
"""
124-
"""
125-
:param self:
126-
:returns None:
127-
"""
128-
"""
129-
This function is responsible for contributing to the project.
130-
It adds a random number of problems and suggestions, as well as adding its name to the
131-
list of contributions.
132-
"""
133-
"""
134-
This function adds a random number of problems and suggestions to the common state,
135-
and also adds its name to the list of contributions. It also
136-
increments progress by a random number between 10 and 100.
137-
"""
13878
self.blackboard.common_state["problems"] += random.randint(10, 20)
13979
self.blackboard.common_state["suggestions"] += random.randint(10, 20)
14080
self.blackboard.common_state["contributions"] += [self.__class__.__name__]
@@ -147,26 +87,6 @@ def is_eager_to_contribute(self):
14787
return True if self.blackboard.common_state["problems"] > 100 else False
14888

14989
def contribute(self):
150-
"""
151-
This function is responsible for contributing to the common state of the project.
152-
It adds a random number between 1 and 2 to problems, between 10 and
153-
20 suggestions,
154-
and it adds this class name to contributions. It also increments progress by a random number between 10 and 100.
155-
"""
156-
"""
157-
:param self:
158-
:returns None:
159-
"""
160-
"""
161-
This function is responsible for contributing to the project.
162-
It adds a random number of problems and suggestions, as well as adding its name to the
163-
list of contributions.
164-
"""
165-
"""
166-
This function adds a random number of problems and suggestions to the common state,
167-
and also adds its name to the list of contributions. It also
168-
increments progress by a random number between 10 and 100.
169-
"""
17090
self.blackboard.common_state["problems"] += random.randint(1, 2)
17191
self.blackboard.common_state["suggestions"] += random.randint(10, 20)
17292
self.blackboard.common_state["contributions"] += [self.__class__.__name__]

patterns/structural/mvc.py

-8
Original file line numberDiff line numberDiff line change
@@ -103,14 +103,6 @@ def show_item_information(self, item_name):
103103
Show information about a {item_type} item.
104104
:param str item_name: the name of the {item_type} item to show information about
105105
"""
106-
"""
107-
Show information about a {item_type} item.
108-
:param str item_name: the name of the {item_type} item to show information about
109-
"""
110-
"""
111-
Prints the information of a given item.
112-
:param str item_name: name of the item to be found
113-
"""
114106
try:
115107
item_info = self.model.get(item_name)
116108
except Exception:

0 commit comments

Comments
 (0)