From ac8a02e3ca2fe5943ea743d2772696708479272e Mon Sep 17 00:00:00 2001 From: Bastian Schroll Date: Thu, 2 Jul 2015 21:39:43 +0200 Subject: [PATCH] insert helper function timeHandler.getTimestamp() --- boswatch.py | 2 +- includes/helper/timeHandler.py | 8 ++++++++ plugins/interface.txt | 1 + 3 files changed, 10 insertions(+), 1 deletion(-) diff --git a/boswatch.py b/boswatch.py index 03ce8da..b0b423a 100755 --- a/boswatch.py +++ b/boswatch.py @@ -21,7 +21,7 @@ import logging.handlers import argparse # for parse the args import ConfigParser # for parse the config file import os # for log mkdir -import time # for timestamp +import time # for time.sleep() import subprocess # for starting rtl_fm and multimon-ng from includes import globals # Global variables diff --git a/includes/helper/timeHandler.py b/includes/helper/timeHandler.py index 7c45fb4..d6b2ad9 100644 --- a/includes/helper/timeHandler.py +++ b/includes/helper/timeHandler.py @@ -47,3 +47,11 @@ def getTime(): @return: Formated time """ return curtime("%H:%M:%S") + +def getTimestamp(): + """ + Returns a integer timestamp + + @return: integer timestamp + """ + return int(time.time() diff --git a/plugins/interface.txt b/plugins/interface.txt index ee2860b..73ecbec 100644 --- a/plugins/interface.txt +++ b/plugins/interface.txt @@ -87,6 +87,7 @@ from includes.helper import timeHandler timeHandler.curtime("FORMAT") # without format string the function returns with "%d.%m.%Y %H:%M:%S" timeHandler.getDate() # Gets the date in "%d.%m.%Y" timeHandler.getTime() # Gets the time in %H:%M:%S +timeHandler.getTimestamp() # Gets a integer timestamp # replace all the standard wildcards in the given text