예제 #1
0
def _set_key(crate, key, name, val, fix_type=False, dtype=str):
    key.name = str(name).strip().upper()
    
    if fix_type:
        val = dtype(val)

    key.set_value( val )
    pycrates.add_key(crate, key)
예제 #2
0
def _set_key(crate, name, val, fix_type=False, dtype=str):
    """
    checked for new crates
    """
    key = pycrates.CrateKey()
    key.name = str(name).strip().upper()

    if fix_type:
        val = dtype(val)

    key.value = val
    pycrates.add_key(crate, key)
예제 #3
0
def _set_key(crate, name, val, fix_type=False, dtype=str):
    """
    checked for new crates
    """
    key = pycrates.CrateKey()
    key.name = str(name).strip().upper()

    if fix_type:
        val = dtype(val)

    key.value = val
    pycrates.add_key(crate, key)
예제 #4
0
파일: ui.py 프로젝트: anetasie/PySALC
 def create_key(kname, kval, desc=None):
     store[kname] = crates.CrateKey()
     store[kname].name = kname
     if desc != None:
         store[kname].desc = desc
     if 1 != store[kname].load(kval):
         raise RuntimeError, "Unable to set key %s to %g" % (name, kval)
     if 1 != crates.add_key(cr, store[kname]):
         raise RuntimeError, "Unable to add key %s to Crates." % kname
예제 #5
0
 def create_key(kname, kval, desc=None):
     store[kname] = crates.CrateKey()
     store[kname].name = kname
     if desc != None:
         store[kname].desc = desc
     if 1 != store[kname].load(kval):
         raise RuntimeError, "Unable to set key %s to %g" % (name, kval)
     if 1 != crates.add_key(cr, store[kname]):
         raise RuntimeError, "Unable to add key %s to Crates." % kname