diff --git a/src/main/python/plot_imageutils.py b/src/main/python/imageutils.py similarity index 100% rename from src/main/python/plot_imageutils.py rename to src/main/python/imageutils.py diff --git a/src/main/python/input_backend.py b/src/main/python/input_backend.py index 024c7a8..a7ab740 100644 --- a/src/main/python/input_backend.py +++ b/src/main/python/input_backend.py @@ -5,7 +5,7 @@ import requests import os from dbfread import DBF -import plot_timeutils +import timeutils line_colors = ['b', 'r', 'g', 'c', 'm', 'y'] tname = CFG("temperatur_plot_name") @@ -142,7 +142,7 @@ def processExternalData(datapoints, plotNameKey, fromTime, toTime, dtype): try: timeStr, value = l.split(";") - timestamp = plot_timeutils.time_from_csv(timeStr, CFG("nff_input_timeformat")) + timestamp = timeutils.time_from_csv(timeStr, CFG("nff_input_timeformat")) datapoints[plotNameKey].data += [float(value.replace(",","."))] datapoints[plotNameKey].times += [timestamp] @@ -223,7 +223,7 @@ def read_in_file(path, backend=None, outsideData=False, plotOutsideTemp=True, pl def dbfread(path,datapoints,pt,ph,pd): for record in DBF(path): - parse_line(datapoints,record,'DATETIME',[ ('TEMPCELS',pt) , ('HUMIDITY',ph) , ('DEWCELS',pd) ] ,plot_timeutils.time_from_dbf) + parse_line(datapoints,record,'DATETIME',[ ('TEMPCELS',pt) , ('HUMIDITY',ph) , ('DEWCELS',pd) ] ,timeutils.time_from_dbf) def csvread(path,datapoints,pt,ph,pd): count = 0; @@ -240,7 +240,7 @@ def csvread(path,datapoints,pt,ph,pd): row["hum"] = float(row_arg[4]) row["taupunkt"] = float(row_arg[5]) parse_line(datapoints,row,'datetime',[ ('temp',pt) , ('hum',ph) , ('taupunkt',pd) ],\ - plot_timeutils.time_from_csv,timeformat="%d-%m-%Y%H:%M:%S") + timeutils.time_from_csv,timeformat="%d-%m-%Y%H:%M:%S") print("Info: Ignored %d lines at beginning of file"%count) import codecs @@ -260,7 +260,7 @@ def csvread_txt(path,datapoints,pt,ph,pd): row["hum"] = float(row_arg[7]) row["taupunkt"] = 0.0 parse_line(datapoints,row,'datetime',[ ('temp',pt) , ('hum',ph) , ('taupunkt',pd) ],\ - plot_timeutils.time_from_csv,timeformat="%d-%m-%Y_%H:%M") + timeutils.time_from_csv,timeformat="%d-%m-%Y_%H:%M") except (UnicodeError, IndexError): count = csvread_txt_fallback(path,datapoints,pt,ph,pd) @@ -283,7 +283,7 @@ def csvread_txt_fallback(path,datapoints,pt,ph,pd): row["hum"] = float(hum) row["taupunkt"] = 0.0 parse_line(datapoints,row,'datetime',[ ('temp',pt) , ('hum',ph) , ('taupunkt',pd) ],\ - plot_timeutils.time_from_csv,timeformat="%d-%m-%Y_%H:%M") + timeutils.time_from_csv,timeformat="%d-%m-%Y_%H:%M") return count diff --git a/src/main/python/main.py b/src/main/python/main.py index 849a796..1bae6aa 100755 --- a/src/main/python/main.py +++ b/src/main/python/main.py @@ -15,7 +15,7 @@ import sys import datetime as dt import input_backend -import plot_main +import plot import config_parse as cp class WidgetGallery(QDialog): @@ -180,7 +180,7 @@ class WidgetGallery(QDialog): endDateTime = dt.datetime.combine(self.endDateEdit.date().toPyDate(), zeroTime) endDateTime += endTimeOffset - self.truePath = plot_main.plot(self.datapoints, path=target, + self.truePath = plot.plot(self.datapoints, path=target, date1=startDateTime, date2=endDateTime, forcePath=forcePath) diff --git a/src/main/python/plot_main.py b/src/main/python/plot.py similarity index 95% rename from src/main/python/plot_main.py rename to src/main/python/plot.py index 4d5cb2f..7bcded9 100644 --- a/src/main/python/plot_main.py +++ b/src/main/python/plot.py @@ -15,13 +15,13 @@ import matplotlib.dates import matplotlib.ticker as ticker import plot_graphutils -import plot_imageutils -import plot_timeutils +import imageutils +import timeutils def plot(datapoints, path=None, date1=None, date2=None, forcePath=False): plotname = "" if CFG("name_of_plot") == "None" else CFG("name_of_plot") - tup = [None,None,plot_timeutils.between_dates,plotname] + tup = [None,None,timeutils.between_dates,plotname] return __plot(tup, datapoints, path, date1, date2, forcePath) def __plot(tup, datapoints, path, date1=None, date2=None, forcePath=False): @@ -80,7 +80,7 @@ def __plot(tup, datapoints, path, date1=None, date2=None, forcePath=False): tup[FIGURE].savefig(pic_path,dpi=DPI,pad_inches=0.1,bbox_inches='tight',transparent=CFG("transparent_background")) ### do operations on the finished png ### - plot_imageutils.check_and_rotate(pic_path) + imageutils.check_and_rotate(pic_path) return pic_path diff --git a/src/main/python/plot_timeutils.py b/src/main/python/timeutils.py similarity index 100% rename from src/main/python/plot_timeutils.py rename to src/main/python/timeutils.py