Ejemplo n.º 1
0
 def __init__(self, name="", parent=None):
   resource.Resource.__init__(self)
   self.name = name
   self.children = {}
   self.parent = parent
   self.data = {}
   log.create(self)
Ejemplo n.º 2
0
 def __init__(self, name="", parent=None):
     resource.Resource.__init__(self)
     self.name = name
     self.children = {}
     self.parent = parent
     self.data = {}
     log.create(self)
Ejemplo n.º 3
0
def start_logging(logfile="gromacs.log"):
    """Start logging of messages to file and console.

    The default logfile is named ``gromacs.log`` and messages are
    logged with the tag *gromacs*.
    """
    import log
    log.create("gromacs", logfile=logfile)
    logging.getLogger("gromacs").info("GromacsWrapper %s STARTED logging to %r", get_version(), logfile)
    #checking the newness of user
    verified = user.verify(user_name)  #returns 'T' or 'F' by checking data

    if verified:  #if verified we break the loop instantly
        verified = True
    else:  #if still not verified we try to verify
        display.heading("new here?")
        display.new_here_msg()
        #display some msg
        while True:  #force user to login or signup
            user_choice = user.choice()
            if user_choice == 1:
                #account creating code goes here
                user.create(user_name)
                log.create(user_name)
                print("ACCOUNT CREATION : SUCCESSFUL")
                verified = True
                break  #we break our loop
            elif user_choice == 2:
                break  #we break our program to change username
            else:
                display.input_warning()

##---------------------------AFTER LOGGED PART-----------------------------##

print("LOGGED AS " + user_name)
user_data = matrix.create("users/" + user_name + ".txt")
#print(user_data)
run = True
while run:  #run program until user wants to quit
Ejemplo n.º 5
0
def start_logging(logfile="bornprofiler.log"):
    """Start logging of messages to file and console."""
    import log
    log.create("bornprofiler", logfile=logfile)
    logging.getLogger("bornprofiler").info(
        "BornProfiler STARTED logging to %r", logfile)
fails[3] = 0
fails[4] = 0

# left side: sensors as listed in in ".._raw"-file
# right side: thingspeak field no.
sensors = [0 for x in range(sensnumb)]
sensors[0] = 1
sensors[1] = 2
sensors[2] = 5
sensors[3] = 4
sensors[4] = 6
# sensors[i]=$fieldNR


log.verbose(False)
log.create("ds18b20")
log.logging.warning("----Start-----")


def thermometer(i=0):
    log.logging.info("%d: reading sensor.." % (i + 1))
    strg = " "
    temp = ds18b20_raw.read_temp(i)
    if temp > 60:
        temp = temp / 0  # raise an exception and don't upload that bullshit
    temp = temp * 10
    temp = int(temp)
    temp = temp / 10  # division!
    # strg="field%i" %(i+1)
    strg = "field%i" % sensors[i]
    log.logging.info("sensor %i" % (i + 1) + " will update " + strg + " with temp:  %d C" % temp)
Ejemplo n.º 7
0
import log

logger = log.create('app', logfile='app.log')
logger.debug("test")
Ejemplo n.º 8
0
#Nodes[1][0]="22"
#Nodes[1][1]="SPI"#18
#Nodes[1][2]="field3"
#Nodes[1][3]="field4"
#Nodes[1][4]=0

#to exclude bogus values if detected
def failstate():
    global temperature, humidity
    temperature = -50
    humidity = -50

#init
failstate()
log.verbose(False)
log.create('dht22')
log.logging.warning('----Start-----')

#spikefree() init values
lasttemp=100
lasthum=100



# Run the DHT program to get the humidity and temperature readings!
def read_dht(node):
    global temperature, humidity
    processread=False
    #stabilize input, then..
    time.sleep(swait)
    log.logging.debug("node %d: reading" %node)