Test Failed
Push — master ( 47aaa2...5ffdf1 )
by Daniel
02:25
created

BasicNeeds.fn_timestamped_print()   A

Complexity

Conditions 1

Size

Total Lines 4
Code Lines 4

Duplication

Lines 4
Ratio 100 %

Importance

Changes 0
Metric Value
cc 1
eloc 4
nop 2
dl 4
loc 4
rs 10
c 0
b 0
f 0
1
"""
2
BasicNeeds - useful functions library
3
4
This library has functions useful to keep main logic short and simple
5
"""
6
# standard Python packages
7
from datetime import datetime, timezone
8
9
10 View Code Duplication
class BasicNeeds:
0 ignored issues
show
Duplication introduced by
This code seems to be duplicated in your project.
Loading history...
11
12
    def fn_optional_print(self, boolean_variable, string_to_print):
13
        if boolean_variable:
14
            self.fn_timestamped_print(self, string_to_print)
15
16
    @staticmethod
17
    def fn_timestamped_print(self, string_to_print):
18
        print(datetime.now(timezone.utc).strftime("%Y-%b-%d %H:%M:%S.%f %Z")
19
              + ' - ' + string_to_print)
20