Exemplo n.º 1
0
 def set(cls, key, value, type='string'):
     Debug.dprint(text=key)
     Debug.dprint(text=value)
     if type == 'string':
         redis_instance.set(key, value)
     elif type == 'list' or type == 'dic':
         redis_instance.set(key, json.dumps(value))
Exemplo n.º 2
0
 def get(cls, handler, name):
     session = SessionManager(handler)
     Debug.dprint(text='name: ' + name, type='custom')
     Debug.dprint(text='value: ' + str(session.get(name)), type='error')
     # print "Session name is: " + name
     # print "Do we have a session? " + str(session.get(name))
     # if cls.exists(handler, name):
     #     print "There is a session"
     # else:
     #     print "There is not any sessionn"
     return session.get(name)
Exemplo n.º 3
0
        with open(configFile) as cf:
            config.readfp(cf)
    else:
        print("Could not find the configuration file specified.")
        sys.exit()

    type = None   
    width = None
    height = None 
    frames = None
    duration = None
    try:
    	debugEnabled = config.get(confString, 'debug')
    	myDebug = Debug(debugEnabled)
        type = config.get(confString, 'type')
        myDebug.dprint("Config file type: " + str(type))
    	
    	if type == 'basic':
    	    waves = int(config.get(confString, 'waves'))
    	    color = config.get(confString, 'color')
    	    coords = config.get(confString, 'coords')
    	    waveLength = float(config.get(confString, 'wavelength'))
    	    speed = float(config.get(confString, 'speed'))
    	    width = int(config.get(confString, 'width'))
    	    height = int(config.get(confString, 'height'))
    	    td = float(config.get(confString, 'delta'))
    	    frames = int(config.get(confString, 'frames'))
    	    duration = float(config.get(confString, 'time'))
    	    myDebug.dprint("Configuration read successfully")
    	    
    	    l = Layer(myDebug)
Exemplo n.º 4
0
 def set(cls, handler, name, value):
     # Debug.dprint(text='INSIDE SESSION SET')
     Debug.dprint(text='name: ' + name, type='data')
     Debug.dprint(text='value: ' + str(value), type='data')
     session = SessionManager(handler)
     session.set(name=name, value=value)