Beispiel #1
0
# @PydevCodeAnalysisIgnore
import sys
import os
import arrow
import pandas as pd
from goerr import Err
from dataswim import Ds
import ghobserver
from ghobserver import db, charts
from ghobserver.notify import notify

err = Err()


def now():
    now = arrow.utcnow()
    date = now.format('YYYY-MM-DDTHH:mm:ss') + "Z"
    return date


def write_file(filepath, content):
    filex = open(filepath, "w")
    filex.write(content)
    filex.close()


def no_data(ds, reposlug, timeframe):
    filename = reposlug.replace("-", "_") + "_" + timeframe + ".html"
    filepath = ds.report_path + "/" + filename
    content = '<div style="font-family:arial;text-align:center;' \
              'font-size:220%;color:lightgrey;margin-top:4em">'
Beispiel #2
0
def newerr():
    err = Err()
    err.test_errs_mode = True
    return err
Beispiel #3
0
 def err(self, *args):
     """
     Handle an error
     """
     Err().new(*args)
Beispiel #4
0
from goerr import Err
err = Err()
try:
    import foobar
except ImportError as e:
    err.panic(e)