mirror of
https://github.com/Schrolli91/BOSWatch.git
synced 2025-12-06 07:42:03 +01:00
30 lines
560 B
Python
30 lines
560 B
Python
|
|
#!/usr/bin/python
|
||
|
|
# -*- coding: cp1252 -*-
|
||
|
|
#
|
||
|
|
|
||
|
|
"""
|
||
|
|
little Helper functions
|
||
|
|
|
||
|
|
@author: Bastian Schroll
|
||
|
|
"""
|
||
|
|
|
||
|
|
import logging
|
||
|
|
import time
|
||
|
|
|
||
|
|
|
||
|
|
def freqToHz(freq):
|
||
|
|
"""
|
||
|
|
gets a frequency and resolve it in Hz
|
||
|
|
|
||
|
|
@type format: string
|
||
|
|
@param format: Python time Format-String
|
||
|
|
|
||
|
|
@return: Formated Time and/or Date
|
||
|
|
@exception: Exception if Error in format
|
||
|
|
"""
|
||
|
|
def curtime(format="%d.%m.%Y %H:%M:%S"):
|
||
|
|
try:
|
||
|
|
return time.strftime(format)
|
||
|
|
except:
|
||
|
|
logging.warning("error in time-format-string")
|
||
|
|
logging.debug("error in time-format-string", exc_info=True)
|