From 2778b9e710616550b5365d60d84f68c77640fe2c Mon Sep 17 00:00:00 2001 From: Schrolli Date: Wed, 1 Jul 2015 14:11:11 +0200 Subject: [PATCH] file for little helper functions - also for use in plugins directly --- includes/helper.py | 30 ++++++++++++++++++++++++++++++ 1 file changed, 30 insertions(+) create mode 100644 includes/helper.py diff --git a/includes/helper.py b/includes/helper.py new file mode 100644 index 0000000..6c0cd2b --- /dev/null +++ b/includes/helper.py @@ -0,0 +1,30 @@ +#!/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) \ No newline at end of file