Passed
Push — master ( 525f7c...1e26bf )
by Dave
01:15
created

backend.fcmutils   A

Complexity

Total Complexity 4

Size/Duplication

Total Lines 13
Duplicated Lines 0 %

Importance

Changes 0
Metric Value
eloc 8
dl 0
loc 13
rs 10
c 0
b 0
f 0
wmc 4

2 Functions

Rating   Name   Duplication   Size   Complexity  
A formattime() 0 3 1
A safestring() 0 6 3
1
#import time
2
3
def safestring(thestring):
4
    '''safely convert anything into string'''
5
    if thestring is None:
6
        return None
7
    if isinstance(thestring, str): return thestring
8
    return str(thestring, "utf-8")
9
10
def formattime(the_time):
11
    '''standard format for time'''
12
    return the_time.strftime('%Y-%m-%d %H:%M:%S')
13